UNPKG

harperdb

Version:

HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.

235 lines 1.64 MB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CXvjAEyW.js","assets/react-redux-6P6An7ZW.js","assets/index-CVjGhoEG.css","assets/index-BlhOerSW.js"])))=>i.map(i=>d[i]);
function vY(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var WDe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function of(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s_={exports:{}},_p={};var JO;function yY(){if(JO)return _p;JO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var l in i)l!=="key"&&(o[l]=i[l])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return _p.Fragment=t,_p.jsx=n,_p.jsxs=n,_p}var QO;function bY(){return QO||(QO=1,s_.exports=yY()),s_.exports}var u=bY();const xd=!0,xY="/",Nd=9925,X1="HDB_ADMIN",ba="/",Fk="../",wY=1024*1024*1024,SY=100*1024*1024;function rz(e,t){return function(){return e.apply(t,arguments)}}const{toString:_Y}=Object.prototype,{getPrototypeOf:Uk}=Object,{iterator:Eb,toStringTag:iz}=Symbol,jb=(e=>t=>{const n=_Y.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xo=e=>(e=e.toLowerCase(),t=>jb(t)===e),Ib=e=>t=>typeof t===e,{isArray:af}=Array,Ad=Ib("undefined");function Um(e){return e!==null&&!Ad(e)&&e.constructor!==null&&!Ad(e.constructor)&&Si(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oz=Xo("ArrayBuffer");function CY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oz(e.buffer),t}const kY=Ib("string"),Si=Ib("function"),az=Ib("number"),Vm=e=>e!==null&&typeof e=="object",EY=e=>e===!0||e===!1,Jv=e=>{if(jb(e)!=="object")return!1;const t=Uk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(iz in e)&&!(Eb in e)},jY=e=>{if(!Vm(e)||Um(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},IY=Xo("Date"),RY=Xo("File"),TY=Xo("Blob"),NY=Xo("FileList"),AY=e=>Vm(e)&&Si(e.pipe),OY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Si(e.append)&&((t=jb(e))==="formdata"||t==="object"&&Si(e.toString)&&e.toString()==="[object FormData]"))},$Y=Xo("URLSearchParams"),[DY,PY,MY,zY]=["ReadableStream","Request","Response","Headers"].map(Xo),LY=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bm(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),af(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Um(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let l;for(r=0;r<a;r++)l=o[r],t.call(null,e[l],l,e)}}function sz(e,t){if(Um(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const gc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lz=e=>!Ad(e)&&e!==gc;function J1(){const{caseless:e,skipUndefined:t}=lz(this)&&this||{},n={},r=(i,o)=>{const a=e&&sz(n,o)||o;Jv(n[a])&&Jv(i)?n[a]=J1(n[a],i):Jv(i)?n[a]=J1({},i):af(i)?n[a]=i.slice():(!t||!Ad(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Bm(arguments[i],r);return n}const FY=(e,t,n,{allOwnKeys:r}={})=>(Bm(t,(i,o)=>{n&&Si(i)?e[o]=rz(i,n):e[o]=i},{allOwnKeys:r}),e),UY=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),VY=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},BY=(e,t,n,r)=>{let i,o,a;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&Uk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},HY=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},qY=e=>{if(!e)return null;if(af(e))return e;let t=e.length;if(!az(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},KY=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Uk(Uint8Array)),GY=(e,t)=>{const r=(e&&e[Eb]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},ZY=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},YY=Xo("HTMLFormElement"),WY=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),e$=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),XY=Xo("RegExp"),cz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Bm(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},JY=e=>{cz(e,(t,n)=>{if(Si(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Si(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},QY=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return af(e)?r(e):r(String(e).split(t)),n},eW=()=>{},tW=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function nW(e){return!!(e&&Si(e.append)&&e[iz]==="FormData"&&e[Eb])}const rW=e=>{const t=new Array(10),n=(r,i)=>{if(Vm(r)){if(t.indexOf(r)>=0)return;if(Um(r))return r;if(!("toJSON"in r)){t[i]=r;const o=af(r)?[]:{};return Bm(r,(a,l)=>{const d=n(a,i+1);!Ad(d)&&(o[l]=d)}),t[i]=void 0,o}}return r};return n(e,0)},iW=Xo("AsyncFunction"),oW=e=>e&&(Vm(e)||Si(e))&&Si(e.then)&&Si(e.catch),uz=((e,t)=>e?setImmediate:t?((n,r)=>(gc.addEventListener("message",({source:i,data:o})=>{i===gc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),gc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Si(gc.postMessage)),aW=typeof queueMicrotask<"u"?queueMicrotask.bind(gc):typeof process<"u"&&process.nextTick||uz,sW=e=>e!=null&&Si(e[Eb]),he={isArray:af,isArrayBuffer:oz,isBuffer:Um,isFormData:OY,isArrayBufferView:CY,isString:kY,isNumber:az,isBoolean:EY,isObject:Vm,isPlainObject:Jv,isEmptyObject:jY,isReadableStream:DY,isRequest:PY,isResponse:MY,isHeaders:zY,isUndefined:Ad,isDate:IY,isFile:RY,isBlob:TY,isRegExp:XY,isFunction:Si,isStream:AY,isURLSearchParams:$Y,isTypedArray:KY,isFileList:NY,forEach:Bm,merge:J1,extend:FY,trim:LY,stripBOM:UY,inherits:VY,toFlatObject:BY,kindOf:jb,kindOfTest:Xo,endsWith:HY,toArray:qY,forEachEntry:GY,matchAll:ZY,isHTMLForm:YY,hasOwnProperty:e$,hasOwnProp:e$,reduceDescriptors:cz,freezeMethods:JY,toObjectSet:QY,toCamelCase:WY,noop:eW,toFiniteNumber:tW,findKey:sz,global:gc,isContextDefined:lz,isSpecCompliantForm:nW,toJSONObject:rW,isAsyncFn:iW,isThenable:oW,setImmediate:uz,asap:aW,isIterable:sW};function ht(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}he.inherits(ht,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:he.toJSONObject(this.config),code:this.code,status:this.status}}});const dz=ht.prototype,fz={};["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=>{fz[e]={value:e}});Object.defineProperties(ht,fz);Object.defineProperty(dz,"isAxiosError",{value:!0});ht.from=(e,t,n,r,i,o)=>{const a=Object.create(dz);he.toFlatObject(e,a,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const l=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return ht.call(a,l,d,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const lW=null;function Q1(e){return he.isPlainObject(e)||he.isArray(e)}function pz(e){return he.endsWith(e,"[]")?e.slice(0,-2):e}function t$(e,t,n){return e?e.concat(t).map(function(i,o){return i=pz(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function cW(e){return he.isArray(e)&&!e.some(Q1)}const uW=he.toFlatObject(he,{},null,function(t){return/^is[A-Z]/.test(t)});function Rb(e,t,n){if(!he.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=he.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!he.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||m,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&he.isSpecCompliantForm(t);if(!he.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(he.isDate(x))return x.toISOString();if(he.isBoolean(x))return x.toString();if(!d&&he.isBlob(x))throw new ht("Blob is not supported. Use a Buffer instead.");return he.isArrayBuffer(x)||he.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function m(x,S,C){let k=x;if(x&&!C&&typeof x=="object"){if(he.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(he.isArray(x)&&cW(x)||(he.isFileList(x)||he.endsWith(S,"[]"))&&(k=he.toArray(x)))return S=pz(S),k.forEach(function(j,I){!(he.isUndefined(j)||j===null)&&t.append(a===!0?t$([S],I,o):a===null?S:S+"[]",f(j))}),!1}return Q1(x)?!0:(t.append(t$(C,S,o),f(x)),!1)}const h=[],v=Object.assign(uW,{defaultVisitor:m,convertValue:f,isVisitable:Q1});function y(x,S){if(!he.isUndefined(x)){if(h.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(x),he.forEach(x,function(k,E){(!(he.isUndefined(k)||k===null)&&i.call(t,k,he.isString(E)?E.trim():E,S,v))===!0&&y(k,S?S.concat(E):[E])}),h.pop()}}if(!he.isObject(e))throw new TypeError("data must be an object");return y(e),t}function n$(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Vk(e,t){this._pairs=[],e&&Rb(e,this,t)}const mz=Vk.prototype;mz.append=function(t,n){this._pairs.push([t,n])};mz.toString=function(t){const n=t?function(r){return t.call(this,r,n$)}:n$;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function dW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function hz(e,t,n){if(!t)return e;const r=n&&n.encode||dW;he.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=he.isURLSearchParams(t)?t.toString():new Vk(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class r${constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){he.forEach(this.handlers,function(r){r!==null&&t(r)})}}const gz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fW=typeof URLSearchParams<"u"?URLSearchParams:Vk,pW=typeof FormData<"u"?FormData:null,mW=typeof Blob<"u"?Blob:null,hW={isBrowser:!0,classes:{URLSearchParams:fW,FormData:pW,Blob:mW},protocols:["http","https","file","blob","url","data"]},Bk=typeof window<"u"&&typeof document<"u",eC=typeof navigator=="object"&&navigator||void 0,gW=Bk&&(!eC||["ReactNative","NativeScript","NS"].indexOf(eC.product)<0),vW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yW=Bk&&window.location.href||"http://localhost",bW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bk,hasStandardBrowserEnv:gW,hasStandardBrowserWebWorkerEnv:vW,navigator:eC,origin:yW},Symbol.toStringTag,{value:"Module"})),$r={...bW,...hW};function xW(e,t){return Rb(e,new $r.classes.URLSearchParams,{visitor:function(n,r,i,o){return $r.isNode&&he.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function wW(e){return he.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function SW(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function vz(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),d=o>=n.length;return a=!a&&he.isArray(i)?i.length:a,d?(he.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!l):((!i[a]||!he.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&he.isArray(i[a])&&(i[a]=SW(i[a])),!l)}if(he.isFormData(e)&&he.isFunction(e.entries)){const n={};return he.forEachEntry(e,(r,i)=>{t(wW(r),i,n,0)}),n}return null}function _W(e,t,n){if(he.isString(e))try{return(t||JSON.parse)(e),he.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Hm={transitional:gz,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=he.isObject(t);if(o&&he.isHTMLForm(t)&&(t=new FormData(t)),he.isFormData(t))return i?JSON.stringify(vz(t)):t;if(he.isArrayBuffer(t)||he.isBuffer(t)||he.isStream(t)||he.isFile(t)||he.isBlob(t)||he.isReadableStream(t))return t;if(he.isArrayBufferView(t))return t.buffer;if(he.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xW(t,this.formSerializer).toString();if((l=he.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Rb(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),_W(t)):t}],transformResponse:[function(t){const n=this.transitional||Hm.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(he.isResponse(t)||he.isReadableStream(t))return t;if(t&&he.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?ht.from(l,ht.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$r.classes.FormData,Blob:$r.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch"],e=>{Hm.headers[e]={}});const CW=he.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"]),kW=e=>{const t={};let n,r,i;return e&&e.split(`
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&CW[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},i$=Symbol("internals");function Cp(e){return e&&String(e).trim().toLowerCase()}function Qv(e){return e===!1||e==null?e:he.isArray(e)?e.map(Qv):String(e)}function EW(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const jW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function l_(e,t,n,r,i){if(he.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!he.isString(t)){if(he.isString(r))return t.indexOf(r)!==-1;if(he.isRegExp(r))return r.test(t)}}function IW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function RW(e,t){const n=he.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let _i=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(l,d,f){const m=Cp(d);if(!m)throw new Error("header name must be a non-empty string");const h=he.findKey(i,m);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=Qv(l))}const a=(l,d)=>he.forEach(l,(f,m)=>o(f,m,d));if(he.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(he.isString(t)&&(t=t.trim())&&!jW(t))a(kW(t),n);else if(he.isObject(t)&&he.isIterable(t)){let l={},d,f;for(const m of t){if(!he.isArray(m))throw TypeError("Object iterator must return a key-value pair");l[f=m[0]]=(d=l[f])?he.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}a(l,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Cp(t),t){const r=he.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return EW(i);if(he.isFunction(n))return n.call(this,i,r);if(he.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cp(t),t){const r=he.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||l_(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=Cp(a),a){const l=he.findKey(r,a);l&&(!n||l_(r,r[l],l,n))&&(delete r[l],i=!0)}}return he.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||l_(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return he.forEach(this,(i,o)=>{const a=he.findKey(r,o);if(a){n[a]=Qv(i),delete n[o];return}const l=t?IW(o):String(o).trim();l!==o&&delete n[o],n[l]=Qv(i),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return he.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&he.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[i$]=this[i$]={accessors:{}}).accessors,i=this.prototype;function o(a){const l=Cp(a);r[l]||(RW(i,a),r[l]=!0)}return he.isArray(t)?t.forEach(o):o(t),this}};_i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);he.reduceDescriptors(_i.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});he.freezeMethods(_i);function c_(e,t){const n=this||Hm,r=t||n,i=_i.from(r.headers);let o=r.data;return he.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function yz(e){return!!(e&&e.__CANCEL__)}function sf(e,t,n){ht.call(this,e??"canceled",ht.ERR_CANCELED,t,n),this.name="CanceledError"}he.inherits(sf,ht,{__CANCEL__:!0});function bz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ht("Request failed with status code "+n.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function TW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function NW(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[o];a||(a=f),n[i]=d,r[i]=f;let h=o,v=0;for(;h!==i;)v+=n[h++],h=h%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<t)return;const y=m&&f-m;return y?Math.round(v*1e3/y):void 0}}function AW(e,t){let n=0,r=1e3/t,i,o;const a=(f,m=Date.now())=>{n=m,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),h=m-n;h>=r?a(f,m):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-h)))},()=>i&&a(i)]}const yy=(e,t,n=3)=>{let r=0;const i=NW(50,250);return AW(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),m=a<=l;r=a;const h={loaded:a,total:l,progress:l?a/l:void 0,bytes:d,rate:f||void 0,estimated:f&&l&&m?(l-a)/f:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(h)},n)},o$=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},a$=e=>(...t)=>he.asap(()=>e(...t)),OW=$r.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,$r.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL($r.origin),$r.navigator&&/(msie|trident)/i.test($r.navigator.userAgent)):()=>!0,$W=$r.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];he.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),he.isString(r)&&l.push(`path=${r}`),he.isString(i)&&l.push(`domain=${i}`),o===!0&&l.push("secure"),he.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function DW(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function PW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xz(e,t,n){let r=!DW(t);return e&&(r||n==!1)?PW(e,t):t}const s$=e=>e instanceof _i?{...e}:e;function Nc(e,t){t=t||{};const n={};function r(f,m,h,v){return he.isPlainObject(f)&&he.isPlainObject(m)?he.merge.call({caseless:v},f,m):he.isPlainObject(m)?he.merge({},m):he.isArray(m)?m.slice():m}function i(f,m,h,v){if(he.isUndefined(m)){if(!he.isUndefined(f))return r(void 0,f,h,v)}else return r(f,m,h,v)}function o(f,m){if(!he.isUndefined(m))return r(void 0,m)}function a(f,m){if(he.isUndefined(m)){if(!he.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function l(f,m,h){if(h in t)return r(f,m);if(h in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(f,m,h)=>i(s$(f),s$(m),h,!0)};return he.forEach(Object.keys({...e,...t}),function(m){const h=d[m]||i,v=h(e[m],t[m],m);he.isUndefined(v)&&h!==l||(n[m]=v)}),n}const wz=e=>{const t=Nc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=_i.from(a),t.url=hz(xz(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),he.isFormData(n)){if($r.hasStandardBrowserEnv||$r.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(he.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,h])=>{f.includes(m.toLowerCase())&&a.set(m,h)})}}if($r.hasStandardBrowserEnv&&(r&&he.isFunction(r)&&(r=r(t)),r||r!==!1&&OW(t.url))){const d=i&&o&&$W.read(o);d&&a.set(i,d)}return t},MW=typeof XMLHttpRequest<"u",zW=MW&&function(e){return new Promise(function(n,r){const i=wz(e);let o=i.data;const a=_i.from(i.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:f}=i,m,h,v,y,x;function S(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function k(){if(!C)return;const j=_i.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),N={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};bz(function(A){n(A),S()},function(A){r(A),S()},N),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(r(new ht("Request aborted",ht.ECONNABORTED,e,C)),C=null)},C.onerror=function(I){const N=I&&I.message?I.message:"Network Error",T=new ht(N,ht.ERR_NETWORK,e,C);T.event=I||null,r(T),C=null},C.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const N=i.transitional||gz;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new ht(I,N.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&he.forEach(a.toJSON(),function(I,N){C.setRequestHeader(N,I)}),he.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),l&&l!=="json"&&(C.responseType=i.responseType),f&&([v,x]=yy(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=yy(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(m=j=>{C&&(r(!j||j.type?new sf(null,e,C):j),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const E=TW(i.url);if(E&&$r.protocols.indexOf(E)===-1){r(new ht("Unsupported protocol "+E+":",ht.ERR_BAD_REQUEST,e));return}C.send(o||null)})},LW=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(f){if(!i){i=!0,l();const m=f instanceof Error?f:this.reason;r.abort(m instanceof ht?m:new sf(m instanceof Error?m.message:m))}};let a=t&&setTimeout(()=>{a=null,o(new ht(`timeout ${t} of ms exceeded`,ht.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>he.asap(l),d}},FW=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},UW=async function*(e,t){for await(const n of VW(e))yield*FW(n,t)},VW=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},l$=(e,t,n,r)=>{const i=UW(e,t);let o=0,a,l=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await i.next();if(f){l(),d.close();return}let h=m.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(m))}catch(f){throw l(f),f}},cancel(d){return l(d),i.return()}},{highWaterMark:2})},c$=64*1024,{isFunction:sv}=he,BW=(({Request:e,Response:t})=>({Request:e,Response:t}))(he.global),{ReadableStream:u$,TextEncoder:d$}=he.global,f$=(e,...t)=>{try{return!!e(...t)}catch{return!1}},HW=e=>{e=he.merge.call({skipUndefined:!0},BW,e);const{fetch:t,Request:n,Response:r}=e,i=t?sv(t):typeof fetch=="function",o=sv(n),a=sv(r);if(!i)return!1;const l=i&&sv(u$),d=i&&(typeof d$=="function"?(x=>S=>x.encode(S))(new d$):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=o&&l&&f$(()=>{let x=!1;const S=new n($r.origin,{body:new u$,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!S}),m=a&&l&&f$(()=>he.isReadableStream(new r("").body)),h={stream:m&&(x=>x.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!h[x]&&(h[x]=(S,C)=>{let k=S&&S[x];if(k)return k.call(S);throw new ht(`Response type '${x}' is not supported`,ht.ERR_NOT_SUPPORT,C)})});const v=async x=>{if(x==null)return 0;if(he.isBlob(x))return x.size;if(he.isSpecCompliantForm(x))return(await new n($r.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(he.isArrayBufferView(x)||he.isArrayBuffer(x))return x.byteLength;if(he.isURLSearchParams(x)&&(x=x+""),he.isString(x))return(await d(x)).byteLength},y=async(x,S)=>{const C=he.toFiniteNumber(x.getContentLength());return C??v(S)};return async x=>{let{url:S,method:C,data:k,signal:E,cancelToken:j,timeout:I,onDownloadProgress:N,onUploadProgress:T,responseType:A,headers:D,withCredentials:F="same-origin",fetchOptions:q}=wz(x),ee=t||fetch;A=A?(A+"").toLowerCase():"text";let G=LW([E,j&&j.toAbortSignal()],I),K=null;const V=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let H;try{if(T&&f&&C!=="get"&&C!=="head"&&(H=await y(D,k))!==0){let P=new n(S,{method:"POST",body:k,duplex:"half"}),U;if(he.isFormData(k)&&(U=P.headers.get("content-type"))&&D.setContentType(U),P.body){const[O,X]=o$(H,yy(a$(T)));k=l$(P.body,c$,O,X)}}he.isString(F)||(F=F?"include":"omit");const z=o&&"credentials"in n.prototype,W={...q,signal:G,method:C.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:z?F:void 0};K=o&&new n(S,W);let L=await(o?ee(K,q):ee(S,W));const ne=m&&(A==="stream"||A==="response");if(m&&(N||ne&&V)){const P={};["status","statusText","headers"].forEach(pe=>{P[pe]=L[pe]});const U=he.toFiniteNumber(L.headers.get("content-length")),[O,X]=N&&o$(U,yy(a$(N),!0))||[];L=new r(l$(L.body,c$,O,()=>{X&&X(),V&&V()}),P)}A=A||"text";let $=await h[he.findKey(h,A)||"text"](L,x);return!ne&&V&&V(),await new Promise((P,U)=>{bz(P,U,{data:$,headers:_i.from(L.headers),status:L.status,statusText:L.statusText,config:x,request:K})})}catch(z){throw V&&V(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,x,K),{cause:z.cause||z}):ht.from(z,z&&z.code,x,K)}}},qW=new Map,Sz=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,l=a,d,f,m=qW;for(;l--;)d=o[l],f=m.get(d),f===void 0&&m.set(d,f=l?new Map:HW(t)),m=f;return f};Sz();const Hk={http:lW,xhr:zW,fetch:{get:Sz}};he.forEach(Hk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const p$=e=>`- ${e}`,KW=e=>he.isFunction(e)||e===null||e===!1;function GW(e,t){e=he.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let l;if(i=r,!KW(r)&&(i=Hk[(l=String(r)).toLowerCase()],i===void 0))throw new ht(`Unknown adapter '${l}'`);if(i&&(he.isFunction(i)||(i=i.get(t))))break;o[l||"#"+a]=i}if(!i){const a=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
`+a.map(p$).join(`
`):" "+p$(a[0]):"as no adapter specified";throw new ht("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const _z={getAdapter:GW,adapters:Hk};function u_(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sf(null,e)}function m$(e){return u_(e),e.headers=_i.from(e.headers),e.data=c_.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_z.getAdapter(e.adapter||Hm.adapter,e)(e).then(function(r){return u_(e),r.data=c_.call(e,e.transformResponse,r),r.headers=_i.from(r.headers),r},function(r){return yz(r)||(u_(e),r&&r.response&&(r.response.data=c_.call(e,e.transformResponse,r.response),r.response.headers=_i.from(r.response.headers))),Promise.reject(r)})}const Cz="1.13.2",Tb={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Tb[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const h$={};Tb.transitional=function(t,n,r){function i(o,a){return"[Axios v"+Cz+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,l)=>{if(t===!1)throw new ht(i(a," has been removed"+(n?" in "+n:"")),ht.ERR_DEPRECATED);return n&&!h$[a]&&(h$[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,l):!0}};Tb.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function ZW(e,t,n){if(typeof e!="object")throw new ht("options must be an object",ht.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const l=e[o],d=l===void 0||a(l,o,e);if(d!==!0)throw new ht("option "+o+" must be "+d,ht.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ht("Unknown option "+o,ht.ERR_BAD_OPTION)}}const ey={assertOptions:ZW,validators:Tb},oa=ey.validators;let _c=class{constructor(t){this.defaults=t||{},this.interceptors={request:new r$,response:new r$}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Nc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&ey.assertOptions(r,{silentJSONParsing:oa.transitional(oa.boolean),forcedJSONParsing:oa.transitional(oa.boolean),clarifyTimeoutError:oa.transitional(oa.boolean)},!1),i!=null&&(he.isFunction(i)?n.paramsSerializer={serialize:i}:ey.assertOptions(i,{encode:oa.function,serialize:oa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ey.assertOptions(n,{baseUrl:oa.spelling("baseURL"),withXsrfToken:oa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&he.merge(o.common,o[n.method]);o&&he.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),n.headers=_i.concat(a,o);const l=[];let d=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(d=d&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let m,h=0,v;if(!d){const x=[m$.bind(this),void 0];for(x.unshift(...l),x.push(...f),v=x.length,m=Promise.resolve(n);h<v;)m=m.then(x[h++],x[h++]);return m}v=l.length;let y=n;for(;h<v;){const x=l[h++],S=l[h++];try{y=x(y)}catch(C){S.call(this,C);break}}try{m=m$.call(this,y)}catch(x){return Promise.reject(x)}for(h=0,v=f.length;h<v;)m=m.then(f[h++],f[h++]);return m}getUri(t){t=Nc(this.defaults,t);const n=xz(t.baseURL,t.url,t.allowAbsoluteUrls);return hz(n,t.params,t.paramsSerializer)}};he.forEach(["delete","get","head","options"],function(t){_c.prototype[t]=function(n,r){return this.request(Nc(r||{},{method:t,url:n,data:(r||{}).data}))}});he.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,l){return this.request(Nc(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}_c.prototype[t]=n(),_c.prototype[t+"Form"]=n(!0)});let YW=class kz{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(l=>{r.subscribe(l),o=l}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,l){r.reason||(r.reason=new sf(o,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kz(function(i){t=i}),cancel:t}}};function WW(e){return function(n){return e.apply(null,n)}}function XW(e){return he.isObject(e)&&e.isAxiosError===!0}const tC={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tC).forEach(([e,t])=>{tC[t]=e});function Ez(e){const t=new _c(e),n=rz(_c.prototype.request,t);return he.extend(n,_c.prototype,t,{allOwnKeys:!0}),he.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Ez(Nc(e,i))},n}const Fn=Ez(Hm);Fn.Axios=_c;Fn.CanceledError=sf;Fn.CancelToken=YW;Fn.isCancel=yz;Fn.VERSION=Cz;Fn.toFormData=Rb;Fn.AxiosError=ht;Fn.Cancel=Fn.CanceledError;Fn.all=function(t){return Promise.all(t)};Fn.spread=WW;Fn.isAxiosError=XW;Fn.mergeConfig=Nc;Fn.AxiosHeaders=_i;Fn.formToJSON=e=>vz(he.isHTMLForm(e)?new FormData(e):e);Fn.getAdapter=_z.getAdapter;Fn.HttpStatusCode=tC;Fn.default=Fn;const{Axios:QDe,AxiosError:e2e,CanceledError:t2e,isCancel:n2e,CancelToken:r2e,VERSION:i2e,all:o2e,Cancel:a2e,isAxiosError:s2e,spread:l2e,toFormData:c2e,AxiosHeaders:u2e,HttpStatusCode:d2e,formToJSON:f2e,getAdapter:p2e,mergeConfig:m2e}=Fn,Gt=Fn.create({withCredentials:!0,baseURL:"/",timeout:15e3,headers:{"Content-Type":"application/json"}});function Yr(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function JW(e){return e.replicated?.some(t=>jz(t))??!1}function QW(e){return e.status!=="failed"}function jz(e){return e.status==="failed"}function eX(e){if(JW(e.data)){const t=e.data.replicated.filter(QW),n=e.data.replicated.filter(jz),r=t.length?`The operation partially succeeded, but ${Yr(n.length,"node","nodes")} failed:`:n.length===1?"The operation failed on the single node:":`The operation failed on all ${n.length} nodes:`,i=n.map(o=>`${o.node}: ${o.reason}`).join(`
`);return Promise.reject(r+`
`+i)}return e}function qc(e=1e3){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function tX(e){return async t=>{const n=t?.response?.status,r=t?.config;if(!r||!(n===502||n===503||n===504))return Promise.reject(t);const o=3;if(r.__retryCount=r.__retryCount||0,r.__retryCount>=o)return Promise.reject(t);r.__retryCount+=1;const l=5e3*Math.pow(2,r.__retryCount-1);return await qc(l),e.request(r)}}function es({id:e=$n,operationsUrl:t,port:n,secure:r,forceFabricConnect:i}={}){let o=t||jt.getOperationsUrl(e);if(o&&(n||r!==void 0)){const f=new URL(o);n&&(f.port=String(n)),r!==void 0&&(f.protocol=r?"https:":"http:"),o=f.toString()}const a=i||jt.checkForFabricConnect(e);a&&(e.startsWith("clu-")?o=Gt.defaults.baseURL+`/Cluster/${e}/operation`:e.startsWith("ins-")&&(o=Gt.defaults.baseURL+`/HDBInstance/${e}/operation`));const l=jt.checkForBasicAuth(e),d=Fn.create({auth:a?void 0:l,withCredentials:a||!l,timeout:15e3,headers:{"Content-Type":"application/json"},baseURL:o});return d.interceptors.response.use(eX,tX(d)),d}var lf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nX={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},rX=class{#e=nX;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},vc=new rX;function iX(e){setTimeout(e,0)}var Ac=typeof window>"u"||"Deno"in globalThis;function Gr(){}function oX(e,t){return typeof e=="function"?e(t):e}function nC(e){return typeof e=="number"&&e>=0&&e!==1/0}function Iz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function al(e,t){return typeof e=="function"?e(t):e}function vo(e,t){return typeof e=="function"?e(t):e}function g$(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==qk(a,t.options))return!1}else if(!hm(t.queryKey,a))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function v$(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Oc(t.options.mutationKey)!==Oc(o))return!1}else if(!hm(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qk(e,t){return(t?.queryKeyHashFn||Oc)(e)}function Oc(e){return JSON.stringify(e,(t,n)=>rC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>hm(e[n],t[n])):!1}var aX=Object.prototype.hasOwnProperty;function Rz(e,t){if(e===t)return e;const n=y$(e)&&y$(t);if(!n&&!(rC(e)&&rC(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,l=n?new Array(a):{};let d=0;for(let f=0;f<a;f++){const m=n?f:o[f],h=e[m],v=t[m];if(h===v){l[m]=h,(n?f<i:aX.call(e,m))&&d++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){l[m]=v;continue}const y=Rz(h,v);l[m]=y,y===h&&d++}return i===a&&d===i?e:l}function by(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function y$(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rC(e){if(!b$(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!b$(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function b$(e){return Object.prototype.toString.call(e)==="[object Object]"}function sX(e){return new Promise(t=>{vc.setTimeout(t,e)})}function iC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Rz(e,t):t}function lX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kk=Symbol();function Tz(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Kk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gk(e,t){return typeof e=="function"?e(...t):!!e}function uX(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var dX=class extends lf{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ac&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Zk=new dX;function oC(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var fX=iX;function pX(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=fX;const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(d=>{n(d)})})})};return{batch:l=>{let d;t++;try{d=l()}finally{t--,t||a()}return d},batchCalls:l=>(...d)=>{o(()=>{l(...d)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var cr=pX(),mX=class extends lf{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ac&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},xy=new mX;function hX(e){return Math.min(1e3*2**e,3e4)}function Nz(e){return(e??"online")==="online"?xy.isOnline():!0}var aC=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Az(e){let t=!1,n=0,r;const i=oC(),o=()=>i.status!=="pending",a=S=>{if(!o()){const C=new aC(S);v(C),e.onCancel?.(C)}},l=()=>{t=!0},d=()=>{t=!1},f=()=>Zk.isFocused()&&(e.networkMode==="always"||xy.isOnline())&&e.canRun(),m=()=>Nz(e.networkMode)&&e.canRun(),h=S=>{o()||(r?.(),i.resolve(S))},v=S=>{o()||(r?.(),i.reject(S))},y=()=>new Promise(S=>{r=C=>{(o()||f())&&S(C)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),x=()=>{if(o())return;let S;const C=n===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(h).catch(k=>{if(o())return;const E=e.retry??(Ac?0:3),j=e.retryDelay??hX,I=typeof j=="function"?j(n,k):j,N=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!N){v(k);return}n++,e.onFail?.(n,k),sX(I).then(()=>f()?void 0:y()).then(()=>{t?v(k):x()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:l,continueRetry:d,canStart:m,start:()=>(m()?x():y().then(x),i)}}var Oz=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nC(this.gcTime)&&(this.#e=vc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ac?1/0:300*1e3))}clearGcTimeout(){this.#e&&(vc.clearTimeout(this.#e),this.#e=void 0)}},gX=class extends Oz{#e;#t;#n;#i;#r;#a;#s;constructor(e){super(),this.#s=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=w$(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=w$(this.options);t.data!==void 0&&(this.setState(x$(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=iC(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Gr).catch(Gr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>vo(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>al(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Iz(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const l=Tz(this.options,t),f=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#s=!1,this.options.persister?this.options.persister(l,f,this):l(f)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(l),l})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=Az({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof aC&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,d)=>{this.#o({type:"failed",failureCount:l,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof aC){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#o({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...$z(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...x$(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function $z(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Nz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function x$(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function w$(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dz=class extends lf{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=oC(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#s;#o;#h;#f;#p;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),S$(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sC(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sC(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vo(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!by(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&_$(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||vo(this.options.enabled,this.#t)!==vo(t.enabled,this.#t)||al(this.options.staleTime,this.#t)!==al(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||vo(this.options.enabled,this.#t)!==vo(t.enabled,this.#t)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return yX(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Gr)),t}#g(){this.#x();const e=al(this.options.staleTime,this.#t);if(Ac||this.#i.isStale||!nC(e))return;const n=Iz(this.#i.dataUpdatedAt,e)+1;this.#c=vc.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(Ac||vo(this.options.enabled,this.#t)===!1||!nC(this.#l)||this.#l===0)&&(this.#u=vc.setInterval(()=>{(this.options.refetchIntervalInBackground||Zk.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(vc.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(vc.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,o=this.#r,a=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let m={...f},h=!1,v;if(t._optimisticResults){const D=this.hasListeners(),F=!D&&S$(e,t),q=D&&_$(e,n,t,r);(F||q)&&(m={...m,...$z(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:S}=m;v=m.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&S==="pending"){let D;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(D=i.data,C=!0):D=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,D!==void 0&&(S="success",v=iC(i?.data,D,t),h=!0)}if(t.select&&v!==void 0&&!C)if(i&&v===o?.data&&t.select===this.#h)v=this.#f;else try{this.#h=t.select,v=t.select(v),v=iC(i?.data,v,t),this.#f=v,this.#o=null}catch(D){this.#o=D}this.#o&&(y=this.#o,v=this.#f,x=Date.now(),S="error");const k=m.fetchStatus==="fetching",E=S==="pending",j=S==="error",I=E&&k,N=v!==void 0,A={status:S,fetchStatus:m.fetchStatus,isPending:E,isSuccess:S==="success",isError:j,isInitialLoading:I,isLoading:I,data:v,dataUpdatedAt:m.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:j&&!N,isPaused:m.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:j&&N,isStale:Yk(e,t),refetch:this.refetch,promise:this.#s,isEnabled:vo(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=ee=>{A.status==="error"?ee.reject(A.error):A.data!==void 0&&ee.resolve(A.data)},F=()=>{const ee=this.#s=A.promise=oC();D(ee)},q=this.#s;switch(q.status){case"pending":e.queryHash===n.queryHash&&D(q);break;case"fulfilled":(A.status==="error"||A.data!==q.value)&&F();break;case"rejected":(A.status!=="error"||A.error!==q.reason)&&F();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#t),by(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(a=>{const l=a;return this.#i[l]!==e[l]&&o.has(l)})};this.#_({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){cr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function vX(e,t){return vo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function S$(e,t){return vX(e,t)||e.state.data!==void 0&&sC(e,t,t.refetchOnMount)}function sC(e,t,n){if(vo(t.enabled,e)!==!1&&al(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Yk(e,t)}return!1}function _$(e,t,n,r){return(e!==t||vo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Yk(e,n)}function Yk(e,t){return vo(t.enabled,e)!==!1&&e.isStaleByTime(al(t.staleTime,e))}function yX(e,t){return!by(e.getCurrentResult(),t)}function C$(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},d=0;const f=async()=>{let m=!1;const h=x=>{uX(x,()=>t.signal,()=>m=!0)},v=Tz(t.options,t.fetchOptions),y=async(x,S,C)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const E=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return h(T),T})(),j=await v(E),{maxPages:I}=t.options,N=C?cX:lX;return{pages:N(x.pages,j,I),pageParams:N(x.pageParams,S,I)}};if(i&&o.length){const x=i==="backward",S=x?bX:k$,C={pages:o,pageParams:a},k=S(r,C);l=await y(C,k,x)}else{const x=e??o.length;do{const S=d===0?a[0]??r.initialPageParam:k$(r,l);if(d>0&&S==null)break;l=await y(l,S),d++}while(d<x)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function k$(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bX(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var xX=class extends Oz{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Pz(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Az({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),cr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Pz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mz=class extends lf{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new xX({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=lv(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=lv(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=lv(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=lv(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){cr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>v$(t,n))}findAll(e={}){return this.getAll().filter(t=>v$(e,t))}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Gr))))}};function lv(e){return e.options.scope?.id}var wX=class extends lf{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),by(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Oc(n.mutationKey)!==Oc(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??Pz();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){cr.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},zz=class extends lf{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??qk(r,t);let o=this.get(i);return o||(o=new gX({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){cr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>g$(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>g$(e,n)):t}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},SX=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new zz,this.#t=e.mutationCache||new Mz,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=Zk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=xy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(al(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=oX(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=cr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Gr).catch(Gr)}invalidateQueries(e,t={}){return cr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=cr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Gr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Gr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gr).catch(Gr)}fetchInfiniteQuery(e){return e.behavior=C$(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gr).catch(Gr)}ensureInfiniteQueryData(e){return e.behavior=C$(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xy.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Oc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{hm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Oc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{hm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qk(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Kk&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},d_={exports:{}},dt={};var E$;function _X(){if(E$)return dt;E$=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.iterator;function y(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(P,U,O){this.props=P,this.context=U,this.refs=C,this.updater=O||x}k.prototype.isReactComponent={},k.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,U,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function E(){}E.prototype=k.prototype;function j(P,U,O){this.props=P,this.context=U,this.refs=C,this.updater=O||x}var I=j.prototype=new E;I.constructor=j,S(I,k.prototype),I.isPureReactComponent=!0;var N=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function F(P,U,O){var X=O.ref;return{$$typeof:e,type:P,key:U,ref:X!==void 0?X:null,props:O}}function q(P,U){return F(P.type,U,P.props)}function ee(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function G(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(O){return U[O]})}var K=/\/+/g;function V(P,U){return typeof P=="object"&&P!==null&&P.key!=null?G(""+P.key):U.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(T,T):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function z(P,U,O,X,pe){var ve=typeof P;(ve==="undefined"||ve==="boolean")&&(P=null);var Q=!1;if(P===null)Q=!0;else switch(ve){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(P.$$typeof){case e:case t:Q=!0;break;case m:return Q=P._init,z(Q(P._payload),U,O,X,pe)}}if(Q)return pe=pe(P),Q=X===""?"."+V(P,0):X,N(pe)?(O="",Q!=null&&(O=Q.replace(K,"$&/")+"/"),z(pe,U,O,"",function(ke){return ke})):pe!=null&&(ee(pe)&&(pe=q(pe,O+(pe.key==null||P&&P.key===pe.key?"":(""+pe.key).replace(K,"$&/")+"/")+Q)),U.push(pe)),1;Q=0;var le=X===""?".":X+":";if(N(P))for(var Se=0;Se<P.length;Se++)X=P[Se],ve=le+V(X,Se),Q+=z(X,U,O,ve,pe);else if(Se=y(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(X=P.next()).done;)X=X.value,ve=le+V(X,Se++),Q+=z(X,U,O,ve,pe);else if(ve==="object"){if(typeof P.then=="function")return z(H(P),U,O,X,pe);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(P,U,O){if(P==null)return P;var X=[],pe=0;return z(P,X,"","",function(ve){return U.call(O,ve,pe++)}),X}function L(P){if(P._status===-1){var U=P._result;U=U(),U.then(function(O){(P._status===0||P._status===-1)&&(P._status=1,P._result=O)},function(O){(P._status===0||P._status===-1)&&(P._status=2,P._result=O)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var ne=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},$={map:W,forEach:function(P,U,O){W(P,function(){U.apply(this,arguments)},O)},count:function(P){var U=0;return W(P,function(){U++}),U},toArray:function(P){return W(P,function(U){return U})||[]},only:function(P){if(!ee(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return dt.Activity=h,dt.Children=$,dt.Component=k,dt.Fragment=n,dt.Profiler=i,dt.PureComponent=j,dt.StrictMode=r,dt.Suspense=d,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,dt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return A.H.useMemoCache(P)}},dt.cache=function(P){return function(){return P.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(P,U,O){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var X=S({},P.props),pe=P.key;if(U!=null)for(ve in U.key!==void 0&&(pe=""+U.key),U)!D.call(U,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&U.ref===void 0||(X[ve]=U[ve]);var ve=arguments.length-2;if(ve===1)X.children=O;else if(1<ve){for(var Q=Array(ve),le=0;le<ve;le++)Q[le]=arguments[le+2];X.children=Q}return F(P.type,pe,X)},dt.createContext=function(P){return P={$$typeof:a,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},dt.createElement=function(P,U,O){var X,pe={},ve=null;if(U!=null)for(X in U.key!==void 0&&(ve=""+U.key),U)D.call(U,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(pe[X]=U[X]);var Q=arguments.length-2;if(Q===1)pe.children=O;else if(1<Q){for(var le=Array(Q),Se=0;Se<Q;Se++)le[Se]=arguments[Se+2];pe.children=le}if(P&&P.defaultProps)for(X in Q=P.defaultProps,Q)pe[X]===void 0&&(pe[X]=Q[X]);return F(P,ve,pe)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(P){return{$$typeof:l,render:P}},dt.isValidElement=ee,dt.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:L}},dt.memo=function(P,U){return{$$typeof:f,type:P,compare:U===void 0?null:U}},dt.startTransition=function(P){var U=A.T,O={};A.T=O;try{var X=P(),pe=A.S;pe!==null&&pe(O,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(T,ne)}catch(ve){ne(ve)}finally{U!==null&&O.types!==null&&(U.types=O.types),A.T=U}},dt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},dt.use=function(P){return A.H.use(P)},dt.useActionState=function(P,U,O){return A.H.useActionState(P,U,O)},dt.useCallback=function(P,U){return A.H.useCallback(P,U)},dt.useContext=function(P){return A.H.useContext(P)},dt.useDebugValue=function(){},dt.useDeferredValue=function(P,U){return A.H.useDeferredValue(P,U)},dt.useEffect=function(P,U){return A.H.useEffect(P,U)},dt.useEffectEvent=function(P){return A.H.useEffectEvent(P)},dt.useId=function(){return A.H.useId()},dt.useImperativeHandle=function(P,U,O){return A.H.useImperativeHandle(P,U,O)},dt.useInsertionEffect=function(P,U){return A.H.useInsertionEffect(P,U)},dt.useLayoutEffect=function(P,U){return A.H.useLayoutEffect(P,U)},dt.useMemo=function(P,U){return A.H.useMemo(P,U)},dt.useOptimistic=function(P,U){return A.H.useOptimistic(P,U)},dt.useReducer=function(P,U,O){return A.H.useReducer(P,U,O)},dt.useRef=function(P){return A.H.useRef(P)},dt.useState=function(P){return A.H.useState(P)},dt.useSyncExternalStore=function(P,U,O){return A.H.useSyncExternalStore(P,U,O)},dt.useTransition=function(){return A.H.useTransition()},dt.version="19.2.3",dt}var j$;function qm(){return j$||(j$=1,d_.exports=_X()),d_.exports}var b=qm();const J=of(b),Wk=vY({__proto__:null,default:J},[b]);var Lz=b.createContext(void 0),ir=e=>{const t=b.useContext(Lz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},CX=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Lz.Provider,{value:e,children:t})),Fz=b.createContext(!1),kX=()=>b.useContext(Fz);Fz.Provider;function EX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jX=b.createContext(EX()),IX=()=>b.useContext(jX),RX=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Gk(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},TX=e=>{b.useEffect(()=>{e.clearReset()},[e])},NX=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gk(n,[e.error,r])),AX=(e,t)=>t.state.data===void 0,OX=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$X=(e,t)=>e.isLoading&&e.isFetching&&!t,DX=(e,t)=>e?.suspense&&t.isPending,I$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Uz(e,t,n){const r=kX(),i=IX(),o=ir(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const l=o.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",OX(a),RX(a,i,l),TX(i);const d=!o.getQueryCache().get(a.queryHash),[f]=b.useState(()=>new t(o,a)),m=f.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(v=>{const y=h?f.subscribe(cr.batchCalls(v)):Gr;return f.updateResult(),y},[f,h]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(a)},[a,f]),DX(a,m))throw I$(a,f,i);if(NX({result:m,errorResetBoundary:i,throwOnError:a.throwOnError,query:l,suspense:a.suspense}))throw m.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,m),a.experimental_prefetchInRender&&!Ac&&$X(m,r)&&(d?I$(a,f,i):l?.promise)?.catch(Gr).finally(()=>{f.updateResult()}),a.notifyOnChangeProps?m:f.trackResult(m)}function Mt(e,t){return Uz(e,Dz)}function Ji(e,t){return Uz({...e,enabled:!0,suspense:!0,throwOnError:AX,placeholderData:void 0},Dz)}function g2e(e){return e}function ct(e,t){const n=ir(),[r]=b.useState(()=>new wX(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(cr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((a,l)=>{r.mutate(a,l).catch(Gr)},[r]);if(i.error&&Gk(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}async function Vz(){const{data:e}=await Gt.get("/User/current");return e}const Nb=["current-user"];function PX(){return{queryKey:Nb,queryFn:Vz,retry:!1}}async function Km({instanceClient:e,entityId:t}){const{data:n}=await e.post("/",{operation:"logout"});if(jt.flagForBasicAuth(t,null),n)return n;throw new Error("Something went wrong")}async function sl({instanceClient:e,...t}){const{data:n}=await e.post("/",{operation:"user_info"},t);return n}function Xk(e){let t=e?.fqdn;if(!t)return null;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return t.match(/:\d+/)||(n.port=String(Nd)),t.includes("://")||(n.protocol="https:"),n.toString()}function Jk(e){let t=e.instanceFqdn;t.match(/^https?:\/\//i)||(t=`https://${t}`);const n=new URL(t);return e.operationsApiPort&&(n.port=String(e.operationsApiPort)),e.operationsApiSecure!==void 0&&(n.protocol=e.operationsApiSecure?"https:":"http:"),n.toString()}const $n="OverallAppSignIn";class MX{broadListeners=[];specificListeners={};potentiallyAuthenticatedKey="Studio:PotentiallyAuthenticated";basicAuthKeyPrefix="Studio:BasicAuth:";fabricConnectKeyPrefix="Studio:FabricConnect:";potentiallyAuthenticated;checkedAuthentication={};allConnections={};constructor(){this.potentiallyAuthenticated=JSON.parse(localStorage.getItem(this.potentiallyAuthenticatedKey)||"{}")}getAllConnections(){return this.potentiallyAuthenticated.OverallAppSignIn||(this.allConnections[$n]={user:null,isLoading:!1}),this.allConnections}getConnectionById(t){return this.allConnections[t]||(this.allConnections[t]={user:null,isLoading:!!this.potentiallyAuthenticated[t]}),this.allConnections[t]}listenToAllEntities(t){this.broadListeners.includes(t)||this.broadListeners.push(t);for(const n in this.potentiallyAuthenticated)this.ensureUserIsLoaded(n);return()=>{const n=this.broadListeners.indexOf(t);n>=0&&this.broadListeners.splice(n,1)}}listenToEntity(t,n){if(t)return this.specificListeners[t]||(this.specificListeners[t]=[]),this.specificListeners[t].includes(n)||this.specificListeners[t].push(n),this.ensureUserIsLoaded(t),()=>{const r=this.specificListeners[t].indexOf(n);r>=0&&this.specificListeners[t].splice(r,1)}}setUserForEntity(t,n){const r=this.calculateIdFromEntity(t),i=this.calculateKeyFromEntity(t);if(!(!r||!i))return this.setUserForIdAndKey(r,i,n)}setUserForIdAndKey(t,n,r){r?this.flagKeyAsSignedIn(t,n):this.flagKeyAsSignedOut(t),this.updateConnectionIfChanged(t,!1,r)}updateUserForEntity(t,n){const r=this.calculateIdFromEntity(t);if(!r)return;const i=this.getConnectionById(r);i.user&&this.updateConnectionIfChanged(r,!1,{...i.user,...n})}calculateIdFromEntity(t){return $n}flagForBasicAuth(t,n){n!==null?localStorage.setItem(this.basicAuthKeyPrefix+t,btoa(JSON.stringify(n))):localStorage.removeItem(this.basicAuthKeyPrefix+t)}flagForFabricConnect(t,n){n?localStorage.setItem(this.fabricConnectKeyPrefix+t,"true"):localStorage.removeItem(this.fabricConnectKeyPrefix+t)}checkForBasicAuth(t){const n=localStorage.getItem(this.basicAuthKeyPrefix+t);return n?JSON.parse(atob(n)):void 0}checkForFabricConnect(t){return localStorage.getItem(this.fabricConnectKeyPrefix+t)==="true"}async signOutFromPotentiallyAuthenticatedInstances(){for(const t in this.potentiallyAuthenticated)if(this.allConnections[t].user=null,this.allConnections[t].isLoading=!1,this.flagKeyAsSignedOut(t),t!==$n)try{const n=es({id:t});await Km({entityId:t,instanceClient:n})}catch(n){console.error(`Failed to log out from ${t}, carrying on`,n)}}calculateKeyFromEntity(t){return $n}updateConnectionIfChanged(t,n,r){this.checkedAuthentication[t]=!0;const i=this.getConnectionById(t);let o=!1;i.isLoading!==n&&(i.isLoading=n,o=!0),i.user!==r&&(i.user=r,o=!0),o&&this.updateListeners(t)}flagKeyAsSignedIn(t,n){this.potentiallyAuthenticated[t]!==n&&(this.potentiallyAuthenticated[t]=n,localStorage.setItem(this.potentiallyAuthenticatedKey,JSON.stringify(this.potentiallyAuthenticated)))}flagKeyAsSignedOut(t){this.potentiallyAuthenticated[t]&&(delete this.potentiallyAuthenticated[t],localStorage.setItem(this.potentiallyAuthenticatedKey,JSON.stringify(this.potentiallyAuthenticated)))}async updateListeners(t){if(await qc(1),this.broadListeners)for(const n of this.broadListeners)this.updateListener(t,n);if(this.specificListeners[t])for(const n of this.specificListeners[t])this.updateListener(t,n)}updateListener(t,n){n(this.getConnectionById(t),t)}async ensureUserIsLoaded(t){this.checkedAuthentication[t]||await this.reloadUser(t)}getOperationsUrl(t){return xY}async reloadUser(t){return this.potentiallyAuthenticated[t]?this.loadUser(t):(this.updateConnectionIfChanged(t,!1,null),null)}async loadUser(t){const n=this.potentiallyAuthenticated[t];this.updateConnectionIfChanged(t,!0,null);let r=null;try{t===$n?xd&&(r=await sl({instanceClient:es()})):t&&(r=await sl({instanceClient:es({id:t})}))}catch(i){console.error(i),r=null}return r?this.flagKeyAsSignedIn(t,n):this.flagKeyAsSignedOut(t),this.updateConnectionIfChanged(t,!1,r),r}}const jt=new MX,wd=new WeakMap,ty=new WeakMap,wy={current:[]};let f_=!1,nm=0;const Wp=new Set,cv=new Map;function Bz(e){const t=Array.from(e).sort((n,r)=>n instanceof Sd&&n.options.deps.includes(r)?1:r instanceof Sd&&r.options.deps.includes(n)?-1:0);for(const n of t){if(wy.current.includes(n))continue;wy.current.push(n),n.recompute();const r=ty.get(n);if(r)for(const i of r){const o=wd.get(i);o&&Bz(o)}}}function zX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function LX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Hz(e){if(nm>0&&!cv.has(e)&&cv.set(e,e.prevState),Wp.add(e),!(nm>0)&&!f_)try{for(f_=!0;Wp.size>0;){const t=Array.from(Wp);Wp.clear();for(const n of t){const r=cv.get(n)??n.prevState;n.prevState=r,zX(n)}for(const n of t){const r=wd.get(n);r&&(wy.current.push(n),Bz(r))}for(const n of t){const r=wd.get(n);if(r)for(const i of r)LX(i)}}}finally{f_=!1,wy.current=[],cv.clear()}}function rm(e){nm++;try{e()}finally{if(nm--,nm===0){const t=Wp.values().next().value;t&&Hz(t)}}}function FX(e){return typeof e=="function"}class lC{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var i,o;this.listeners.add(r);const a=(o=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:o.call(i,r,this);return()=>{this.listeners.delete(r),a?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):FX(t)?this.state=t(this.prevState):this.state=t,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),Hz(this)}}class Sd{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const n=this.options.deps.length,r=new Array(n),i=new Array(n);for(let o=0;o<n;o++){const a=this.options.deps[o];r[o]=a.prevState,i[o]=a.state}return this.lastSeenDepValues=i,{prevDepVals:r,currDepVals:i,prevVal:this.prevState??void 0}},this.recompute=()=>{var n,r;this.prevState=this.state;const i=this.getDepVals();this.state=this.options.fn(i),(r=(n=this.options).onUpdate)==null||r.call(n)},this.checkIfRecalculationNeededDeeply=()=>{for(const o of this.options.deps)o instanceof Sd&&o.checkIfRecalculationNeededDeeply();let n=!1;const r=this.lastSeenDepValues,{currDepVals:i}=this.getDepVals();for(let o=0;o<i.length;o++)if(i[o]!==r[o]){n=!0;break}n&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const n of this._subscriptions)n()}),this.subscribe=n=>{var r,i;this.listeners.add(n);const o=(i=(r=this.options).onSubscribe)==null?void 0:i.call(r,n,this);return()=>{this.listeners.delete(n),o?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(const n of t)if(n instanceof Sd)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof lC){let r=wd.get(n);r||(r=new Set,wd.set(n,r)),r.add(this);let i=ty.get(this);i||(i=new Set,ty.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof Sd)this.unregisterFromGraph(n.options.deps);else if(n instanceof lC){const r=wd.get(n);r&&r.delete(this);const i=ty.get(this);i&&i.delete(n)}}}const ll="__TSR_index",R$="popstate",T$="beforeunload";function UX(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(l=>l({location:t,action:a}))},i=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},o=async({task:a,navigateOpts:l,...d})=>{if(l?.ignoreBlocker??!1){a();return}const m=e.getBlockers?.()??[],h=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&m.length&&h)for(const v of m){const y=gm(d.path,d.state);if(await v.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}a()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,l,d)=>{const f=t.state[ll];l=N$(f+1,l),o({task:()=>{e.pushState(a,l),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:a,state:l})},replace:(a,l,d)=>{const f=t.state[ll];l=N$(f,l),o({task:()=>{e.replaceState(a,l),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:a,state:l})},go:(a,l)=>{o({task:()=>{e.go(a),i({type:"GO",index:a})},navigateOpts:l,type:"GO"})},back:a=>{o({task:()=>{e.back(a?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{o({task:()=>{e.forward(a?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>t.state[ll]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const l=e.getBlockers?.()??[];return e.setBlockers([...l,a]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function N$(e,t){t||(t={});const n=Qk();return{...t,key:n,__TSR_key:n,[ll]:e}}function qz(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let i=[];const o=()=>i,a=D=>i=D,l=e?.createHref??(D=>D),d=e?.parseLocation??(()=>gm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const D=Qk();t.history.replaceState({[ll]:0,key:D,__TSR_key:D},"")}let f=d(),m,h=!1,v=!1,y=!1,x=!1;const S=()=>f;let C,k;const E=()=>{C&&(A._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),A._ignoreSubscribers=!1,C=void 0,k=void 0,m=void 0)},j=(D,F,q)=>{const ee=l(F);k||(m=f),f=gm(F,q),C={href:ee,state:q,isPush:C?.isPush||D==="push"},k||(k=Promise.resolve().then(()=>E()))},I=D=>{f=d(),A.notify({type:D})},N=async()=>{if(v){v=!1;return}const D=d(),F=D.state[ll]-f.state[ll],q=F===1,ee=F===-1,G=!q&&!ee||h;h=!1;const K=G?"GO":ee?"BACK":"FORWARD",V=G?{type:"GO",index:F}:{type:ee?"BACK":"FORWARD"};if(y)y=!1;else{const H=o();if(typeof document<"u"&&H.length){for(const z of H)if(await z.blockerFn({currentLocation:f,nextLocation:D,action:K})){v=!0,t.history.go(1),A.notify(V);return}}}f=d(),A.notify(V)},T=D=>{if(x){x=!1;return}let F=!1;const q=o();if(typeof document<"u"&&q.length)for(const ee of q){const G=ee.enableBeforeUnload??!0;if(G===!0){F=!0;break}if(typeof G=="function"&&G()===!0){F=!0;break}}if(F)return D.preventDefault(),D.returnValue=""},A=UX({getLocation:S,getLength:()=>t.history.length,pushState:(D,F)=>j("push",D,F),replaceState:(D,F)=>j("replace",D,F),back:D=>(D&&(y=!0),x=!0,t.history.back()),forward:D=>{D&&(y=!0),x=!0,t.history.forward()},go:D=>{h=!0,t.history.go(D)},createHref:D=>l(D),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(T$,T,{capture:!0}),t.removeEventListener(R$,N)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(T$,T,{capture:!0}),t.addEventListener(R$,N),t.history.pushState=function(...D){const F=n.apply(t.history,D);return A._ignoreSubscribers||I("PUSH"),F},t.history.replaceState=function(...D){const F=r.apply(t.history,D);return A._ignoreSubscribers||I("REPLACE"),F},A}function VX(e){const t=typeof document<"u"?window:void 0;return qz({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",i=t.location.search,o=n.slice(1),a=o.length===0?"":`#${o.join("#")}`,l=`${r}${i}${a}`;return gm(l,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function gm(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),i=Qk();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[ll]:0,key:i,__TSR_key:i}}}function Qk(){return(Math.random()+1).toString(36).substring(7)}function cC(e){return e[e.length-1]}function BX(e){return typeof e=="function"}function Cc(e,t){return BX(e)?e(t):e}const HX=Object.prototype.hasOwnProperty;function ho(e,t){if(e===t)return e;const n=t,r=$$(e)&&$$(n);if(!r&&!(Sy(e)&&Sy(n)))return n;const i=r?e:A$(e);if(!i)return n;const o=r?n:A$(n);if(!o)return n;const a=i.length,l=o.length,d=r?new Array(l):{};let f=0;for(let m=0;m<l;m++){const h=r?m:o[m],v=e[h],y=n[h];if(v===y){d[h]=v,(r?m<a:HX.call(e,h))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){d[h]=y;continue}const x=ho(v,y);d[h]=x,x===v&&f++}return a===l&&f===a?e:d}function A$(e){const t=[],n=Object.getOwnPropertyNames(e);for(const i of n){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}const r=Object.getOwnPropertySymbols(e);for(const i of r){if(!Object.prototype.propertyIsEnumerable.call(e,i))return!1;t.push(i)}return t}function Sy(e){if(!O$(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!O$(n)||!n.hasOwnProperty("isPrototypeOf"))}function O$(e){return Object.prototype.toString.call(e)==="[object Object]"}function $$(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kc(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!kc(e[r],t[r],n))return!1;return!0}if(Sy(e)&&Sy(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!kc(e[a],t[a],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const a in e)e[a]!==void 0&&i++;let o=0;for(const a in t)if((!r||t[a]!==void 0)&&(o++,o>i||!kc(e[a],t[a],n)))return!1;return i===o}return!1}function Od(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function qX(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function cl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}var KX="Invariant failed";function rs(e,t){if(!e)throw new Error(KX)}const yi="__root__",ga=0,$c=1,$d=2,Dd=3;function ts(e){return eE(e.filter(t=>t!==void 0).join("/"))}function eE(e){return e.replace(/\/{2,}/g,"/")}function tE(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ul(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ny(e){return ul(tE(e))}function _y(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function GX(e,t,n){return _y(e,n)===_y(t,n)}function ZX(e){const{type:t,value:n}=e;if(t===ga)return n;const{prefixSegment:r,suffixSegment:i}=e;if(t===$c){const o=n.substring(1);if(r&&i)return`${r}{$${o}}${i}`;if(r)return`${r}{$${o}}`;if(i)return`{$${o}}${i}`}if(t===Dd){const o=n.substring(1);return r&&i?`${r}{-$${o}}${i}`:r?`${r}{-$${o}}`:i?`{-$${o}}${i}`:`{-$${o}}`}if(t===$d){if(r&&i)return`${r}{$}${i}`;if(r)return`${r}{$}`;if(i)return`{$}${i}`}return n}function YX({base:e,to:t,trailingSlash:n="never",parseCache:r}){let i=Kz(e,r).slice();const o=Ab(t,r);i.length>1&&cC(i)?.value==="/"&&i.pop();for(let d=0,f=o.length;d<f;d++){const m=o[d],h=m.value;h==="/"?d?d===f-1&&i.push(m):i=[m]:h===".."?i.pop():h==="."||i.push(m)}i.length>1&&(cC(i).value==="/"?n==="never"&&i.pop():n==="always"&&i.push({type:ga,value:"/"}));const a=i.map(ZX);return ts(a)}const Kz=(e,t)=>Gz(e,t,!0),Ab=(e,t)=>Gz(e,t,!1),Gz=(e,t,n)=>{if(!e)return[];const r=t?.get(e);if(r)return r;const i=tJ(e,n);return t?.set(e,i),i},WX=/^\$.{1,}$/,XX=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,JX=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,QX=/^\$$/,eJ=/^(.*?)\{\$\}(.*)$/;function tJ(e,t){e=eE(e);const n=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),n.push({type:ga,value:"/"})),!e)return n;const r=e.split("/").filter(Boolean);return n.push(...r.map(i=>{const o=!t&&i!==yi&&i.slice(-1)==="_"?i.slice(0,-1):i,a=o.match(eJ);if(a){const f=a[1],m=a[2];return{type:$d,value:"$",prefixSegment:f||void 0,suffixSegment:m||void 0}}const l=o.match(JX);if(l){const f=l[1],m=l[2],h=l[3];return{type:Dd,value:m,prefixSegment:f||void 0,suffixSegment:h||void 0}}const d=o.match(XX);if(d){const f=d[1],m=d[2],h=d[3];return{type:$c,value:""+m,prefixSegment:f||void 0,suffixSegment:h||void 0}}if(WX.test(o)){const f=o.substring(1);return{type:$c,value:"$"+f,prefixSegment:void 0,suffixSegment:void 0}}return QX.test(o)?{type:$d,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ga,value:o.includes("%25")?o.split("%25").map(f=>decodeURI(f)).join("%25"):decodeURI(o)}})),e.slice(-1)==="/"&&(e=e.substring(1),n.push({type:ga,value:"/"})),n}function uv({path:e,params:t,leaveWildcards:n,leaveParams:r,decodeCharMap:i,parseCache:o}){const a=Ab(e,o);function l(h){const v=t[h],y=typeof v=="string";return h==="*"||h==="_splat"?y?encodeURI(v):v:y?nJ(v,i):v}let d=!1;const f={},m=ts(a.map(h=>{if(h.type===ga)return h.value;if(h.type===$d){f._splat=t._splat,f["*"]=t._splat;const v=h.prefixSegment||"",y=h.suffixSegment||"";if(!t._splat)return d=!0,n?`${v}${h.value}${y}`:v||y?`${v}${y}`:void 0;const x=l("_splat");return n?`${v}${h.value}${x??""}${y}`:`${v}${x}${y}`}if(h.type===$c){const v=h.value.substring(1);!d&&!(v in t)&&(d=!0),f[v]=t[v];const y=h.prefixSegment||"",x=h.suffixSegment||"";if(r){const S=l(h.value);return`${y}${h.value}${S??""}${x}`}return`${y}${l(v)??"undefined"}${x}`}if(h.type===Dd){const v=h.value.substring(1),y=h.prefixSegment||"",x=h.suffixSegment||"";if(!(v in t)||t[v]==null)return n?`${y}${v}${x}`:y||x?`${y}${x}`:void 0;if(f[v]=t[v],r){const S=l(h.value);return`${y}${h.value}${S??""}${x}`}return n?`${y}${v}${l(v)??""}${x}`:`${y}${l(v)??""}${x}`}return h.value}));return{usedParams:f,interpolatedPath:m,isMissingParams:d}}function nJ(e,t){let n=encodeURIComponent(e);if(t)for(const[r,i]of t)n=n.replaceAll(r,i);return n}function uC(e,t,n){const r=rJ(e,t,n);if(!(t.to&&!r))return r??{}}function rJ(e,{to:t,fuzzy:n,caseSensitive:r},i){const o=t,a=Kz(e.startsWith("/")?e:`/${e}`,i),l=Ab(o.startsWith("/")?o:`/${o}`,i),d={};return iJ(a,l,d,n,r)?d:void 0}function iJ(e,t,n,r,i){let o=0,a=0;for(;o<e.length||a<t.length;){const l=e[o],d=t[a];if(d){if(d.type===$d){const f=e.slice(o);let m;if(d.prefixSegment||d.suffixSegment){if(!l)return!1;const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if("prefixSegment"in d&&!y.startsWith(h)||"suffixSegment"in d&&!e[e.length-1]?.value.endsWith(v))return!1;let x=decodeURI(ts(f.map(S=>S.value)));h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),m=x}else m=decodeURI(ts(f.map(h=>h.value)));return n["*"]=m,n._splat=m,!0}if(d.type===ga){if(d.value==="/"&&!l?.value){a++;continue}if(l){if(i){if(d.value!==l.value)return!1}else if(d.value.toLowerCase()!==l.value.toLowerCase())return!1;o++,a++;continue}else return!1}if(d.type===$c){if(!l||l.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if(h&&!y.startsWith(h)||v&&!y.endsWith(v))return!1;let x=y;h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),f=decodeURIComponent(x),m=!0}else f=decodeURIComponent(l.value),m=!0;m&&(n[d.value.substring(1)]=f,o++),a++;continue}if(d.type===Dd){if(!l){a++;continue}if(l.value==="/"){a++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=l.value;if((!h||y.startsWith(h))&&(!v||y.endsWith(v))){let x=y;h&&x.startsWith(h)&&(x=x.slice(h.length)),v&&x.endsWith(v)&&(x=x.slice(0,x.length-v.length)),f=decodeURIComponent(x),m=!0}}else{let h=!0;for(let v=a+1;v<t.length;v++){const y=t[v];if(y?.type===ga&&y.value===l.value){h=!1;break}if(y?.type===$c||y?.type===$d){e.length<t.length&&(h=!1);break}}h&&(f=decodeURIComponent(l.value),m=!0)}m&&(n[d.value.substring(1)]=f,o++),a++;continue}}if(o<e.length&&a>=t.length)return n["**"]=ts(e.slice(o).map(f=>f.value)),!!r&&t[t.length-1]?.value!=="/";if(a<t.length&&o>=e.length){for(let f=a;f<t.length;f++)if(t[f]?.type!==Dd)return!1;break}break}return!0}const oJ=.75,aJ=1,sJ=.5,lJ=.4,cJ=.25,uJ=.2,dJ=.05,fJ=.02,pJ=.01,D$=2e-4,P$=1e-4;function M$(e,t){return e.prefixSegment&&e.suffixSegment?t+dJ+D$*e.prefixSegment.length+P$*e.suffixSegment.length:e.prefixSegment?t+fJ+D$*e.prefixSegment.length:e.suffixSegment?t+pJ+P$*e.suffixSegment.length:t}function mJ(e){const t=[];return e.forEach((r,i)=>{if(r.isRoot||!r.path)return;const o=tE(r.fullPath);let a=Ab(o),l=0;for(;a.length>l+1&&a[l]?.value==="/";)l++;l>0&&(a=a.slice(l));let d=0,f=!1;const m=a.map((h,v)=>{if(h.value==="/")return oJ;if(h.type===ga)return aJ;let y;h.type===$c?y=sJ:h.type===Dd?(y=lJ,d++):y=cJ;for(let x=v+1;x<a.length;x++){const S=a[x];if(S.type===ga&&S.value!=="/")return f=!0,M$(h,y+uJ)}return M$(h,y)});t.push({child:r,trimmed:o,parsed:a,index:i,scores:m,optionalParamCount:d,hasStaticAfter:f})}),t.sort((r,i)=>{const o=Math.min(r.scores.length,i.scores.length);for(let a=0;a<o;a++)if(r.scores[a]!==i.scores[a])return i.scores[a]-r.scores[a];if(r.scores.length!==i.scores.length){if(r.optionalParamCount!==i.optionalParamCount){if(r.hasStaticAfter===i.hasStaticAfter)return r.optionalParamCount-i.optionalParamCount;if(r.hasStaticAfter&&!i.hasStaticAfter)return-1;if(!r.hasStaticAfter&&i.hasStaticAfter)return 1}return i.scores.length-r.scores.length}for(let a=0;a<o;a++)if(r.parsed[a].value!==i.parsed[a].value)return r.parsed[a].value>i.parsed[a].value?1:-1;return r.index-i.index}).map((r,i)=>(r.child.rank=i,r.child))}function hJ({routeTree:e,initRoute:t}){const n={},r={},i=a=>{a.forEach((l,d)=>{t?.(l,d);const f=n[l.id];if(rs(!f,`Duplicate routes found with id: ${String(l.id)}`),n[l.id]=l,!l.isRoot&&l.path){const h=ul(l.fullPath);(!r[h]||l.fullPath.endsWith("/"))&&(r[h]=l)}const m=l.children;m?.length&&i(m)})};i([e]);const o=mJ(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Ho(e){return!!e?.isNotFound}function gJ(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Cy="tsr-scroll-restoration-v1_3",vJ=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function yJ(){const e=gJ();if(!e)return null;const t=e.getItem(Cy);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=Cc(r,n)||n,e.setItem(Cy,JSON.stringify(n)))}}const dv=yJ(),dC=e=>e.state.__TSR_key||e.href;function bJ(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let ky=!1;function Zz({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:o}){let a;try{a=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const l=t||window.history.state?.__TSR_key,d=a[l];ky=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const h in d){const v=d[h];if(h==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(h){const y=document.querySelector(h);y&&(y.scrollLeft=v.scrollX,y.scrollTop=v.scrollY)}}break e}const f=(o??window.location).hash.split("#",2)[1];if(f){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const v=document.getElementById(f);v&&v.scrollIntoView(h)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const h of i){if(h==="window")continue;const v=typeof h=="function"?h():document.querySelector(h);v&&v.scrollTo(m)}}ky=!1}function xJ(e,t){if(!dv&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!dv))return;e.isScrollRestorationSetup=!0,ky=!1;const r=e.options.getScrollRestorationKey||dC;window.history.scrollRestoration="manual";const i=o=>{if(ky||!e.isScrollRestoring)return;let a="";if(o.target===document||o.target===window)a="window";else{const d=o.target.getAttribute("data-scroll-restoration-id");d?a=`[data-scroll-restoration-id="${d}"]`:a=bJ(o.target)}const l=r(e.state.location);dv.set(d=>{const f=d[l]||={},m=f[a]||={};if(a==="window")m.scrollX=window.scrollX||0,m.scrollY=window.scrollY||0;else if(a){const h=document.querySelector(a);h&&(m.scrollX=h.scrollLeft||0,m.scrollY=h.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",vJ(i,100),!0),e.subscribe("onRendered",o=>{const a=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Zz({storageKey:Cy,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&dv.set(l=>(l[a]||={},l)))})}function wJ(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function SJ(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function p_(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function _J(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=p_(i):Array.isArray(o)?o.push(p_(i)):n[r]=[o,p_(i)]}return n}const CJ=EJ(JSON.parse),kJ=jJ(JSON.stringify,JSON.parse);function EJ(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=_J(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function jJ(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const o=SJ(i,r);return o?`?${o}`:""}}function Kc(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function da(e){return e instanceof Response&&!!e.options}function IJ(e){const t=new Map;let n,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const a=t.get(o);if(a)return i(a),a.value},set(o,a){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const l=t.get(o);if(l)l.value=a,i(l);else{const d={key:o,value:a,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const ry=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ob=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Yz=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),rs(n.options.notFoundComponent);const r=e.matches.find(i=>i.routeId===n.id);rs(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,Yz(e,t))},el=(e,t,n)=>{if(!(!da(n)&&!Ho(n))){if(da(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=da(n)?"redirected":"notFound";e.updateMatch(t.id,i=>({...i,status:r,isFetching:!1,error:n})),Ho(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw da(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Yz(e,n),n)}},Wz=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},kp=(e,t,n,r)=>{const{id:i,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,el(e,e.router.getMatch(i),n);try{a.options.onError?.(n)}catch(l){n=l,el(e,e.router.getMatch(i),n)}e.updateMatch(i,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},RJ=(e,t,n,r)=>{const i=e.router.getMatch(t),o=e.matches[n-1]?.id,a=o?e.router.getMatch(o):void 0;if(e.router.isShell()){i.ssr=t===yi;return}if(a?.ssr===!1){i.ssr=!1;return}const l=y=>y===!0&&a?.ssr==="data-only"?"data-only":y,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=l(d);return}if(typeof r.options.ssr!="function"){i.ssr=l(r.options.ssr);return}const{search:f,params:m}=i,h={search:fv(f,i.searchError),params:fv(m,i.paramsError),location:e.location,matches:e.matches.map(y=>({index:y.index,pathname:y.pathname,fullPath:y.fullPath,staticData:y.staticData,id:y.id,routeId:y.routeId,search:fv(y.search,y.searchError),params:fv(y.params,y.paramsError),ssr:y.ssr}))},v=r.options.ssr(h);if(cl(v))return v.then(y=>{i.ssr=l(y??d)});i.ssr=l(v??d)},Xz=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Ob(e,t)&&(n.options.loader||n.options.beforeLoad||e4(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{ry(e)},i);r._nonReactive.pendingTimeout=a}},TJ=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Xz(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&el(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},NJ=(e,t,n,r)=>{const i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Od(()=>{o?.resolve()});const{paramsError:a,searchError:l}=i;a&&kp(e,n,a,"PARSE_PARAMS"),l&&kp(e,n,l,"VALIDATE_SEARCH"),Xz(e,t,r,i);const d=new AbortController,f=e.matches[n-1]?.id,v={...(f?e.router.getMatch(f):void 0)?.context??e.router.options.context??void 0,...i.__routeContext};let y=!1;const x=()=>{y||(y=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d,context:v})))},S=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){rm(()=>{x(),S()});return}i._nonReactive.beforeLoadPromise=Od();const{search:C,params:k,cause:E}=i,j=Ob(e,t),I={search:C,abortController:d,params:k,preload:j,context:v,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":E,matches:e.matches,...e.router.options.additionalContext},N=A=>{if(A===void 0){rm(()=>{x(),S()});return}(da(A)||Ho(A))&&(x(),kp(e,n,A,"BEFORE_LOAD")),rm(()=>{x(),e.updateMatch(t,D=>({...D,__beforeLoadContext:A,context:{...D.context,...A}})),S()})};let T;try{if(T=r.options.beforeLoad(I),cl(T))return x(),T.catch(A=>{kp(e,n,A,"BEFORE_LOAD")}).then(N)}catch(A){x(),kp(e,n,A,"BEFORE_LOAD")}N(T)},AJ=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=RJ(e,n,t,i);if(cl(d))return d.then(l)}return l()},a=()=>NJ(e,n,t,i),l=()=>{if(Wz(e,n))return;const d=TJ(e,n,i);return cl(d)?d.then(a):a()};return o()},im=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([o,a,l])=>{const d=o?.meta,f=o?.links,m=o?.scripts,h=o?.styles;return{meta:d,links:f,headScripts:m,headers:l,scripts:a,styles:h}})},Jz=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:o,loaderDeps:a,abortController:l,context:d,cause:f}=e.router.getMatch(t),m=Ob(e,t);return{params:o,deps:a,preload:!!m,parentMatchPromise:i,abortController:l,context:d,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:m?"preload":f,route:r,...e.router.options.additionalContext}},z$=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&Qz(r);const o=r.options.loader?.(Jz(e,t,n,r)),a=r.options.loader&&cl(o);if((a||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,h=>({...h,isFetching:"loader"})),r.options.loader){const h=a?await o:o;el(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,v=>({...v,loaderData:h}))}r._lazyPromise&&await r._lazyPromise;const d=im(e,t,r),f=d?await d:void 0,m=i._nonReactive.minPendingPromise;m&&await m,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(o){let a=o;const l=i._nonReactive.minPendingPromise;l&&await l,Ho(o)&&await r.options.notFoundComponent?.preload?.(),el(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(m){a=m,el(e,e.router.getMatch(t),m)}const d=im(e,t,r),f=d?await d:void 0;e.updateMatch(t,m=>({...m,error:a,status:"error",isFetching:!1,...f}))}}catch(i){const o=e.router.getMatch(t);if(o){const a=im(e,t,r);if(a){const l=await a;e.updateMatch(t,d=>({...d,...l}))}o._nonReactive.loaderPromise=void 0}el(e,o,i)}},OJ=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let i=!1,o=!1;const a=e.router.looseRoutesById[r];if(Wz(e,n)){if(e.router.isServer){const f=im(e,n,a);if(f){const m=await f;e.updateMatch(n,h=>({...h,...m}))}return e.router.getMatch(n)}}else{const f=e.router.getMatch(n);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;const m=e.router.getMatch(n);m.error&&el(e,m,m.error)}else{const m=Date.now()-f.updatedAt,h=Ob(e,n),v=h?a.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:a.options.staleTime??e.router.options.defaultStaleTime??0,y=a.options.shouldReload,x=typeof y=="function"?y(Jz(e,n,t,a)):y,S=!!h&&!e.router.state.matches.some(j=>j.id===n),C=e.router.getMatch(n);C._nonReactive.loaderPromise=Od(),S!==C.preload&&e.updateMatch(n,j=>({...j,preload:S}));const{status:k,invalid:E}=C;if(i=k==="success"&&(E||(x??m>v)),!(h&&a.options.preload===!1))if(i&&!e.sync)o=!0,(async()=>{try{await z$(e,n,t,a);const j=e.router.getMatch(n);j._nonReactive.loaderPromise?.resolve(),j._nonReactive.loadPromise?.resolve(),j._nonReactive.loaderPromise=void 0}catch(j){da(j)&&await e.router.navigate(j.options)}})();else if(k!=="success"||i&&e.sync)await z$(e,n,t,a);else{const j=im(e,n,a);if(j){const I=await j;e.updateMatch(n,N=>({...N,...I}))}}}}const l=e.router.getMatch(n);o||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,o||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0;const d=o?l.isFetching:!1;return d!==l.isFetching||l.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):l};async function L$(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&ry(t);try{for(let i=0;i<t.matches.length;i++){const o=AJ(t,i);cl(o)&&await o}const n=t.firstBadMatchIndex??t.matches.length;for(let i=0;i<n;i++)t.matchPromises.push(OJ(t,i));await Promise.all(t.matchPromises);const r=ry(t);cl(r)&&await r}catch(n){if(Ho(n)&&!t.preload){const r=ry(t);throw cl(r)&&await r,n}if(da(n))throw n}return t.matches}async function Qz(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of t4){const i=e.options[r]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function fv(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function e4(e){for(const t of t4)if(e.options[t]?.preload)return!0;return!1}const t4=["component","errorComponent","pendingComponent","notFoundComponent"];function $J(e){return{input:({url:t})=>{for(const n of e)t=n4(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=r4(e[n],t);return t}}}function DJ(e){const t=ny(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===i?a.pathname="/":l.startsWith(o)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=ts(["/",t,a.pathname]),a)}}function n4(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function r4(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ec(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,i=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:o}}class PJ{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,a=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(v=>[encodeURIComponent(v),v])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=qz())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new lC(zJ(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(v=>!["redirected"].includes(v.status))}}}),xJ(this));let l=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||i!==d||a!==f){this.basepath=d;const v=[];ny(d)!==""&&v.push(DJ({basepath:d})),f&&v.push(f),this.rewrite=v.length===0?void 0:v.length===1?v[0]:$J(v),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:i}=hJ({routeTree:this.routeTree,initRoute:(a,l)=>{a.init({originalIndex:l})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=i;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({href:d,state:f})=>{const m=new URL(d,this.origin),h=n4(this.rewrite,m),v=this.options.parseSearch(h.search),y=this.options.stringifySearch(v);h.search=y;const x=h.href.replace(h.origin,""),{pathname:S,hash:C}=h;return{href:x,publicHref:d,url:h.href,pathname:S,searchStr:y,search:ho(r?.search,v),hash:C.split("#").reverse()[0]??"",state:ho(r?.state,f)}},o=i(n),{__tempLocation:a,__tempKey:l}=o.state;if(a&&(!l||l===this.tempLocationKey)){const d=i(a);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>YX({base:n,to:eE(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.parsePathnameCache=IJ(1e3),this.getMatchedRoutes=(n,r)=>LJ({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.state.pendingMatches?.forEach(n=>{this.cancelMatch(n.id)})},this.buildLocation=n=>{const r=(o={})=>{const a=o._fromLocation||this.latestLocation,l=this.matchRoutes(a,{_buildLocation:!0}),d=cC(l);o.from;const f=o.unsafeRelative==="path"?a.pathname:o.from??d.fullPath,m=this.resolvePathWithBase(f,"."),h=d.search,v={...d.params},y=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),x=o.params===!1||o.params===null?{}:(o.params??!0)===!0?v:Object.assign(v,Cc(o.params,v)),S=uv({path:y,params:x,parseCache:this.parsePathnameCache}).interpolatedPath,C=this.matchRoutes(S,void 0,{_buildLocation:!0}).map(q=>this.looseRoutesById[q.routeId]);if(Object.keys(x).length>0)for(const q of C){const ee=q.options.params?.stringify??q.options.stringifyParams;ee&&Object.assign(x,ee(x))}const k=uv({path:y,params:x,leaveWildcards:!1,leaveParams:n.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let E=h;if(n._includeValidateSearch&&this.options.search?.strict){const q={};C.forEach(ee=>{if(ee.options.validateSearch)try{Object.assign(q,fC(ee.options.validateSearch,{...q,...E}))}catch{}}),E=q}E=FJ({search:E,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),E=ho(h,E);const j=this.options.stringifySearch(E),I=o.hash===!0?a.hash:o.hash?Cc(o.hash,a.hash):void 0,N=I?`#${I}`:"";let T=o.state===!0?a.state:o.state?Cc(o.state,a.state):{};T=ho(a.state,T);const A=`${k}${j}${N}`,D=new URL(A,this.origin),F=r4(this.rewrite,D);return{publicHref:F.pathname+F.search+F.hash,href:A,url:F.href,pathname:k,search:E,searchStr:j,state:T,hash:I??"",unmaskOnReload:o.unmaskOnReload}},i=(o={},a)=>{const l=r(o);let d=a?r(a):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(h=>{const v=uC(l.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return v?(f=v,!0):!1});if(m){const{from:h,...v}=m;a={from:n.from,...v,params:f},d=r(a)}}return d&&(l.maskedLocation=d),l};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...i})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(m=>{i.state[m]=this.latestLocation.state[m]});const f=kc(i.state,this.latestLocation.state);return d.forEach(m=>{delete i.state[m]}),f},a=ul(this.latestLocation.href)===ul(i.href),l=this.commitLocationPromise;if(this.commitLocationPromise=Od(()=>{l?.resolve()}),a&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:f,...m}=i;d&&(m={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:a,href:l,...d}={})=>{if(l){const m=this.history.location.state.__TSR_index,h=gm(l,{__TSR_index:n?m:m+1});d.to=h.pathname,d.search=this.options.parseSearch(h.search),d.hash=h.hash.slice(1)}const f=this.buildLocation({...d,_includeValidateSearch:!0});return this.commitLocation({...f,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:a})},this.navigate=({to:n,reloadDocument:r,href:i,...o})=>{if(!r&&i)try{new URL(`${i}`),r=!0}catch{}return r?(i||(i=this.buildLocation({to:n,...o}).url),o.replace?window.location.replace(i):window.location.href=i,Promise.resolve()):this.buildAndCommitLocation({...o,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),i=o=>{try{return encodeURI(decodeURI(o))}catch{return o}};if(ny(i(this.latestLocation.href))!==ny(i(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),Kc({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.some(o=>o.id===i.id))}))},this.load=async n=>{let r,i,o;for(o=new Promise(l=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ec({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ec({resolvedLocation:f,location:d})}),await L$({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let m,h,v;rm(()=>{this.__store.setState(y=>{const x=y.matches,S=y.pendingMatches||y.matches;return m=x.filter(C=>!S.some(k=>k.id===C.id)),h=S.filter(C=>!x.some(k=>k.id===C.id)),v=x.filter(C=>S.some(k=>k.id===C.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...m.filter(C=>C.status!=="error")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[h,"onEnter"],[v,"onStay"]].forEach(([y,x])=>{y.forEach(S=>{this.looseRoutesById[S.routeId].options[x]?.(S)})})})}})}catch(d){da(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Ho(d)&&(i=d),this.__store.setState(f=>({...f,statusCode:r?r.status:i?404:f.matches.some(m=>m.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(l=>l.status==="error")&&(a=500),a!==void 0&&this.__store.setState(l=>({...l,statusCode:a}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,a=this.state.resolvedLocation,l=typeof r.types=="function"?r.types(Ec({resolvedLocation:a,location:o})):r.types;if(l===!1){n();return}i={update:n,types:l}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{const i=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";i&&this.__store.setState(o=>({...o,[i]:o[i]?.map(a=>a.id===n?r(a):a)}))},this.getMatch=n=>{const r=i=>i.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:i.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let i=r.url;this.origin&&i.startsWith(this.origin)&&(i=i.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",i)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(o=>!r(o))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const o=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=Qz,this.preloadRoute=async n=>{const r=this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),a=new Set([...o,...this.state.cachedMatches.map(l=>l.id)]);rm(()=>{i.forEach(l=>{a.has(l.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,l]}))})});try{return i=await L$({router:this,matches:i,location:r,preload:!0,updateMatch:(l,d)=>{o.has(l)?i=i.map(f=>f.id===l?d(f):f):this.updateMatch(l,d)}}),i}catch(l){if(da(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});Ho(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.state.status!=="pending")return!1;const l=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=uC(l.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!kc(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?kc(l.search,o.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??kJ,parseSearch:t.parseSearch??CJ}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:i,routeParams:o}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let a=!1;(r?r.path!=="/"&&o["**"]:ul(t.pathname))&&(this.options.notFoundRoute?i.push(this.options.notFoundRoute):a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let m=i.length-1;m>=0;m--){const h=i[m];if(h.children)return h.id}return yi}})(),d=[],f=m=>m?.id?m.context??this.options.context??void 0:this.options.context??void 0;return i.forEach((m,h)=>{const v=d[h-1],[y,x,S]=(()=>{const G=v?.search??t.search,K=v?._strictSearch??void 0;try{const V=fC(m.options.validateSearch,{...G})??void 0;return[{...G,...V},{...K,...V},void 0]}catch(V){let H=V;if(V instanceof Ey||(H=new Ey(V.message,{cause:V})),n?.throwOnError)throw H;return[G,{},H]}})(),C=m.options.loaderDeps?.({search:y})??"",k=C?JSON.stringify(C):"",{interpolatedPath:E,usedParams:j}=uv({path:m.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),I=uv({path:m.id,params:o,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+k,N=this.getMatch(I),T=this.state.matches.find(G=>G.routeId===m.id),A=N?._strictParams??j;let D;if(!N){const G=m.options.params?.parse??m.options.parseParams;if(G)try{Object.assign(A,G(A))}catch(K){if(D=new MJ(K.message,{cause:K}),n?.throwOnError)throw D}}Object.assign(o,A);const F=T?"stay":"enter";let q;if(N)q={...N,cause:F,params:T?ho(T.params,o):o,_strictParams:A,search:ho(T?T.search:N.search,y),_strictSearch:x};else{const G=m.options.loader||m.options.beforeLoad||m.lazyFn||e4(m)?"pending":"success";q={id:I,index:h,routeId:m.id,params:T?ho(T.params,o):o,_strictParams:A,pathname:E,updatedAt:Date.now(),search:T?ho(T.search,y):y,_strictSearch:x,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Od()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:T?ho(T.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:m.options.staticData||{},fullPath:m.fullPath}}n?.preload||(q.globalNotFound=l===m.id),q.searchError=S;const ee=f(v);q.context={...ee,...q.__routeContext,...q.__beforeLoadContext},d.push(q)}),d.forEach((m,h)=>{const v=this.looseRoutesById[m.routeId];if(!this.getMatch(m.id)&&n?._buildLocation!==!0){const x=d[h-1],S=f(x);if(v.options.context){const C={deps:m.loaderDeps,params:m.params,context:S??{},location:t,navigate:k=>this.navigate({...k,_fromLocation:t}),buildLocation:this.buildLocation,cause:m.cause,abortController:m.abortController,preload:!!m.preload,matches:d};m.__routeContext=v.options.context(C)??void 0}m.context={...S,...m.__routeContext,...m.__beforeLoadContext}}}),d}}class Ey extends Error{}class MJ extends Error{}function zJ(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function fC(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Ey("Async validation not supported");if(n.issues)throw new Ey(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function LJ({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:i,flatRoutes:o,parseCache:a}){let l={};const d=ul(e),f=y=>uC(d,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},a);let m=t!==void 0?r[t]:void 0;if(m)l=f(m);else{let y;for(const x of o){const S=f(x);if(S)if(x.path!=="/"&&S["**"])y||(y={foundRoute:x,routeParams:S});else{m=x,l=S;break}}!m&&y&&(m=y.foundRoute,l=y.routeParams)}let h=m||i[yi];const v=[h];for(;h.parentRoute;)h=h.parentRoute,v.push(h);return v.reverse(),{matchedRoutes:v,routeParams:l,foundRoute:m}}function FJ({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const i=n.reduce((l,d)=>{const f=[];if("search"in d.options)d.options.search?.middlewares&&f.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const m=({search:h,next:v})=>{let y=h;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(y=d.options.preSearchFilters.reduce((S,C)=>C(S),h));const x=v(y);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((S,C)=>C(S),x):x};f.push(m)}if(r&&d.options.validateSearch){const m=({search:h,next:v})=>{const y=v(h);try{return{...y,...fC(d.options.validateSearch,y)??void 0}}catch{return y}};f.push(m)}return l.concat(f)},[])??[],o=({search:l})=>t.search?t.search===!0?l:Cc(t.search,l):{};i.push(o);const a=(l,d)=>{if(l>=i.length)return d;const f=i[l];return f({search:d,next:h=>a(l+1,h)})};return a(0,e)}const UJ="Error preloading route! ☝️";class i4{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,i=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=yi:this.parentRoute||rs(!1);let o=i?yi:r?.path;o&&o!=="/"&&(o=tE(o));const a=r?.id||o;let l=i?yi:ts([this.parentRoute.id===yi?"":this.parentRoute.id,a]);o===yi&&(o="/"),l!==yi&&(l=ts(["/",l]));const d=l===yi?"/":ts([this.parentRoute.fullPath,o]);this._path=o,this._id=l,this._fullPath=d,this._to=d},this.clone=n=>{this._path=n._path,this._id=n._id,this._fullPath=n._fullPath,this._to=n._to,this.options.getParentRoute=n.options.getParentRoute,this.children=n.children},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class VJ extends i4{constructor(t){super(t)}}function nE(e){const t=e.errorComponent??$b;return u.jsx(BJ,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}class BJ extends b.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function $b({error:e}){const[t,n]=b.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function HJ({children:e,fallback:t=null}){return qJ()?u.jsx(J.Fragment,{children:e}):u.jsx(J.Fragment,{children:t})}function qJ(){return J.useSyncExternalStore(KJ,()=>!0,()=>!1)}function KJ(){return()=>{}}var m_={exports:{}},h_={},g_={exports:{}},v_={};var F$;function GJ(){if(F$)return v_;F$=1;var e=qm();function t(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function l(h,v){var y=v(),x=r({inst:{value:y,getSnapshot:v}}),S=x[0].inst,C=x[1];return o(function(){S.value=y,S.getSnapshot=v,d(S)&&C({inst:S})},[h,y,v]),i(function(){return d(S)&&C({inst:S}),h(function(){d(S)&&C({inst:S})})},[h]),a(y),y}function d(h){var v=h.getSnapshot;h=h.value;try{var y=v();return!n(h,y)}catch{return!0}}function f(h,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return v_.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,v_}var U$;function ZJ(){return U$||(U$=1,g_.exports=GJ()),g_.exports}var V$;function YJ(){if(V$)return h_;V$=1;var e=qm(),t=ZJ();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,l=e.useMemo,d=e.useDebugValue;return h_.useSyncExternalStoreWithSelector=function(f,m,h,v,y){var x=o(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=l(function(){function k(T){if(!E){if(E=!0,j=T,T=v(T),y!==void 0&&S.hasValue){var A=S.value;if(y(A,T))return I=A}return I=T}if(A=I,r(j,T))return A;var D=v(T);return y!==void 0&&y(A,D)?(j=T,A):(j=T,I=D)}var E=!1,j,I,N=h===void 0?null:h;return[function(){return k(m())},N===null?void 0:function(){return k(N())}]},[m,h,v,y]);var C=i(f,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=C},[C]),d(C),C},h_}var B$;function WJ(){return B$||(B$=1,m_.exports=YJ()),m_.exports}var XJ=WJ();function JJ(e,t=n=>n){return XJ.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,QJ)}function QJ(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=H$(e);if(n.length!==H$(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function H$(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const y_=b.createContext(null);function o4(){return typeof document>"u"?y_:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=y_,y_)}function _n(e){const t=b.useContext(o4());return e?.warn,t}function Wr(e){const t=_n({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return JJ(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=ho(r.current,e.select(i));return r.current=o,o}return e.select(i)}return i})}const Db=b.createContext(void 0),eQ=b.createContext(void 0);function qo(e){const t=b.useContext(e.from?eQ:Db);return Wr({select:r=>{const i=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(rs(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Gm(e){return qo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rE(e){const{select:t,...n}=e;return qo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function rt(e){return qo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Rr(e){return qo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function jn(e){const t=_n();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function jc(e){const t=_n(),n=jn(),r=b.useRef(null);return b.useEffect(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}var b_={exports:{}},Tr={};var q$;function tQ(){if(q$)return Tr;q$=1;var e=qm();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(d,f,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:d,containerInfo:f,implementation:m}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Tr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Tr.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(d,f,null,m)},Tr.flushSync=function(d){var f=a.T,m=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=f,r.p=m,r.d.f()}},Tr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},Tr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Tr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,h=l(m,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:h,integrity:v,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Tr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=l(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},Tr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,h=l(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Tr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=l(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},Tr.requestFormReset=function(d){r.d.r(d)},Tr.unstable_batchedUpdates=function(d,f){return d(f)},Tr.useFormState=function(d,f,m){return a.H.useFormState(d,f,m)},Tr.useFormStatus=function(){return a.H.useHostTransitionStatus()},Tr.version="19.2.3",Tr}var K$;function a4(){if(K$)return b_.exports;K$=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),b_.exports=tQ(),b_.exports}var cf=a4();const iE=of(cf),pv=typeof window<"u"?b.useLayoutEffect:b.useEffect;function x_(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function nQ(e,t,n={},r={}){b.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function rQ(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}function iQ(e,t){const n=_n(),[r,i]=b.useState(!1),o=b.useRef(!1),a=rQ(t),{activeProps:l,inactiveProps:d,activeOptions:f,to:m,preload:h,preloadDelay:v,hashScrollIntoView:y,replace:x,startTransition:S,resetScroll:C,viewTransition:k,children:E,target:j,disabled:I,style:N,className:T,onClick:A,onFocus:D,onMouseEnter:F,onMouseLeave:q,onTouchStart:ee,ignoreBlocker:G,params:K,search:V,hash:H,state:z,mask:W,reloadDocument:L,unsafeRelative:ne,from:$,_fromLocation:P,...U}=e,O=Wr({select:se=>se.location.search,structuralSharing:!0}),X=e.from,pe=b.useMemo(()=>({...e,from:X}),[n,O,X,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ve=b.useMemo(()=>n.buildLocation({...pe}),[n,pe]),Q=b.useMemo(()=>{if(I)return;let se=ve.maskedLocation?ve.maskedLocation.url:ve.url,ie=!1;return n.origin&&(se.startsWith(n.origin)?se=n.history.createHref(se.replace(n.origin,""))||"/":ie=!0),{href:se,external:ie}},[I,ve.maskedLocation,ve.url,n.origin,n.history]),le=b.useMemo(()=>{if(Q?.external)return Q.href;try{return new URL(m),m}catch{}},[m,Q]),Se=e.reloadDocument||le?!1:h??n.options.defaultPreload,ke=v??n.options.defaultPreloadDelay??0,Pe=Wr({select:se=>{if(le)return!1;if(f?.exact){if(!GX(se.location.pathname,ve.pathname,n.basepath))return!1}else{const ie=_y(se.location.pathname,n.basepath),me=_y(ve.pathname,n.basepath);if(!(ie.startsWith(me)&&(ie.length===me.length||ie[me.length]==="/")))return!1}return(f?.includeSearch??!0)&&!kc(se.location.search,ve.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?se.location.hash===ve.hash:!0}}),Fe=b.useCallback(()=>{n.preloadRoute({...pe}).catch(se=>{console.warn(se),console.warn(UJ)})},[n,pe]),ut=b.useCallback(se=>{se?.isIntersecting&&Fe()},[Fe]);nQ(a,ut,cQ,{disabled:!!I||Se!=="viewport"}),b.useEffect(()=>{o.current||!I&&Se==="render"&&(Fe(),o.current=!0)},[I,Fe,Se]);const Ze=se=>{const ie=se.currentTarget.target,me=j!==void 0?j:ie;if(!I&&!uQ(se)&&!se.defaultPrevented&&(!me||me==="_self")&&se.button===0){se.preventDefault(),cf.flushSync(()=>{i(!0)});const B=n.subscribe("onResolved",()=>{B(),i(!1)});n.navigate({...pe,replace:x,resetScroll:C,hashScrollIntoView:y,startTransition:S,viewTransition:k,ignoreBlocker:G})}};if(le)return{...U,ref:a,href:le,...E&&{children:E},...j&&{target:j},...I&&{disabled:I},...N&&{style:N},...T&&{className:T},...A&&{onClick:A},...D&&{onFocus:D},...F&&{onMouseEnter:F},...q&&{onMouseLeave:q},...ee&&{onTouchStart:ee}};const Pt=se=>{I||Se&&Fe()},dn=Pt,tn=se=>{if(!(I||!Se))if(!ke)Fe();else{const ie=se.target;if(Ep.has(ie))return;const me=setTimeout(()=>{Ep.delete(ie),Fe()},ke);Ep.set(ie,me)}},br=se=>{if(I||!Se||!ke)return;const ie=se.target,me=Ep.get(ie);me&&(clearTimeout(me),Ep.delete(ie))},Yt=Pe?Cc(l,{})??oQ:w_,An=Pe?w_:Cc(d,{})??w_,Y=[T,Yt.className,An.className].filter(Boolean).join(" "),re=(N||Yt.style||An.style)&&{...N,...Yt.style,...An.style};return{...U,...Yt,...An,href:Q?.href,ref:a,onClick:jp([A,Ze]),onFocus:jp([D,Pt]),onMouseEnter:jp([F,tn]),onMouseLeave:jp([q,br]),onTouchStart:jp([ee,dn]),disabled:!!I,target:j,...re&&{style:re},...Y&&{className:Y},...I&&aQ,...Pe&&sQ,...r&&lQ}}const w_={},oQ={className:"active"},aQ={role:"link","aria-disabled":!0},sQ={"data-status":"active","aria-current":"page"},lQ={"data-transitioning":"transitioning"},Ep=new WeakMap,cQ={rootMargin:"100px"},jp=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Ye=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,ref:o,...a}=iQ(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;return n===void 0&&delete a.disabled,b.createElement(n||"a",{...a,ref:o},l)});function uQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class dQ extends i4{constructor(t){super(t),this.useMatch=n=>qo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Rr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rE({...n,from:this.id}),this.useLoaderData=n=>Gm({...n,from:this.id}),this.useNavigate=()=>jn({from:this.fullPath}),this.Link=J.forwardRef((n,r)=>u.jsx(Ye,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function nt(e){return new dQ(e)}function fQ(){return e=>mQ(e)}class pQ extends VJ{constructor(t){super(t),this.useMatch=n=>qo({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Rr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>rE({...n,from:this.id}),this.useLoaderData=n=>Gm({...n,from:this.id}),this.useNavigate=()=>jn({from:this.fullPath}),this.Link=J.forwardRef((n,r)=>u.jsx(Ye,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function mQ(e){return new pQ(e)}function G$(e){return typeof e=="object"?new Z$(e,{silent:!0}).createRoute(e):new Z$(e,{silent:!0}).createRoute}class Z${constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const i=nt(r);return i.isRoot=!1,i},this.silent=n?.silent}}class pC{constructor(t){this.useMatch=n=>qo({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qo({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Rr({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>rt({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>rE({...n,from:this.options.id}),this.useLoaderData=n=>Gm({...n,from:this.options.id}),this.useNavigate=()=>{const n=_n();return jn({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function v2e(e){return t=>new pC({id:e,...t})}function Y$(e){return typeof e=="object"?new pC(e):t=>new pC({id:e,...t})}function s4(e,t){let n,r,i,o;const a=()=>(n||(n=e().then(d=>{n=void 0,r=d[t??"default"]}).catch(d=>{if(i=d,qX(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),o=!0)}})),n),l=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)throw a();return b.createElement(r,f)};return l.preload=a,l}function hQ(){const e=_n(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:o}=Wr({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),a=x_(o),l=o||n||i,d=x_(l),f=o||i,m=x_(f);return e.startTransition=h=>{r(!0),b.startTransition(()=>{h(),r(!1)})},b.useEffect(()=>{const h=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ul(e.latestLocation.href)!==ul(v.href)&&e.commitLocation({...v,replace:!0}),()=>{h()}},[e,e.history]),pv(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),pv(()=>{a&&!o&&e.emit({type:"onLoad",...Ec(e.state)})},[a,e,o]),pv(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Ec(e.state)})},[f,m,e]),pv(()=>{d&&!l&&(e.emit({type:"onResolved",...Ec(e.state)}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),wJ(e))},[l,d,e]),null}function gQ(e){const t=Wr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(nE,{getResetKey:()=>t,onCatch:(n,r)=>{if(Ho(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Ho(n))return e.fallback?.(n);throw n},children:e.children})}function vQ(){return u.jsx("p",{children:"Not Found"})}function cd(e){return u.jsx(u.Fragment,{children:e.children})}function l4(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{data:n}):u.jsx(vQ,{})}function yQ({children:e}){const t=_n();return t.isServer?u.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
`)+";$_TSR.c()"}}):null}function bQ(){const e=_n();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||dC)(e.latestLocation),r=n!==dC(e.latestLocation)?n:void 0,i={storageKey:Cy,shouldScrollRestoration:!0};return r&&(i.key=r),u.jsx(yQ,{children:`(${Zz.toString()})(${JSON.stringify(i)})`})}const c4=b.memo(function({matchId:t}){const n=_n(),r=Wr({select:k=>{const E=k.matches.find(j=>j.id===t);return rs(E),{routeId:E.routeId,ssr:E.ssr,_displayPending:E._displayPending}},structuralSharing:!0}),i=n.routesById[r.routeId],o=i.options.pendingComponent??n.options.defaultPendingComponent,a=o?u.jsx(o,{}):null,l=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",h=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||m))?b.Suspense:cd,v=l?nE:cd,y=f?gQ:cd,x=Wr({select:k=>k.loadedAt}),S=Wr({select:k=>{const E=k.matches.findIndex(j=>j.id===t);return k.matches[E-1]?.routeId}}),C=i.isRoot?i.options.shellComponent??cd:cd;return u.jsxs(C,{children:[u.jsx(Db.Provider,{value:t,children:u.jsx(h,{fallback:a,children:u.jsx(v,{getResetKey:()=>x,errorComponent:l||$b,onCatch:(k,E)=>{if(Ho(k))throw k;d?.(k,E)},children:u.jsx(y,{fallback:k=>{if(!f||k.routeId&&k.routeId!==r.routeId||!k.routeId&&!i.isRoot)throw k;return b.createElement(f,k)},children:m||r._displayPending?u.jsx(HJ,{fallback:a,children:u.jsx(W$,{matchId:t})}):u.jsx(W$,{matchId:t})})})})}),S===yi&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(xQ,{}),u.jsx(bQ,{})]}):null]})});function xQ(){const e=_n(),t=b.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ec(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const W$=b.memo(function({matchId:t}){const n=_n(),{match:r,key:i,routeId:o}=Wr({select:d=>{const f=d.matches.find(x=>x.id===t),m=f.routeId,v=(n.routesById[m].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:m,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:m,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),a=n.routesById[o],l=b.useMemo(()=>{const d=a.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(jl,{})},[i,a.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!n.isServer){const m=Od();f._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return rs(Ho(r.error)),l4(n,a,r.error);if(r.status==="redirected")throw rs(da(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(a.options.errorComponent??n.options.defaultErrorComponent)||$b;return u.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return l}),jl=b.memo(function(){const t=_n(),n=b.useContext(Db),r=Wr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[r],o=Wr({select:f=>{const h=f.matches.find(v=>v.id===n);return rs(h),h.globalNotFound}}),a=Wr({select:f=>{const m=f.matches,h=m.findIndex(v=>v.id===n);return m[h+1]?.id}}),l=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(o)return l4(t,i,void 0);if(!a)return null;const d=u.jsx(c4,{matchId:a});return n===yi?u.jsx(b.Suspense,{fallback:l,children:d}):d});function wQ(){const e=_n(),n=e.routesById[yi].options.pendingComponent??e.options.defaultPendingComponent,r=n?u.jsx(n,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?cd:b.Suspense,o=u.jsxs(i,{fallback:r,children:[!e.isServer&&u.jsx(hQ,{}),u.jsx(SQ,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:o}):o}function SQ(){const e=_n(),t=Wr({select:i=>i.matches[0]?.id}),n=Wr({select:i=>i.loadedAt}),r=t?u.jsx(c4,{matchId:t}):null;return u.jsx(Db.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(nE,{getResetKey:()=>n,errorComponent:$b,onCatch:i=>{i.message||i.toString()},children:r})})}const _Q=e=>new CQ(e);class CQ extends PJ{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=G$,globalThis.createLazyFileRoute=Y$):typeof window<"u"&&(window.createFileRoute=G$,window.createLazyFileRoute=Y$);function kQ({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=o4(),i=u.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:i}):i}function EQ({router:e,...t}){return u.jsx(kQ,{router:e,...t,children:u.jsx(wQ,{})})}function Zm(e){return qo({...e,select:t=>e.select?e.select(t.context):t.context})}function jQ(e){return Wr({select:t=>t.location})}function IQ(){const[e,t]=b.useState(jt.getAllConnections());return b.useEffect(()=>jt.listenToAllEntities((n,r)=>{t({...e,[r]:n})}),[e]),e}function Gc(){const e=jt.calculateIdFromEntity($n),[t,n]=b.useState(jt.getConnectionById($n));return b.useEffect(()=>jt.listenToEntity(e,n),[e]),t}function Il(){return Gc()}function ms(e){const t=$n,{clusterId:n,instanceId:r}=rt({strict:!1}),[i,o]=b.useState(jt.getConnectionById(t));return b.useEffect(()=>jt.listenToEntity(t,o),[t]),i}function u4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function d4(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u4(e))&&(r&&(r+=" "),r+=t);return r}const X$=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ki=d4,Pb=(e,t)=>n=>{var r;if(t?.variants==null)return ki(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(f=>{const m=n?.[f],h=o?.[f];if(m===null)return null;const v=X$(m)||X$(h);return i[f][v]}),l=n&&Object.entries(n).reduce((f,m)=>{let[h,v]=m;return v===void 0||(f[h]=v),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:h,className:v,...y}=m;return Object.entries(y).every(x=>{let[S,C]=x;return Array.isArray(C)?C.includes({...o,...l}[S]):{...o,...l}[S]===C})?[...f,h,v]:f},[]);return ki(e,a,d,n?.class,n?.className)},Ip="hover:-translate-y-1 transition duration-200",Rp="border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40",RQ=Pb(`inline-flex
  items-center
  justify-center
  gap-2
  whitespace-nowrap
  rounded-lg
  text-sm
  transition-[color,box-shadow]
  disabled:pointer-events-none
  disabled:opacity-50
  [&_svg]:pointer-events-none
  [&_svg:not([class*='size-'])]:size-4
  [&_svg]:shrink-0
  ring-ring/10
  dark:ring-ring/20
  dark:outline-ring/40
  outline-ring/50
  focus-visible:ring-1
  focus-visible:outline-1
  focus-visible:ring-purple-200
  aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",submit:"bg-gradient-to-r from-blue-100 from-0% to-blue to-100% hover:bg-gradient-to-r hover:from-blue text-primary-foreground shadow-sm",destructive:"bg-destructive shadow-xs hover:bg-destructive/90",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-muted-foreground",destructiveGhost:"hover:bg-accent hover:text-red",link:"text-primary underline-offset-4 hover:underline",positive:"bg-green text-white shadow-xs hover:bg-green/90",warning:"bg-yellow text-white shadow-xs hover:bg-yellow/90",outline:`${Rp} ${Ip}`,ghostOutline:`${Rp} ${Ip} border-none`,positiveOutline:`${Rp} ${Ip} border-green`,destructiveOutline:`${Rp} ${Ip} border-destructive`,defaultOutline:`${Rp} ${Ip} border-primary`},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4 text-md",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),TQ=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},NQ=(e,t)=>({classGroupId:e,validator:t}),f4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),jy="-",J$=[],AQ="arbitrary..",OQ=e=>{const t=DQ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return $Q(a);const l=a.split(jy),d=l[0]===""&&l.length>1?1:0;return p4(l,d,t)},getConflictingClassGroupIds:(a,l)=>{if(l){const d=r[a],f=n[a];return d?f?TQ(f,d):d:f||J$}return n[a]||J$}}},p4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const f=p4(e,t+1,o);if(f)return f}const a=n.validators;if(a===null)return;const l=t===0?e.join(jy):e.slice(t).join(jy),d=a.length;for(let f=0;f<d;f++){const m=a[f];if(m.validator(l))return m.classGroupId}},$Q=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?AQ+r:void 0})(),DQ=e=>{const{theme:t,classGroups:n}=e;return PQ(n,t)},PQ=(e,t)=>{const n=f4();for(const r in e){const i=e[r];oE(i,n,r,t)}return n},oE=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const a=e[o];MQ(a,t,n,r)}},MQ=(e,t,n,r)=>{if(typeof e=="string"){zQ(e,t,n);return}if(typeof e=="function"){LQ(e,t,n,r);return}FQ(e,t,n,r)},zQ=(e,t,n)=>{const r=e===""?t:m4(t,e);r.classGroupId=n},LQ=(e,t,n,r)=>{if(UQ(e)){oE(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(NQ(n,e))},FQ=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let a=0;a<o;a++){const[l,d]=i[a];oE(d,m4(t,l),n,r)}},m4=(e,t)=>{let n=e;const r=t.split(jy),i=r.length;for(let o=0;o<i;o++){const a=r[o];let l=n.nextPart.get(a);l||(l=f4(),n.nextPart.set(a,l)),n=l}return n},UQ=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VQ=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,a)=>{n[o]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let a=n[o];if(a!==void 0)return a;if((a=r[o])!==void 0)return i(o,a),a},set(o,a){o in n?n[o]=a:i(o,a)}}},mC="!",Q$=":",BQ=[],eD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),HQ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,l=0,d=0,f;const m=i.length;for(let S=0;S<m;S++){const C=i[S];if(a===0&&l===0){if(C===Q$){o.push(i.slice(d,S)),d=S+1;continue}if(C==="/"){f=S;continue}}C==="["?a++:C==="]"?a--:C==="("?l++:C===")"&&l--}const h=o.length===0?i:i.slice(d);let v=h,y=!1;h.endsWith(mC)?(v=h.slice(0,-1),y=!0):h.startsWith(mC)&&(v=h.slice(1),y=!0);const x=f&&f>d?f-d:void 0;return eD(o,y,v,x)};if(t){const i=t+Q$,o=r;r=a=>a.startsWith(i)?o(a.slice(i.length)):eD(BQ,!1,a,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},qQ=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const a=n[o],l=a[0]==="[",d=t.has(a);l||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},KQ=e=>({cache:VQ(e.cacheSize),parseClassName:HQ(e),sortModifiers:qQ(e),...OQ(e)}),GQ=/\s+/,ZQ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],l=e.trim().split(GQ);let d="";for(let f=l.length-1;f>=0;f-=1){const m=l[f],{isExternal:h,modifiers:v,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:S}=n(m);if(h){d=m+(d.length>0?" "+d:d);continue}let C=!!S,k=r(C?x.substring(0,S):x);if(!k){if(!C){d=m+(d.length>0?" "+d:d);continue}if(k=r(x),!k){d=m+(d.length>0?" "+d:d);continue}C=!1}const E=v.length===0?"":v.length===1?v[0]:o(v).join(":"),j=y?E+mC:E,I=j+k;if(a.indexOf(I)>-1)continue;a.push(I);const N=i(k,C);for(let T=0;T<N.length;++T){const A=N[T];a.push(j+A)}d=m+(d.length>0?" "+d:d)}return d},YQ=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=h4(n))&&(i&&(i+=" "),i+=r);return i},h4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=h4(e[r]))&&(n&&(n+=" "),n+=t);return n},WQ=(e,...t)=>{let n,r,i,o;const a=d=>{const f=t.reduce((m,h)=>h(m),e());return n=KQ(f),r=n.cache.get,i=n.cache.set,o=l,l(d)},l=d=>{const f=r(d);if(f)return f;const m=ZQ(d,n);return i(d,m),m};return o=a,(...d)=>o(YQ(...d))},XQ=[],lr=e=>{const t=n=>n[e]||XQ;return t.isThemeGetter=!0,t},g4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,v4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,JQ=/^\d+\/\d+$/,QQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ree=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wu=e=>JQ.test(e),Ct=e=>!!e&&!Number.isNaN(Number(e)),Hs=e=>!!e&&Number.isInteger(Number(e)),S_=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),Za=e=>QQ.test(e),iee=()=>!0,oee=e=>eee.test(e)&&!tee.test(e),y4=()=>!1,aee=e=>nee.test(e),see=e=>ree.test(e),lee=e=>!He(e)&&!qe(e),cee=e=>uf(e,w4,y4),He=e=>g4.test(e),cc=e=>uf(e,S4,oee),__=e=>uf(e,mee,Ct),tD=e=>uf(e,b4,y4),uee=e=>uf(e,x4,see),mv=e=>uf(e,_4,aee),qe=e=>v4.test(e),Tp=e=>df(e,S4),dee=e=>df(e,hee),nD=e=>df(e,b4),fee=e=>df(e,w4),pee=e=>df(e,x4),hv=e=>df(e,_4,!0),uf=(e,t,n)=>{const r=g4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},df=(e,t,n=!1)=>{const r=v4.exec(e);return r?r[1]?t(r[1]):n:!1},b4=e=>e==="position"||e==="percentage",x4=e=>e==="image"||e==="url",w4=e=>e==="length"||e==="size"||e==="bg-size",S4=e=>e==="length",mee=e=>e==="number",hee=e=>e==="family-name",_4=e=>e==="shadow",gee=()=>{const e=lr("color"),t=lr("font"),n=lr("text"),r=lr("font-weight"),i=lr("tracking"),o=lr("leading"),a=lr("breakpoint"),l=lr("container"),d=lr("spacing"),f=lr("radius"),m=lr("shadow"),h=lr("inset-shadow"),v=lr("text-shadow"),y=lr("drop-shadow"),x=lr("blur"),S=lr("perspective"),C=lr("aspect"),k=lr("ease"),E=lr("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...I(),qe,He],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],D=()=>[qe,He,d],F=()=>[Wu,"full","auto",...D()],q=()=>[Hs,"none","subgrid",qe,He],ee=()=>["auto",{span:["full",Hs,qe,He]},Hs,qe,He],G=()=>[Hs,"auto",qe,He],K=()=>["auto","min","max","fr",qe,He],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...D()],W=()=>[Wu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],L=()=>[e,qe,He],ne=()=>[...I(),nD,tD,{position:[qe,He]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",fee,cee,{size:[qe,He]}],U=()=>[S_,Tp,cc],O=()=>["","none","full",f,qe,He],X=()=>["",Ct,Tp,cc],pe=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Ct,S_,nD,tD],le=()=>["","none",x,qe,He],Se=()=>["none",Ct,qe,He],ke=()=>["none",Ct,qe,He],Pe=()=>[Ct,qe,He],Fe=()=>[Wu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Za],breakpoint:[Za],color:[iee],container:[Za],"drop-shadow":[Za],ease:["in","out","in-out"],font:[lee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Za],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Za],shadow:[Za],spacing:["px",Ct],text:[Za],"text-shadow":[Za],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wu,He,qe,C]}],container:["container"],columns:[{columns:[Ct,He,qe,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Hs,"auto",qe,He]}],basis:[{basis:[Wu,"full","auto",l,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,Wu,"auto","initial","none",He]}],grow:[{grow:["",Ct,qe,He]}],shrink:[{shrink:["",Ct,qe,He]}],order:[{order:[Hs,"first","last","none",qe,He]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[l,"screen",...W()]}],"min-w":[{"min-w":[l,"screen","none",...W()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,Tp,cc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,qe,__]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",S_,He]}],"font-family":[{font:[dee,He,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,qe,He]}],"line-clamp":[{"line-clamp":[Ct,"none",qe,__]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",qe,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",qe,cc]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Ct,"auto",qe,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hs,qe,He],radial:["",qe,He],conic:[Hs,qe,He]},pee,uee]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,qe,He]}],"outline-w":[{outline:["",Ct,Tp,cc]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",m,hv,mv]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,hv,mv]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Ct,cc]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",v,hv,mv]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Ct,qe,He]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[qe,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,He]}],filter:[{filter:["","none",qe,He]}],blur:[{blur:le()}],brightness:[{brightness:[Ct,qe,He]}],contrast:[{contrast:[Ct,qe,He]}],"drop-shadow":[{"drop-shadow":["","none",y,hv,mv]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Ct,qe,He]}],"hue-rotate":[{"hue-rotate":[Ct,qe,He]}],invert:[{invert:["",Ct,qe,He]}],saturate:[{saturate:[Ct,qe,He]}],sepia:[{sepia:["",Ct,qe,He]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,He]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Ct,qe,He]}],"backdrop-contrast":[{"backdrop-contrast":[Ct,qe,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ct,qe,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ct,qe,He]}],"backdrop-invert":[{"backdrop-invert":["",Ct,qe,He]}],"backdrop-opacity":[{"backdrop-opacity":[Ct,qe,He]}],"backdrop-saturate":[{"backdrop-saturate":[Ct,qe,He]}],"backdrop-sepia":[{"backdrop-sepia":["",Ct,qe,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ct,"initial",qe,He]}],ease:[{ease:["linear","initial",k,qe,He]}],delay:[{delay:[Ct,qe,He]}],animate:[{animate:["none",E,qe,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,qe,He]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[qe,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,He]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,He]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Ct,Tp,cc,__]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vee=WQ(gee);function Ue(...e){return vee(d4(e))}function rD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ff(...e){return t=>{let n=!1;const r=e.map(i=>{const o=rD(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():rD(e[i],null)}}}}function pt(...e){return b.useCallback(ff(...e),e)}var yee=Symbol.for("react.lazy"),Iy=Wk[" use ".trim().toString()];function bee(e){return typeof e=="object"&&e!==null&&"then"in e}function C4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yee&&"_payload"in e&&bee(e._payload)}function k4(e){const t=xee(e),n=b.forwardRef((r,i)=>{let{children:o,...a}=r;C4(o)&&typeof Iy=="function"&&(o=Iy(o._payload));const l=b.Children.toArray(o),d=l.find(See);if(d){const f=d.props.children,m=l.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var aE=k4("Slot");function xee(e){const t=b.forwardRef((n,r)=>{let{children:i,...o}=n;if(C4(i)&&typeof Iy=="function"&&(i=Iy(i._payload)),b.isValidElement(i)){const a=Cee(i),l=_ee(o,i.props);return i.type!==b.Fragment&&(l.ref=r?ff(r,a):a),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wee=Symbol("radix.slottable");function See(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wee}function _ee(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const d=o(...l);return i(...l),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Cee(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function be({className:e,variant:t,size:n,asChild:r=!1,...i}){const o=r?aE:"button";return u.jsx(o,{"data-slot":"button",className:Ue(RQ({variant:t,size:n,className:e})),...i})}function Dc({className:e,...t}){return u.jsx("div",{"data-slot":"card",className:Ue("bg-card text-card-foreground flex flex-col gap-6 rounded-xl  py-4 shadow-deep",e),...t})}function Rl({className:e,...t}){return u.jsx("div",{"data-slot":"card-header",className:Ue("flex flex-col gap-1.5 px-6",e),...t})}function Tl({className:e,...t}){return u.jsx("div",{"data-slot":"card-title",className:Ue("leading-none text-lg",e),...t})}function Zc({className:e,...t}){return u.jsx("div",{"data-slot":"card-description",className:Ue("text-muted-foreground text-xs",e),...t})}function hs({className:e,...t}){return u.jsx("div",{"data-slot":"card-content",className:Ue("px-6",e),...t})}function kee(e){return e!==null&&!!e.username}function Yc(e){if(e&&!kee(e)){const t=Object.keys(e.roles);if(t.length===1)return`/${t[0]}`}return"/"}const Eee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),iD=e=>{const t=jee(e);return t.charAt(0).toUpperCase()+t.slice(1)},E4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Iee=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ree={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Tee=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...l},d)=>b.createElement("svg",{ref:d,...Ree,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:E4("lucide",i),...!o&&!Iee(l)&&{"aria-hidden":"true"},...l},[...a.map(([f,m])=>b.createElement(f,m)),...Array.isArray(o)?o:[o]]));const Ve=(e,t)=>{const n=b.forwardRef(({className:r,...i},o)=>b.createElement(Tee,{ref:o,iconNode:t,className:E4(`lucide-${Eee(iD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=iD(e),n};const Nee=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Aee=Ve("activity",Nee);const Oee=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Mb=Ve("arrow-down",Oee);const $ee=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Pc=Ve("arrow-left",$ee);const Dee=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],bi=Ve("arrow-right",Dee);const Pee=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Mee=Ve("arrow-up-down",Pee);const zee=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Lee=Ve("arrow-up",zee);const Fee=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Uee=Ve("ban",Fee);const Vee=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]],j4=Ve("book-open-text",Vee);const Bee=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Hee=Ve("boxes",Bee);const qee=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Kee=Ve("bug",qee);const Gee=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],I4=Ve("chart-pie",Gee);const Zee=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sE=Ve("check",Zee);const Yee=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],R4=Ve("chevron-down",Yee);const Wee=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Xee=Ve("chevron-up",Wee);const Jee=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Qee=Ve("circle-check-big",Jee);const ete=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T4=Ve("circle",ete);const tte=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],nte=Ve("clipboard-check",tte);const rte=[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M17 18h.5a1 1 0 0 0 0-9h-1.79A7 7 0 1 0 7 17.708",key:"xsb5ju"}]],ite=Ve("cloud-alert",rte);const ote=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],ate=Ve("cloud-download",ote);const ste=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],N4=Ve("cloud-upload",ste);const lte=[["path",{d:"M10.5 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5",key:"1g2yzs"}],["path",{d:"m14.3 19.6 1-.4",key:"11sv9r"}],["path",{d:"M15 3v7.5",key:"7lm50a"}],["path",{d:"m15.2 16.9-.9-.3",key:"1t7mvx"}],["path",{d:"m16.6 21.7.3-.9",key:"1j67ps"}],["path",{d:"m16.8 15.3-.4-1",key:"1ei7r6"}],["path",{d:"m19.1 15.2.3-.9",key:"18r7jp"}],["path",{d:"m19.6 21.7-.4-1",key:"z2vh2"}],["path",{d:"m20.7 16.8 1-.4",key:"19m87a"}],["path",{d:"m21.7 19.4-.9-.3",key:"1qgwi9"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],cte=Ve("columns-3-cog",lte);const ute=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],A4=Ve("copy",ute);const dte=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],O4=Ve("credit-card",dte);const fte=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],pte=Ve("database",fte);const mte=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$4=Ve("download",mte);const hte=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lE=Ve("ellipsis",hte);const gte=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],vte=Ve("external-link",gte);const yte=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],bte=Ve("file",yte);const xte=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],wte=Ve("folder",xte);const Ste=[["path",{d:"M13.354 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l1.218-1.348",key:"8mvsmf"}],["path",{d:"M16 6h6",key:"1dogtp"}],["path",{d:"M19 3v6",key:"1ytpjt"}]],_te=Ve("funnel-plus",Ste);const Cte=[["path",{d:"M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473",key:"ol2ft2"}],["path",{d:"m16.5 3.5 5 5",key:"15e6fa"}],["path",{d:"m21.5 3.5-5 5",key:"m0lwru"}]],oD=Ve("funnel-x",Cte);const kte=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ete=Ve("funnel",kte);const jte=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ite=Ve("gauge",jte);const Rte=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Tte=Ve("git-branch",Rte);const Nte=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],cE=Ve("github",Nte);const Ate=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ote=Ve("grip-vertical",Ate);const $te=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],D4=Ve("handshake",$te);const Dte=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Pte=Ve("house",Dte);const Mte=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],P4=Ve("key",Mte);const zte=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Lte=Ve("link",zte);const Fte=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],M4=Ve("loader-circle",Fte);const Ute=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Vte=Ve("lock",Ute);const Bte=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],Hte=Ve("log-in",Bte);const qte=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Kte=Ve("log-out",qte);const Gte=[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M20 14v4",key:"1hm744"}],["path",{d:"M20 22v.01",key:"12bgn6"}]],Zte=Ve("mail-warning",Gte);const Yte=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],z4=Ve("menu",Yte);const Wte=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]],Xte=Ve("notepad-text",Wte);const Jte=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],uE=Ve("package",Jte);const Qte=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],ene=Ve("panel-right-close",Qte);const tne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],nne=Ve("panel-right-open",tne);const rne=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],L4=Ve("pencil",rne);const ine=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jr=Ve("plus",ine);const one=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],F4=Ve("receipt-text",one);const ane=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],sne=Ve("receipt",ane);const lne=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],xa=Ve("refresh-cw",lne);const cne=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],U4=Ve("rocket",cne);const une=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],dne=Ve("rotate-ccw",une);const fne=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],To=Ve("save",fne);const pne=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],mne=Ve("server",pne);const hne=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],gne=Ve("settings",hne);const vne=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],yne=Ve("table",vne);const bne=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],dE=Ve("terminal",bne);const xne=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],wne=Ve("trash-2",xne);const Sne=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ca=Ve("trash",Sne);const _ne=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Cne=Ve("triangle-alert",_ne);const kne=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Ene=Ve("undo-2",kne);const jne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],V4=Ve("users",jne);const Ine=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B4=Ve("x",Ine);function Ry({className:e,error:t,title:n,showReturnToHome:r,children:i}){const{user:o,isLoading:a}=Gc();return Yc(o),u.jsxs(Dc,{className:Ue("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[u.jsxs(Rl,{children:[u.jsx(Tl,{className:"text-2xl",children:u.jsx("h2",{children:n??"Component Error"})}),u.jsx(Zc,{children:t.message})]}),u.jsxs(hs,{children:[i,r!==!1&&(o&&!a?u.jsx(Ye,{to:ba,children:u.jsxs(be,{children:[" ",u.jsx(Pc,{})," Return to Home"]})}):u.jsx(Ye,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(Pc,{})," Go to Sign In Page"]})}))]})]})}function Rne(){const{user:e,isLoading:t}=Gc();return Yc(e),u.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:u.jsxs(Dc,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[u.jsx(Rl,{children:u.jsx(Tl,{className:"text-2xl",children:u.jsx("h2",{children:"Sorry, Page Not Found"})})}),u.jsx(hs,{children:e&&!t?u.jsx(Ye,{to:ba,children:u.jsxs(be,{children:[" ",u.jsx(Pc,{})," Return to Home"]})}):u.jsx(Ye,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(Pc,{})," Go Sign In Page"]})})})]})})}function Tne(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function Nne(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Ane=e=>{switch(e){case"success":return Dne;case"info":return Mne;case"warning":return Pne;case"error":return zne;default:return null}},One=Array(12).fill(0),$ne=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},One.map((n,r)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Dne=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Pne=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Mne=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zne=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Lne=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fne=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let hC=1;class Une{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:hC++,a=this.toasts.find(d=>d.id===o),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:l,title:r}):d):this.addToast({title:r,...i,dismissible:l,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,a;const l=i.then(async f=>{if(a=["resolve",f],J.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(Bne(f)&&!f.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof h=="object"&&!J.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...x})}else if(f instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(f):n.error,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof h=="object"&&!J.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:v,...x})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(f):n.success,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof h=="object"&&!J.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:v,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(f):n.error,h=typeof n.description=="function"?await n.description(f):n.description,y=typeof m=="object"&&!J.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,m)=>l.then(()=>a[0]==="reject"?m(a[1]):f(a[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||hC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gi=new Une,Vne=(e,t)=>{const n=t?.id||hC++;return gi.addToast({title:e,...t,id:n}),n},Bne=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hne=Vne,qne=()=>gi.toasts,Kne=()=>gi.getActiveToasts(),we=Object.assign(Hne,{success:gi.success,info:gi.info,warning:gi.warning,error:gi.error,custom:gi.custom,message:gi.message,promise:gi.promise,dismiss:gi.dismiss,loading:gi.loading},{getHistory:qne,getToasts:Kne});Nne("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function gv(e){return e.label!==void 0}const Gne=3,Zne="24px",Yne="16px",aD=4e3,Wne=356,Xne=14,Jne=45,Qne=200;function aa(...e){return e.filter(Boolean).join(" ")}function ere(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const tre=e=>{var t,n,r,i,o,a,l,d,f;const{invert:m,toast:h,unstyled:v,interacting:y,setHeights:x,visibleToasts:S,heights:C,index:k,toasts:E,expanded:j,removeToast:I,defaultRichColors:N,closeButton:T,style:A,cancelButtonStyle:D,actionButtonStyle:F,className:q="",descriptionClassName:ee="",duration:G,position:K,gap:V,expandByDefault:H,classNames:z,icons:W,closeButtonAriaLabel:L="Close toast"}=e,[ne,$]=J.useState(null),[P,U]=J.useState(null),[O,X]=J.useState(!1),[pe,ve]=J.useState(!1),[Q,le]=J.useState(!1),[Se,ke]=J.useState(!1),[Pe,Fe]=J.useState(!1),[ut,Ze]=J.useState(0),[Pt,dn]=J.useState(0),tn=J.useRef(h.duration||G||aD),br=J.useRef(null),Yt=J.useRef(null),An=k===0,Y=k+1<=S,re=h.type,se=h.dismissible!==!1,ie=h.className||"",me=h.descriptionClassName||"",B=J.useMemo(()=>C.findIndex(Xe=>Xe.toastId===h.id)||0,[C,h.id]),ce=J.useMemo(()=>{var Xe;return(Xe=h.closeButton)!=null?Xe:T},[h.closeButton,T]),Ee=J.useMemo(()=>h.duration||G||aD,[h.duration,G]),Me=J.useRef(0),Ke=J.useRef(0),Wt=J.useRef(0),Vt=J.useRef(null),[Cn,zt]=K.split("-"),fn=J.useMemo(()=>C.reduce((Xe,nn,Wn)=>Wn>=B?Xe:Xe+nn.height,0),[C,B]),kt=Fne(),ar=h.invert||m,In=re==="loading";Ke.current=J.useMemo(()=>B*V+fn,[B,fn]),J.useEffect(()=>{tn.current=Ee},[Ee]),J.useEffect(()=>{X(!0)},[]),J.useEffect(()=>{const Xe=Yt.current;if(Xe){const nn=Xe.getBoundingClientRect().height;return dn(nn),x(Wn=>[{toastId:h.id,height:nn,position:h.position},...Wn]),()=>x(Wn=>Wn.filter(fr=>fr.toastId!==h.id))}},[x,h.id]),J.useLayoutEffect(()=>{if(!O)return;const Xe=Yt.current,nn=Xe.style.height;Xe.style.height="auto";const Wn=Xe.getBoundingClientRect().height;Xe.style.height=nn,dn(Wn),x(fr=>fr.find(pn=>pn.toastId===h.id)?fr.map(pn=>pn.toastId===h.id?{...pn,height:Wn}:pn):[{toastId:h.id,height:Wn,position:h.position},...fr])},[O,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const dr=J.useCallback(()=>{ve(!0),Ze(Ke.current),x(Xe=>Xe.filter(nn=>nn.toastId!==h.id)),setTimeout(()=>{I(h)},Qne)},[h,I,x,Ke]);J.useEffect(()=>{if(h.promise&&re==="loading"||h.duration===1/0||h.type==="loading")return;let Xe;return j||y||kt?(()=>{if(Wt.current<Me.current){const fr=new Date().getTime()-Me.current;tn.current=tn.current-fr}Wt.current=new Date().getTime()})():tn.current!==1/0&&(Me.current=new Date().getTime(),Xe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),dr()},tn.current)),()=>clearTimeout(Xe)},[j,y,h,re,kt,dr]),J.useEffect(()=>{h.delete&&(dr(),h.onDismiss==null||h.onDismiss.call(h,h))},[dr,h.delete]);function ys(){var Xe;if(W?.loading){var nn;return J.createElement("div",{className:aa(z?.loader,h==null||(nn=h.classNames)==null?void 0:nn.loader,"sonner-loader"),"data-visible":re==="loading"},W.loading)}return J.createElement($ne,{className:aa(z?.loader,h==null||(Xe=h.classNames)==null?void 0:Xe.loader),visible:re==="loading"})}const bs=h.icon||W?.[re]||Ane(re);var Ra,Bt;return J.createElement("li",{tabIndex:0,ref:Yt,className:aa(q,ie,z?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,z?.default,z?.[re],h==null||(n=h.classNames)==null?void 0:n[re]),"data-sonner-toast":"","data-rich-colors":(Ra=h.richColors)!=null?Ra:N,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":O,"data-promise":!!h.promise,"data-swiped":Pe,"data-removed":pe,"data-visible":Y,"data-y-position":Cn,"data-x-position":zt,"data-index":k,"data-front":An,"data-swiping":Q,"data-dismissible":se,"data-type":re,"data-invert":ar,"data-swipe-out":Se,"data-swipe-direction":P,"data-expanded":!!(j||H&&O),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":E.length-k,"--offset":`${pe?ut:Ke.current}px`,"--initial-height":H?"auto":`${Pt}px`,...A,...h.style},onDragEnd:()=>{le(!1),$(null),Vt.current=null},onPointerDown:Xe=>{Xe.button!==2&&(In||!se||(br.current=new Date,Ze(Ke.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(le(!0),Vt.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,nn,Wn;if(Se||!se)return;Vt.current=null;const fr=Number(((Xe=Yt.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ea=Number(((nn=Yt.current)==null?void 0:nn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pn=new Date().getTime()-((Wn=br.current)==null?void 0:Wn.getTime()),ii=ne==="x"?fr:ea,ql=Math.abs(ii)/pn;if(Math.abs(ii)>=Jne||ql>.11){Ze(Ke.current),h.onDismiss==null||h.onDismiss.call(h,h),U(ne==="x"?fr>0?"right":"left":ea>0?"down":"up"),dr(),ke(!0);return}else{var oi,ai;(oi=Yt.current)==null||oi.style.setProperty("--swipe-amount-x","0px"),(ai=Yt.current)==null||ai.style.setProperty("--swipe-amount-y","0px")}Fe(!1),le(!1),$(null)},onPointerMove:Xe=>{var nn,Wn,fr;if(!Vt.current||!se||((nn=window.getSelection())==null?void 0:nn.toString().length)>0)return;const pn=Xe.clientY-Vt.current.y,ii=Xe.clientX-Vt.current.x;var ql;const oi=(ql=e.swipeDirections)!=null?ql:ere(K);!ne&&(Math.abs(ii)>1||Math.abs(pn)>1)&&$(Math.abs(ii)>Math.abs(pn)?"x":"y");let ai={x:0,y:0};const du=Do=>1/(1.5+Math.abs(Do)/20);if(ne==="y"){if(oi.includes("top")||oi.includes("bottom"))if(oi.includes("top")&&pn<0||oi.includes("bottom")&&pn>0)ai.y=pn;else{const Do=pn*du(pn);ai.y=Math.abs(Do)<Math.abs(pn)?Do:pn}}else if(ne==="x"&&(oi.includes("left")||oi.includes("right")))if(oi.includes("left")&&ii<0||oi.includes("right")&&ii>0)ai.x=ii;else{const Do=ii*du(ii);ai.x=Math.abs(Do)<Math.abs(ii)?Do:ii}(Math.abs(ai.x)>0||Math.abs(ai.y)>0)&&Fe(!0),(Wn=Yt.current)==null||Wn.style.setProperty("--swipe-amount-x",`${ai.x}px`),(fr=Yt.current)==null||fr.style.setProperty("--swipe-amount-y",`${ai.y}px`)}},ce&&!h.jsx&&re!=="loading"?J.createElement("button",{"aria-label":L,"data-disabled":In,"data-close-button":!0,onClick:In||!se?()=>{}:()=>{dr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:aa(z?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Bt=W?.close)!=null?Bt:Lne):null,(re||h.icon||h.promise)&&h.icon!==null&&(W?.[re]!==null||h.icon)?J.createElement("div",{"data-icon":"",className:aa(z?.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ys():null,h.type!=="loading"?bs:null):null,J.createElement("div",{"data-content":"",className:aa(z?.content,h==null||(o=h.classNames)==null?void 0:o.content)},J.createElement("div",{"data-title":"",className:aa(z?.title,h==null||(a=h.classNames)==null?void 0:a.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?J.createElement("div",{"data-description":"",className:aa(ee,me,z?.description,h==null||(l=h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),J.isValidElement(h.cancel)?h.cancel:h.cancel&&gv(h.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||D,onClick:Xe=>{gv(h.cancel)&&se&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Xe),dr())},className:aa(z?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,J.isValidElement(h.action)?h.action:h.action&&gv(h.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:Xe=>{gv(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Xe),!Xe.defaultPrevented&&dr())},className:aa(z?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function sD(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function nre(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,a=o?"--mobile-offset":"--offset",l=o?Yne:Zne;function d(f){["top","right","bottom","left"].forEach(m=>{n[`${a}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=l:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(l)}),n}const rre=J.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:d,className:f,offset:m,mobileOffset:h,theme:v="light",richColors:y,duration:x,style:S,visibleToasts:C=Gne,toastOptions:k,dir:E=sD(),gap:j=Xne,icons:I,containerAriaLabel:N="Notifications"}=t,[T,A]=J.useState([]),D=J.useMemo(()=>r?T.filter(O=>O.toasterId===r):T.filter(O=>!O.toasterId),[T,r]),F=J.useMemo(()=>Array.from(new Set([o].concat(D.filter(O=>O.position).map(O=>O.position)))),[D,o]),[q,ee]=J.useState([]),[G,K]=J.useState(!1),[V,H]=J.useState(!1),[z,W]=J.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=J.useRef(null),ne=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=J.useRef(null),P=J.useRef(!1),U=J.useCallback(O=>{A(X=>{var pe;return(pe=X.find(ve=>ve.id===O.id))!=null&&pe.delete||gi.dismiss(O.id),X.filter(({id:ve})=>ve!==O.id)})},[]);return J.useEffect(()=>gi.subscribe(O=>{if(O.dismiss){requestAnimationFrame(()=>{A(X=>X.map(pe=>pe.id===O.id?{...pe,delete:!0}:pe))});return}setTimeout(()=>{iE.flushSync(()=>{A(X=>{const pe=X.findIndex(ve=>ve.id===O.id);return pe!==-1?[...X.slice(0,pe),{...X[pe],...O},...X.slice(pe+1)]:[O,...X]})})})}),[T]),J.useEffect(()=>{if(v!=="system"){W(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:X})=>{W(X?"dark":"light")})}catch{O.addListener(({matches:pe})=>{try{W(pe?"dark":"light")}catch(ve){console.error(ve)}})}},[v]),J.useEffect(()=>{T.length<=1&&K(!1)},[T]),J.useEffect(()=>{const O=X=>{var pe;if(a.every(le=>X[le]||X.code===le)){var Q;K(!0),(Q=L.current)==null||Q.focus()}X.code==="Escape"&&(document.activeElement===L.current||(pe=L.current)!=null&&pe.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),J.useEffect(()=>{if(L.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,P.current=!1)}},[L.current]),J.createElement("section",{ref:n,"aria-label":`${N} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((O,X)=>{var pe;const[ve,Q]=O.split("-");return D.length?J.createElement("ol",{key:O,dir:E==="auto"?sD():E,tabIndex:-1,ref:L,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ve,"data-x-position":Q,style:{"--front-toast-height":`${((pe=q[0])==null?void 0:pe.height)||0}px`,"--width":`${Wne}px`,"--gap":`${j}px`,...S,...nre(m,h)},onBlur:le=>{P.current&&!le.currentTarget.contains(le.relatedTarget)&&(P.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||P.current||(P.current=!0,$.current=le.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{V||K(!1)},onDragEnd:()=>K(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},D.filter(le=>!le.position&&X===0||le.position===O).map((le,Se)=>{var ke,Pe;return J.createElement(tre,{key:le.id,icons:I,index:Se,toast:le,defaultRichColors:y,duration:(ke=k?.duration)!=null?ke:x,className:k?.className,descriptionClassName:k?.descriptionClassName,invert:i,visibleToasts:C,closeButton:(Pe=k?.closeButton)!=null?Pe:d,interacting:V,position:O,style:k?.style,unstyled:k?.unstyled,classNames:k?.classNames,cancelButtonStyle:k?.cancelButtonStyle,actionButtonStyle:k?.actionButtonStyle,closeButtonAriaLabel:k?.closeButtonAriaLabel,removeToast:U,toasts:D.filter(Fe=>Fe.position==le.position),heights:q.filter(Fe=>Fe.position==le.position),setHeights:ee,expandByDefault:l,gap:j,expanded:G,swipeDirections:t.swipeDirections})})):null}))});function lD(e){let t="Error",n="We had some trouble!";console.error(e);const r=e,i=e;if(typeof e=="string"?n=e:r?.response?.data?typeof r.response.data=="string"?n=r.response.data:r.response.data.error?n=r.response.data.error:r.response.data.message&&(n=r.response.data.message):i?.message&&(n=i.message),n.includes(":")){const o=n.split(":");t=o.shift(),n=o.join(":")}we.error(t,{description:n,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}const Ty=new SX({queryCache:new zz({onError:lD}),mutationCache:new Mz({onError:lD})});function Jo(e){return!!e}const zb={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Ja=console,ud={};Object.keys(zb).forEach(e=>{ud[e]=Ja[e]});const Np="Datadog Browser SDK:",gt={debug:ud.debug.bind(Ja,Np),log:ud.log.bind(Ja,Np),info:ud.info.bind(Ja,Np),warn:ud.warn.bind(Ja,Np),error:ud.error.bind(Ja,Np)},Lb="https://docs.datadoghq.com",ire=`${Lb}/real_user_monitoring/browser/troubleshooting`,fE="More details:";function H4(e,t){return(...n)=>{try{return e(...n)}catch(r){gt.error(t,r)}}}function yc(e){return e!==0&&Math.random()*100<=e}function pd(e,t){return+e.toFixed(t)}function ore(e){return Ym(e)&&e>=0&&e<=100}function Ym(e){return typeof e=="number"}function vm(e){return{...e}}function Ny(e,t){return Object.keys(e).some(n=>e[n]===t)}function Nl(e){return Object.keys(e).length===0}function q4(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function No(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!="object"&&(typeof self=="object"?e=self:typeof window=="object"?e=window:e={}),e}const wa=No(),Fb="WorkerGlobalScope"in wa;function ml(e,t){const n=No();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let gC,K4=!1;function are(e){gC=e}function sre(e){K4=e}function St(e){return function(...t){return dl(e,this,t)}}function dl(e,t,n){try{return e.apply(t,n)}catch(r){hl(r)}}function hl(e){if(vC(e),gC)try{gC(e)}catch(t){vC(t)}}function vC(...e){K4&&gt.error("[MONITOR]",...e)}function Dr(e,t){return ml(No(),"setTimeout")(St(e),t)}function xo(e){ml(No(),"clearTimeout")(e)}function pf(e,t){return ml(No(),"setInterval")(St(e),t)}function Ub(e){ml(No(),"clearInterval")(e)}function cD(e){var t;const n=(t=wa.queueMicrotask)===null||t===void 0?void 0:t.bind(wa);typeof n=="function"?n(St(e)):Promise.resolve().then(St(e))}class Dt{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(n=>n(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(n=>t!==n),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function G4(...e){return new Dt(t=>{const n=e.map(r=>r.subscribe(i=>t.notify(i)));return()=>n.forEach(r=>r.unsubscribe())})}class Z4 extends Dt{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let n=!1;const r={unsubscribe:()=>{n=!0,this.removeObserver(t)}};return cD(()=>{for(const i of this.buffer){if(n)return;t(i)}n||this.addObserver(t)}),r}unbuffer(){cD(()=>{this.maxBufferSize=this.buffer.length=0})}}const zr=1e3,ei=60*zr,Y4=60*ei,lre=24*Y4,W4=365*lre;function Vb(e){return{relative:e,timeStamp:ure(e)}}function cre(e){return{relative:pE(e),timeStamp:e}}function ure(e){const t=Xr()-performance.now();return t>Wm()?Math.round(Al(t,e)):fre(e)}function dre(){return Math.round(Xr()-Al(Wm(),performance.now()))}function xt(e){return Ym(e)?pd(e*1e6,0):e}function Xr(){return new Date().getTime()}function jr(){return Xr()}function qi(){return performance.now()}function vr(){return{relative:qi(),timeStamp:jr()}}function X4(){return{relative:0,timeStamp:Wm()}}function Zn(e,t){return t-e}function Al(e,t){return e+t}function pE(e){return e-Wm()}function fre(e){return Math.round(Al(Wm(),e))}function pre(e){return e<W4}let C_;function Wm(){var e,t;return C_===void 0&&(C_=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),C_}function Bb(e,t,n){const r=n&&n.leading!==void 0?n.leading:!0,i=n&&n.trailing!==void 0?n.trailing:!0;let o=!1,a,l;return{throttled:(...d)=>{if(o){a=d;return}r?e(...d):a=d,o=!0,l=Dr(()=>{i&&a&&e(...a),o=!1,a=void 0},t)},cancel:()=>{xo(l),o=!1,a=void 0}}}function en(){}function Qr(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,Qr)}const Pd=/([\w-]+)\s*=\s*([^;]+)/g;function ym(e,t){for(Pd.lastIndex=0;;){const n=Pd.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function mre(e){const t=new Map;for(Pd.lastIndex=0;;){const n=Pd.exec(e);if(n){const r=n[1],i=n[2];t.has(r)?t.get(r).push(i):t.set(r,[i])}else break}return t}function hre(e){const t=new Map;for(Pd.lastIndex=0;;){const n=Pd.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function mE(e,t,n=""){const r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:`${e.slice(0,o)}${n}`}function gre(){return J4()===0}function y2e(){return J4()===1}let vv;function J4(){return vv??(vv=vre())}function vre(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}function hE(e){return Hb(e,location.href).href}function yre(e){try{return!!Hb(e)}catch{return!1}}function bre(e){const t=Hb(e).pathname;return t[0]==="/"?t:`/${t}`}function Hb(e,t){const{URL:n}=xre();try{return t!==void 0?new n(e,t):new n(e)}catch(r){throw new Error(`Failed to construct URL: ${String(r)}`)}}let k_;function xre(){if(!k_){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=wa}k_={URL:t.URL},e?.remove()}return k_}function qb(e,t,n=0,r){const i=new Date;i.setTime(i.getTime()+n);const o=`expires=${i.toUTCString()}`,a=r&&r.crossSite?"none":"strict",l=r&&r.domain?`;domain=${r.domain}`:"",d=r&&r.secure?";secure":"",f=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${o};path=/;samesite=${a}${l}${d}${f}`}function Kb(e){return ym(document.cookie,e)}function wre(e){return mre(document.cookie).get(e)||[]}let E_;function tl(e){return E_||(E_=hre(document.cookie)),E_.get(e)}function Q4(e,t){qb(e,"",0,t)}function Sre(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${Qr()}`,n="test";qb(t,n,ei,e);const r=Kb(t)===n;return Q4(t,e),r}catch(t){return gt.error(t),!1}}let j_;function eL(e=location.hostname,t=document.referrer){if(j_===void 0){const n=_re(e,t);if(n){const r=`dd_site_test_${Qr()}`,i="test",o=n.split(".");let a=o.pop();for(;o.length&&!Kb(r);)a=`${o.pop()}.${a}`,qb(r,i,zr,{domain:a});Q4(r,{domain:a}),j_=a}}return j_}function _re(e,t){try{return e||Hb(t).hostname}catch{}}const is="_dd_s";function tL(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function nL(e){return Object.values(e)}function gE(e){return Object.entries(e)}const Ol=4*Y4,rL=15*ei,Cre=W4,iL="0",Md={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},oL=/^([a-zA-Z]+)=([a-z0-9-]+)$/,vE="&";function kre(e){return!!e&&(e.indexOf(vE)!==-1||oL.test(e))}const Ere="1";function dc(e,t){const n={isExpired:Ere};return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function iy(e){return Nl(e)}function aL(e){return!iy(e)}function om(e){return e.isExpired!==void 0||!jre(e)}function jre(e){return(e.created===void 0||Xr()-Number(e.created)<Ol)&&(e.expire===void 0||Xr()<Number(e.expire))}function sL(e){e.expire=String(Xr()+rL)}function yC(e){return gE(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(vE)}function Gb(e){const t={};return kre(e)&&e.split(vE).forEach(n=>{const r=oL.exec(n);if(r!==null){const[,i,o]=r;i==="aid"?t.anonymousId=o:t[i]=o}}),t}const Ire="_dd",Rre="_dd_r",Tre="_dd_l",Nre="rum",Are="logs";function Ore(e){if(!tl(is)){const n=tl(Ire),r=tl(Rre),i=tl(Tre),o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[Are]=i),r&&/^[012]$/.test(r)&&(o[Nre]=r),aL(o)&&(sL(o),e.persistSession(o))}}const $re=0;function uD(e){const t=Pre(e);return t&&Sre(t)?{type:Md.COOKIE,cookieOptions:t}:void 0}function Dre(e,t){const n={isLockEnabled:gre(),persistSession:r=>dD(t,e,r,rL),retrieveSession:()=>lL(t,e),expireSession:r=>dD(t,e,dc(r,e),Ol)};return Ore(n),n}function dD(e,t,n,r){let i=yC(n);t.betaEncodeCookieOptions&&(i=yC({...n,...Nl(n)?{}:{c:cL(e)}})),qb(is,i,t.trackAnonymousUser?Cre:r,e)}function lL(e,t){if(t.betaEncodeCookieOptions)return Mre(e);const n=Kb(is);return Gb(n)}function Pre(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const n=eL();if(!n)return;t.domain=n}return t}function cL(e){const t=e.domain?e.domain.split(".").length-1:0;let n=0;return n|=$re<<5,n|=t<<1,n|=e.crossSite?1:0,n.toString(16)}function Mre(e){const t=wre(is),n=cL(e);let r;for(const i of t.reverse())if(r=Gb(i),r.c===n)break;return r==null||delete r.c,r??{}}const zre="_dd_test_";function fD(){try{const e=Qr(),t=`${zre}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Md.LOCAL_STORAGE}:void 0}catch{return}}function Lre(e){return{isLockEnabled:!1,persistSession:uL,retrieveSession:dL,expireSession:t=>Fre(t,e)}}function uL(e){localStorage.setItem(is,yC(e))}function dL(){const e=localStorage.getItem(is);return Gb(e)}function Fre(e,t){uL(dc(e,t))}const Ure=10,Vre=100,Bre=zr,fL="--",pL=[];let oy;function fc(e,t,n=0){var r;const{isLockEnabled:i,persistSession:o,expireSession:a}=t,l=v=>o({...v,lock:f}),d=()=>{const{lock:v,...y}=t.retrieveSession();return{session:y,lock:v&&!qre(v)?v:void 0}};if(oy||(oy=e),e!==oy){pL.push(e);return}if(i&&n>=Vre){pD(t);return}let f,m=d();if(i){if(m.lock){yv(e,t,n);return}if(f=Hre(),l(m.session),m=d(),m.lock!==f){yv(e,t,n);return}}let h=e.process(m.session);if(i&&(m=d(),m.lock!==f)){yv(e,t,n);return}if(h&&(om(h)?a(h):(sL(h),i?l(h):o(h))),i&&!(h&&om(h))){if(m=d(),m.lock!==f){yv(e,t,n);return}o(m.session),h=m.session}(r=e.after)===null||r===void 0||r.call(e,h||m.session),pD(t)}function yv(e,t,n){Dr(()=>{fc(e,t,n+1)},Ure)}function pD(e){oy=void 0;const t=pL.shift();t&&fc(t,e)}function Hre(){return Qr()+fL+jr()}function qre(e){const[,t]=e.split(fL);return!t||Zn(Number(t),jr())>Bre}const mD=zr;function Kre(e){switch(e.sessionPersistence){case Md.COOKIE:return uD(e);case Md.LOCAL_STORAGE:return fD();case void 0:{let t=uD(e);return!t&&e.allowFallbackToLocalStorage&&(t=fD()),t}default:gt.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Gre(e,t){return e.type===Md.COOKIE?Dre(t,e.cookieOptions):Lre(t)}function Zre(e,t,n,r,i=Gre(e,t)){const o=new Dt,a=new Dt,l=new Dt,d=pf(y,mD);let f;S();const{throttled:m,cancel:h}=Bb(()=>{fc({process:T=>{if(iy(T))return;const A=x(T);return C(A),A},after:T=>{aL(T)&&!k()&&I(T),f=T}},i)},mD);function v(){fc({process:T=>k()?x(T):void 0},i)}function y(){const T=i.retrieveSession();om(T)?fc({process:A=>om(A)?dc(A,t):void 0,after:x},i):x(T)}function x(T){return om(T)&&(T=dc(T,t)),k()&&(E(T)?j():(l.notify({previousState:f,newState:T}),f=T)),T}function S(){fc({process:T=>{if(iy(T))return T.anonymousId=Qr(),dc(T,t)},after:T=>{f=T}},i)}function C(T){if(iy(T))return!1;const A=r(T[n]);T[n]=A,delete T.isExpired,A!==iL&&!T.id&&(T.id=Qr(),T.created=String(Xr()))}function k(){return f?.[n]!==void 0}function E(T){return f.id!==T.id||f[n]!==T[n]}function j(){f=dc(f,t),a.notify()}function I(T){f=T,o.notify()}function N(T){fc({process:A=>({...A,...T}),after:x},i)}return{expandOrRenewSession:m,expandSession:v,getSession:()=>f,renewObservable:o,expireObservable:a,sessionStateUpdateObservable:l,restartSession:S,expire:T=>{h(),T===!1&&f&&delete f.anonymousId,i.expireSession(f),x(dc(f,t))},stop:()=>{Ub(d)},updateSessionState:N}}const bC={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Yre(e){const t=new Dt;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===bC.GRANTED},observable:t}}function Wc(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function bm(e){const t=Wc(e);return t==="string"||t==="function"||e instanceof RegExp}function Zb(e,t,n=!1){return e.some(r=>{try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?t.startsWith(r):r===t}catch(i){gt.error(i)}return!1})}const Wre=["chrome-extension://","moz-extension://"];function hD(e){return Wre.some(t=>e.includes(t))}function Xre(e,t=""){if(hD(e))return!1;const r=t.split(`
`).filter(i=>{const o=i.trim();return o.length&&/^at\s+|@/.test(o)})[1]||"";return hD(r)}const Jre="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",Qre="SDK initialized on a non-allowed domain.";function eie(e,t,n=typeof location<"u"?location.origin:""){const r=e.allowedTrackingOrigins;if(!r)return Xre(n,t)?(gt.error(Jre),!1):!0;const i=Zb(r,n);return i||gt.error(Qre),i}const mL="datad0g.com",tie="dd0g-gov.com",bc="datadoghq.com",nie="datadoghq.eu",rie="ddog-gov.com",iie="pci.browser-intake-datadoghq.com",oie=["ddsource","dd-api-key","dd-request-id"];function Ys(e,t,n){const r=aie(e,t);return{build(i,o){const a=sie(e,t,i,o,n);return r(a)},trackType:t}}function aie(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const o=hE(r);return a=>`${o}?ddforward=${encodeURIComponent(`${n}?${a}`)}`}if(typeof r=="function")return o=>r({path:n,parameters:o});const i=hL(t,e);return o=>`https://${i}${n}?${o}`}function hL(e,t){const{site:n=bc,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===bc)return iie;if(r&&n===bc)return`${r}.${bc}`;if(n===tie)return`http-intake.logs.${n}`;const i=n.split("."),o=i.pop();return`browser-intake-${i.join("-")}.${o}`}function sie({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},r,i,{retry:o,encoding:a},l=[]){const d=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.25.2")}`,"dd-evp-origin=browser",`dd-request-id=${Qr()}`].concat(l);return a&&d.push(`dd-evp-encoding=${a}`),r==="rum"&&(d.push(`batch_time=${jr()}`,`_dd.api=${i}`),o&&d.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),t&&d.reverse(),d.join("&")}function lie(e){const t=e.site||bc,n=cie(e.source),r=uie({...e,site:t,source:n});return{replica:die({...e,site:t,source:n}),site:t,source:n,...r}}function cie(e){return e==="flutter"||e==="unity"?e:"browser"}function uie(e){return{logsEndpointBuilder:Ys(e,"logs"),rumEndpointBuilder:Ys(e,"rum"),profilingEndpointBuilder:Ys(e,"profile"),sessionReplayEndpointBuilder:Ys(e,"replay"),exposuresEndpointBuilder:Ys(e,"exposures"),flagEvaluationEndpointBuilder:Ys(e,"flagevaluation")}}function die(e){if(!e.replica)return;const t={...e,site:bc,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Ys(t,"logs"),rumEndpointBuilder:Ys(t,"rum",[`application.id=${e.replica.applicationId}`])}}function fie(e){return oie.every(t=>e.includes(t))}const md={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},xC={ALL:"all",SAMPLED:"sampled"};function I_(e,t){return e!=null&&typeof e!="string"?(gt.error(`${t} must be defined as a string`),!1):!0}function pie(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(gt.error(`Site should be a valid Datadog site. ${fE} ${Lb}/getting_started/site/.`),!1):!0}function hd(e,t){return e!==void 0&&!ore(e)?(gt.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function mie(e,t){var n,r,i,o,a,l,d,f,m,h;if(!e||!e.clientToken){gt.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){gt.error("Allowed Tracking Origins must be an array");return}if(!(!pie(e.site)||!hd(e.sessionSampleRate,"Session")||!hd(e.telemetrySampleRate,"Telemetry")||!hd(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!hd(e.telemetryUsageSampleRate,"Telemetry Usage")||!I_(e.version,"Version")||!I_(e.env,"Env")||!I_(e.service,"Service")||!eie(e,t??""))){if(e.trackingConsent!==void 0&&!Ny(bC,e.trackingConsent)){gt.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&H4(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Fb?void 0:Kre(e),sessionSampleRate:(n=e.sessionSampleRate)!==null&&n!==void 0?n:100,telemetrySampleRate:(r=e.telemetrySampleRate)!==null&&r!==void 0?r:20,telemetryConfigurationSampleRate:(i=e.telemetryConfigurationSampleRate)!==null&&i!==void 0?i:5,telemetryUsageSampleRate:(o=e.telemetryUsageSampleRate)!==null&&o!==void 0?o:5,service:(a=e.service)!==null&&a!==void 0?a:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(d=e.version)!==null&&d!==void 0?d:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:bC.GRANTED,trackAnonymousUser:(h=e.trackAnonymousUser)!==null&&h!==void 0?h:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...lie(e)}}}function hie(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),beta_encode_cookie_options:e.betaEncodeCookieOptions,source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}var gl;(function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.SHORT_SESSION_INVESTIGATION="short_session_investigation",e.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"})(gl||(gl={}));const yE=new Set;function gie(e){Array.isArray(e)&&vie(e.filter(t=>Ny(gl,t)))}function vie(e){e.forEach(t=>{yE.add(t)})}function Xm(e){return yE.has(e)}function yie(){return yE}const zd="?";function Yb(e){var t,n;const r=[];let i=R_(e,"stack");const o=String(e);if(i&&i.startsWith(o)&&(i=i.slice(o.length)),i&&i.split(`
`).forEach(a=>{const l=wie(a)||_ie(a)||kie(a)||Iie(a);l&&(!l.func&&l.line&&(l.func=zd),r.push(l))}),r.length>0&&Aie()&&e instanceof Error){const a=[];let l=e;for(;(l=Object.getPrototypeOf(l))&&vL(l);){const d=((t=l.constructor)===null||t===void 0?void 0:t.name)||zd;a.push(d)}for(let d=a.length-1;d>=0&&((n=r[0])===null||n===void 0?void 0:n.func)===a[d];d--)r.shift()}return{message:R_(e,"message"),name:R_(e,"name"),stack:r}}const gL="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Ld="(?::(\\d+))",bie=new RegExp(`^\\s*at (.*?) ?\\(${gL}${Ld}?${Ld}?\\)?\\s*$`,"i"),xie=new RegExp(`\\((\\S*)${Ld}${Ld}\\)`);function wie(e){const t=bie.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,i=xie.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||zd,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const Sie=new RegExp(`^\\s*at ?${gL}${Ld}?${Ld}??\\s*$`,"i");function _ie(e){const t=Sie.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:zd,line:t[2]?+t[2]:void 0,url:t[1]}}const Cie=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function kie(e){const t=Cie.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||zd,line:+t[3],url:t[2]}}const Eie=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,jie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Iie(e){const t=Eie.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=jie.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||zd,line:t[4]?+t[4]:void 0,url:t[3]}}function R_(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function Rie(e,t,n,r){if(t===void 0)return;const{name:i,message:o}=Nie(e);return{name:i,message:o,stack:[{url:t,column:r,line:n}]}}const Tie=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Nie(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=Tie.exec(e)),{name:t,message:n}}function vL(e){return String(e.constructor).startsWith("class ")}let bv;function Aie(){if(bv!==void 0)return bv;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(r=>new r);return bv=vL(Object.getPrototypeOf(t))&&n.stack!==t.stack,bv}function xm(e){const n=new Error(e);n.name="HandlingStack";let r;return dl(()=>{const i=Yb(n);i.stack=i.stack.slice(2),r=Wb(i)}),r}function Wb(e){let t=yL(e);return e.stack.forEach(n=>{const r=n.func==="?"?"<anonymous>":n.func,i=n.args&&n.args.length>0?`(${n.args.join(", ")})`:"",o=n.line?`:${n.line}`:"",a=n.line&&n.column?`:${n.column}`:"";t+=`
  at ${r}${i} @ ${n.url}${o}${a}`}),t}function yL(e){return`${e.name||"Error"}: ${e.message}`}function va(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!="function")if(t in e&&typeof t=="string"&&t.startsWith("on"))i=en;else return{stop:en};let o=!1;const a=function(){if(o)return i.apply(this,arguments);const l=Array.from(arguments);let d;dl(n,null,[{target:this,parameters:l,onPostCall:m=>{d=m},handlingStack:r?xm("instrumented method"):void 0}]);const f=i.apply(this,l);return d&&dl(d,null,[f]),f};return e[t]=a,{stop:()=>{o=!0,e[t]===a&&(e[t]=i)}}}function b2e(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:en};const i=en;let o=(l,d)=>{Dr(()=>{o!==i&&n(l,d)},0)};const a=function(l){r.set.call(this,l),o(this,l)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var l;((l=Object.getOwnPropertyDescriptor(e,t))===null||l===void 0?void 0:l.set)===a&&Object.defineProperty(e,t,r),o=i}}}const Xc=1024,bL=1024*Xc,Oie=/[^\u0000-\u007F]/;function xL(e){return Oie.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function wL(e){if(e.length===1)return e[0];const t=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}function Fd(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=gd(Object.prototype),i=gd(Array.prototype),o=gd(Object.getPrototypeOf(e)),a=gd(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),i(),o(),a()}}function gd(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):en}const $ie=220*Xc,Die="$",Pie=3;function wn(e,t=$ie){const n=gd(Object.prototype),r=gd(Array.prototype),i=[],o=new WeakMap,a=T_(e,Die,void 0,i,o),l=JSON.stringify(a);let d=l?l.length:0;if(d>t){N_(t,"discarded",e);return}for(;i.length>0&&d<t;){const f=i.shift();let m=0;if(Array.isArray(f.source))for(let h=0;h<f.source.length;h++){const v=T_(f.source[h],f.path,h,i,o);if(v!==void 0?d+=JSON.stringify(v).length:d+=4,d+=m,m=1,d>t){N_(t,"truncated",e);break}f.target[h]=v}else for(const h in f.source)if(Object.prototype.hasOwnProperty.call(f.source,h)){const v=T_(f.source[h],f.path,h,i,o);if(v!==void 0&&(d+=JSON.stringify(v).length+m+h.length+Pie,m=1),d>t){N_(t,"truncated",e);break}f.target[h]=v}}return n(),r(),a}function T_(e,t,n,r,i){const o=Lie(e);if(!o||typeof o!="object")return Mie(o);const a=wC(o);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;const l=e;if(i.has(l))return`[Reference seen at ${i.get(l)}]`;const d=n!==void 0?`${t}.${n}`:t,f=Array.isArray(o)?[]:{};return i.set(l,d),r.push({source:o,target:f,path:d}),f}function Mie(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function wC(e){try{if(e instanceof Event)return zie(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch{}return"[Unserializable]"}function zie(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?wC(e.currentTarget):null,target:e.target?wC(e.target):null}}function Lie(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function N_(e,t,n){gt.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const SL="No stack, consider using an instance of Error";function _L({originalError:e,stackTrace:t,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){const o=$l(e);return!t&&o&&(t=Yb(e)),{source:n,type:t?t.name:void 0,message:Fie(t,o,i,e),stack:t?Wb(t):r?SL:void 0}}function bE({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:o,useFallbackStack:a=!0,source:l,handling:d}){const f=_L({originalError:t,stackTrace:e,source:l,useFallbackStack:a,nonErrorPrefix:o});return{startClocks:i,handling:d,handlingStack:n,componentStack:r,originalError:t,...f,causes:$l(t)?Bie(t,l):void 0,fingerprint:Uie(t),context:Vie(t)}}function Fie(e,t,n,r){return e?.message&&e?.name?e.message:t?"Empty message":n?`${n} ${Fd(wn(r))}`:Fd(wn(r))}function Uie(e){return $l(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Vie(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function $l(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function Bie(e,t){const n=[];let r=e.cause;for(;r!=null&&n.length<10;){const i=_L({originalError:r,source:t,useFallbackStack:!1});n.push(i),r=$l(r)?r.cause:void 0}return n.length?n:void 0}const mf={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Hie(){return new Dt(e=>{const t=(i,o)=>{const a=bE({stackTrace:o,originalError:i,startClocks:vr(),nonErrorPrefix:"Uncaught",source:mf.SOURCE,handling:"unhandled"});e.notify(a)},{stop:n}=qie(t),{stop:r}=Kie(t);return()=>{n(),r()}})}function qie(e){return va(No(),"onerror",({parameters:[t,n,r,i,o]})=>{let a;$l(o)||(a=Rie(t,n,r,i)),e(o??t,a)})}function Kie(e){return va(No(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function Gie(e){const t={version:"6.25.2",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return sre},enumerable:!1}),t}function Zie(e,t,n){const r=e[t];r&&!r.q&&r.version&&gt.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(i=>H4(i,"onReady callback threw an error:")())}function CL(e,t){t.silentMultipleInit||gt.error(`${e} is already initialized.`)}function Dn(e,t,n,r,i){return vl(e,t,[n],r,i)}function vl(e,t,n,r,{once:i,capture:o,passive:a}={}){const l=St(v=>{!v.isTrusted&&!v.__ddIsTrusted&&!e.allowUntrustedEvents||(i&&h(),r(v))}),d=a?{capture:o,passive:a}:o,f=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,m=ml(f,"addEventListener");n.forEach(v=>m.call(t,v,l,d));function h(){const v=ml(f,"removeEventListener");n.forEach(y=>v.call(t,y,l,d))}return{stop:h}}const wm={intervention:"intervention",cspViolation:"csp_violation"};function Yie(e,t){const n=[];t.includes(wm.cspViolation)&&n.push(Xie(e));const r=t.filter(i=>i!==wm.cspViolation);return r.length&&n.push(Wie(r)),G4(...n)}function Wie(e){return new Dt(t=>{if(!window.ReportingObserver)return;const n=St((i,o)=>i.forEach(a=>t.notify(Jie(a)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function Xie(e){return new Dt(t=>{const{stop:n}=Dn(e,document,"securitypolicyviolation",r=>{t.notify(Qie(r))});return n})}function Jie(e){const{type:t,body:n}=e;return kL({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:EL(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Qie(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return kL({type:e.effectiveDirective,message:`${wm.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:EL(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${mE(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function kL(e){return{startClocks:vr(),source:mf.REPORT,handling:"unhandled",...e}}function EL(e,t,n,r,i){return n?Wb({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:i??void 0}]}):void 0}const eoe=200;function jL(e){const{env:t,service:n,version:r,datacenter:i,sdkVersion:o,variant:a}=e,l=[Xu("sdk_version",o??"6.25.2")];return t&&l.push(Xu("env",t)),n&&l.push(Xu("service",n)),r&&l.push(Xu("version",r)),i&&l.push(Xu("datacenter",i)),a&&l.push(Xu("variant",a)),l}function Xu(e,t){const n=t?`${e}:${t}`:e;return(n.length>eoe||noe(n))&&gt.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${fE} ${Lb}/getting_started/tagging/#defining-tags`),toe(n)}function toe(e){return e.replace(/,/g,"_")}function noe(e){return roe()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function roe(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function IL(e,t){const n=wa.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Ay(e,t,n=ioe()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const i=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,i)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const i=Array.isArray(e)?e:[];for(let o=0;o<t.length;++o)i[o]=Ay(i[o],t[o],n);return i}const r=Wc(e)==="object"?e:{};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Ay(r[i],t[i],n));return r}function xE(e){return Ay(void 0,e)}function os(...e){let t;for(const n of e)n!=null&&(t=Ay(t,n));return t}function ioe(){if(typeof WeakSet<"u"){const t=new WeakSet;return{hasAlreadyBeenSeen(n){const r=t.has(n);return r||t.add(n),r}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}function RL(){var e;const t=wa.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function ooe(e){return e>=500}function aoe(e){try{return e.clone()}catch{return}}const soe=80*Xc,loe=32,TL=20*bL,coe=ei,NL=zr;function AL(e,t,n,r,i,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?$L(e,t,n,o,{onSuccess:()=>DL(0,t,n,r,i,o),onFailure:()=>{t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),OL(t,n,r,i,o)}}):t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function OL(e,t,n,r,i){e.transportStatus===2&&Dr(()=>{const o=e.queuedPayloads.first();$L(o,e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=NL,DL(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(coe,e.currentBackoffTime*2),OL(e,t,n,r,i)}})},e.currentBackoffTime)}function $L(e,t,n,r,{onSuccess:i,onFailure:o}){t.bandwidthMonitor.add(e),n(e,a=>{t.bandwidthMonitor.remove(e),uoe(a)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:a.status},r.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),o()):(t.transportStatus=0,r.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function DL(e,t,n,r,i,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${TL/bL}MiB`,source:mf.AGENT,startClocks:vr()}),t.queueFullReported=!0);const a=t.queuedPayloads;for(t.queuedPayloads=PL();a.size()>0;)AL(a.dequeue(),t,n,r,i,o)}function uoe(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||ooe(e.status))}function doe(){return{transportStatus:0,currentBackoffTime:NL,bandwidthMonitor:foe(),queuedPayloads:PL(),queueFullReported:!1}}function PL(){const e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=TL}}}function foe(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=soe&&this.ongoingRequestCount<loe},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}const SC=16*Xc;function ML(e,t,n=SC){const r=new Dt,i=doe();return{observable:r,send:o=>{for(const a of e)AL(o,i,(l,d)=>{Xm(gl.AVOID_FETCH_KEEPALIVE)?Oy(a,l,d):hoe(a,n,l,d)},a.trackType,t,r)},sendOnExit:o=>{for(const a of e)poe(a,n,o)}}}function poe(e,t,n){if(!!navigator.sendBeacon&&n.bytesCount<t)try{const i=e.build("beacon",n);if(navigator.sendBeacon(i,n.data))return}catch(i){moe(i)}Oy(e,n)}let gD=!1;function moe(e){gD||(gD=!0,hl(e))}function hoe(e,t,n,r){if(goe()&&n.bytesCount<t){const o=e.build("fetch-keepalive",n);fetch(o,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(St(a=>r?.({status:a.status,type:a.type}))).catch(St(()=>Oy(e,n,r)))}else Oy(e,n,r)}function Oy(e,t,n){const r=e.build("fetch",t);fetch(r,{method:"POST",body:t.data,mode:"cors"}).then(St(i=>n?.({status:i.status,type:i.type}))).catch(St(()=>n?.({status:0})))}function goe(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function Jm(){const e=voe();if(e)return{getCapabilities(){var t;return JSON.parse(((t=e.getCapabilities)===null||t===void 0?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return(t=e.getPrivacyLevel)===null||t===void 0?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){const i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function zL(e){const t=Jm();return!!t&&t.getCapabilities().includes(e)}function Ud(e){var t;e===void 0&&(e=(t=No().location)===null||t===void 0?void 0:t.hostname);const n=Jm();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function voe(){return No().DatadogEventBridge}const _d={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function yoe(e){return new Dt(t=>{const{stop:n}=vl(e,window,["visibilitychange","freeze"],i=>{i.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:_d.HIDDEN}):i.type==="freeze"&&t.notify({reason:_d.FROZEN})},{capture:!0}),r=Dn(e,window,"beforeunload",()=>{t.notify({reason:_d.UNLOADING})}).stop;return()=>{n(),r()}})}function boe(e){return nL(_d).includes(e)}const vD=256*Xc;function LL({encoder:e,request:t,flushController:n}){let r={};const i=n.flushObservable.subscribe(m=>f(m));function o(m,h,v){n.notifyBeforeAddMessage(h),v!==void 0?(r[v]=m,n.notifyAfterAddMessage()):e.write(e.isEmpty?m:`
${m}`,y=>{n.notifyAfterAddMessage(y-h)})}function a(m){return m!==void 0&&r[m]!==void 0}function l(m){const h=r[m];delete r[m];const v=e.estimateEncodedBytesCount(h);n.notifyAfterRemoveMessage(v)}function d(m,h){const v=Fd(m),y=e.estimateEncodedBytesCount(v);if(y>=vD){gt.warn(`Discarded a message whose size was bigger than the maximum allowed size ${vD/Xc}KiB. ${fE} ${ire}/#technical-limitations`);return}a(h)&&l(h),o(v,y,h)}function f(m){const h=nL(r).join(`
`);r={};const v=boe(m.reason),y=v?t.sendOnExit:t.send;if(v&&e.isAsync){const x=e.finishSync();x.outputBytesCount&&y(yD(x));const S=[x.pendingData,h].filter(Boolean).join(`
`);S&&y({data:S,bytesCount:xL(S)})}else h&&e.write(e.isEmpty?h:`
${h}`),e.finish(x=>{y(yD(x))})}return{flushController:n,add:d,upsert:d,stop:i.unsubscribe}}function yD(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}const xoe=30*zr,woe=Fb?1:50;function FL({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(h=>l(h.reason)),r=t.subscribe(()=>l("session_expire")),i=new Dt(()=>()=>{n.unsubscribe(),r.unsubscribe()});let o=0,a=0;function l(h){if(a===0)return;const v=a,y=o;a=0,o=0,m(),i.notify({reason:h,messagesCount:v,bytesCount:y})}let d;function f(){d===void 0&&(d=Dr(()=>{l("duration_limit")},xoe))}function m(){xo(d),d=void 0}return{flushObservable:i,get messagesCount(){return a},notifyBeforeAddMessage(h){o+h>=SC&&l("bytes_limit"),a+=1,o+=h,f()},notifyAfterAddMessage(h=0){o+=h,a>=woe?l("messages_limit"):o>=SC&&l("bytes_limit")},notifyAfterRemoveMessage(h){o-=h,a-=1,a===0&&m()}}}const yl="DISCARDED",Ki="SKIPPED";function Soe(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const o of r){const a=o(n);if(a===yl)return yl;a!==Ki&&i.push(a)}return os(...i)}}}const fl={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},_oe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Coe=1,koe=[rie],Eoe=15;let A_;function hf(){return A_||(A_=new Z4(100)),A_}function joe(e,t,n,r,i,o){const a=new Dt,{stop:l}=Roe(t,r,i,o,a),{enabled:d,metricsEnabled:f}=Ioe(e,t,n,a);return{stop:l,enabled:d,metricsEnabled:f}}function Ioe(e,t,n,r,i=Coe,o=Eoe){const a={},l=!koe.includes(t.site)&&yc(t.telemetrySampleRate),d={[fl.LOG]:l,[fl.CONFIGURATION]:l&&yc(t.telemetryConfigurationSampleRate),[fl.USAGE]:l&&yc(t.telemetryUsageSampleRate),metric:l&&yc(i)},f=Toe(),m=hf();return m.subscribe(({rawEvent:v,metricName:y})=>{if(y&&!d.metric||!d[v.type])return;const x=y||v.status||v.type;let S=a[x];if(S||(S=a[x]=new Set),S.size>=o)return;const C=Fd(v);if(S.has(C))return;const k=n.triggerHook(1,{startTime:vr().relative});if(k===yl)return;const E=h(k,e,v,f);r.notify(E),IL("telemetry",E),S.add(C)}),m.unbuffer(),are(wE),{enabled:l,metricsEnabled:d.metric};function h(v,y,x,S){const k={type:"telemetry",date:vr().timeStamp,service:y,version:"6.25.2",source:"browser",_dd:{format_version:2},telemetry:os(x,{runtime_env:S,connectivity:RL(),sdk_setup:"npm"}),ddtags:jL(t).join(","),experimental_features:Array.from(yie())};return os(k,v)}}function Roe(e,t,n,r,i){const o=[];if(Ud()){const a=Jm(),l=i.subscribe(d=>a.send("internal_telemetry",d));o.push(l.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Noe(e)&&a.push(e.replica.rumEndpointBuilder);const l=LL({encoder:r(4),request:ML(a,t),flushController:FL({pageMayExitObservable:n,sessionExpireObservable:new Dt})});o.push(l.stop);const d=i.subscribe(l.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function Toe(){var e;return{is_local_file:((e=wa.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Fb}}function Noe(e){return e.site===mL}function Qm(e,t){vC(zb.debug,e,t),hf().notify({rawEvent:{type:fl.LOG,message:e,status:"debug",...t}})}function wE(e,t){hf().notify({rawEvent:{type:fl.LOG,status:"error",...Ooe(e),...t}})}function Aoe(e){hf().notify({rawEvent:{type:fl.CONFIGURATION,configuration:e}})}function Xb(e,t){hf().notify({rawEvent:{type:fl.LOG,message:e,status:"debug",...t},metricName:e})}function hr(e){hf().notify({rawEvent:{type:fl.USAGE,usage:e}})}function Ooe(e){if($l(e)){const t=Yb(e);return{error:{kind:t.name,stack:Wb($oe(t))},message:t.message}}return{error:{stack:SL},message:`Uncaught ${Fd(e)}`}}function $oe(e){return e.stack=e.stack.filter(t=>!t.url||_oe.some(n=>t.url.startsWith(n))),e}function UL(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Ic(e){return Array.isArray(e)&&e.length>0}const xv=1/0,Doe=ei;let Ap=null;const ay=new Set;function Poe(){ay.forEach(e=>e())}function Jc({expireDelay:e,maxEntries:t}){let n=[];Ap||(Ap=pf(()=>Poe(),Doe));const r=()=>{const m=qi()-e;for(;n.length>0&&n[n.length-1].endTime<m;)n.pop()};ay.add(r);function i(m,h){const v={value:m,startTime:h,endTime:xv,remove:()=>{UL(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(m=xv,h={returnInactive:!1}){for(const v of n)if(v.startTime<=m){if(h.returnInactive||m<=v.endTime)return v.value;break}}function a(m){const h=n[0];h&&h.endTime===xv&&h.close(m)}function l(m=xv,h=0){const v=Al(m,h);return n.filter(y=>y.startTime<=v&&m<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){ay.delete(r),ay.size===0&&Ap&&(Ub(Ap),Ap=null)}return{add:i,find:o,closeActive:a,findAll:l,reset:d,stop:f}}const Moe="datadog-synthetics-public-id",zoe="datadog-synthetics-result-id",Loe="datadog-synthetics-injects-rum";function VL(){return Fb?!1:!!(wa._DATADOG_SYNTHETICS_INJECTS_RUM||tl(Loe))}function BL(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||tl(Moe);return typeof e=="string"?e:void 0}function HL(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||tl(zoe);return typeof e=="string"?e:void 0}function qL(){return!!(BL()&&HL())}const Foe=ei,Uoe=Ol;function Voe(e,t,n,r){const i=new Dt,o=new Dt,a=Zre(e.sessionStoreStrategyType,e,t,n),l=Jc({expireDelay:Uoe});if(a.renewObservable.subscribe(()=>{l.add(d(),qi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),l.closeActive(qi())}),a.expandOrRenewSession(),l.add(d(),X4().relative),Xm(gl.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Goe(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Boe(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),Hoe(e,()=>a.expandSession()),qoe(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Koe(e).catch(()=>{}),{id:"invalid",trackingType:iL,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,m)=>l.find(f,m),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Boe(e,t){const{stop:n}=vl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Hoe(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Dn(e,document,"visibilitychange",n);pf(n,Foe)}function qoe(e,t){const{stop:n}=Dn(e,window,"resume",t,{capture:!0})}async function Koe(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===Md.COOKIE?(n=lL(t.cookieOptions,e),r={cookie:await KL(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=dL(),Qm("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:qL(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Goe(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Xr(),{stop:i}=Dn(e,cookieStore,"change",o);function o(a){const l=tL(a.changed,f=>f.name===is);if(!l)return;const d=Xr()-n;if(d>14*ei)i();else{const f=Gb(l.value);if(f.id&&f.id!==t.id){i();const m=Xr()-r;KL().then(h=>{Qm("Session cookie changed",{time:m,session_age:d,old:t,new:f,cookie:h})}).catch(hl)}}}}async function KL(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(is):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(is)),{count:e.length,domain:eL()||"undefined",...e}}function Zoe(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=xL(n);t+=i,e+=n,r&&r(i)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class Yoe{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}const Woe=3e3;function O_(e,t,n=Woe){let r=0,i=!1;return{isLimitReached(){if(r===0&&Dr(()=>{r=0},ei),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${n}`,source:mf.AGENT,startClocks:vr()})}finally{i=!1}}return!0}}}function SE(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:en}):Dn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function Xoe(e,t){return new Promise(n=>{SE(e,t,n)})}let $_;const _E=new WeakMap;function Joe(e){return $_||($_=Qoe(e)),$_}function Qoe(e){return new Dt(t=>{const{stop:n}=va(XMLHttpRequest.prototype,"open",eae),{stop:r}=va(XMLHttpRequest.prototype,"send",o=>{tae(o,e,t)},{computeHandlingStack:!0}),{stop:i}=va(XMLHttpRequest.prototype,"abort",nae);return()=>{n(),r(),i()}})}function eae({target:e,parameters:[t,n]}){_E.set(e,{state:"open",method:String(t).toUpperCase(),url:hE(String(n))})}function tae({target:e,parameters:[t],handlingStack:n},r,i){const o=_E.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=vr(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let l=!1;const{stop:d}=va(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),l)return;l=!0;const h=o;h.state="complete",h.duration=Zn(a.startClocks.timeStamp,jr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(vm(h))},{stop:m}=Dn(r,e,"loadend",f);i.notify(a)}function nae({target:e}){const t=_E.get(e);t&&(t.isAborted=!0)}async function rae(e,t){const n=e.getReader(),r=[];for(;;){const i=await n.read();if(i.done)break;t.collectStreamBody&&r.push(i.value)}return n.cancel().catch(en),t.collectStreamBody?wL(r):void 0}let D_;const GL=[];function ZL({responseBodyAction:e}={}){return e&&GL.push(e),D_||(D_=iae()),D_}function iae(){return new Dt(e=>{if(!wa.fetch)return;const{stop:t}=va(wa,"fetch",n=>oae(n,e),{computeHandlingStack:!0});return t})}function oae({parameters:e,onPostCall:t,handlingStack:n},r){const[i,o]=e;let a=o&&o.method;a===void 0&&i instanceof Request&&(a=i.method);const l=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:hE(String(i)),f=vr(),m={state:"start",init:o,input:i,method:l,startClocks:f,url:d,handlingStack:n};r.notify(m),e[0]=m.input,e[1]=m.init,t(h=>{aae(r,h,m).catch(hl)})}async function aae(e,t,n){var r,i;const o=n;o.state="resolve";let a;try{a=await t}catch(d){o.status=0,o.isAborted=((i=(r=o.init)===null||r===void 0?void 0:r.signal)===null||i===void 0?void 0:i.aborted)||d instanceof DOMException&&d.code===DOMException.ABORT_ERR,o.error=d,e.notify(o);return}o.response=a,o.status=a.status,o.responseType=a.type,o.isAborted=!1;const l=GL.reduce((d,f)=>Math.max(d,f(o)),0);if(l!==0){const d=aoe(a);if(d&&d.body)try{const f=await rae(d.body,{collectStreamBody:l===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function sae(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(St(e),t);return()=>window.cancelIdleCallback(n)}return cae(e)}const lae=50;function cae(e){const t=Xr(),n=Dr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,lae-(Xr()-t))})},0);return()=>xo(n)}const uae=zr,dae=30;function fae(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>dae-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){sae(t,{timeout:uae})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let P_={};function pae(e){const t=e.map(n=>(P_[n]||(P_[n]=mae(n)),P_[n]));return G4(...t)}function mae(e){return new Dt(t=>{const n=Ja[e];return Ja[e]=(...r)=>{n.apply(console,r);const i=xm("console error");dl(()=>{t.notify(hae(r,e,i))})},()=>{Ja[e]=n}})}function hae(e,t,n){const r=e.map(i=>gae(i)).join(" ");if(t===zb.error){const i=e.find($l),o=bE({originalError:i,handlingStack:n,startClocks:vr(),source:mf.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return o.message=r,{api:t,message:r,handlingStack:n,error:o}}return{api:t,message:r,error:void 0,handlingStack:n}}function gae(e){return typeof e=="string"?wn(e):$l(e)?yL(Yb(e)):Fd(wn(e),void 0,2)}const vae=500;function yae(){const e=[];return{add:i=>{e.push(i)>vae&&e.splice(0,1)},remove:i=>{UL(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function bae(e){const t=Wc(e)==="object";return t||gt.error("Unsupported context:",e),t}function M_(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!bD(r[i])&&(r[i]=String(r[i])),o&&bD(r[i])&&gt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function bD(e){return e==null||e===""}function Jb(e="",{propertiesConfig:t={}}={}){let n={};const r=new Dt,i={getContext:()=>xE(n),setContext:o=>{bae(o)?n=wn(M_(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=wn(M_({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],M_(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Vr(e,t,n,r){return St((...i)=>(r&&hr({feature:r}),e()[t][n](...i)))}const xae="_dd_c",wae=[];function CE(e,t,n,r){const i=Sae(n,r);wae.push(Dn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(l);const o=os(d(),t.getContext());Nl(o)||t.setContext(o);function a(){t.setContext(d())}function l(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function Sae(e,t){return`${xae}_${e}_${t}`}function _ae(e,t,n){const r=YL();return t.storeContextsAcrossPages&&CE(t,r,n,4),e.register(0,()=>{const i=r.getContext();return Nl(i)||!i.id?Ki:{account:i}}),r}function YL(){return Jb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Cae(e,t,n,r){const i=WL();return t.storeContextsAcrossPages&&CE(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function WL(){return Jb("global context")}function kae(e,t,n,r){const i=XL();return t.storeContextsAcrossPages&&CE(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const l=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!l.anonymous_id&&t.trackAnonymousUser&&(l.anonymous_id=d.anonymousId),Nl(l)?Ki:{type:o,usr:l}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function XL(){return Jb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const gr={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Br={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Kr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Qb={FETCH:Kr.FETCH,XHR:Kr.XHR},Eae=500;function jae(e=Hie){const t=new Z4(Eae),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function Iae(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const wt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},xD={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Qa={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},kE={CLICK:"click",CUSTOM:"custom"},Op={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},Sm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Rae(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Tae(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,wD(a))}function o(a,l,d,f){if(!Xm(gl.FEATURE_OPERATION_VITAL))return;const{operationKey:m,context:h,description:v}=d||{},y={name:a,type:Sm.OPERATION_STEP,operationKey:m,failureReason:f,stepType:l,startClocks:vr(),context:wn(h),description:v};e.notify(12,wD(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,l={})=>JL(n,a,l),stopDurationVital:(a,l={})=>{QL(i,n,a,l)}}}function JL({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:vr(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function QL(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Nae(o,o.startClocks,i,vr())),typeof r=="string"?t.delete(r):n.delete(r))}function Nae(e,t,n,r){var i;return{name:e.name,type:Sm.DURATION,startClocks:t,duration:Zn(t.timeStamp,r.timeStamp),context:os(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function wD(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:Qr(),type:n,name:r,description:i,...n===Sm.DURATION?{duration:xt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:wt.VITAL,context:o},startTime:t.relative,duration:n===Sm.DURATION?e.duration:void 0,domainContext:{}}}function eF(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const SD=new Map;function tF(e,t){if(t===100)return!0;if(t===0)return!1;const n=SD.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=Aae(BigInt(`0x${e.split("-")[4]}`),t):r=yc(t),SD.set(t,{sessionId:e,decision:r}),r}function Aae(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function Oae(){return rF(64)}function nF(){return rF(63)}function rF(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],i=t[0],o="";do{const a=r%n*4294967296+i;r=Math.floor(r/n),i=Math.floor(a/n),o=(a%n).toString(n)+o}while(r||i);return o}}}function Ju(e){return e.toString(16).padStart(16,"0")}function $ae(e){const t=e;return Wc(t)==="object"&&bm(t.match)&&Array.isArray(t.propagatorTypes)}function Dae(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Pae(e,t,n,r){return{clearTracingIfNeeded:Dae,traceFetch:i=>_D(e,i,t,n,r,o=>{var a;if(i.input instanceof Request&&!(!((a=i.init)===null||a===void 0)&&a.headers))i.input=new Request(i.input),Object.keys(o).forEach(l=>{i.input.headers.append(l,o[l])});else{i.init=vm(i.init);const l=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{l.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{l.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{l.push([d,i.init.headers[d]])}),i.init.headers=l.concat(gE(o))}}),traceXhr:(i,o)=>_D(e,i,t,n,r,a=>{Object.keys(a).forEach(l=>{o.setRequestHeader(l,a[l])})})}}function _D(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const l=e.allowedTracingUrls.find(m=>Zb([m.match],t.url,!0));if(!l)return;const d=tF(a.id,e.traceSampleRate);(d||e.traceContextInjection===xC.ALL)&&(t.traceSampled=d,t.traceId=Oae(),t.spanId=nF(),o(Mae(t.traceId,t.spanId,t.traceSampled,a.id,l.propagatorTypes,r,i,e)))}function Mae(e,t,n,r,i,o,a,l){const d={};if(i.forEach(f=>{switch(f){case"datadog":{Object.assign(d,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(d,{traceparent:`00-0000000000000000${Ju(e)}-${Ju(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Ju(e)}-${Ju(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Ju(e),"X-B3-SpanId":Ju(t),"X-B3-Sampled":n?"1":"0"});break}}}),l.propagateTraceBaggage){const f={"session.id":r},m=o.getContext().id;typeof m=="string"&&(f["user.id"]=m);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,x])=>`${y}=${encodeURIComponent(x)}`).join(",");v&&(d.baggage=v)}return d}const iF=["tracecontext","datadog"];function zae(e,t){var n,r,i,o,a,l,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&gt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){gt.error("Application ID is not configured, no RUM data will be collected.");return}if(!hd(e.sessionReplaySampleRate,"Session Replay")||!hd(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){gt.error("Excluded Activity Urls should be an array");return}const f=Lae(e);if(!f)return;const m=mie(e,t),h=Uae(e);if(!m)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:Ym(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((o=e.trackUserInteractions)!==null&&o!==void 0)||o),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Ny(md,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:md.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Ny(xC,e.traceContextInjection)?e.traceContextInjection:xC.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...m}}function Lae(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){gt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){gt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{bm(n)?t.push({match:n,propagatorTypes:iF}):$ae(n)?t.push(n):gt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Fae(e){const t=new Set;return Ic(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{bm(n)?iF.forEach(r=>t.add(r)):Wc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Uae(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return gt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{bm(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&bm(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function Vae(e){return Ic(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Bae(e){return Ic(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Hae(e){var t;const n=hie(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Ic(e.allowedTracingUrls),use_allowed_graph_ql_urls:Ic(e.allowedGraphQlUrls),use_track_graph_ql_payload:Vae(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Bae(e.allowedGraphQlUrls),selected_tracing_propagators:Fae(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Ic(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function qae(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=CD[n].find(l=>Xae[l](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!ese(i.escapeSequence))return[];o+=nse(i.escapeSequence),i.escapeSequence=void 0}Jae.includes(r)?o+=a:Qae.includes(r)&&o!==""?(t.push(o),o=""):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${a}`:a:r===8?i.quote=a:r===9&&(i.quote=void 0),n=r}return CD[n].includes(1)?(o!==""&&t.push(o),t):[]}const Kae=/[a-zA-Z_$]/,Gae=/[a-zA-Z0-9_$]/,Zae=/[0-9]/,Yae=/[a-fA-F0-9]/,Wae=`'"`,Xae={0:()=>!1,1:()=>!1,2:e=>Kae.test(e),3:e=>Gae.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Zae.test(e),8:e=>Wae.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?Yae.test(e):!1},CD={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},Jae=[2,3,7,10],Qae=[4,5,6];function ese(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const tse={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
`,r:"\r",t:"	"};function nse(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):tse[e]}const rse="v1",ise=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ose(e,t){let n;const r=sse(),i=await dse(e);return i.ok?(r.increment("fetch","success"),n=ase(e,i.value,t,r)):(r.increment("fetch","failure"),gt.error(i.error)),Xb("remote configuration metrics",{metrics:r.get()}),n}function ase(e,t,n,r){const i={...e};return ise.forEach(v=>{v in t&&(i[v]=o(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),i;function o(v){if(Array.isArray(v))return v.map(o);if(lse(v)){if(cse(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return oF(v.value);case"dynamic":return l(v);default:gt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return q4(v,o)}return v}function a(v,y){y.forEach(({key:x,value:S})=>{v.setContextProperty(x,o(S))})}function l(v){const y=v.strategy;let x;switch(y){case"cookie":x=d(v);break;case"dom":x=f(v);break;case"js":x=h(v);break;default:gt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof x=="string"?use(S,x):x}function d({name:v}){const y=Kb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let x;try{x=document.querySelector(v)}catch{gt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!x){r.increment("dom","missing");return}if(m(x,y)){gt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?x.getAttribute(y):x.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function m(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const x=qae(v);if(x.length===0){gt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of x){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){gt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function sse(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function lse(e){return typeof e=="object"&&e!==null}function cse(e){return"rcSerializedType"in e}function oF(e){try{return new RegExp(e)}catch{gt.error(`Invalid regex in the remote configuration: '${e}'`)}}function use(e,t){const n=oF(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,o]=r;return o||i}async function dse(e){let t;try{t=await fetch(fse(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function fse(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${hL("rum",e)}/${rse}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function pse({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=yae(),a=WL();z_(a,gr.globalContext,o);const l=XL();z_(l,gr.userContext,o);const d=YL();z_(d,gr.accountContext,o);let f,m,h,v;const y=n.observable.subscribe(S),x={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const N=i(v,m,I);o.drain(N)}function C(I,N){const T=Ud();if(T&&(I=mse(I)),h=I,Aoe(Hae(I)),v){CL("DD_RUM",I);return}const A=zae(I,N);if(A){if(!T&&!A.sessionStoreStrategyType){gt.warn("No storage available for session. We will not send any data.");return}A.compressIntakeRequests&&!T&&t&&(m=t(A,"Datadog RUM",en),!m)||(v=A,ZL().subscribe(en),n.tryToInit(A.trackingConsent),S())}}const k=I=>{o.add(N=>N.addDurationVital(I))};return{init(I,N,T){if(!I){gt.error("Missing configuration");return}gie(I.enableExperimentalFeatures),h=I,!(e&&VL())&&(eF(I.plugins,"onInit",{initConfiguration:I,publicApi:N}),I.remoteConfigurationId?ose(I,{user:l,context:a}).then(A=>{A&&C(A,T)}).catch(hl):C(I,T))},get initConfiguration(){return h},getInternalContext:en,stopSession:en,addTiming(I,N=jr()){o.add(T=>T.addTiming(I,N))},startView(I,N=vr()){const T=A=>{A.startView(I,N)};o.add(T),f||(f={options:I,callback:T},S())},setViewName(I){o.add(N=>N.setViewName(I))},setViewContext(I){o.add(N=>N.setViewContext(I))},setViewContextProperty(I,N){o.add(T=>T.setViewContextProperty(I,N))},getViewContext:()=>x,globalContext:a,userContext:l,accountContext:d,addAction(I){o.add(N=>N.addAction(I))},addError(I){o.add(N=>N.addError(I))},addFeatureFlagEvaluation(I,N){o.add(T=>T.addFeatureFlagEvaluation(I,N))},startDurationVital(I,N){return JL(r,I,N)},stopDurationVital(I,N){QL(k,r,I,N)},addDurationVital:k,addOperationStepVital:(I,N,T,A)=>{o.add(D=>D.addOperationStepVital(wn(I),N,wn(T),wn(A)))}}}function mse(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Jm())===null||n===void 0?void 0:n.getPrivacyLevel()}}function z_(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function hse(e,t,n,r={}){const i=Yre(),o=Rae(),a=jae().observable;let l=pse(r,i,o,(h,v,y)=>{const x=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Zoe,S=e(h,t,n,y,x,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,S.longTaskContexts,x),l=gse(l,S),eF(h.plugins,"onRumStart",{strategy:l,addEvent:S.addEvent}),S});const d=()=>l,f=St(h=>{const v=typeof h=="object"?h:{name:h};l.startView(v),hr({feature:"start-view"})}),m=Gie({init:h=>{const v=new Error().stack;dl(()=>l.init(h,m,v))},setTrackingConsent:St(h=>{i.update(h),hr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:St(h=>{l.setViewName(h),hr({feature:"set-view-name"})}),setViewContext:St(h=>{l.setViewContext(h),hr({feature:"set-view-context"})}),setViewContextProperty:St((h,v)=>{l.setViewContextProperty(h,v),hr({feature:"set-view-context-property"})}),getViewContext:St(()=>(hr({feature:"set-view-context-property"}),l.getViewContext())),getInternalContext:St(h=>l.getInternalContext(h)),getInitConfiguration:St(()=>xE(l.initConfiguration)),addAction:(h,v)=>{const y=xm("action");dl(()=>{l.addAction({name:wn(h),context:wn(v),startClocks:vr(),type:kE.CUSTOM,handlingStack:y}),hr({feature:"add-action"})})},addError:(h,v)=>{const y=xm("error");dl(()=>{l.addError({error:h,handlingStack:y,context:wn(v),startClocks:vr()}),hr({feature:"add-error"})})},addTiming:St((h,v)=>{l.addTiming(wn(h),v)}),setGlobalContext:Vr(d,gr.globalContext,Br.setContext,"set-global-context"),getGlobalContext:Vr(d,gr.globalContext,Br.getContext,"get-global-context"),setGlobalContextProperty:Vr(d,gr.globalContext,Br.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Vr(d,gr.globalContext,Br.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Vr(d,gr.globalContext,Br.clearContext,"clear-global-context"),setUser:Vr(d,gr.userContext,Br.setContext,"set-user"),getUser:Vr(d,gr.userContext,Br.getContext,"get-user"),setUserProperty:Vr(d,gr.userContext,Br.setContextProperty,"set-user-property"),removeUserProperty:Vr(d,gr.userContext,Br.removeContextProperty,"remove-user-property"),clearUser:Vr(d,gr.userContext,Br.clearContext,"clear-user"),setAccount:Vr(d,gr.accountContext,Br.setContext,"set-account"),getAccount:Vr(d,gr.accountContext,Br.getContext,"get-account"),setAccountProperty:Vr(d,gr.accountContext,Br.setContextProperty,"set-account-property"),removeAccountProperty:Vr(d,gr.accountContext,Br.removeContextProperty,"remove-account-property"),clearAccount:Vr(d,gr.accountContext,Br.clearContext,"clear-account"),startView:f,stopSession:St(()=>{l.stopSession(),hr({feature:"stop-session"})}),addFeatureFlagEvaluation:St((h,v)=>{l.addFeatureFlagEvaluation(wn(h),wn(v)),hr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:St(()=>t.getSessionReplayLink()),startSessionReplayRecording:St(h=>{t.start(h),hr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:St(()=>t.stop()),addDurationVital:St((h,v)=>{hr({feature:"add-duration-vital"}),l.addDurationVital({name:wn(h),type:Sm.DURATION,startClocks:cre(v.startTime),duration:v.duration,context:wn(v&&v.context),description:wn(v&&v.description)})}),startDurationVital:St((h,v)=>(hr({feature:"start-duration-vital"}),l.startDurationVital(wn(h),{context:wn(v&&v.context),description:wn(v&&v.description)}))),stopDurationVital:St((h,v)=>{hr({feature:"stop-duration-vital"}),l.stopDurationVital(typeof h=="string"?wn(h):h,{context:wn(v&&v.context),description:wn(v&&v.description)})}),startFeatureOperation:St((h,v)=>{hr({feature:"add-operation-step-vital",action_type:"start"}),l.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:St((h,v)=>{hr({feature:"add-operation-step-vital",action_type:"succeed"}),l.addOperationStepVital(h,"end",v)}),failFeatureOperation:St((h,v,y)=>{hr({feature:"add-operation-step-vital",action_type:"fail"}),l.addOperationStepVital(h,"end",y,v)})});return m}function gse(e,t){return{init:n=>{CL("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function vse(){const e=yse();return new Dt(t=>{if(!e)return;const n=new e(St(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function yse(){let e;const t=window;if(t.Zone&&(e=ml(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(en),r=ml(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function bse(){const e=new Dt,{stop:t}=va(window,"open",()=>e.notify());return{observable:e,stop:t}}function xse(e,t,n,r,i){return{get:o=>{const a=n.findView(o),l=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&l){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:l.referrer,url:l.url}}}}}}const wse=Yoe,Sse=Ol;function _se(e){const t=Jc({expireDelay:Sse});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const aF="initial_document",Cse=[[Kr.DOCUMENT,e=>aF===e],[Kr.XHR,e=>e==="xmlhttprequest"],[Kr.FETCH,e=>e==="fetch"],[Kr.BEACON,e=>e==="beacon"],[Kr.CSS,(e,t)=>/\.css$/i.test(t)],[Kr.JS,(e,t)=>/\.js$/i.test(t)],[Kr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Kr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Kr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function kse(e){const t=e.name;if(!yre(t))return Kr.OTHER;const n=bre(t);for(const[r,i]of Cse)if(i(e.initiatorType,n))return r;return Kr.OTHER}function kD(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function sF(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function Ese(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Zn(n,r):t}function jse(e){if(!cF(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:l,connectStart:d,secureConnectionStart:f,connectEnd:m,requestStart:h,responseStart:v,responseEnd:y}=e,x={download:uc(t,v,y),first_byte:uc(t,h,v)};return 0<r&&r<n&&(x.worker=uc(t,r,n)),n<m&&(x.connect=uc(t,d,m),d<=f&&f<=m&&(x.ssl=uc(t,f,m))),n<l&&(x.dns=uc(t,a,l)),t<o&&(x.redirect=uc(t,i,o)),x}function lF(e){return e.duration>=0}function cF(e){const t=kD(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=Ise(e)?kD(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function Ise(e){return e.redirectEnd>e.startTime}function uc(e,t,n){if(e<=t&&t<=n)return{duration:xt(Zn(t,n)),start:xt(Zn(e,t))}}function Rse(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Tse(e){return e.deliveryType===""?"other":e.deliveryType}function Nse(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function EE(e){return e&&(!fie(e)||Xm(gl.TRACK_INTAKE_REQUESTS))}const Ase=/data:(.+)?(;base64)?,/g,Ose=24e3;function $se(e,t=Ose){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Ase);return n?`${n[0]}[...]`:e}const Dse=32*Xc;function Pse(e,t){const n=zse(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Mse(e.responseBody);r&&(n.error_count=r.length,n.errors=r)}return n}}function Mse(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Ic(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function uF(e,t){return t.allowedGraphQlUrls.find(n=>Zb([n.match],e))}function zse(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n)return;let r,i;if(n.query){const l=n.query.trim();r=Lse(l),t&&(i=mE(l,Dse,"..."))}const o=n.operationName;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:o,variables:a,payload:i}}function Lse(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let ED=1;function Fse(e,t,n,r,i){const o=Pae(t,n,r,i);Use(e,t,o),Vse(e,t,o)}function Use(e,t,n){const r=Joe(t).subscribe(i=>{const o=i;if(EE(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=dF(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:Qb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function Vse(e,t,n){const r=ZL({responseBodyAction:i=>{var o;return!((o=uF(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(EE(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=dF(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Zn(a.startClocks.timeStamp,jr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:Qb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function dF(){const e=ED;return ED+=1,e}function fF(e){return Ym(e)&&e<0?void 0:e}function pF({lifeCycle:e,isChildEvent:t,onChange:n=en}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case wt.ERROR:r.errorCount+=1,n();break;case wt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case wt.LONG_TASK:r.longTaskCount+=1,n();break;case wt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Bse(e,t){const n=Xr();let r=!1;const{stop:i}=vl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],l=>{if(!l.cancelable)return;const d={entryType:"first-input",processingStart:qi(),processingEnd:qi(),startTime:l.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};l.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(l,d){vl(l,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(l){if(!r){r=!0,i();const d=l.processingStart-l.startTime;d>=0&&d<Xr()-n&&t(l)}}}var Ut;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(Ut||(Ut={}));function as(e,t){return new Dt(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Kse(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(St(d=>{o?i=Dr(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Ut.RESOURCE,Ut.NAVIGATION,Ut.LONG_TASK,Ut.PAINT].includes(t.type)){t.buffered&&(i=Dr(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Hse(e);let l;return!Qc(Ut.FIRST_INPUT)&&t.type===Ut.FIRST_INPUT&&({stop:l}=Bse(e,d=>{r([d])})),()=>{a.disconnect(),l&&l(),xo(i)}})}let $p;function Hse(e){return!$p&&qse()&&"addEventListener"in performance&&($p=Dn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{$p?.stop()}}function qse(){return window.performance!==void 0&&"getEntries"in performance}function Qc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Kse(e){return e.filter(t=>!Gse(t))}function Gse(e){return e.entryType===Ut.RESOURCE&&(!EE(e.name)||!lF(e))}function _C(e){return e.nodeType===Node.TEXT_NODE}function Zse(e){return e.nodeType===Node.COMMENT_NODE}function ss(e){return e.nodeType===Node.ELEMENT_NODE}function mF(e){return ss(e)&&!!e.shadowRoot}function Yse(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&ss(t.host)}function x2e(e){return e.childNodes.length>0||mF(e)}function w2e(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;mF(e)&&t(e.shadowRoot)}function Wse(e){return Yse(e)?e.host:e.parentNode}const hF=100,Xse=100,jD="data-dd-excluded-activity-mutations";function jE(e,t,n,r,i,o){const a=Qse(e,t,n,r);return Jse(a,i,o)}function Jse(e,t,n){let r,i=!1;const o=Dr(St(()=>f({hadActivity:!1})),hF),a=n!==void 0?Dr(St(()=>f({hadActivity:!0,end:jr()})),n):void 0,l=e.subscribe(({isBusy:m})=>{xo(o),xo(r);const h=jr();m||(r=Dr(St(()=>f({hadActivity:!0,end:h})),Xse))}),d=()=>{i=!0,xo(o),xo(r),xo(a),l.unsubscribe()};function f(m){i||(d(),t(m))}return{stop:d}}function Qse(e,t,n,r){return new Dt(i=>{const o=[];let a,l=0;return o.push(t.subscribe(f=>{f.every(ele)||d()}),n.subscribe(d),as(r,{type:Ut.RESOURCE}).subscribe(f=>{f.some(m=>!L_(r,m.name))&&d()}),e.subscribe(7,f=>{L_(r,f.url)||(a===void 0&&(a=f.requestIndex),l+=1,d())}),e.subscribe(8,f=>{L_(r,f.url)||a===void 0||f.requestIndex<a||(l-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:l>0})}})}function L_(e,t){return Zb(e.excludedActivityUrls,t)}function ele(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&ss(t)&&t.matches(`[${jD}], [${jD}] *`))}const ex="data-dd-action-name",gF="Masked Element",vF=[ex,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],tle=[bF,rle],nle=[bF,ile,ole];function eh(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=ID(r,tle,sle,t,n);if(i)return i;n=ID(r,nle,lle,t,n)||tx(ale(r),n),r=r.parentElement}return n}function yF(e){return/[0-9]/.test(e)}function rle(e){if(e.id&&!yF(e.id))return`#${CSS.escape(e.id)}`}function ile(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!yF(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function ole(e){return CSS.escape(e.tagName)}function bF(e,t){if(t){const r=n(t);if(r)return r}for(const r of vF){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function ale(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function ID(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return tx(a,i)}}function sle(e,t,n){return e.ownerDocument.querySelectorAll(tx(t,n)).length===1}function lle(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=tx(`${t}:scope`,n);r=l=>l.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function tx(e,t){return t?`${e}>${t}`:e}const Et={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:md.ALLOW,MASK:md.MASK,MASK_USER_INPUT:md.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:md.MASK_UNLESS_ALLOWLISTED},xF="data-dd-privacy",S2e="hidden",cle="dd-privacy-",F_="***",_2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",ule={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},dle="x";function pc(e){return`[${xF}="${e}"], .${cle}${e}`}function nx(e,t,n){if(n&&n.has(e))return n.get(e);const r=Wse(e),i=r?nx(r,t,n):t,o=ple(e),a=fle(o,i);return n&&n.set(e,a),a}function fle(e,t){switch(t){case Et.HIDDEN:case Et.IGNORE:return t}switch(e){case Et.ALLOW:case Et.MASK:case Et.MASK_USER_INPUT:case Et.MASK_UNLESS_ALLOWLISTED:case Et.HIDDEN:case Et.IGNORE:return e;default:return t}}function ple(e){if(ss(e)){if(e.tagName==="BASE")return Et.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Et.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Et.MASK}if(e.matches(pc(Et.HIDDEN)))return Et.HIDDEN;if(e.matches(pc(Et.MASK)))return Et.MASK;if(e.matches(pc(Et.MASK_UNLESS_ALLOWLISTED)))return Et.MASK_UNLESS_ALLOWLISTED;if(e.matches(pc(Et.MASK_USER_INPUT)))return Et.MASK_USER_INPUT;if(e.matches(pc(Et.ALLOW)))return Et.ALLOW;if(hle(e))return Et.IGNORE}}function wF(e,t){switch(t){case Et.MASK:case Et.HIDDEN:case Et.IGNORE:return!0;case Et.MASK_UNLESS_ALLOWLISTED:return _C(e)?wv(e.parentNode)?!0:!_F(e.textContent||""):wv(e);case Et.MASK_USER_INPUT:return _C(e)?wv(e.parentNode):wv(e);default:return!1}}function mle(e,t,n,r,i){if(r!==Et.MASK&&r!==Et.MASK_UNLESS_ALLOWLISTED||t===xF||vF.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||n&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function wv(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!ule[t.tagName]}const SF=e=>e.replace(/\S/g,dle);function C2e(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=F_;else if(a===Et.HIDDEN)i=F_;else if(wF(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=F_:a===Et.MASK_UNLESS_ALLOWLISTED?i=CF(i):i=SF(i);return i}function hle(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function _F(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function CF(e,t){return _F(e)?e:t||SF(e)}const kF=zr,gle=100;function vle(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),xo(i),i=Dr(l,kF)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function l(){xo(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!yle(n[n.length-1].event,d.event)?(l(),!1):(o(d),!0),stop:()=>{l()}}}function yle(e,t){return e.target===t.target&&ble(e,t)<=gle&&e.timeStamp-t.timeStamp<=kF}function ble(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function xle(e,t,n=Et.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=RD(e,ex)||i&&RD(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===Et.MASK?{name:gF,nameSource:"mask_placeholder"}:TD(e,wle,t,r)||TD(e,Sle,t,r)||{name:"",nameSource:"blank"}}function RD(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return jF(EF(r.trim()))}const wle=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return sy(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return sy(e,t,n)},(e,t,n)=>Dp(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>Cle(e,i)).filter(i=>!!i).map(i=>IF(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>Dp(e,"alt",t,n),(e,t,n)=>Dp(e,"name",t,n),(e,t,n)=>Dp(e,"title",t,n),(e,t,n)=>Dp(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return sy(e.options[0],t,n)}],Sle=[(e,t,n)=>sy(e,t,n)],_le=10;function TD(e,t,n,r){let i=e,o=0;for(;o<=_le&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const l=a(i,n,r);if(l){const{name:d,nameSource:f}=l,m=d&&d.trim();if(m)return{name:jF(EF(m)),nameSource:f}}}if(i.nodeName==="FORM")break;i=i.parentElement,o+=1}}function EF(e){return e.replace(/\s+/g," ")}function jF(e){return e.length>100?`${mE(e,100)} [...]`:e}function Cle(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Dp(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const l=nx(e,o,r);mle(e.tagName,t,a,l,n)&&(a=CF(a,gF))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function sy(e,t,n){return{name:IF(e,t,n)||"",nameSource:"text_content"}}function IF(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Xm(gl.USE_TREE_WALKER_FOR_ACTION_NAME))return kle(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const l=d=>{const f=e.querySelectorAll(d);for(let m=0;m<f.length;m+=1){const h=f[m];if("innerText"in h){const v=h.innerText;v&&v.trim().length>0&&(a=a.replace(v,""))}}};return l(`[${ex}]`),i&&l(`[${i}]`),r&&l(`${pc(Et.HIDDEN)}, ${pc(Et.MASK)}`),a}return e.textContent}function kle(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,l);let a="";for(;o.nextNode();){const d=o.currentNode;if(ss(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function l(d){const f=nx(d,r,i);if(n&&f&&wF(d,f))return NodeFilter.FILTER_REJECT;if(ss(d)){if(d.hasAttribute(ex)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const m=getComputedStyle(d);if(m.visibility!=="visible"||m.display==="none"||m.contentVisibility&&m.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Ele(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Dn(e,window,"pointerdown",l=>{AD(l)&&(r=ND(),i={selection:!1,input:!1,scroll:!1},o=t(l))},{capture:!0}),Dn(e,window,"selectionchange",()=>{(!r||!ND())&&(i.selection=!0)},{capture:!0}),Dn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Dn(e,window,"pointerup",l=>{if(AD(l)&&o){const d=i;n(o,l,()=>d),o=void 0}},{capture:!0}),Dn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(l=>l.stop())}}}function ND(){const e=window.getSelection();return!e||e.isCollapsed}function AD(e){return e.target instanceof Element&&e.isPrimary!==!1}const OD=3;function jle(e,t){if(Ile(e))return t.addFrustration(Op.RAGE_CLICK),e.some($D)&&t.addFrustration(Op.DEAD_CLICK),t.hasError&&t.addFrustration(Op.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(Op.ERROR_CLICK),$D(r)&&!n&&r.addFrustration(Op.DEAD_CLICK)}),{isRage:!1}}function Ile(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(OD-1);t+=1)if(e[t+OD-1].event.timeStamp-e[t].event.timeStamp<=zr)return!0;return!1}const Rle='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function $D(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(Rle)}const RF=10*zr,am=new Map;function Tle(e){const t=am.get(e);return am.delete(e),t}function TF(e,t){am.set(e,t),am.forEach((n,r)=>{Zn(r,qi())>RF&&am.delete(r)})}const Nle=5*ei;function Ale(e,t,n,r){const i=Jc({expireDelay:Nle}),o=new Dt;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,m),e.subscribe(11,h=>{h.reason===_d.UNLOADING&&m()});const{stop:l}=Ele(r,{onPointerDown:h=>Ole(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,x)=>{$le(r,e,t,n,i,o,f,h,y,x,v)}});return{stop:()=>{m(),o.notify(),l()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=vle(h,y=>{Ple(y,v),a=void 0})}}function m(){a&&a.stop()}}function Ole(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=nx(r.target,e.defaultPrivacyLevel):o=Et.ALLOW,o===Et.HIDDEN)return;const a=Dle(r,o,e);let l=!1;return jE(t,n,i,e,d=>{l=d.hadActivity},hF),{clickActionBase:a,hadActivityOnPointerDown:()=>l}}function $le(e,t,n,r,i,o,a,l,d,f,m){var h;const v=NF(t,i,f,l,d);a(v);const y=(h=l?.target)===null||h===void 0?void 0:h.selector;y&&TF(d.timeStamp,y);const{stop:x}=jE(t,n,r,e,k=>{k.hadActivity&&k.end<v.startClocks.timeStamp?v.discard():k.hadActivity?v.stop(k.end):m()?v.stop(v.startClocks.timeStamp):v.stop()},RF),S=t.subscribe(5,({endClocks:k})=>{v.stop(k.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function Dle(e,t,n){const r=e.target.getBoundingClientRect(),i=eh(e.target,n.actionNameAttribute);i&&TF(e.timeStamp,i);const{name:o,nameSource:a}=xle(e.target,n,t);return{type:kE.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function NF(e,t,n,r,i){const o=Qr(),a=Vb(i.timeStamp),l=t.add(o,a.relative),d=pF({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(o):x.action.id===o)});let f=0,m;const h=[],v=new Dt;function y(x){f===0&&(m=x,f=1,m?l.close(pE(m)):l.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return m!==void 0},getUserActivity:n,addFrustration:x=>{h.push(x)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>NF(e,t,n,r,i),validate:x=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:k}=d.eventCounts,E={duration:m&&Zn(a.timeStamp,m),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:k},events:x??[i],event:i,...r};e.notify(0,E),f=2},discard:()=>{y(),f=2}}}function Ple(e,t){const{isRage:n}=jle(e,t);n?(e.forEach(r=>r.discard()),t.stop(jr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}const Mle=1;function zle(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,DD(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==wt.ERROR&&f!==wt.RESOURCE&&f!==wt.LONG_TASK)return Ki;const m=f===wt.LONG_TASK?Al(d,Mle):d,h=a.findActionId(m);return h?{type:f,action:{id:h}}:Ki}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:en},l=en;return i.trackUserInteractions&&({actionContexts:a,stop:l}=Ale(e,n,r,i)),{addAction:d=>{e.notify(12,DD(d))},actionContexts:a,stop:()=>{o(),l()}}}function DD(e){const t=U_(e)?{action:{id:e.id,loading_time:fF(xt(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=os({action:{id:Qr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:wt.ACTION},t),r=U_(e)?e.duration:void 0,i=U_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function U_(e){return e.type!==kE.CUSTOM}function Lle(e){const t=pae([zb.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Fle(e,t){const n=Yie(e,[wm.cspViolation,wm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Ule(e,t,n){const r=new Dt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Lle(r),Fle(t,r),r.subscribe(i=>e.notify(14,{error:i})),Vle(e)}function Vle(e){return e.subscribe(14,({error:t})=>{e.notify(12,Ble(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=bE({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:mf.CUSTOM,handling:"handled"});a.context=os(a.context,o),e.notify(14,{error:a})}}}function Ble(e){const t={date:e.startClocks.timeStamp,error:{id:Qr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:wt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const PD=new WeakSet;function Hle(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!PD.has(r)).filter(r=>lF(r)&&cF(r)).filter(r=>qle(r,e.startClocks.relative,AF({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return PD.add(n[0]),n[0].toJSON()}function AF(e){return Al(e.startTime,e.duration)}function qle(e,t,n){return e.startTime>=t-1&&AF(e)<=Al(n,1)}const Kle=2*ei;function Gle(e){const t=Zle(e)||Yle(e);if(!(!t||t.traceTime<=Xr()-Kle))return t.traceId}function Zle(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return OF(t&&t.content,n&&n.content)}function Yle(e){const t=Wle(e);if(t)return OF(ym(t,"trace-id"),ym(t,"trace-time"))}function OF(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function Wle(e){for(let t=0;t<e.childNodes.length;t+=1){const n=MD(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=MD(n);if(r)return r;if(!_C(n))break}}function MD(e){if(e&&Zse(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function $F(){if(Qc(Ut.NAVIGATION)){const n=performance.getEntriesByType(Ut.NAVIGATION)[0];if(n)return n}const e=Xle(),t={entryType:Ut.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function Xle(){const e={},t=performance.timing;for(const n in t)if(Ym(t[n])){const r=n,i=t[r];e[r]=i===0?0:pE(i)}return e}function Jle(e,t,n=$F){SE(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Ut.RESOURCE,initiatorType:aF,duration:r.responseEnd,traceId:Gle(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const Qle=1e3;function ece(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>Qle&&(Qm("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const l=r.startTime-a.startClocks.relative;0<=l&&l<i&&a.url===r.name&&(i=Math.abs(l),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function tce(e,t,n,r=fae(),i=Jle){let o;const a=t.trackEarlyRequests;a?o=ece(e):e.subscribe(8,f=>{d(()=>nce(f,t,n))});const l=as(t,{type:Ut.RESOURCE,buffered:!0}).subscribe(f=>{for(const m of f)(a||!sF(m))&&d(()=>zD(m,t,n,o))});i(t,f=>{d(()=>zD(f,t,n,o))});function d(f){r.push(()=>{const m=f();m&&e.notify(12,m)})}return{stop:()=>{r.stop(),l.unsubscribe()}}}function nce(e,t,n){const r=Hle(e);return DF(r,e,n,t)}function zD(e,t,n,r){const i=sF(e)&&r?r.getMatchingRequest(e):void 0;return DF(e,i,n,t)}function DF(e,t,n,r){if(!e&&!t)return;const i=t?ace(t,r):sce(e,r);if(!r.trackResources&&!i)return;const o=e?Vb(e.startTime):t.startClocks,a=e?Ese(e):lce(n,o,t.duration),l=t&&rce(t,r),d=os({date:o.timeStamp,resource:{id:Qr(),duration:xt(a),type:t?t.type===Qb.XHR?Kr.XHR:Kr.FETCH:kse(e),method:t?t.method:void 0,status_code:t?t.status:cce(e.responseStatus),url:t?$se(t.url):e.name,protocol:e&&Rse(e),delivery_type:e&&Tse(e),graphql:l},type:wt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&oce(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:ice(e,t)}}function rce(e,t){const n=uF(e.url,t);if(n)return Pse(e,n)}function ice(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Qb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function oce(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Nse(e),...jse(e)}}}function ace(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function sce(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:nF().toString(),rule_psr:t.rulePsr}}}function lce(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function cce(e){return e===0?void 0:e}function uce(e,t,n){const{stop:r,eventCounts:i}=pF({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const dce=10*ei;function fce(e,t,n){return{stop:as(e,{type:Ut.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<dce);o&&n(o.startTime)}).unsubscribe}}function pce(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Zn(e,qi()))})})}function mce(e,t,n){const r=as(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Zn(o.startTime,o.processingStart);let l;o.target&&ss(o.target)&&(l=eh(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:l})}});return{stop:()=>{r.unsubscribe()}}}function hce(e,t,n=$F){return yce(e,()=>{const r=n();vce(r)||t(gce(r))})}function gce(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=qi()?e.responseStart:void 0}}function vce(e){return e.loadEventEnd<=0}function yce(e,t){let n;const{stop:r}=SE(e,"complete",()=>{n=Dr(()=>t())});return{stop:()=>{r(),xo(n)}}}const bce=10*ei;function xce(e,t,n,r){let i=1/0;const{stop:o}=vl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const l=as(e,{type:Ut.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=tL(d,m=>m.entryType===Ut.LARGEST_CONTENTFUL_PAINT&&m.startTime<i&&m.startTime<t.timeStamp&&m.startTime<bce&&m.size>a);if(f){let m;f.element&&(m=eh(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:m,resourceUrl:wce(f)}),a=f.size}});return{stop:()=>{o(),l.unsubscribe()}}}function wce(e){return e.url===""?void 0:e.url}function PF(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:en};if(Qc(Ut.VISIBILITY_STATE)){const o=performance.getEntriesByType(Ut.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:en}}let r=1/0;const{stop:i}=vl(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function Sce(e,t,n,r){const i={},{stop:o}=hce(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=PF(e,t),{stop:l}=fce(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=xce(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=mce(e,a,h=>{i.firstInput=h,r()});function m(){o(),l(),d(),f(),a.stop()}return{stop:m,initialViewMetrics:i}}const CC=(e,t)=>e*t,_ce=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return n>=i||r>=o?0:CC(i-n,o-r)},LD=e=>{const t=CC(e.previousRect.width,e.previousRect.height),n=CC(e.currentRect.width,e.currentRect.height),r=_ce(e.previousRect,e.currentRect);return t+n-r};function Cce(e,t,n){if(!Rce())return{stop:en};let r=0,i;n({value:0});const o=Ice(),a=as(e,{type:Ut.LAYOUT_SHIFT,buffered:!0}).subscribe(l=>{var d;for(const f of l){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:m,isMaxValue:h}=o.update(f);if(h){const v=kce(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Zn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(m>r){r=m;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:pd(r,4),targetSelector:v&&eh(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?FD(i.previousRect):void 0,currentRect:i?.currentRect?FD(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function kce(e){let t;for(const n of e)if(n.node&&ss(n.node)){const r=LD(n);(!t||LD(t)<r)&&(t=n)}return t}function FD({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const Ece=5*zr,jce=zr;function Ice(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=jce||i.startTime-t>=Ece;let a;return o?(t=n=i.startTime,r=e=i.value,a=!0):(e+=i.value,n=i.startTime,a=i.value>r,a&&(r=i.value)),{cumulatedValue:e,isMaxValue:a}}}}function Rce(){return Qc(Ut.LAYOUT_SHIFT)&&"WeakRef"in window}let ly,MF=0,V_=1/0,B_=0;function Tce(){"interactionCount"in performance||ly||(ly=new window.PerformanceObserver(St(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(V_=Math.min(V_,n.interactionId),B_=Math.max(B_,n.interactionId),MF=(B_-V_)/7+1)})})),ly.observe({type:"event",buffered:!0,durationThreshold:0}))}const UD=()=>ly?MF:window.performance.interactionCount||0,VD=10,Nce=1*ei;function Ace(e,t,n){if(!Dce())return{getInteractionToNextPaint:()=>{},setViewEnd:en,stop:en};const{getViewInteractionCount:r,stopViewInteractionCount:i}=$ce(n);let o=1/0;const a=Oce(r);let l=-1,d,f;function m(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const x=a.estimateP98Interaction();x&&x.duration!==l&&(l=x.duration,f=Zn(t,x.startTime),d=Tle(x.startTime),!d&&x.target&&ss(x.target)&&(d=eh(x.target,e.actionNameAttribute)))}const h=as(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(m),v=as(e,{type:Ut.EVENT,durationThreshold:40,buffered:!0}).subscribe(m);return{getInteractionToNextPaint:()=>{if(l>=0)return{value:Math.min(l,Nce),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Oce(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(VD)}return{process(r){const i=t.findIndex(a=>r.interactionId===a.interactionId),o=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<VD||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function $ce(e){Tce();const t=e===Qa.INITIAL_LOAD?0:UD();let n={stopped:!1};function r(){return UD()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Dce(){return Qc(Ut.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Pce(e,t,n,r,i,o,a){let l=i===Qa.INITIAL_LOAD,d=!0;const f=[],m=PF(r,o);function h(){if(!d&&!l&&f.length>0){const y=Math.max(...f);y<m.timeStamp-o.relative&&a(y)}}const{stop:v}=jE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Zn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),m.stop()},setLoadEvent:y=>{l&&(l=!1,f.push(y),h())}}}function k2e(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Mce(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let H_;function zce(e){return H_||(H_=Lce(e)),H_}function Lce(e){return new Dt(t=>{const{throttled:n}=Bb(()=>{t.notify(IE())},200);return Dn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function IE(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const Fce=zr;function Uce(e,t,n,r=Bce(e)){let i=0,o=0,a=0;const l=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:m})=>{let h=!1;if(d>i&&(i=d,h=!0),m>o){o=m;const v=qi();a=Zn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>l.unsubscribe()}}function Vce(){const e=Mce(),{height:t}=IE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function Bce(e,t=Fce){return new Dt(n=>{function r(){n.notify(Vce())}if(window.ResizeObserver){const i=Bb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(St(i.throttled));o&&a.observe(o);const l=Dn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),l.stop()}}})}function Hce(e,t,n,r,i,o,a){const l={},{stop:d,setLoadEvent:f}=Pce(e,t,n,r,o,a,S=>{l.loadingTime=S,i()}),{stop:m}=Uce(r,a,S=>{l.scroll=S}),{stop:h}=Cce(r,a.relative,S=>{l.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:x}=Ace(r,a.relative,o);return{stop:()=>{d(),h(),m()},stopINPTracking:v,setLoadEvent:f,setViewEnd:x,getCommonViewMetrics:()=>(l.interactionToNextPaint=y(),l)}}function qce(e,t){const{stop:n}=Dn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Kce(e,t,n){pce(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Gce=3e3,Zce=5*ei,Yce=5*ei;function Wce(e,t,n,r,i,o,a,l){const d=new Set;let f=v(Qa.INITIAL_LOAD,X4(),l),m;y();let h;a&&(h=x(o),i.trackBfcacheViews&&(m=qce(i,S=>{f.end();const C=Vb(S.timeStamp);f=v(Qa.BF_CACHE,C,void 0)})));function v(S,C,k){const E=Xce(t,n,r,i,e,S,C,k);return d.add(E),E.stopObservable.subscribe(()=>{d.delete(E)}),E}function y(){t.subscribe(10,()=>{f=v(Qa.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function x(S){return S.subscribe(({oldLocation:C,newLocation:k})=>{Qce(C,k)&&(f.end(),f=v(Qa.ROUTE_CHANGE))})}return{addTiming:(S,C=jr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Qa.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),m&&m(),f.end(),d.forEach(S=>S.stop())}}}function Xce(e,t,n,r,i,o,a=vr(),l){const d=Qr(),f=new Dt,m={};let h=0,v;const y=vm(i),x=Jb();let S=!0,C=l?.name;const k=l?.service||r.service,E=l?.version||r.version,j=l?.context;j&&x.setContext(j);const I={id:d,name:C,startClocks:a,service:k,version:E,context:j};e.notify(1,I),e.notify(2,I);const{throttled:N,cancel:T}=Bb($,Gce,{leading:!1}),{setLoadEvent:A,setViewEnd:D,stop:F,stopINPTracking:q,getCommonViewMetrics:ee}=Hce(e,t,n,r,ne,o,a),{stop:G,initialViewMetrics:K}=o===Qa.INITIAL_LOAD?Sce(r,a,A,ne):{stop:en,initialViewMetrics:{}};o===Qa.BF_CACHE&&Kce(a,K,ne);const{stop:V,eventCounts:H}=uce(e,d,ne),z=pf($,Zce),W=e.subscribe(11,P=>{P.reason===_d.UNLOADING&&$()});$(),x.changeObservable.subscribe(ne);function L(){e.notify(3,{id:d,name:C,context:x.getContext(),startClocks:a,sessionIsActive:S})}function ne(){L(),N()}function $(){T(),L(),h+=1;const P=v===void 0?jr():v.timeStamp;e.notify(4,{customTimings:m,documentVersion:h,id:d,name:C,service:k,version:E,context:x.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:ee(),initialViewMetrics:K,duration:Zn(a.timeStamp,P),isActive:v===void 0,sessionIsActive:S,eventCounts:H})}return{get name(){return C},service:k,version:E,contextManager:x,stopObservable:f,end(P={}){var U,O;v||(v=(U=P.endClocks)!==null&&U!==void 0?U:vr(),S=(O=P.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Ub(z),D(v.relative),F(),W.unsubscribe(),$(),Dr(()=>{this.stop()},Yce))},stop(){G(),V(),q(),f.notify()},addTiming(P,U){if(v)return;const O=pre(U)?U:Zn(a.timeStamp,U);m[Jce(P)]=O,ne()},setViewName(P){C=P,$()}}}function Jce(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&gt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Qce(e,t){return e.pathname!==t.pathname||!eue(t.hash)&&BD(t.hash)!==BD(e.hash)}function eue(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function BD(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function tue(e,t,n,r,i,o,a,l,d,f){return e.subscribe(4,m=>e.notify(12,nue(m,n,l))),t.register(0,({startTime:m,eventType:h})=>{const v=d.findView(m);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:yl}),t.register(1,({startTime:m})=>{var h;return{view:{id:(h=d.findView(m))===null||h===void 0?void 0:h.id}}}),Wce(r,e,i,o,n,a,!n.trackViewsManually,f)}function nue(e,t,n){var r,i,o,a,l,d,f,m,h,v,y,x,S,C,k,E,j,I;const N=n.getReplayStats(e.id),T=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,A={_dd:{document_version:e.documentVersion,replay_stats:N,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:wt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:xt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.targetSelector,first_byte:xt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:xt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:xt((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domContentLoaded),dom_interactive:xt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:xt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:xt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:xt((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:xt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:xt((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(k=e.commonViewMetrics.interactionToNextPaint)===null||k===void 0?void 0:k.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:xt((E=e.initialViewMetrics.largestContentfulPaint)===null||E===void 0?void 0:E.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:xt((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:fF(xt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:rue(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:xt(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:xt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:Iae()}};return Nl(e.customTimings)||(A.view.custom_timings=q4(e.customTimings,xt)),{rawRumEvent:A,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function rue({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:xt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:xt(n)},fid:r&&{duration:xt(r.delay),timestamp:xt(r.time),target_selector:r.targetSelector},inp:t&&{duration:xt(t.value),timestamp:xt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:xt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const iue="rum";function oue(e,t,n){const r=Voe(e,iue,i=>sue(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:o})=>{if(!i.forcedReplay&&o.forcedReplay){const a=r.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:i=>{const o=r.findSession(i);if(!(!o||o.trackingType==="0"))return{id:o.id,sessionReplay:o.trackingType==="1"?1:o.isReplayForced?2:0,anonymousId:o.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function aue(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:zL("records")?1:0};return{findTrackedSession:()=>e,expire:en,expireObservable:new Dt,setForcedReplay:en}}function sue(e,t){return lue(t)?t:yc(e.sessionSampleRate)?yc(e.sessionReplaySampleRate)?"1":"2":"0"}function lue(e){return e==="0"||e==="1"||e==="2"}function cue(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const l=LL({encoder:o(2),request:ML(a,n),flushController:FL({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===wt.VIEW?l.upsert(d,d.view.id):l.add(d)}),l}function uue(e){const t=Jm();e.subscribe(13,n=>{t.send("rum",n)})}const due=Ol;function fue(e,t,n,r){const i=Jc({expireDelay:due});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(l({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const m=qi();i.closeActive(m),i.add(l({url:d.href,referrer:f.referrer}),m)}});function l({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const m=i.find(d);return m?{type:f,view:{url:m.url,referrer:m.referrer}}:yl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function pue(e,t){let n=vm(t);return new Dt(r=>{const{stop:i}=mue(e,a),{stop:o}=hue(e,a);function a(){if(n.href===t.href)return;const l=vm(t);r.notify({newLocation:l,oldLocation:n}),n=l}return()=>{i(),o()}})}function mue(e,t){const{stop:n}=va(HD("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=va(HD("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Dn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function hue(e,t){return Dn(e,window,"hashchange",t)}function HD(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const gue=Ol;function vue(e,t,n){const r=Jc({expireDelay:gue});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([wt.VIEW,wt.ERROR]).includes(o))return Ki;const l=r.find(i);return!l||Nl(l)?Ki:{type:o,feature_flags:l}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const yue=10*zr;let Cd,Sv;function bue(e,t,n){e.metricsEnabled&&(zF(),Sv=!1,t.subscribe(13,()=>{Sv=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Sv&&(Sv=!1,Cd.batchCount+=1,KD(Cd.batchBytesCount,r),KD(Cd.batchMessagesCount,i))}),pf(xue,yue))}function xue(){Cd.batchCount!==0&&(Xb("Customer data measures",Cd),zF())}function qD(){return{min:1/0,max:0,sum:0}}function KD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function zF(){Cd={batchCount:0,batchBytesCount:qD(),batchMessagesCount:qD()}}const wue=4e3,Sue=500,_ue=Ol;function Cue(e,t,n=Sue){const r=Jc({expireDelay:_ue,maxEntries:wue});let i;Qc(Ut.VISIBILITY_STATE)&&performance.getEntriesByType(Ut.VISIBILITY_STATE).forEach(f=>{const m=f.name==="hidden"?"hidden":"active";a(m,f.startTime)}),a(LF(),qi());const{stop:o}=vl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(Eue(d),d.timeStamp)},{capture:!0});function a(d,f=qi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function l(d,f,m){return r.findAll(f,m).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:m})=>{if(m===wt.VIEW){const h=r.findAll(d,f);return{type:m,_dd:{page_states:kue(h,d,n)}}}return m===wt.ACTION||m===wt.ERROR?{type:m,view:{in_foreground:l("active",d,0)}}:Ki}),{wasInPageStateDuringPeriod:l,addPageState:a,stop:()=>{o(),r.stop()}}}function kue(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:xt(Zn(t,i))}))}function Eue(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":LF()}function LF(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function jue(e,t){let n;const r=requestAnimationFrame(St(()=>{n=IE()})),i=zce(t).subscribe(o=>{n=o}).unsubscribe;return e.register(0,({eventType:o})=>({type:o,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function Iue(e,t){const n=window.cookieStore?Rue(e):Nue;return new Dt(r=>n(t,i=>r.notify(i)))}function Rue(e){return(t,n)=>Dn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Tue=zr;function Nue(e,t){const n=ym(document.cookie,e),r=pf(()=>{const i=ym(document.cookie,e);i!==n&&t(i)},Tue);return()=>{Ub(r)}}const GD="datadog-ci-visibility-test-execution-id";function Aue(e,t,n=Iue(e,GD)){var r;let i=tl(GD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Ki:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}const Oue=Ol;function $ue(e,t){const n=Jc({expireDelay:Oue}),r=Qc(Ut.LONG_ANIMATION_FRAME)?Ut.LONG_ANIMATION_FRAME:Ut.LONG_TASK,i=as(t,{type:r,buffered:!0}).subscribe(a=>{for(const l of a){if(!t.trackLongTasks)break;const d=Vb(l.startTime),f=Qr(),m=Due(l,d,f);e.notify(12,{rawRumEvent:m,startTime:d.relative,duration:l.duration,domainContext:{performanceEntry:l}}),n.add({id:f,startClocks:d,duration:l.duration,entryType:r},d.relative),n.closeActive(Al(d.relative,l.duration))}});return{stop:()=>{i.unsubscribe(),n.stop()},longTaskContexts:{findLongTasks:(a,l)=>n.findAll(a,l)}}}function Due(e,t,n){const r={date:t.timeStamp,type:wt.LONG_TASK,_dd:{discarded:!1}};return e.entryType===Ut.LONG_TASK?{...r,long_task:{id:n,entry_type:xD.LONG_TASK,duration:xt(e.duration)}}:{...r,long_task:{id:n,entry_type:xD.LONG_ANIMATION_FRAME,duration:xt(e.duration),blocking_duration:xt(e.blockingDuration),first_ui_event_timestamp:xt(e.firstUIEventTimestamp),render_start:xt(e.renderStart),style_and_layout_start:xt(e.styleAndLayoutStart),start_time:xt(e.startTime),scripts:e.scripts.map(i=>({duration:xt(i.duration),pause_duration:xt(i.pauseDuration),forced_style_and_layout_duration:xt(i.forcedStyleAndLayoutDuration),start_time:xt(i.startTime),execution_start:xt(i.executionStart),source_url:i.sourceURL,source_function_name:i.sourceFunctionName,source_char_position:i.sourceCharPosition,invoker:i.invoker,invoker_type:i.invokerType,window_attribution:i.windowAttribution}))}}}function Pue(e){e.register(0,({eventType:t})=>{if(!qL())return Ki;const n=BL(),r=HL();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:VL()}}})}function Mue(e,t,n){const r=xE(e),i=n(r);return gE(t).forEach(([o,a])=>kC(e,r,o.split(/\.|(?=\[\])/),a)),i}function kC(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,l)=>kC(a,t[l],o,r));return}if(!(!ZD(e)||!ZD(t))){if(o.length>0)return kC(e[i],t[i],o,r);zue(e,i,t[i],r)}}function zue(e,t,n,r){const i=Wc(n);i===r?e[t]=wn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function ZD(e){return Wc(e)==="object"}const Qu={"view.name":"string","view.url":"string","view.referrer":"string"},ed={context:"object"},td={service:"string",version:"string"};let FF;function Lue(e,t,n,r,i){FF={[wt.VIEW]:{"view.performance.lcp.resource_url":"string",...ed,...Qu,...td},[wt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...ed,...Qu,...td},[wt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...ed,...Qu,...td},[wt.ACTION]:{"action.target.name":"string",...ed,...Qu,...td},[wt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...ed,...Qu,...td},[wt.VITAL]:{...ed,...Qu,...td}};const o={[wt.ERROR]:O_(wt.ERROR,r,i),[wt.ACTION]:O_(wt.ACTION,r,i),[wt.VITAL]:O_(wt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:l,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:a,duration:l});if(m===yl)return;const h=os(m,d,{ddtags:jL(e).join(",")});Fue(h,e.beforeSend,f,o)&&(Nl(h.context)&&delete h.context,t.notify(13,h))})}function Fue(e,t,n,r){var i;if(t){const a=Mue(e,FF[e.type],l=>t(l,n));if(a===!1&&e.type!==wt.VIEW)return!1;a===!1&&gt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Uue(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),l=r.findView(o);if(!a||!l)return yl;let d,f,m;return i===wt.VIEW?(d=n.getReplayStats(l.id)?!0:void 0,f=a.sessionReplay===1,m=l.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:m}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Ki})}function Vue(e){e.register(0,({eventType:t})=>({type:t,connectivity:RL()}))}function Bue(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:dre(),configuration:{session_sample_rate:pd(t.sessionSampleRate,3),session_replay_sample_rate:pd(t.sessionReplaySampleRate,3),profiling_sample_rate:pd(t.profilingSampleRate,3),trace_sample_rate:pd(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:Ud()?"6.25.2":void 0,sdk_name:n},application:{id:t.applicationId},date:jr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function Hue(e,t){e.register(1,()=>t.isGranted()?Ki:yl)}const que=Soe,Kue=[wt.ACTION,wt.ERROR,wt.LONG_TASK,wt.RESOURCE,wt.VITAL];function Gue(e){return{addEvent:(t,n,r,i)=>{Kue.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Zue(e,t){if(!t.metricsEnabled)return{stop:en};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Xb("Initial view metrics",{metrics:Yue(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Yue(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Wue(e,t,n,r,i,o,a,l,d){const f=[],m=new wse,h=que();m.subscribe(13,I=>IL("rum",I));const v=I=>{m.notify(14,{error:I}),Qm("Error reported to customer",{"error.message":I.message})},y=yoe(e),x=y.subscribe(I=>{m.notify(11,I)});f.push(()=>x.unsubscribe());const S=joe("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=Ud()?aue():oue(e,m,o);if(Ud())uue(m);else{const I=cue(e,m,v,y,C.expireObservable,i);f.push(()=>I.stop()),bue(S,m,I.flushController.flushObservable)}Hue(h,o);const{stop:k}=Zue(m,S);f.push(k);const{stop:E,...j}=Xue(m,h,e,C,t,r,a,l,d,v);return f.push(E),l.unbuffer(),f.push(()=>n.stop()),{...j,lifeCycle:m,session:C,stopSession:()=>C.expire(),telemetry:S,stop:()=>{f.forEach(I=>I())},hooks:h}}function Xue(e,t,n,r,i,o,a,l,d,f){const m=[],h=vse(),v=pue(n,location),{observable:y,stop:x}=bse();m.push(x),Bue(t,n,d);const S=Cue(t,n);m.push(()=>S.stop());const C=_se(e);m.push(()=>C.stop());const k=fue(e,t,v,location);m.push(()=>k.stop());const E=vue(e,t,n);Uue(t,r,i,C),Vue(t);const j=Cae(t,n,"rum"),I=kae(t,n,r,"rum"),N=_ae(t,n,"rum"),T=zle(e,t,h,y,n);m.push(T.stop);const A=Gue(e),D=jue(t,n);m.push(D.stop);const F=Aue(n,t);m.push(F.stop),Pue(t),Lue(n,e,t,f);const{addTiming:q,startView:ee,setViewName:G,setViewContext:K,setViewContextProperty:V,getViewContext:H,stop:z}=tue(e,t,n,location,h,y,v,i,C,o);m.push(z);const{stop:W}=tce(e,n,S);m.push(W);const{stop:L,longTaskContexts:ne}=$ue(e,n);m.push(L);const{addError:$}=Ule(e,n,l);Fse(e,n,r,I,N);const P=Tae(e,S,a),U=xse(n.applicationId,r,C,T.actionContexts,k);return{addAction:T.addAction,addEvent:A.addEvent,addError:$,addTiming:q,addFeatureFlagEvaluation:E.addFeatureFlagEvaluation,startView:ee,setViewContext:K,setViewContextProperty:V,getViewContext:H,setViewName:G,viewHistory:C,getInternalContext:U.get,startDurationVital:P.startDurationVital,stopDurationVital:P.stopDurationVital,addDurationVital:P.addDurationVital,addOperationStepVital:P.addOperationStepVital,globalContext:j,userContext:I,accountContext:N,longTaskContexts:ne,stop:()=>m.forEach(O=>O())}}function Jue(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",o=[];r!==void 0&&o.push(`error-type=${r}`),n&&(o.push(`seed=${n.id}`),o.push(`from=${n.startClocks.timeStamp}`));const a=Que(e),l=`/rum/replay/sessions/${i}`;return`${a}${l}?${o.join("&")}`}function Que(e){const t=e.site,n=e.subdomain||ede(e);return`https://${n?`${n}.`:""}${t}`}function ede(e){switch(e.site){case bc:case nie:return"app";case mL:return"dd";default:return}}const tde=1e3;let yo;function E2e(e){return rx(e).segments_count}function j2e(e){rx(e).segments_count+=1}function I2e(e){rx(e).records_count+=1}function R2e(e,t){rx(e).segments_total_raw_size+=t}function nde(e){return yo?.get(e)}function rx(e){yo||(yo=new Map);let t;return yo.has(e)?t=yo.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},yo.set(e,t),yo.size>tde&&rde()),t}function rde(){if(!yo)return;const e=yo.keys().next().value;e&&yo.delete(e)}function UF(e,t,n){let r=0,i=[],o,a=!0,l=0;const d=[],{stop:f}=Dn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function m(){const v=i.length===0?new Uint8Array(0):wL(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:l,data:v,streamId:n}),d.push({id:l,writeCallback:y,data:v}),a=!1,l+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(m())):v(m())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...m(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function RE({configuredUrl:e,error:t,source:n,scriptType:r}){if(gt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&ide(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",gt.error(`${i} See documentation at ${Lb}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&wE(t)}function ide(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const ode=30*zr;function VF(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.25.2"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let Gn={status:0};function BF(e,t,n,r=VF){switch(Gn.status===0&&ade(e,t,r),Gn.status){case 1:return Gn.initializationFailureCallbacks.push(n),Gn.worker;case 3:return Gn.worker}}function YD(){return Gn.status}function ade(e,t,n=VF){try{const r=n(e),{stop:i}=Dn(e,r,"error",l=>{q_(e,t,l)}),{stop:o}=Dn(e,r,"message",({data:l})=>{l.type==="errored"?q_(e,t,l.error,l.streamId):l.type==="initialized"&&lde(l.version)});r.postMessage({action:"init"}),Dr(()=>sde(t),ode),Gn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){q_(e,t,r)}}function sde(e){Gn.status===1&&(gt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Gn.initializationFailureCallbacks.forEach(t=>t()),Gn={status:2})}function lde(e){Gn.status===1&&(Gn={status:3,worker:Gn.worker,stop:Gn.stop,version:e})}function q_(e,t,n,r){Gn.status===1||Gn.status===0?(RE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Gn.status===1&&Gn.initializationFailureCallbacks.forEach(i=>i()),Gn={status:2}):wE(n,{worker_version:Gn.status===3&&Gn.version,stream_id:r})}function HF(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function cde(e,t,n,r){const i=t.findTrackedSession(),o=ude(i,r),a=n.findView();return Jue(e,{viewContext:a,errorType:o,session:i})}function ude(e,t){if(!HF())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function dde(e,t){if(!e.metricsEnabled)return{stop:en};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:jr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Zn(n.timestamp,jr()));break;case"recorder-settled":n&&(i=Zn(n.timestamp,jr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&Xb("Recorder init metrics",{metrics:fde(n.forced,i,Zn(n.timestamp,jr()),a.type,r)});break}});return{stop:o}}function fde(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function pde(e,t,n,r,i,o,a){let l=0,d;t.subscribe(9,()=>{(l===2||l===3)&&(v(),l=1)}),t.subscribe(10,()=>{l===1&&h()});const f=new Dt;dde(a,f);const m=async y=>{f.notify({type:"start",forced:y});const[x]=await Promise.all([WD(f,{type:"recorder-settled"},i()),WD(f,{type:"document-ready"},Xoe(e,"interactive"))]);if(l!==2){f.notify({type:"aborted"});return}if(!x){l=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){l=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=x(t,e,n,r,S,a)),l=3,f.notify({type:"succeeded"})};function h(y){const x=n.findTrackedSession();if(mde(x,y)){l=1;return}if(hde(l))return;l=2;const S=gde(x,y)||!1;m(S).catch(hl),S&&n.setForcedReplay()}function v(){l===3&&d?.(),l=0}return{start:h,stop:v,getSessionReplayLink(){return cde(e,n,r,l!==0)},isRecording:()=>l===3}}function mde(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function hde(e){return e===2||e===3}function gde(e,t){return t&&t.force&&e.sessionReplay===0}async function WD(e,t,n){try{return await n}finally{e.notify(t)}}function vde(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:en},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function yde(e,t){if(Ud()&&!zL("records")||!HF())return{start:en,stop:en,getReplayStats:()=>{},onRumStart:en,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=vde();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>YD()===3&&n.isRecording(),getReplayStats:o=>YD()===3?nde(o):void 0};function i(o,a,l,d,f,m){let h;function v(){return h||(f??(f=BF(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=UF(a,f,1))),h}n=pde(a,o,l,d,e,v,m),r(a)&&n.start()}}const bde="modulepreload",xde=function(e){return"/"+e},XD={},th=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=xde(f),f in XD)return;XD[f]=!0;const m=f.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":bde,m||(v.as="script"),v.crossOrigin="",v.href=f,l&&v.setAttribute("nonce",l),document.head.appendChild(v),m)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};async function wde(e=Sde){try{return await e()}catch(t){RE({error:t,source:"Recorder",scriptType:"module"})}}async function Sde(){return(await th(()=>import("./startRecording-Cj4L9_0I.js"),[])).startRecording}function _de(){return No().Profiler!==void 0}function Cde(e){let t={status:"starting"};return e.register(0,({eventType:n})=>n!==wt.VIEW&&n!==wt.LONG_TASK?Ki:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}}async function kde(e=Ede){try{return await e()}catch(t){RE({error:t,source:"Profiler",scriptType:"module"})}}async function Ede(){return(await th(()=>import("./profiler-Dn0i6smK.js"),[])).createRumProfiler}function jde(){let e;function t(n,r,i,o,a,l,d){const f=o.findTrackedSession();if(!f||!tF(f.id,i.profilingSampleRate))return;const m=Cde(r);if(!_de()){m.set({status:"error",error_reason:"not-supported-by-browser"});return}kde().then(h=>{if(!h){Qm("[DD_RUM] Failed to lazy load the RUM Profiler"),m.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=h(i,n,o,m,l,d,a,void 0),e.start()}).catch(hl)}return{onRumStart:t,stop:()=>{e?.stop().catch(hl)}}}const Ide=yde(wde),Rde=jde(),Tde=hse(Wue,Ide,Rde,{startDeflateWorker:BF,createDeflateEncoder:UF,sdkName:"rum"});Zie(No(),"DD_RUM",Tde);function cy(e,t){xm("react error"),vr()}const JD={didCatch:!1,error:null};class T2e extends J.Component{constructor(t){super(t),this.resetError=()=>{this.setState(JD)},this.state=JD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){cy()}render(){return this.state.didCatch?J.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let QD=!1;function Nde(){b.useEffect(()=>{QD||(QD=!0)},[])}function Ade(){return u.jsx(u.Fragment,{children:u.jsx(jl,{})})}const ix=fQ()({component:Ade});function Ode(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:u.jsx("path",{fill:"currentColor",d:"M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z"})})}function TE(){return u.jsxs(u.Fragment,{children:[u.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),u.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function $de(e,t){const n=b.createContext(t),r=o=>{const{children:a,...l}=o,d=b.useMemo(()=>l,Object.values(l));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Qi(e,t=[]){let n=[];function r(o,a){const l=b.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...x}=h,S=v?.[e]?.[d]||l,C=b.useMemo(()=>x,Object.values(x));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function m(h,v){const y=v?.[e]?.[d]||l,x=b.useContext(y);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const i=()=>{const o=n.map(a=>b.createContext(a));return function(l){const d=l?.[e]||o;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return i.scopeName=e,[r,Dde(i,...t)]}function Dde(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((l,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...l,...h}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Vd(e){const t=Pde(e),n=b.forwardRef((r,i)=>{const{children:o,...a}=r,l=b.Children.toArray(o),d=l.find(zde);if(d){const f=d.props.children,m=l.map(h=>h===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,m):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Pde(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const a=Fde(i),l=Lde(o,i.props);return i.type!==b.Fragment&&(l.ref=r?ff(r,a):a),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qF=Symbol("radix.slottable");function Mde(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=qF,t}function zde(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qF}function Lde(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const d=o(...l);return i(...l),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Fde(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ude=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=Ude.reduce((e,t)=>{const n=Vd(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...l}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $y(e,t){e&&cf.flushSync(()=>e.dispatchEvent(t))}var rr=globalThis?.document?b.useLayoutEffect:()=>{},Vde=Wk[" useInsertionEffect ".trim().toString()]||rr;function Ko({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Bde({defaultProp:t,onChange:n}),l=e!==void 0,d=l?e:i;{const m=b.useRef(e!==void 0);b.useEffect(()=>{const h=m.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,r])}const f=b.useCallback(m=>{if(l){const h=Hde(m)?m(e):m;h!==e&&a.current?.(h)}else o(m)},[l,e,o,a]);return[d,f]}function Bde({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return Vde(()=>{o.current=t},[t]),b.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function Hde(e){return typeof e=="function"}var qde=b.createContext(void 0);function eu(e){const t=b.useContext(qde);return e||t||"ltr"}function Kde(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var or=e=>{const{present:t,children:n}=e,r=Gde(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=pt(r.ref,Zde(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};or.displayName="Presence";function Gde(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[l,d]=Kde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=_v(r.current);o.current=l==="mounted"?f:"none"},[l]),rr(()=>{const f=r.current,m=i.current;if(m!==e){const v=o.current,y=_v(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),rr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=y=>{const S=_v(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=_v(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function _v(e){return e?.animationName||"none"}function Zde(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yde=Wk[" useId ".trim().toString()]||(()=>{}),Wde=0;function Vi(e){const[t,n]=b.useState(Yde());return rr(()=>{n(r=>r??String(Wde++))},[e]),t?`radix-${t}`:""}function nh(e){const t=e+"CollectionProvider",[n,r]=Qi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:k}=S,E=J.useRef(null),j=J.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:E,children:k})};a.displayName=t;const l=e+"CollectionSlot",d=Vd(l),f=J.forwardRef((S,C)=>{const{scope:k,children:E}=S,j=o(l,k),I=pt(C,j.collectionRef);return u.jsx(d,{ref:I,children:E})});f.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",v=Vd(m),y=J.forwardRef((S,C)=>{const{scope:k,children:E,...j}=S,I=J.useRef(null),N=pt(C,I),T=o(m,k);return J.useEffect(()=>(T.itemMap.set(I,{ref:I,...j}),()=>{T.itemMap.delete(I)})),u.jsx(v,{[h]:"",ref:N,children:E})});y.displayName=m;function x(S){const C=o(e+"CollectionConsumer",S);return J.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((T,A)=>j.indexOf(T.ref.current)-j.indexOf(A.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}function Tn(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Xde(e,t=globalThis?.document){const n=Tn(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Jde="DismissableLayer",EC="dismissableLayer.update",Qde="dismissableLayer.pointerDownOutside",efe="dismissableLayer.focusOutside",e2,KF=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gf=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...d}=e,f=b.useContext(KF),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),x=pt(t,A=>h(A)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=m?S.indexOf(m):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=E>=k,N=rfe(A=>{const D=A.target,F=[...f.branches].some(q=>q.contains(D));!I||F||(i?.(A),a?.(A),A.defaultPrevented||l?.())},v),T=ife(A=>{const D=A.target;[...f.branches].some(q=>q.contains(D))||(o?.(A),a?.(A),A.defaultPrevented||l?.())},v);return Xde(A=>{E===f.layers.size-1&&(r?.(A),!A.defaultPrevented&&l&&(A.preventDefault(),l()))},v),b.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(e2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),t2(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=e2)}},[m,v,n,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),t2())},[m,f]),b.useEffect(()=>{const A=()=>y({});return document.addEventListener(EC,A),()=>document.removeEventListener(EC,A)},[]),u.jsx(We.div,{...d,ref:x,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,N.onPointerDownCapture)})});gf.displayName=Jde;var tfe="DismissableLayerBranch",nfe=b.forwardRef((e,t)=>{const n=b.useContext(KF),r=b.useRef(null),i=pt(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(We.div,{...e,ref:i})});nfe.displayName=tfe;function rfe(e,t=globalThis?.document){const n=Tn(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let d=function(){GF(Qde,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ife(e,t=globalThis?.document){const n=Tn(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&GF(efe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function t2(){const e=new CustomEvent(EC);document.dispatchEvent(e)}function GF(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$y(i,o):i.dispatchEvent(o)}function NE(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ZF=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ofe="VisuallyHidden",YF=b.forwardRef((e,t)=>u.jsx(We.span,{...e,ref:t,style:{...ZF,...e.style}}));YF.displayName=ofe;var WF=YF,tu="NavigationMenu",[AE,XF,afe]=nh(tu),[jC,sfe,lfe]=nh(tu),[OE]=Qi(tu,[afe,lfe]),[cfe,Ao]=OE(tu),[ufe,dfe]=OE(tu),JF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:l=300,orientation:d="horizontal",dir:f,...m}=e,[h,v]=b.useState(null),y=pt(t,F=>v(F)),x=eu(f),S=b.useRef(0),C=b.useRef(0),k=b.useRef(0),[E,j]=b.useState(!0),[I,N]=Ko({prop:r,onChange:F=>{const q=F!=="",ee=l>0;q?(window.clearTimeout(k.current),ee&&j(!1)):(window.clearTimeout(k.current),k.current=window.setTimeout(()=>j(!0),l)),i?.(F)},defaultProp:o??"",caller:tu}),T=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>N(""),150)},[N]),A=b.useCallback(F=>{window.clearTimeout(C.current),N(F)},[N]),D=b.useCallback(F=>{I===F?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),N(F)},a)},[I,N,a]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(k.current)},[]),u.jsx(QF,{scope:n,isRootMenu:!0,value:I,dir:x,orientation:d,rootNavigationMenu:h,onTriggerEnter:F=>{window.clearTimeout(S.current),E?D(F):A(F)},onTriggerLeave:()=>{window.clearTimeout(S.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:F=>{N(q=>q===F?"":F)},onItemDismiss:()=>N(""),children:u.jsx(We.nav,{"aria-label":"Main","data-orientation":d,dir:x,...m,ref:y})})});JF.displayName=tu;var IC="NavigationMenuSub",ffe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...l}=e,d=Ao(IC,n),[f,m]=Ko({prop:r,onChange:i,defaultProp:o??"",caller:IC});return u.jsx(QF,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>m(h),onItemSelect:h=>m(h),onItemDismiss:()=>m(""),children:u.jsx(We.div,{"data-orientation":a,...l,ref:t})})});ffe.displayName=IC;var QF=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:l,onItemSelect:d,onItemDismiss:f,onTriggerEnter:m,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[x,S]=b.useState(null),[C,k]=b.useState(new Map),[E,j]=b.useState(null);return u.jsx(cfe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:l,previousValue:NE(l),baseId:Vi(),dir:i,orientation:o,viewport:x,onViewportChange:S,indicatorTrack:E,onIndicatorTrackChange:j,onTriggerEnter:Tn(m),onTriggerLeave:Tn(h),onContentEnter:Tn(v),onContentLeave:Tn(y),onItemSelect:Tn(d),onItemDismiss:Tn(f),onViewportContentChange:b.useCallback((I,N)=>{k(T=>(T.set(I,N),new Map(T)))},[]),onViewportContentRemove:b.useCallback(I=>{k(N=>N.has(I)?(N.delete(I),new Map(N)):N)},[]),children:u.jsx(AE.Provider,{scope:t,children:u.jsx(ufe,{scope:t,items:C,children:a})})})},eU="NavigationMenuList",tU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao(eU,n),o=u.jsx(We.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(We.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(AE.Slot,{scope:n,children:i.isRootMenu?u.jsx(lU,{asChild:!0,children:o}):o})})});tU.displayName=eU;var nU="NavigationMenuItem",[pfe,rU]=OE(nU),iU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Vi(),a=r||o||"LEGACY_REACT_AUTO_VALUE",l=b.useRef(null),d=b.useRef(null),f=b.useRef(null),m=b.useRef(()=>{}),h=b.useRef(!1),v=b.useCallback((x="start")=>{if(l.current){m.current();const S=TC(l.current);S.length&&PE(x==="start"?S:S.reverse())}},[]),y=b.useCallback(()=>{if(l.current){const x=TC(l.current);x.length&&(m.current=_fe(x))}},[]);return u.jsx(pfe,{scope:n,value:a,triggerRef:d,contentRef:l,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(We.li,{...i,ref:t})})});iU.displayName=nU;var RC="NavigationMenuTrigger",mfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Ao(RC,e.__scopeNavigationMenu),a=rU(RC,e.__scopeNavigationMenu),l=b.useRef(null),d=pt(l,a.triggerRef,t),f=uU(o.baseId,a.value),m=dU(o.baseId,a.value),h=b.useRef(!1),v=b.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(AE.ItemSlot,{scope:n,value:a.value,children:u.jsx(cU,{asChild:!0,children:u.jsx(We.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":ME(y),"aria-expanded":y,"aria-controls":m,...i,ref:d,onPointerEnter:Re(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:Re(e.onPointerMove,Dy(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:Re(e.onPointerLeave,Dy(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:Re(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:Re(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&x.key===C&&(a.onEntryKeyDown(),x.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx(WF,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const S=a.contentRef.current,C=x.relatedTarget,k=C===l.current,E=S?.contains(C);(k||!E)&&a.onFocusProxyEnter(k?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":m})]})]})});mfe.displayName=RC;var hfe="NavigationMenuLink",n2="navigationMenu.linkSelect",oU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(cU,{asChild:!0,children:u.jsx(We.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:Re(e.onClick,a=>{const l=a.target,d=new CustomEvent(n2,{bubbles:!0,cancelable:!0});if(l.addEventListener(n2,f=>i?.(f),{once:!0}),$y(l,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(uy,{bubbles:!0,cancelable:!0});$y(l,f)}},{checkForDefaultPrevented:!1})})})});oU.displayName=hfe;var $E="NavigationMenuIndicator",gfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ao($E,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?iE.createPortal(u.jsx(or,{present:n||o,children:u.jsx(vfe,{...r,ref:t})}),i.indicatorTrack):null});gfe.displayName=$E;var vfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao($E,n),o=XF(n),[a,l]=b.useState(null),[d,f]=b.useState(null),m=i.orientation==="horizontal",h=!!i.value;b.useEffect(()=>{const x=o().find(S=>S.value===i.value)?.ref.current;x&&l(x)},[o,i.value]);const v=()=>{a&&f({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return NC(a,v),NC(i.indicatorTrack,v),d?u.jsx(We.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...m?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),Bd="NavigationMenuContent",yfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ao(Bd,e.__scopeNavigationMenu),o=rU(Bd,e.__scopeNavigationMenu),a=pt(o.contentRef,t),l=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(bfe,{forceMount:n,...d,ref:a}):u.jsx(or,{present:n||l,children:u.jsx(aU,{"data-state":ME(l),...d,ref:a,onPointerEnter:Re(e.onPointerEnter,i.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Dy(i.onContentLeave)),style:{pointerEvents:!l&&i.isRootMenu?"none":void 0,...d.style}})})});yfe.displayName=Bd;var bfe=b.forwardRef((e,t)=>{const n=Ao(Bd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return rr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),rr(()=>()=>i(e.value),[e.value,i]),null}),uy="navigationMenu.rootContentDismiss",aU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:l,onContentFocusOutside:d,...f}=e,m=Ao(Bd,n),h=b.useRef(null),v=pt(h,t),y=uU(m.baseId,r),x=dU(m.baseId,r),S=XF(n),C=b.useRef(null),{onItemDismiss:k}=m;b.useEffect(()=>{const j=h.current;if(m.isRootMenu&&j){const I=()=>{k(),l(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(uy,I),()=>j.removeEventListener(uy,I)}},[m.isRootMenu,e.value,i,k,l]);const E=b.useMemo(()=>{const I=S().map(q=>q.value);m.dir==="rtl"&&I.reverse();const N=I.indexOf(m.value),T=I.indexOf(m.previousValue),A=r===m.value,D=T===I.indexOf(r);if(!A&&!D)return C.current;const F=(()=>{if(N!==T){if(A&&T!==-1)return N>T?"from-end":"from-start";if(D&&N!==-1)return N>T?"to-start":"to-end"}return null})();return C.current=F,F},[m.previousValue,m.value,m.dir,S,r]);return u.jsx(lU,{asChild:!0,children:u.jsx(gf,{id:x,"aria-labelledby":y,"data-motion":E,"data-orientation":m.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(uy,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:Re(e.onFocusOutside,j=>{d();const I=j.target;m.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:Re(e.onPointerDownOutside,j=>{const I=j.target,N=S().some(A=>A.ref.current?.contains(I)),T=m.isRootMenu&&m.viewport?.contains(I);(N||T||!m.isRootMenu)&&j.preventDefault()}),onKeyDown:Re(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const T=TC(j.currentTarget),A=document.activeElement,D=T.findIndex(ee=>ee===A),q=j.shiftKey?T.slice(0,D).reverse():T.slice(D+1,T.length);PE(q)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:Re(e.onEscapeKeyDown,j=>{a.current=!0})})})}),DE="NavigationMenuViewport",sU=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Ao(DE,e.__scopeNavigationMenu).value;return u.jsx(or,{present:n||o,children:u.jsx(xfe,{...r,ref:t})})});sU.displayName=DE;var xfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Ao(DE,n),a=pt(t,o.onViewportChange),l=dfe(Bd,e.__scopeNavigationMenu),[d,f]=b.useState(null),[m,h]=b.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,x=!!o.value,S=x?o.value:o.previousValue;return NC(m,()=>{m&&f({width:m.offsetWidth,height:m.offsetHeight})}),u.jsx(We.div,{"data-state":ME(x),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!x&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:Re(e.onPointerEnter,o.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Dy(o.onContentLeave)),children:Array.from(l.items).map(([k,{ref:E,forceMount:j,...I}])=>{const N=S===k;return u.jsx(or,{present:j||N,children:u.jsx(aU,{...I,ref:ff(E,T=>{N&&T&&h(T)})})},k)})})}),wfe="FocusGroup",lU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Ao(wfe,n);return u.jsx(jC.Provider,{scope:n,children:u.jsx(jC.Slot,{scope:n,children:u.jsx(We.div,{dir:i.dir,...r,ref:t})})})}),r2=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Sfe="FocusGroupItem",cU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=sfe(n),o=Ao(Sfe,n);return u.jsx(jC.ItemSlot,{scope:n,children:u.jsx(We.button,{...r,ref:t,onKeyDown:Re(e.onKeyDown,a=>{if(["Home","End",...r2].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),r2.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>PE(d)),a.preventDefault()}})})})});function TC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function PE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function _fe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function NC(e,t){const n=Tn(t);rr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function ME(e){return e?"open":"closed"}function uU(e,t){return`${e}-trigger-${t}`}function dU(e,t){return`${e}-content-${t}`}function Dy(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Cfe=JF,kfe=tU,Efe=iU,jfe=oU,Ife=sU;function Rfe({className:e,...t}){return u.jsx("div",{className:Ue("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Ife,{"data-slot":"navigation-menu-viewport",className:Ue("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function fU({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(Cfe,{"data-slot":"navigation-menu","data-viewport":n,className:Ue("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(Rfe,{})]})}function AC({className:e,...t}){return u.jsx(Efe,{"data-slot":"navigation-menu-item",className:Ue("relative",e),...t})}function OC({className:e,...t}){return u.jsx(jfe,{"data-slot":"navigation-menu-link",className:Ue("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function pU({className:e,...t}){return u.jsx(kfe,{"data-slot":"navigation-menu-list",className:Ue("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const mU=Pb("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-auto",{variants:{variant:{default:"border-primary bg-primary/40 text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-secondary bg-secondary/40 text-secondary-foreground [a&]:hover:bg-secondary/90",warning:"border-yellow bg-yellow/40 text-white [a&]:hover:bg-yellow/90",success:"border-green bg-green/40 text-white [a&]:hover:bg-green/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-white [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function zE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Ue(mU({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.15"," BETA"]})})}function rh(e,t,n){const{instanceId:r,clusterId:i}=rt({strict:!1});return es({id:$n,operationsUrl:e,port:t,secure:n})}function ox(e,t,n){const{instanceId:r,clusterId:i}=rt({strict:!1});return{instanceClient:es({id:$n,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Zt(e,t,n){const r=rt({strict:!1});return b.useMemo(()=>hU({...r,operationsUrl:e,port:t,secure:n}),[r,e,t,n])}function hU({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=$n;return{instanceClient:es({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Tfe(){localStorage.clear()}function Nfe(){sessionStorage.clear()}async function Afe(){jt.setUserForEntity($n,null),Ty.getQueryCache().clear(),Tfe(),Nfe(),await Ty.invalidateQueries({refetchType:"none"})}async function Ofe(e){await jt.signOutFromPotentiallyAuthenticatedInstances(),await Km({...e,entityId:$n})}function $fe(){const e=rh();return ct({mutationFn:()=>Ofe({instanceClient:e}),onSuccess:Afe})}function ax(e){const{user:t}=Il(),{organizationId:n}=rt({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function vf(e){const{user:t}=Il(),{organizationId:n}=rt({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function sx(e,t){const{user:n}=Il(),{organizationId:r,clusterId:i}=rt({strict:!1});return gU(n,e??r,t??i)}function gU(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n),o=r.organization.clusters;return{create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function Dfe(e,t){const{user:n}=Il(),{organizationId:r,clusterId:i}=rt({strict:!1});return vU(n,r,i)}function vU(e,t,n){const r=e?.roles?.[t];if(!r?.permission&&!r?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.clusters.resources?.find(a=>a.id===n)?.instances,o=r.organization.clusters;return{create:i?i.create:o.create,remove:i?i.delete:o.delete,update:i?i.update:o.update,view:i?i.view:o.view}}function LE(e){const{clusterId:t,instanceId:n}=rt({strict:!1}),{user:r}=ms(),i=r?.role?.permission;return i?i.super_user===!0:!1}function yf(e){const{clusterId:t,instanceId:n}=rt({strict:!1}),{user:r}=ms(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function K_(e,t,n,r){const{clusterId:i,instanceId:o}=rt({strict:!1}),{user:a}=ms(),l=a?.role?.permission;return l?l.super_user===!0||l.structure_user===!0?!0:l[t]?.tables?.[n][r]===!0:!1}const FE={className:"text-white"};function yU(){const{mutate:e}=$fe(),t=jn(),{user:n}=Gc(),r=_n(),{organizationId:i}=rt({strict:!1}),{update:o}=ax(i),{view:a}=vf(i),l=o,d=b.useCallback(()=>{e(void 0,{onSuccess:async()=>{we.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>we.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=b.useMemo(()=>[!xd,!xd,!xd,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(j4,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(Kee,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Ode,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(Kte,{}),text:"Sign Out",textBreakpoint:"md"}].filter(Jo),[i,l,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(zfe,{menuItems:f}),u.jsx(Mfe,{menuItems:f})]}):u.jsx(Pfe,{})}function bU(e){return e.items!==void 0}function Pfe(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ye,{to:"/sign-in",children:u.jsx(TE,{})}),u.jsx(zE,{})]}),u.jsx(fU,{children:u.jsxs(pU,{className:"text-grey-400",children:[u.jsx(AC,{children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ye,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(j4,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(AC,{children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ye,{to:"/sign-in",className:"flex-row items-center",activeProps:FE,children:[u.jsx(Hte,{})," Sign In"]})})})]})})]})}function Mfe({menuItems:e}){const{user:t}=Gc();return Yc(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ye,{to:ba,children:u.jsx(TE,{})}),u.jsx(zE,{})]}),u.jsx(fU,{children:u.jsx(pU,{className:"text-grey-400",children:e.map(n=>bU(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(i2,{menuItem:r},r.text))},n.text):u.jsx(i2,{menuItem:n},n.text))})})]})})}function i2({menuItem:e}){return u.jsx(AC,{className:"text-gray-400 hover:text-white",children:u.jsx(OC,{asChild:!0,children:u.jsxs(Ye,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?FE:void 0,children:[e.icon,u.jsx("span",{className:`hidden ${e.textBreakpoint}:inline-block`,children:e.text}),u.jsx("span",{className:`${e.textBreakpoint}:hidden`,children:" "})]})})})}function zfe({menuItems:e}){const{user:t}=Gc();Yc(t);const[n,r]=b.useState(!1),i=b.useCallback(()=>r(a=>!a),[]),o=b.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Ye,{to:ba,children:u.jsx(TE,{})}),u.jsx(zE,{}),u.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:i,children:[u.jsx("span",{className:"sr-only",children:n?"Close menu":"Open menu"}),n?u.jsx(B4,{}):u.jsx(z4,{})]})]}),u.jsx("div",{className:`${n?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:o}),u.jsx("div",{className:`${n?"block":"hidden"} md:hidden z-50 space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:e.map(a=>bU(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(l=>u.jsx(o2,{menuItem:l,onClick:o},l.text))},a.text):u.jsx(o2,{menuItem:a,onClick:o},a.text))})]})}function o2({menuItem:e,onClick:t}){const n=b.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ye,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?FE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function Pp({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Lfe(){return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(yU,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(Pp,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(Pp,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(Pp,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(Pp,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(Pp,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(jl,{})})]})]})}function Ffe(){b.useEffect(()=>{},[])}const Ufe=["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","aol.com","protonmail.com","mail.com","zoho.com","yandex.com","gmx.com","live.com","msn.com","me.com","inbox.com"];function UE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Ufe)if(t===n||t.endsWith("."+n))return null;return t}let G_=null;function Vfe(){const e=jn(),t=_n(),n=ir(),{redirect:r}=Rr({strict:!1});return b.useEffect(()=>{G_||(G_=(async function(){const i=await Vz().catch(()=>null);if(!i)we.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{jt.setUserForEntity($n,i);const o=Yc(i);UE(i.email),await n.invalidateQueries({queryKey:Nb,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}G_=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(Ye,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Bfe=["top","right","bottom","left"],bl=Math.min,Li=Math.max,Py=Math.round,Cv=Math.floor,ya=e=>({x:e,y:e}),Hfe={left:"right",right:"left",bottom:"top",top:"bottom"},qfe={start:"end",end:"start"};function $C(e,t,n){return Li(e,bl(t,n))}function ls(e,t){return typeof e=="function"?e(t):e}function cs(e){return e.split("-")[0]}function bf(e){return e.split("-")[1]}function VE(e){return e==="x"?"y":"x"}function BE(e){return e==="y"?"height":"width"}const Kfe=new Set(["top","bottom"]);function fa(e){return Kfe.has(cs(e))?"y":"x"}function HE(e){return VE(fa(e))}function Gfe(e,t,n){n===void 0&&(n=!1);const r=bf(e),i=HE(e),o=BE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=My(a)),[a,My(a)]}function Zfe(e){const t=My(e);return[DC(e),t,DC(t)]}function DC(e){return e.replace(/start|end/g,t=>qfe[t])}const a2=["left","right"],s2=["right","left"],Yfe=["top","bottom"],Wfe=["bottom","top"];function Xfe(e,t,n){switch(e){case"top":case"bottom":return n?t?s2:a2:t?a2:s2;case"left":case"right":return t?Yfe:Wfe;default:return[]}}function Jfe(e,t,n,r){const i=bf(e);let o=Xfe(cs(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(DC)))),o}function My(e){return e.replace(/left|right|bottom|top/g,t=>Hfe[t])}function Qfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function xU(e){return typeof e!="number"?Qfe(e):{top:e,right:e,bottom:e,left:e}}function zy(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function l2(e,t,n){let{reference:r,floating:i}=e;const o=fa(t),a=HE(t),l=BE(a),d=cs(t),f=o==="y",m=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[l]/2-i[l]/2;let y;switch(d){case"top":y={x:m,y:r.y-i.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(bf(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const epe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:h}=l2(f,r,d),v=r,y={},x=0;for(let S=0;S<l.length;S++){const{name:C,fn:k}=l[S],{x:E,y:j,data:I,reset:N}=await k({x:m,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});m=E??m,h=j??h,y={...y,[C]:{...y[C],...I}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(v=N.placement),N.rects&&(f=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):N.rects),{x:m,y:h}=l2(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:i,middlewareData:y}};async function _m(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:l,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=ls(t,e),x=xU(y),C=l[v?h==="floating"?"reference":"floating":h],k=zy(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:d})),E=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},N=zy(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:j,strategy:d}):E);return{top:(k.top-N.top+x.top)/I.y,bottom:(N.bottom-k.bottom+x.bottom)/I.y,left:(k.left-N.left+x.left)/I.x,right:(N.right-k.right+x.right)/I.x}}const tpe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:l,middlewareData:d}=t,{element:f,padding:m=0}=ls(e,t)||{};if(f==null)return{};const h=xU(m),v={x:n,y:r},y=HE(i),x=BE(y),S=await a.getDimensions(f),C=y==="y",k=C?"top":"left",E=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[x]+o.reference[y]-v[y]-o.floating[x],N=v[y]-o.reference[y],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let A=T?T[j]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=l.floating[j]||o.floating[x]);const D=I/2-N/2,F=A/2-S[x]/2-1,q=bl(h[k],F),ee=bl(h[E],F),G=q,K=A-S[x]-ee,V=A/2-S[x]/2+D,H=$C(G,V,K),z=!d.arrow&&bf(i)!=null&&V!==H&&o.reference[x]/2-(V<G?q:ee)-S[x]/2<0,W=z?V<G?V-G:V-K:0;return{[y]:v[y]+W,data:{[y]:H,centerOffset:V-H-W,...z&&{alignmentOffset:W}},reset:z}}}),npe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:l,platform:d,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...C}=ls(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=cs(i),E=fa(l),j=cs(l)===l,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),N=v||(j||!S?[My(l)]:Zfe(l)),T=x!=="none";!v&&T&&N.push(...Jfe(l,S,x,I));const A=[l,...N],D=await _m(t,C),F=[];let q=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&F.push(D[k]),h){const V=Gfe(i,a,I);F.push(D[V[0]],D[V[1]])}if(q=[...q,{placement:i,overflows:F}],!F.every(V=>V<=0)){var ee,G;const V=(((ee=o.flip)==null?void 0:ee.index)||0)+1,H=A[V];if(H&&(!(h==="alignment"?E!==fa(H):!1)||q.every(L=>fa(L.placement)===E?L.overflows[0]>0:!0)))return{data:{index:V,overflows:q},reset:{placement:H}};let z=(G=q.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:G.placement;if(!z)switch(y){case"bestFit":{var K;const W=(K=q.filter(L=>{if(T){const ne=fa(L.placement);return ne===E||ne==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(ne=>ne>0).reduce((ne,$)=>ne+$,0)]).sort((L,ne)=>L[1]-ne[1])[0])==null?void 0:K[0];W&&(z=W);break}case"initialPlacement":z=l;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function c2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function u2(e){return Bfe.some(t=>e[t]>=0)}const rpe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ls(e,t);switch(r){case"referenceHidden":{const o=await _m(t,{...i,elementContext:"reference"}),a=c2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:u2(a)}}}case"escaped":{const o=await _m(t,{...i,altBoundary:!0}),a=c2(o,n.floating);return{data:{escapedOffsets:a,escaped:u2(a)}}}default:return{}}}}},wU=new Set(["left","top"]);async function ipe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=cs(n),l=bf(n),d=fa(n)==="y",f=wU.has(a)?-1:1,m=o&&d?-1:1,h=ls(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const ope=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:l}=t,d=await ipe(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},ape=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:C=>{let{x:k,y:E}=C;return{x:k,y:E}}},...d}=ls(e,t),f={x:n,y:r},m=await _m(t,d),h=fa(cs(i)),v=VE(h);let y=f[v],x=f[h];if(o){const C=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=y+m[C],j=y-m[k];y=$C(E,y,j)}if(a){const C=h==="y"?"top":"left",k=h==="y"?"bottom":"right",E=x+m[C],j=x-m[k];x=$C(E,x,j)}const S=l.fn({...t,[v]:y,[h]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},spe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:d=!0,crossAxis:f=!0}=ls(e,t),m={x:n,y:r},h=fa(i),v=VE(h);let y=m[v],x=m[h];const S=ls(l,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,N=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>N&&(y=N)}if(f){var k,E;const j=v==="y"?"width":"height",I=wU.has(cs(i)),N=o.reference[h]-o.floating[j]+(I&&((k=a.offset)==null?void 0:k[h])||0)+(I?0:C.crossAxis),T=o.reference[h]+o.reference[j]+(I?0:((E=a.offset)==null?void 0:E[h])||0)-(I?C.crossAxis:0);x<N?x=N:x>T&&(x=T)}return{[v]:y,[h]:x}}}},lpe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:l}=t,{apply:d=()=>{},...f}=ls(e,t),m=await _m(t,f),h=cs(i),v=bf(i),y=fa(i)==="y",{width:x,height:S}=o.floating;let C,k;h==="top"||h==="bottom"?(C=h,k=v===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(k=h,C=v==="end"?"top":"bottom");const E=S-m.top-m.bottom,j=x-m.left-m.right,I=bl(S-m[C],E),N=bl(x-m[k],j),T=!t.middlewareData.shift;let A=I,D=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=E),T&&!v){const q=Li(m.left,0),ee=Li(m.right,0),G=Li(m.top,0),K=Li(m.bottom,0);y?D=x-2*(q!==0||ee!==0?q+ee:Li(m.left,m.right)):A=S-2*(G!==0||K!==0?G+K:Li(m.top,m.bottom))}await d({...t,availableWidth:D,availableHeight:A});const F=await a.getDimensions(l.floating);return x!==F.width||S!==F.height?{reset:{rects:!0}}:{}}}};function lx(){return typeof window<"u"}function xf(e){return SU(e)?(e.nodeName||"").toLowerCase():"#document"}function Bi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ka(e){var t;return(t=(SU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function SU(e){return lx()?e instanceof Node||e instanceof Bi(e).Node:!1}function Go(e){return lx()?e instanceof Element||e instanceof Bi(e).Element:!1}function Sa(e){return lx()?e instanceof HTMLElement||e instanceof Bi(e).HTMLElement:!1}function d2(e){return!lx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bi(e).ShadowRoot}const cpe=new Set(["inline","contents"]);function ih(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!cpe.has(i)}const upe=new Set(["table","td","th"]);function dpe(e){return upe.has(xf(e))}const fpe=[":popover-open",":modal"];function cx(e){return fpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const ppe=["transform","translate","scale","rotate","perspective"],mpe=["transform","translate","scale","rotate","perspective","filter"],hpe=["paint","layout","strict","content"];function qE(e){const t=KE(),n=Go(e)?Zo(e):e;return ppe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mpe.some(r=>(n.willChange||"").includes(r))||hpe.some(r=>(n.contain||"").includes(r))}function gpe(e){let t=xl(e);for(;Sa(t)&&!Hd(t);){if(qE(t))return t;if(cx(t))return null;t=xl(t)}return null}function KE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vpe=new Set(["html","body","#document"]);function Hd(e){return vpe.has(xf(e))}function Zo(e){return Bi(e).getComputedStyle(e)}function ux(e){return Go(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xl(e){if(xf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||d2(e)&&e.host||ka(e);return d2(t)?t.host:t}function _U(e){const t=xl(e);return Hd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&ih(t)?t:_U(t)}function Cm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=_U(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Bi(i);if(o){const l=PC(a);return t.concat(a,a.visualViewport||[],ih(i)?i:[],l&&n?Cm(l):[])}return t.concat(i,Cm(i,[],n))}function PC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function CU(e){const t=Zo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=Py(n)!==o||Py(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function GE(e){return Go(e)?e:e.contextElement}function kd(e){const t=GE(e);if(!Sa(t))return ya(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=CU(t);let a=(o?Py(n.width):n.width)/r,l=(o?Py(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const ype=ya(0);function kU(e){const t=Bi(e);return!KE()||!t.visualViewport?ype:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bpe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bi(e)?!1:t}function Mc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=GE(e);let a=ya(1);t&&(r?Go(r)&&(a=kd(r)):a=kd(e));const l=bpe(o,n,r)?kU(o):ya(0);let d=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,m=i.width/a.x,h=i.height/a.y;if(o){const v=Bi(o),y=r&&Go(r)?Bi(r):r;let x=v,S=PC(x);for(;S&&r&&y!==x;){const C=kd(S),k=S.getBoundingClientRect(),E=Zo(S),j=k.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,I=k.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=j,f+=I,x=Bi(S),S=PC(x)}}return zy({width:m,height:h,x:d,y:f})}function dx(e,t){const n=ux(e).scrollLeft;return t?t.left+n:Mc(ka(e)).left+n}function EU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-dx(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function xpe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ka(r),l=t?cx(t.floating):!1;if(r===a||l&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ya(1);const m=ya(0),h=Sa(r);if((h||!h&&!o)&&((xf(r)!=="body"||ih(a))&&(d=ux(r)),Sa(r))){const y=Mc(r);f=kd(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=a&&!h&&!o?EU(a,d):ya(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+m.x+v.x,y:n.y*f.y-d.scrollTop*f.y+m.y+v.y}}function wpe(e){return Array.from(e.getClientRects())}function Spe(e){const t=ka(e),n=ux(e),r=e.ownerDocument.body,i=Li(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Li(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+dx(e);const l=-n.scrollTop;return Zo(r).direction==="rtl"&&(a+=Li(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:l}}const f2=25;function _pe(e,t){const n=Bi(e),r=ka(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,l=0,d=0;if(i){o=i.width,a=i.height;const m=KE();(!m||m&&t==="fixed")&&(l=i.offsetLeft,d=i.offsetTop)}const f=dx(r);if(f<=0){const m=r.ownerDocument,h=m.body,v=getComputedStyle(h),y=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-y);x<=f2&&(o-=x)}else f<=f2&&(o+=f);return{width:o,height:a,x:l,y:d}}const Cpe=new Set(["absolute","fixed"]);function kpe(e,t){const n=Mc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Sa(e)?kd(e):ya(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:l,x:d,y:f}}function p2(e,t,n){let r;if(t==="viewport")r=_pe(e,n);else if(t==="document")r=Spe(ka(e));else if(Go(t))r=kpe(t,n);else{const i=kU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zy(r)}function jU(e,t){const n=xl(e);return n===t||!Go(n)||Hd(n)?!1:Zo(n).position==="fixed"||jU(n,t)}function Epe(e,t){const n=t.get(e);if(n)return n;let r=Cm(e,[],!1).filter(l=>Go(l)&&xf(l)!=="body"),i=null;const o=Zo(e).position==="fixed";let a=o?xl(e):e;for(;Go(a)&&!Hd(a);){const l=Zo(a),d=qE(a);!d&&l.position==="fixed"&&(i=null),(o?!d&&!i:!d&&l.position==="static"&&!!i&&Cpe.has(i.position)||ih(a)&&!d&&jU(e,a))?r=r.filter(m=>m!==a):i=l,a=xl(a)}return t.set(e,r),r}function jpe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?cx(t)?[]:Epe(t,this._c):[].concat(n),r],l=a[0],d=a.reduce((f,m)=>{const h=p2(t,m,i);return f.top=Li(h.top,f.top),f.right=bl(h.right,f.right),f.bottom=bl(h.bottom,f.bottom),f.left=Li(h.left,f.left),f},p2(t,l,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ipe(e){const{width:t,height:n}=CU(e);return{width:t,height:n}}function Rpe(e,t,n){const r=Sa(t),i=ka(t),o=n==="fixed",a=Mc(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const d=ya(0);function f(){d.x=dx(i)}if(r||!r&&!o)if((xf(t)!=="body"||ih(i))&&(l=ux(t)),r){const y=Mc(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const m=i&&!r&&!o?EU(i,l):ya(0),h=a.left+l.scrollLeft-d.x-m.x,v=a.top+l.scrollTop-d.y-m.y;return{x:h,y:v,width:a.width,height:a.height}}function Z_(e){return Zo(e).position==="static"}function m2(e,t){if(!Sa(e)||Zo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ka(e)===n&&(n=n.ownerDocument.body),n}function IU(e,t){const n=Bi(e);if(cx(e))return n;if(!Sa(e)){let i=xl(e);for(;i&&!Hd(i);){if(Go(i)&&!Z_(i))return i;i=xl(i)}return n}let r=m2(e,t);for(;r&&dpe(r)&&Z_(r);)r=m2(r,t);return r&&Hd(r)&&Z_(r)&&!qE(r)?n:r||gpe(e)||n}const Tpe=async function(e){const t=this.getOffsetParent||IU,n=this.getDimensions,r=await n(e.floating);return{reference:Rpe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Npe(e){return Zo(e).direction==="rtl"}const Ape={convertOffsetParentRelativeRectToViewportRelativeRect:xpe,getDocumentElement:ka,getClippingRect:jpe,getOffsetParent:IU,getElementRects:Tpe,getClientRects:wpe,getDimensions:Ipe,getScale:kd,isElement:Go,isRTL:Npe};function RU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ope(e,t){let n=null,r;const i=ka(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:m,top:h,width:v,height:y}=f;if(l||t(),!v||!y)return;const x=Cv(h),S=Cv(i.clientWidth-(m+v)),C=Cv(i.clientHeight-(h+y)),k=Cv(m),j={rootMargin:-x+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Li(0,bl(1,d))||1};let I=!0;function N(T){const A=T[0].intersectionRatio;if(A!==d){if(!I)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!RU(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(N,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,j)}n.observe(e)}return a(!0),o}function $pe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=GE(e),m=i||o?[...f?Cm(f):[],...Cm(t)]:[];m.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&l?Ope(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(k=>{let[E]=k;E&&E.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let x,S=d?Mc(e):null;d&&C();function C(){const k=Mc(e);S&&!RU(S,k)&&n(),S=k,x=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h?.(),(k=y)==null||k.disconnect(),y=null,d&&cancelAnimationFrame(x)}}const Dpe=ope,Ppe=ape,Mpe=npe,zpe=lpe,Lpe=rpe,h2=tpe,Fpe=spe,Upe=(e,t,n)=>{const r=new Map,i={platform:Ape,...n},o={...i.platform,_c:r};return epe(e,t,{...i,platform:o})};var Vpe=typeof document<"u",Bpe=function(){},dy=Vpe?b.useLayoutEffect:Bpe;function Ly(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ly(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Ly(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function TU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function g2(e,t){const n=TU(e);return Math.round(t*n)/n}function Y_(e){const t=b.useRef(e);return dy(()=>{t.current=e}),t}function Hpe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:d,open:f}=e,[m,h]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=b.useState(r);Ly(v,r)||y(r);const[x,S]=b.useState(null),[C,k]=b.useState(null),E=b.useCallback(L=>{L!==T.current&&(T.current=L,S(L))},[]),j=b.useCallback(L=>{L!==A.current&&(A.current=L,k(L))},[]),I=o||x,N=a||C,T=b.useRef(null),A=b.useRef(null),D=b.useRef(m),F=d!=null,q=Y_(d),ee=Y_(i),G=Y_(f),K=b.useCallback(()=>{if(!T.current||!A.current)return;const L={placement:t,strategy:n,middleware:v};ee.current&&(L.platform=ee.current),Upe(T.current,A.current,L).then(ne=>{const $={...ne,isPositioned:G.current!==!1};V.current&&!Ly(D.current,$)&&(D.current=$,cf.flushSync(()=>{h($)}))})},[v,t,n,ee,G]);dy(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(L=>({...L,isPositioned:!1})))},[f]);const V=b.useRef(!1);dy(()=>(V.current=!0,()=>{V.current=!1}),[]),dy(()=>{if(I&&(T.current=I),N&&(A.current=N),I&&N){if(q.current)return q.current(I,N,K);K()}},[I,N,K,q,F]);const H=b.useMemo(()=>({reference:T,floating:A,setReference:E,setFloating:j}),[E,j]),z=b.useMemo(()=>({reference:I,floating:N}),[I,N]),W=b.useMemo(()=>{const L={position:n,left:0,top:0};if(!z.floating)return L;const ne=g2(z.floating,m.x),$=g2(z.floating,m.y);return l?{...L,transform:"translate("+ne+"px, "+$+"px)",...TU(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:$}},[n,l,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:K,refs:H,elements:z,floatingStyles:W}),[m,K,H,z,W])}const qpe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?h2({element:r.current,padding:i}).fn(n):{}:r?h2({element:r,padding:i}).fn(n):{}}}},Kpe=(e,t)=>({...Dpe(e),options:[e,t]}),Gpe=(e,t)=>({...Ppe(e),options:[e,t]}),Zpe=(e,t)=>({...Fpe(e),options:[e,t]}),Ype=(e,t)=>({...Mpe(e),options:[e,t]}),Wpe=(e,t)=>({...zpe(e),options:[e,t]}),Xpe=(e,t)=>({...Lpe(e),options:[e,t]}),Jpe=(e,t)=>({...qpe(e),options:[e,t]});var Qpe="Arrow",NU=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});NU.displayName=Qpe;var eme=NU;function AU(e){const[t,n]=b.useState(void 0);return rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,l;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,l=f.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ZE="Popper",[OU,wf]=Qi(ZE),[tme,$U]=OU(ZE),DU=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return u.jsx(tme,{scope:t,anchor:r,onAnchorChange:i,children:n})};DU.displayName=ZE;var PU="PopperAnchor",MU=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=$U(PU,n),a=b.useRef(null),l=pt(t,a),d=b.useRef(null);return b.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(We.div,{...i,ref:l})});MU.displayName=PU;var YE="PopperContent",[nme,rme]=OU(YE),zU=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,...S}=e,C=$U(YE,n),[k,E]=b.useState(null),j=pt(t,Q=>E(Q)),[I,N]=b.useState(null),T=AU(I),A=T?.width??0,D=T?.height??0,F=r+(o!=="center"?"-"+o:""),q=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ee=Array.isArray(f)?f:[f],G=ee.length>0,K={padding:q,boundary:ee.filter(ome),altBoundary:G},{refs:V,floatingStyles:H,placement:z,isPositioned:W,middlewareData:L}=Hpe({strategy:"fixed",placement:F,whileElementsMounted:(...Q)=>$pe(...Q,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Kpe({mainAxis:i+D,alignmentAxis:a}),d&&Gpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Zpe():void 0,...K}),d&&Ype({...K}),Wpe({...K,apply:({elements:Q,rects:le,availableWidth:Se,availableHeight:ke})=>{const{width:Pe,height:Fe}=le.reference,ut=Q.floating.style;ut.setProperty("--radix-popper-available-width",`${Se}px`),ut.setProperty("--radix-popper-available-height",`${ke}px`),ut.setProperty("--radix-popper-anchor-width",`${Pe}px`),ut.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),I&&Jpe({element:I,padding:l}),ame({arrowWidth:A,arrowHeight:D}),v&&Xpe({strategy:"referenceHidden",...K})]}),[ne,$]=UU(z),P=Tn(x);rr(()=>{W&&P?.()},[W,P]);const U=L.arrow?.x,O=L.arrow?.y,X=L.arrow?.centerOffset!==0,[pe,ve]=b.useState();return rr(()=>{k&&ve(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(nme,{scope:n,placedSide:ne,onArrowChange:N,arrowX:U,arrowY:O,shouldHideArrow:X,children:u.jsx(We.div,{"data-side":ne,"data-align":$,...S,ref:j,style:{...S.style,animation:W?void 0:"none"}})})})});zU.displayName=YE;var LU="PopperArrow",ime={top:"bottom",right:"left",bottom:"top",left:"right"},FU=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=rme(LU,r),a=ime[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(eme,{...i,ref:n,style:{...i.style,display:"block"}})})});FU.displayName=LU;function ome(e){return e!==null}var ame=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,m]=UU(n),h={start:"0%",center:"50%",end:"100%"}[m],v=(i.arrow?.x??0)+l/2,y=(i.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=a?h:`${v}px`,S=`${-d}px`):f==="top"?(x=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(x=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x,y:S}}}});function UU(e){const[t,n="center"]=e.split("-");return[t,n]}var WE=DU,XE=MU,JE=zU,QE=FU,sme="Portal",oh=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=b.useState(!1);rr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?iE.createPortal(u.jsx(We.div,{...r,ref:t}),a):null});oh.displayName=sme;var[fx]=Qi("Tooltip",[wf]),px=wf(),VU="TooltipProvider",lme=700,MC="tooltip.open",[cme,ej]=fx(VU),BU=e=>{const{__scopeTooltip:t,delayDuration:n=lme,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=b.useRef(!0),l=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(cme,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:o})};BU.displayName=VU;var km="Tooltip",[ume,ah]=fx(km),HU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,d=ej(km,e.__scopeTooltip),f=px(t),[m,h]=b.useState(null),v=Vi(),y=b.useRef(0),x=a??d.disableHoverableContent,S=l??d.delayDuration,C=b.useRef(!1),[k,E]=Ko({prop:r,defaultProp:i??!1,onChange:A=>{A?(d.onOpen(),document.dispatchEvent(new CustomEvent(MC))):d.onClose(),o?.(A)},caller:km}),j=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),I=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,E(!0)},[E]),N=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E(!1)},[E]),T=b.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,E(!0),y.current=0},S)},[S,E]);return b.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(WE,{...f,children:u.jsx(ume,{scope:t,contentId:v,open:k,stateAttribute:j,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?T():I()},[d.isOpenDelayedRef,T,I]),onTriggerLeave:b.useCallback(()=>{x?N():(window.clearTimeout(y.current),y.current=0)},[N,x]),onOpen:I,onClose:N,disableHoverableContent:x,children:n})})};HU.displayName=km;var zC="TooltipTrigger",qU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ah(zC,n),o=ej(zC,n),a=px(n),l=b.useRef(null),d=pt(t,l,i.onTriggerChange),f=b.useRef(!1),m=b.useRef(!1),h=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(XE,{asChild:!0,...a,children:u.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:Re(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Re(e.onBlur,i.onClose),onClick:Re(e.onClick,i.onClose)})})});qU.displayName=zC;var tj="TooltipPortal",[dme,fme]=fx(tj,{forceMount:void 0}),KU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=ah(tj,t);return u.jsx(dme,{scope:t,forceMount:n,children:u.jsx(or,{present:n||o.open,children:u.jsx(oh,{asChild:!0,container:i,children:r})})})};KU.displayName=tj;var qd="TooltipContent",GU=b.forwardRef((e,t)=>{const n=fme(qd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=ah(qd,e.__scopeTooltip);return u.jsx(or,{present:r||a.open,children:a.disableHoverableContent?u.jsx(ZU,{side:i,...o,ref:t}):u.jsx(pme,{side:i,...o,ref:t})})}),pme=b.forwardRef((e,t)=>{const n=ah(qd,e.__scopeTooltip),r=ej(qd,e.__scopeTooltip),i=b.useRef(null),o=pt(t,i),[a,l]=b.useState(null),{trigger:d,onClose:f}=n,m=i.current,{onPointerInTransitChange:h}=r,v=b.useCallback(()=>{l(null),h(!1)},[h]),y=b.useCallback((x,S)=>{const C=x.currentTarget,k={x:x.clientX,y:x.clientY},E=vme(k,C.getBoundingClientRect()),j=yme(k,E),I=bme(S.getBoundingClientRect()),N=wme([...j,...I]);l(N),h(!0)},[h]);return b.useEffect(()=>()=>v(),[v]),b.useEffect(()=>{if(d&&m){const x=C=>y(C,m),S=C=>y(C,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[d,m,y,v]),b.useEffect(()=>{if(a){const x=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},E=d?.contains(C)||m?.contains(C),j=!xme(k,a);E?v():j&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,a,f,v]),u.jsx(ZU,{...e,ref:o})}),[mme,hme]=fx(km,{isInside:!1}),gme=Mde("TooltipContent"),ZU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,d=ah(qd,n),f=px(n),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener(MC,m),()=>document.removeEventListener(MC,m)),[m]),b.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&m()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,m]),u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:u.jsxs(JE,{"data-state":d.stateAttribute,...f,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(gme,{children:r}),u.jsx(mme,{scope:n,isInside:!0,children:u.jsx(WF,{id:d.contentId,role:"tooltip",children:i||r})})]})})});GU.displayName=qd;var YU="TooltipArrow",WU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=px(n);return hme(YU,n).isInside?null:u.jsx(QE,{...i,...r,ref:t})});WU.displayName=YU;function vme(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yme(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function bme(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function xme(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],f=l.x,m=l.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function wme(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Sme(t)}function Sme(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _me=BU,Cme=HU,kme=qU,Eme=KU,jme=GU,Ime=WU;function Rme({delayDuration:e=0,...t}){return u.jsx(_me,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function mx({...e}){return u.jsx(Rme,{children:u.jsx(Cme,{"data-slot":"tooltip",...e})})}function hx({...e}){return u.jsx(kme,{"data-slot":"tooltip-trigger",...e})}function gx({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(Eme,{children:u.jsxs(jme,{"data-slot":"tooltip-content",sideOffset:t,className:Ue("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(Ime,{className:Ue("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const Mp=new Map;function wo(e){if(!e)return"";if(Mp.has(e))return Mp.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Mp.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Mp.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const l=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(l)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(l)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(l+d),a++):r.push(l)}const o=r.map(Tme).join(" ");return Mp.set(e,o),o}function Tme(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function vx({restartRequired:e}){const t=jQ(),{organization:n,instance:r,cluster:i}=Zm({strict:!1}),o="Instance",a=b.useMemo(()=>{const l=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ye,{to:"/",children:[u.jsx(Pte,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let f=0;f<l.length;f++){const m=l[f];if(m==="instance")continue;let h=`/${l.slice(0,f+1).join("/")}`,v=wo(m),y;m==="databases"&&l.length===f+3?(v=l[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",l[f+1]==="instance"&&(h+="/instances")):v.startsWith("Ins ")?v=r?.name?.split(".")?.shift()||"Instance":v==="Apis"&&(v="APIs"),d.push(u.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:u.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),u.jsxs(Ye,{to:h,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[v,y]}))}return d},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...a,e&&u.jsxs(mx,{children:[u.jsx(hx,{asChild:!0,children:u.jsxs("div",{className:"text-xs italic text-muted-foreground",children:["* Restart ",u.jsx("span",{className:"hidden lg:inline-block",children:"Requested"})]})}),u.jsxs(gx,{side:"bottom",children:["This ",o," is requesting a restart, when convenient, to apply your latest changes.",u.jsx("br",{}),"You can do this from the Apps or Config pages."]})]})]})}var sh=e=>e.type==="checkbox",xc=e=>e instanceof Date,vi=e=>e==null;const XU=e=>typeof e=="object";var nr=e=>!vi(e)&&!Array.isArray(e)&&XU(e)&&!xc(e),JU=e=>nr(e)&&e.target?sh(e.target)?e.target.checked:e.target.value:e,Nme=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,QU=(e,t)=>e.has(Nme(t)),Ame=e=>{const t=e.constructor&&e.constructor.prototype;return nr(t)&&t.hasOwnProperty("isPrototypeOf")},nj=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(nj&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(nr(e)&&Ame(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=bn(e[i]));return r}var yx=e=>/^\w*$/.test(e),sn=e=>e===void 0,bx=e=>Array.isArray(e)?e.filter(Boolean):[],rj=e=>bx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!nr(e))return n;const r=(yx(t)?[t]:rj(t)).reduce((i,o)=>vi(i)?i:i[o],e);return sn(r)||r===e?sn(e[t])?n:e[t]:r},Mi=e=>typeof e=="boolean",Zr=e=>typeof e=="function",qt=(e,t,n)=>{let r=-1;const i=yx(t)?[t]:rj(t),o=i.length,a=o-1;for(;++r<o;){const l=i[r];let d=n;if(r!==a){const f=e[l];d=nr(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=d,e=e[l]}};const Fy={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},So={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ya={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ij=J.createContext(null);ij.displayName="HookFormContext";const lh=()=>J.useContext(ij),Ome=e=>{const{children:t,...n}=e;return J.createElement(ij.Provider,{value:n},t)};var e6=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==So.all&&(t._proxyFormState[a]=!r||So.all),n&&(n[a]=!0),e[a]}});return i};const xx=typeof window<"u"?J.useLayoutEffect:J.useEffect;function oj(e){const t=lh(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,l]=J.useState(n._formState),d=J.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return xx(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&l({...n._formState,...f})}}),[i,r,o]),J.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),J.useMemo(()=>e6(a,n,d.current,!1),[a,n])}var Fi=e=>typeof e=="string",LC=(e,t,n,r,i)=>Fi(e)?(r&&t.watch.add(e),De(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),De(n,o))):(r&&(t.watchAll=!0),n),FC=e=>vi(e)||!XU(e);function Uo(e,t,n=new WeakSet){if(FC(e)||FC(t))return Object.is(e,t);if(xc(e)&&xc(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const l=t[o];if(xc(a)&&xc(l)||nr(a)&&nr(l)||Array.isArray(a)&&Array.isArray(l)?!Uo(a,l,n):!Object.is(a,l))return!1}}return!0}function $me(e){const t=lh(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:l}=e||{},d=J.useRef(i),f=J.useRef(l),m=J.useRef(void 0),h=J.useRef(n),v=J.useRef(r);f.current=l;const[y,x]=J.useState(()=>{const I=n._getWatch(r,d.current);return f.current?f.current(I):I}),S=J.useCallback(I=>{const N=LC(r,n._names,I||n._formValues,!1,d.current);return f.current?f.current(N):N},[n._formValues,n._names,r]),C=J.useCallback(I=>{if(!o){const N=LC(r,n._names,I||n._formValues,!1,d.current);if(f.current){const T=f.current(N);Uo(T,m.current)||(x(T),m.current=T)}else x(N)}},[n._formValues,n._names,o,r]);xx(()=>((h.current!==n||!Uo(v.current,r))&&(h.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:I=>{C(I.values)}})),[n,a,r,C]),J.useEffect(()=>n._removeUnmounted());const k=h.current!==n,E=v.current,j=J.useMemo(()=>{if(o)return null;const I=!k&&!Uo(E,r);return k||I?S():null},[o,k,r,E,S]);return j!==null?j:y}function Dme(e){const t=lh(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a,exact:l=!0}=e,d=QU(i._names.array,n),f=J.useMemo(()=>De(i._formValues,n,De(i._defaultValues,n,a)),[i,n,a]),m=$me({control:i,name:n,defaultValue:f,exact:l}),h=oj({control:i,name:n,exact:l}),v=J.useRef(e),y=J.useRef(void 0),x=J.useRef(i.register(n,{...e.rules,value:m,...Mi(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const S=J.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(h.validatingFields,n)},error:{enumerable:!0,get:()=>De(h.errors,n)}}),[h,n]),C=J.useCallback(I=>x.current.onChange({target:{value:JU(I),name:n},type:Fy.CHANGE}),[n]),k=J.useCallback(()=>x.current.onBlur({target:{value:De(i._formValues,n),name:n},type:Fy.BLUR}),[n,i._formValues]),E=J.useCallback(I=>{const N=De(i._fields,n);N&&N._f&&I&&(N._f.ref={focus:()=>Zr(I.focus)&&I.focus(),select:()=>Zr(I.select)&&I.select(),setCustomValidity:T=>Zr(I.setCustomValidity)&&I.setCustomValidity(T),reportValidity:()=>Zr(I.reportValidity)&&I.reportValidity()})},[i._fields,n]),j=J.useMemo(()=>({name:n,value:m,...Mi(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:E}),[n,r,h.disabled,C,k,E,m]);return J.useEffect(()=>{const I=i._options.shouldUnregister||o,N=y.current;N&&N!==n&&!d&&i.unregister(N),i.register(n,{...v.current.rules,...Mi(v.current.disabled)?{disabled:v.current.disabled}:{}});const T=(A,D)=>{const F=De(i._fields,A);F&&F._f&&(F._f.mount=D)};if(T(n,!0),I){const A=bn(De(i._options.defaultValues,n,v.current.defaultValue));qt(i._defaultValues,n,A),sn(De(i._formValues,n))&&qt(i._formValues,n,A)}return!d&&i.register(n),y.current=n,()=>{(d?I&&!i._state.action:I)?i.unregister(n):T(n,!1)}},[n,i,d,o]),J.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),J.useMemo(()=>({field:j,formState:h,fieldState:S}),[j,h,S])}const Pme=e=>e.render(Dme(e));var aj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},wi=e=>Array.isArray(e)?e:[e],v2=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}};function t6(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&nr(i)&&o){const a=t6(i,o);nr(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Ar=e=>nr(e)&&!Object.keys(e).length,sj=e=>e.type==="file",Uy=e=>{if(!nj)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},n6=e=>e.type==="select-multiple",lj=e=>e.type==="radio",Mme=e=>lj(e)||sh(e),W_=e=>Uy(e)&&e.isConnected;function zme(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=sn(e)?r++:e[t[r++]];return e}function Lme(e){for(const t in e)if(e.hasOwnProperty(t)&&!sn(e[t]))return!1;return!0}function Kn(e,t){const n=Array.isArray(t)?t:yx(t)?[t]:rj(t),r=n.length===1?e:zme(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(nr(r)&&Ar(r)||Array.isArray(r)&&Lme(r))&&Kn(e,n.slice(0,-1)),e}var Fme=e=>{for(const t in e)if(Zr(e[t]))return!0;return!1};function r6(e){return Array.isArray(e)||nr(e)&&!Fme(e)}function UC(e,t={}){for(const n in e){const r=e[n];r6(r)?(t[n]=Array.isArray(r)?[]:{},UC(r,t[n])):sn(r)||(t[n]=!0)}return t}function dd(e,t,n){n||(n=UC(t));for(const r in e){const i=e[r];if(r6(i))sn(t)||FC(n[r])?n[r]=UC(i,Array.isArray(i)?[]:{}):dd(i,vi(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!Uo(i,o)}}return n}const y2={value:!1,isValid:!1},b2={value:!0,isValid:!0};var i6=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!sn(e[0].attributes.value)?sn(e[0].value)||e[0].value===""?b2:{value:e[0].value,isValid:!0}:b2:y2}return y2},o6=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>sn(e)?e:t?e===""?NaN:e&&+e:n&&Fi(e)?new Date(e):r?r(e):e;const x2={isValid:!1,value:null};var a6=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,x2):x2;function w2(e){const t=e.ref;return sj(t)?t.files:lj(t)?a6(e.refs).value:n6(t)?[...t.selectedOptions].map(({value:n})=>n):sh(t)?i6(e.refs).value:o6(sn(t.value)?e.ref.value:t.value,e)}var Ume=(e,t,n,r)=>{const i={};for(const o of e){const a=De(t,o);a&&qt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Vy=e=>e instanceof RegExp,zp=e=>sn(e)?e:Vy(e)?e.source:nr(e)?Vy(e.value)?e.value.source:e.value:e,vd=e=>({isOnSubmit:!e||e===So.onSubmit,isOnBlur:e===So.onBlur,isOnChange:e===So.onChange,isOnAll:e===So.all,isOnTouch:e===So.onTouched});const S2="AsyncFunction";var Vme=e=>!!e&&!!e.validate&&!!(Zr(e.validate)&&e.validate.constructor.name===S2||nr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===S2)),Bme=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),VC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ed=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=De(e,i);if(o){const{_f:a,...l}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(Ed(l,t))break}else if(nr(l)&&Ed(l,t))break}}};function _2(e,t,n){const r=De(e,n);if(r||yx(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=De(t,o),l=De(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};i.pop()}return{name:n}}var Hme=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Ar(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||So.all))},qme=(e,t,n)=>!e||!t||e===t||wi(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Kme=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Gme=(e,t)=>!bx(De(e,t)).length&&Kn(e,t),s6=(e,t,n)=>{const r=wi(De(e,n));return qt(r,"root",t[n]),qt(e,n,r),e};function C2(e,t,n="validate"){if(Fi(e)||Array.isArray(e)&&e.every(Fi)||Mi(e)&&!e)return{type:n,message:Fi(e)?e:"",ref:t}}var nd=e=>nr(e)&&!Vy(e)?e:{value:e,message:""},BC=async(e,t,n,r,i,o)=>{const{ref:a,refs:l,required:d,maxLength:f,minLength:m,min:h,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:k}=e._f,E=De(n,S);if(!k||t.has(S))return{};const j=l?l[0]:a,I=G=>{i&&j.reportValidity&&(j.setCustomValidity(Mi(G)?"":G||""),j.reportValidity())},N={},T=lj(a),A=sh(a),D=T||A,F=(C||sj(a))&&sn(a.value)&&sn(E)||Uy(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,q=aj.bind(null,S,r,N),ee=(G,K,V,H=Ya.maxLength,z=Ya.minLength)=>{const W=G?K:V;N[S]={type:G?H:z,message:W,ref:a,...q(G?H:z,W)}};if(o?!Array.isArray(E)||!E.length:d&&(!D&&(F||vi(E))||Mi(E)&&!E||A&&!i6(l).isValid||T&&!a6(l).isValid)){const{value:G,message:K}=Fi(d)?{value:!!d,message:d}:nd(d);if(G&&(N[S]={type:Ya.required,message:K,ref:j,...q(Ya.required,K)},!r))return I(K),N}if(!F&&(!vi(h)||!vi(v))){let G,K;const V=nd(v),H=nd(h);if(!vi(E)&&!isNaN(E)){const z=a.valueAsNumber||E&&+E;vi(V.value)||(G=z>V.value),vi(H.value)||(K=z<H.value)}else{const z=a.valueAsDate||new Date(E),W=$=>new Date(new Date().toDateString()+" "+$),L=a.type=="time",ne=a.type=="week";Fi(V.value)&&E&&(G=L?W(E)>W(V.value):ne?E>V.value:z>new Date(V.value)),Fi(H.value)&&E&&(K=L?W(E)<W(H.value):ne?E<H.value:z<new Date(H.value))}if((G||K)&&(ee(!!G,V.message,H.message,Ya.max,Ya.min),!r))return I(N[S].message),N}if((f||m)&&!F&&(Fi(E)||o&&Array.isArray(E))){const G=nd(f),K=nd(m),V=!vi(G.value)&&E.length>+G.value,H=!vi(K.value)&&E.length<+K.value;if((V||H)&&(ee(V,G.message,K.message),!r))return I(N[S].message),N}if(y&&!F&&Fi(E)){const{value:G,message:K}=nd(y);if(Vy(G)&&!E.match(G)&&(N[S]={type:Ya.pattern,message:K,ref:a,...q(Ya.pattern,K)},!r))return I(K),N}if(x){if(Zr(x)){const G=await x(E,n),K=C2(G,j);if(K&&(N[S]={...K,...q(Ya.validate,K.message)},!r))return I(K.message),N}else if(nr(x)){let G={};for(const K in x){if(!Ar(G)&&!r)break;const V=C2(await x[K](E,n),j,K);V&&(G={...V,...q(K,V.message)},I(V.message),r&&(N[S]=G))}if(!Ar(G)&&(N[S]={ref:j,...G},!r))return N}}return I(!0),N};const Zme={mode:So.onSubmit,reValidateMode:So.onChange,shouldFocusError:!0};function Yme(e={}){let t={...Zme,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Zr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=nr(t.defaultValues)||nr(t.values)?bn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:bn(i),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m};let v={...h};const y={array:v2(),state:v2()},x=t.criteriaMode===So.all,S=Y=>re=>{clearTimeout(f),f=setTimeout(Y,re)},C=async Y=>{if(!a.keepIsValid&&!t.disabled&&(h.isValid||v.isValid||Y)){let re;t.resolver?(re=Ar((await D()).errors),k()):re=await q(r,!0),re!==n.isValid&&y.state.next({isValid:re})}},k=(Y,re)=>{!t.disabled&&(h.isValidating||h.validatingFields||v.isValidating||v.validatingFields)&&((Y||Array.from(l.mount)).forEach(se=>{se&&(re?qt(n.validatingFields,se,re):Kn(n.validatingFields,se))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Ar(n.validatingFields)}))},E=(Y,re=[],se,ie,me=!0,B=!0)=>{if(ie&&se&&!t.disabled){if(a.action=!0,B&&Array.isArray(De(r,Y))){const ce=se(De(r,Y),ie.argA,ie.argB);me&&qt(r,Y,ce)}if(B&&Array.isArray(De(n.errors,Y))){const ce=se(De(n.errors,Y),ie.argA,ie.argB);me&&qt(n.errors,Y,ce),Gme(n.errors,Y)}if((h.touchedFields||v.touchedFields)&&B&&Array.isArray(De(n.touchedFields,Y))){const ce=se(De(n.touchedFields,Y),ie.argA,ie.argB);me&&qt(n.touchedFields,Y,ce)}(h.dirtyFields||v.dirtyFields)&&(n.dirtyFields=dd(i,o)),y.state.next({name:Y,isDirty:G(Y,re),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qt(o,Y,re)},j=(Y,re)=>{qt(n.errors,Y,re),y.state.next({errors:n.errors})},I=Y=>{n.errors=Y,y.state.next({errors:n.errors,isValid:!1})},N=(Y,re,se,ie)=>{const me=De(r,Y);if(me){const B=De(o,Y,sn(se)?De(i,Y):se);sn(B)||ie&&ie.defaultChecked||re?qt(o,Y,re?B:w2(me._f)):H(Y,B),a.mount&&!a.action&&C()}},T=(Y,re,se,ie,me)=>{let B=!1,ce=!1;const Ee={name:Y};if(!t.disabled){if(!se||ie){(h.isDirty||v.isDirty)&&(ce=n.isDirty,n.isDirty=Ee.isDirty=G(),B=ce!==Ee.isDirty);const Me=Uo(De(i,Y),re);ce=!!De(n.dirtyFields,Y),Me?Kn(n.dirtyFields,Y):qt(n.dirtyFields,Y,!0),Ee.dirtyFields=n.dirtyFields,B=B||(h.dirtyFields||v.dirtyFields)&&ce!==!Me}if(se){const Me=De(n.touchedFields,Y);Me||(qt(n.touchedFields,Y,se),Ee.touchedFields=n.touchedFields,B=B||(h.touchedFields||v.touchedFields)&&Me!==se)}B&&me&&y.state.next(Ee)}return B?Ee:{}},A=(Y,re,se,ie)=>{const me=De(n.errors,Y),B=(h.isValid||v.isValid)&&Mi(re)&&n.isValid!==re;if(t.delayError&&se?(d=S(()=>j(Y,se)),d(t.delayError)):(clearTimeout(f),d=null,se?qt(n.errors,Y,se):Kn(n.errors,Y)),(se?!Uo(me,se):me)||!Ar(ie)||B){const ce={...ie,...B&&Mi(re)?{isValid:re}:{},errors:n.errors,name:Y};n={...n,...ce},y.state.next(ce)}},D=async Y=>(k(Y,!0),await t.resolver(o,t.context,Ume(Y||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),F=async Y=>{const{errors:re}=await D(Y);if(k(Y),Y)for(const se of Y){const ie=De(re,se);ie?qt(n.errors,se,ie):Kn(n.errors,se)}else n.errors=re;return re},q=async(Y,re,se={valid:!0})=>{for(const ie in Y){const me=Y[ie];if(me){const{_f:B,...ce}=me;if(B){const Ee=l.array.has(B.name),Me=me._f&&Vme(me._f);Me&&h.validatingFields&&k([B.name],!0);const Ke=await BC(me,l.disabled,o,x,t.shouldUseNativeValidation&&!re,Ee);if(Me&&h.validatingFields&&k([B.name]),Ke[B.name]&&(se.valid=!1,re||e.shouldUseNativeValidation))break;!re&&(De(Ke,B.name)?Ee?s6(n.errors,Ke,B.name):qt(n.errors,B.name,Ke[B.name]):Kn(n.errors,B.name))}!Ar(ce)&&await q(ce,re,se)}}return se.valid},ee=()=>{for(const Y of l.unMount){const re=De(r,Y);re&&(re._f.refs?re._f.refs.every(se=>!W_(se)):!W_(re._f.ref))&&le(Y)}l.unMount=new Set},G=(Y,re)=>!t.disabled&&(Y&&re&&qt(o,Y,re),!Uo(P(),i)),K=(Y,re,se)=>LC(Y,l,{...a.mount?o:sn(re)?i:Fi(Y)?{[Y]:re}:re},se,re),V=Y=>bx(De(a.mount?o:i,Y,t.shouldUnregister?De(i,Y,[]):[])),H=(Y,re,se={})=>{const ie=De(r,Y);let me=re;if(ie){const B=ie._f;B&&(!B.disabled&&qt(o,Y,o6(re,B)),me=Uy(B.ref)&&vi(re)?"":re,n6(B.ref)?[...B.ref.options].forEach(ce=>ce.selected=me.includes(ce.value)):B.refs?sh(B.ref)?B.refs.forEach(ce=>{(!ce.defaultChecked||!ce.disabled)&&(Array.isArray(me)?ce.checked=!!me.find(Ee=>Ee===ce.value):ce.checked=me===ce.value||!!me)}):B.refs.forEach(ce=>ce.checked=ce.value===me):sj(B.ref)?B.ref.value="":(B.ref.value=me,B.ref.type||y.state.next({name:Y,values:bn(o)})))}(se.shouldDirty||se.shouldTouch)&&T(Y,me,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&$(Y)},z=(Y,re,se)=>{for(const ie in re){if(!re.hasOwnProperty(ie))return;const me=re[ie],B=Y+"."+ie,ce=De(r,B);(l.array.has(Y)||nr(me)||ce&&!ce._f)&&!xc(me)?z(B,me,se):H(B,me,se)}},W=(Y,re,se={})=>{const ie=De(r,Y),me=l.array.has(Y),B=bn(re);qt(o,Y,B),me?(y.array.next({name:Y,values:bn(o)}),(h.isDirty||h.dirtyFields||v.isDirty||v.dirtyFields)&&se.shouldDirty&&y.state.next({name:Y,dirtyFields:dd(i,o),isDirty:G(Y,B)})):ie&&!ie._f&&!vi(B)?z(Y,B,se):H(Y,B,se),VC(Y,l)?y.state.next({...n,name:Y,values:bn(o)}):y.state.next({name:a.mount?Y:void 0,values:bn(o)})},L=async Y=>{a.mount=!0;const re=Y.target;let se=re.name,ie=!0;const me=De(r,se),B=Me=>{ie=Number.isNaN(Me)||xc(Me)&&isNaN(Me.getTime())||Uo(Me,De(o,se,Me))},ce=vd(t.mode),Ee=vd(t.reValidateMode);if(me){let Me,Ke;const Wt=re.type?w2(me._f):JU(Y),Vt=Y.type===Fy.BLUR||Y.type===Fy.FOCUS_OUT,Cn=!Bme(me._f)&&!t.resolver&&!De(n.errors,se)&&!me._f.deps||Kme(Vt,De(n.touchedFields,se),n.isSubmitted,Ee,ce),zt=VC(se,l,Vt);qt(o,se,Wt),Vt?(!re||!re.readOnly)&&(me._f.onBlur&&me._f.onBlur(Y),d&&d(0)):me._f.onChange&&me._f.onChange(Y);const fn=T(se,Wt,Vt),kt=!Ar(fn)||zt;if(!Vt&&y.state.next({name:se,type:Y.type,values:bn(o)}),Cn)return(h.isValid||v.isValid)&&(t.mode==="onBlur"?Vt&&C():Vt||C()),kt&&y.state.next({name:se,...zt?{}:fn});if(!Vt&&zt&&y.state.next({...n}),t.resolver){const{errors:ar}=await D([se]);if(k([se]),B(Wt),ie){const In=_2(n.errors,r,se),dr=_2(ar,r,In.name||se);Me=dr.error,se=dr.name,Ke=Ar(ar)}}else k([se],!0),Me=(await BC(me,l.disabled,o,x,t.shouldUseNativeValidation))[se],k([se]),B(Wt),ie&&(Me?Ke=!1:(h.isValid||v.isValid)&&(Ke=await q(r,!0)));ie&&(me._f.deps&&(!Array.isArray(me._f.deps)||me._f.deps.length>0)&&$(me._f.deps),A(se,Ke,Me,fn))}},ne=(Y,re)=>{if(De(n.errors,re)&&Y.focus)return Y.focus(),1},$=async(Y,re={})=>{let se,ie;const me=wi(Y);if(t.resolver){const B=await F(sn(Y)?Y:me);se=Ar(B),ie=Y?!me.some(ce=>De(B,ce)):se}else Y?(ie=(await Promise.all(me.map(async B=>{const ce=De(r,B);return await q(ce&&ce._f?{[B]:ce}:ce)}))).every(Boolean),!(!ie&&!n.isValid)&&C()):ie=se=await q(r);return y.state.next({...!Fi(Y)||(h.isValid||v.isValid)&&se!==n.isValid?{}:{name:Y},...t.resolver||!Y?{isValid:se}:{},errors:n.errors}),re.shouldFocus&&!ie&&Ed(r,ne,Y?me:l.mount),ie},P=(Y,re)=>{let se={...a.mount?o:i};return re&&(se=t6(re.dirtyFields?n.dirtyFields:n.touchedFields,se)),sn(Y)?se:Fi(Y)?De(se,Y):Y.map(ie=>De(se,ie))},U=(Y,re)=>({invalid:!!De((re||n).errors,Y),isDirty:!!De((re||n).dirtyFields,Y),error:De((re||n).errors,Y),isValidating:!!De(n.validatingFields,Y),isTouched:!!De((re||n).touchedFields,Y)}),O=Y=>{Y&&wi(Y).forEach(re=>Kn(n.errors,re)),y.state.next({errors:Y?n.errors:{}})},X=(Y,re,se)=>{const ie=(De(r,Y,{_f:{}})._f||{}).ref,me=De(n.errors,Y)||{},{ref:B,message:ce,type:Ee,...Me}=me;qt(n.errors,Y,{...Me,...re,ref:ie}),y.state.next({name:Y,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&ie&&ie.focus&&ie.focus()},pe=(Y,re)=>Zr(Y)?y.state.subscribe({next:se=>"values"in se&&Y(K(void 0,re),se)}):K(Y,re,!0),ve=Y=>y.state.subscribe({next:re=>{qme(Y.name,re.name,Y.exact)&&Hme(re,Y.formState||h,br,Y.reRenderRoot)&&Y.callback({values:{...o},...n,...re,defaultValues:i})}}).unsubscribe,Q=Y=>(a.mount=!0,v={...v,...Y.formState},ve({...Y,formState:{...m,...Y.formState}})),le=(Y,re={})=>{for(const se of Y?wi(Y):l.mount)l.mount.delete(se),l.array.delete(se),re.keepValue||(Kn(r,se),Kn(o,se)),!re.keepError&&Kn(n.errors,se),!re.keepDirty&&Kn(n.dirtyFields,se),!re.keepTouched&&Kn(n.touchedFields,se),!re.keepIsValidating&&Kn(n.validatingFields,se),!t.shouldUnregister&&!re.keepDefaultValue&&Kn(i,se);y.state.next({values:bn(o)}),y.state.next({...n,...re.keepDirty?{isDirty:G()}:{}}),!re.keepIsValid&&C()},Se=({disabled:Y,name:re})=>{(Mi(Y)&&a.mount||Y||l.disabled.has(re))&&(Y?l.disabled.add(re):l.disabled.delete(re))},ke=(Y,re={})=>{let se=De(r,Y);const ie=Mi(re.disabled)||Mi(t.disabled);return qt(r,Y,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:Y}},name:Y,mount:!0,...re}}),l.mount.add(Y),se?Se({disabled:Mi(re.disabled)?re.disabled:t.disabled,name:Y}):N(Y,!0,re.value),{...ie?{disabled:re.disabled||t.disabled}:{},...t.progressive?{required:!!re.required,min:zp(re.min),max:zp(re.max),minLength:zp(re.minLength),maxLength:zp(re.maxLength),pattern:zp(re.pattern)}:{},name:Y,onChange:L,onBlur:L,ref:me=>{if(me){ke(Y,re),se=De(r,Y);const B=sn(me.value)&&me.querySelectorAll&&me.querySelectorAll("input,select,textarea")[0]||me,ce=Mme(B),Ee=se._f.refs||[];if(ce?Ee.find(Me=>Me===B):B===se._f.ref)return;qt(r,Y,{_f:{...se._f,...ce?{refs:[...Ee.filter(W_),B,...Array.isArray(De(i,Y))?[{}]:[]],ref:{type:B.type,name:Y}}:{ref:B}}}),N(Y,!1,void 0,B)}else se=De(r,Y,{}),se._f&&(se._f.mount=!1),(t.shouldUnregister||re.shouldUnregister)&&!(QU(l.array,Y)&&a.action)&&l.unMount.add(Y)}}},Pe=()=>t.shouldFocusError&&Ed(r,ne,l.mount),Fe=Y=>{Mi(Y)&&(y.state.next({disabled:Y}),Ed(r,(re,se)=>{const ie=De(r,se);ie&&(re.disabled=ie._f.disabled||Y,Array.isArray(ie._f.refs)&&ie._f.refs.forEach(me=>{me.disabled=ie._f.disabled||Y}))},0,!1))},ut=(Y,re)=>async se=>{let ie;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let me=bn(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:ce}=await D();k(),n.errors=B,me=bn(ce)}else await q(r);if(l.disabled.size)for(const B of l.disabled)Kn(me,B);if(Kn(n.errors,"root"),Ar(n.errors)){y.state.next({errors:{}});try{await Y(me,se)}catch(B){ie=B}}else re&&await re({...n.errors},se),Pe(),setTimeout(Pe);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ar(n.errors)&&!ie,submitCount:n.submitCount+1,errors:n.errors}),ie)throw ie},Ze=(Y,re={})=>{De(r,Y)&&(sn(re.defaultValue)?W(Y,bn(De(i,Y))):(W(Y,re.defaultValue),qt(i,Y,bn(re.defaultValue))),re.keepTouched||Kn(n.touchedFields,Y),re.keepDirty||(Kn(n.dirtyFields,Y),n.isDirty=re.defaultValue?G(Y,bn(De(i,Y))):G()),re.keepError||(Kn(n.errors,Y),h.isValid&&C()),y.state.next({...n}))},Pt=(Y,re={})=>{const se=Y?bn(Y):i,ie=bn(se),me=Ar(Y),B=me?i:ie;if(re.keepDefaultValues||(i=se),!re.keepValues){if(re.keepDirtyValues){const ce=new Set([...l.mount,...Object.keys(dd(i,o))]);for(const Ee of Array.from(ce)){const Me=De(n.dirtyFields,Ee),Ke=De(o,Ee),Wt=De(B,Ee);Me&&!sn(Ke)?qt(B,Ee,Ke):!Me&&!sn(Wt)&&W(Ee,Wt)}}else{if(nj&&sn(Y))for(const ce of l.mount){const Ee=De(r,ce);if(Ee&&Ee._f){const Me=Array.isArray(Ee._f.refs)?Ee._f.refs[0]:Ee._f.ref;if(Uy(Me)){const Ke=Me.closest("form");if(Ke){Ke.reset();break}}}}if(re.keepFieldsRef)for(const ce of l.mount)W(ce,De(B,ce));else r={}}o=t.shouldUnregister?re.keepDefaultValues?bn(i):{}:bn(B),y.array.next({values:{...B}}),y.state.next({values:{...B}})}l={mount:re.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!h.isValid||!!re.keepIsValid||!!re.keepDirtyValues||!t.shouldUnregister&&!Ar(B),a.watch=!!t.shouldUnregister,a.keepIsValid=!!re.keepIsValid,a.action=!1,re.keepErrors||(n.errors={}),y.state.next({submitCount:re.keepSubmitCount?n.submitCount:0,isDirty:me?!1:re.keepDirty?n.isDirty:!!(re.keepDefaultValues&&!Uo(Y,i)),isSubmitted:re.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:me?{}:re.keepDirtyValues?re.keepDefaultValues&&o?dd(i,o):n.dirtyFields:re.keepDefaultValues&&Y?dd(i,Y):re.keepDirty?n.dirtyFields:{},touchedFields:re.keepTouched?n.touchedFields:{},errors:re.keepErrors?n.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},dn=(Y,re)=>Pt(Zr(Y)?Y(o):Y,{...t.resetOptions,...re}),tn=(Y,re={})=>{const se=De(r,Y),ie=se&&se._f;if(ie){const me=ie.refs?ie.refs[0]:ie.ref;me.focus&&setTimeout(()=>{me.focus(),re.shouldSelect&&Zr(me.select)&&me.select()})}},br=Y=>{n={...n,...Y}},An={control:{register:ke,unregister:le,getFieldState:U,handleSubmit:ut,setError:X,_subscribe:ve,_runSchema:D,_updateIsValidating:k,_focusError:Pe,_getWatch:K,_getDirty:G,_setValid:C,_setFieldArray:E,_setDisabledField:Se,_setErrors:I,_getFieldArray:V,_reset:Pt,_resetDefaultValues:()=>Zr(t.defaultValues)&&t.defaultValues().then(Y=>{dn(Y,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:ee,_disableForm:Fe,_subjects:y,_proxyFormState:h,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(Y){a=Y},get _defaultValues(){return i},get _names(){return l},set _names(Y){l=Y},get _formState(){return n},get _options(){return t},set _options(Y){t={...t,...Y}}},subscribe:Q,trigger:$,register:ke,handleSubmit:ut,watch:pe,setValue:W,getValues:P,reset:dn,resetField:Ze,clearErrors:O,unregister:le,setError:X,setFocus:tn,getFieldState:U};return{...An,formControl:An}}var qs=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},X_=(e,t,n={})=>n.shouldFocus||sn(n.shouldFocus)?n.focusName||`${e}.${sn(n.focusIndex)?t:n.focusIndex}.`:"",J_=(e,t)=>[...e,...wi(t)],Q_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function e1(e,t,n){return[...e.slice(0,t),...wi(n),...e.slice(t)]}var t1=(e,t,n)=>Array.isArray(e)?(sn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],n1=(e,t)=>[...wi(t),...wi(e)];function Wme(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return bx(r).length?r:[]}var r1=(e,t)=>sn(t)?[]:Wme(e,wi(t).sort((n,r)=>n-r)),i1=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},k2=(e,t,n)=>(e[t]=n,e);function cj(e){const t=lh(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[l,d]=J.useState(n._getFieldArray(r)),f=J.useRef(n._getFieldArray(r).map(qs)),m=J.useRef(!1);n._names.array.add(r),J.useMemo(()=>a&&l.length>=0&&n.register(r,a),[n,r,l.length,a]),xx(()=>n._subjects.array.subscribe({next:({values:I,name:N})=>{if(N===r||!N){const T=De(I,r);Array.isArray(T)&&(d(T),f.current=T.map(qs))}}}).unsubscribe,[n,r]);const h=J.useCallback(I=>{m.current=!0,n._setFieldArray(r,I)},[n,r]),v=(I,N)=>{const T=wi(bn(I)),A=J_(n._getFieldArray(r),T);n._names.focus=X_(r,A.length-1,N),f.current=J_(f.current,T.map(qs)),h(A),d(A),n._setFieldArray(r,A,J_,{argA:Q_(I)})},y=(I,N)=>{const T=wi(bn(I)),A=n1(n._getFieldArray(r),T);n._names.focus=X_(r,0,N),f.current=n1(f.current,T.map(qs)),h(A),d(A),n._setFieldArray(r,A,n1,{argA:Q_(I)})},x=I=>{const N=r1(n._getFieldArray(r),I);f.current=r1(f.current,I),h(N),d(N),!Array.isArray(De(n._fields,r))&&qt(n._fields,r,void 0),n._setFieldArray(r,N,r1,{argA:I})},S=(I,N,T)=>{const A=wi(bn(N)),D=e1(n._getFieldArray(r),I,A);n._names.focus=X_(r,I,T),f.current=e1(f.current,I,A.map(qs)),h(D),d(D),n._setFieldArray(r,D,e1,{argA:I,argB:Q_(N)})},C=(I,N)=>{const T=n._getFieldArray(r);i1(T,I,N),i1(f.current,I,N),h(T),d(T),n._setFieldArray(r,T,i1,{argA:I,argB:N},!1)},k=(I,N)=>{const T=n._getFieldArray(r);t1(T,I,N),t1(f.current,I,N),h(T),d(T),n._setFieldArray(r,T,t1,{argA:I,argB:N},!1)},E=(I,N)=>{const T=bn(N),A=k2(n._getFieldArray(r),I,T);f.current=[...A].map((D,F)=>!D||F===I?qs():f.current[F]),h(A),d([...A]),n._setFieldArray(r,A,k2,{argA:I,argB:T},!0,!1)},j=I=>{const N=wi(bn(I));f.current=N.map(qs),h([...N]),d([...N]),n._setFieldArray(r,[...N],T=>T,{},!0,!1)};return J.useEffect(()=>{if(n._state.action=!1,VC(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!vd(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!vd(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(I=>{n._updateIsValidating([r]);const N=De(I.errors,r),T=De(n._formState.errors,r);(T?!N&&T.type||N&&(T.type!==N.type||T.message!==N.message):N&&N.type)&&(N?qt(n._formState.errors,r,N):Kn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const I=De(n._fields,r);I&&I._f&&!(vd(n._options.reValidateMode).isOnSubmit&&vd(n._options.mode).isOnSubmit)&&BC(I,n._names.disabled,n._formValues,n._options.criteriaMode===So.all,n._options.shouldUseNativeValidation,!0).then(N=>!Ar(N)&&n._subjects.state.next({errors:s6(n._formState.errors,N,r)}))}n._subjects.state.next({name:r,values:bn(n._formValues)}),n._names.focus&&Ed(n._fields,(I,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&I.focus)return I.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[l,r,n]),J.useEffect(()=>(!De(n._formValues,r)&&n._setFieldArray(r),()=>{const I=(N,T)=>{const A=De(n._fields,N);A&&A._f&&(A._f.mount=T)};n._options.shouldUnregister||o?n.unregister(r):I(r,!1)}),[r,n,i,o]),{swap:J.useCallback(C,[h,r,n]),move:J.useCallback(k,[h,r,n]),prepend:J.useCallback(y,[h,r,n]),append:J.useCallback(v,[h,r,n]),remove:J.useCallback(x,[h,r,n]),insert:J.useCallback(S,[h,r,n]),update:J.useCallback(E,[h,r,n]),replace:J.useCallback(j,[h,r,n]),fields:J.useMemo(()=>l.map((I,N)=>({...I,[i]:f.current[N]||qs()})),[l,i])}}function cn(e={}){const t=J.useRef(void 0),n=J.useRef(void 0),[r,i]=J.useState({isDirty:!1,isValidating:!1,isLoading:Zr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Zr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Zr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...l}=Yme(e);t.current={...l,formState:r}}const o=t.current.control;return o._options=e,xx(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),o._formState.isReady=!0,a},[o]),J.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),J.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),J.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),J.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),J.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),J.useEffect(()=>{var a;e.values&&!Uo(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),n.current=e.values,i(l=>({...l}))):o._resetDefaultValues()},[o,e.values]),J.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=e6(r,o),t.current}const un=Ome,l6=b.createContext({}),c6=b.createContext({});function wx(){const e=b.useContext(l6),t=b.useContext(c6),{getFieldState:n}=lh(),r=oj({name:e.name}),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}}function Oe({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=wx();return u.jsx(aE,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function $e({...e}){return u.jsx(l6,{value:{name:e.name},children:u.jsx(Pme,{...e})})}function Te({className:e,...t}){const n=b.useId();return u.jsx(c6,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Ue("grid gap-2",e),...t})})}var Xme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],u6=Xme.reduce((e,t)=>{const n=k4(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...l}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Jme="Label",d6=b.forwardRef((e,t)=>u.jsx(u6.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));d6.displayName=Jme;var Qme=d6;function ch({className:e,...t}){return u.jsx(Qme,{"data-slot":"label",className:Ue("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Ne({className:e,...t}){const{error:n,formItemId:r}=wx();return u.jsx(ch,{"data-slot":"form-label","data-error":!!n,className:Ue("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Ae({className:e,...t}){const{error:n,formMessageId:r}=wx(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:Ue("text-destructive text-sm",e),...t,children:i}):null}function ze({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
        selection:text-primary-foreground
        dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
        dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
        aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
        flex h-9 w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
        file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
        focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple  disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
        aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...n})}const Sx=["RUNNING"],uj=["TERMINATING","TERMINATED","REMOVED"];function ehe(){return"https://fabric.harper.fast/#/?createCluster="+encodeURIComponent(JSON.stringify({deploymentDescription:"Self-Hosted",performanceDescription:"Self Supported and Managed",instances:[{secure:String(location.protocol==="https:"),fqdn:location.hostname,port:parseInt(location.port,10)}]}))}async function HC({username:e,password:t,instanceClient:n,entityId:r}){const{data:{message:i}}=await n.post("/",{operation:"login",username:e,password:t});try{const l=await sl({instanceClient:n});return{message:i,user:l}}catch(l){console.error("Failed to get user after login, trying basic auth",l)}try{const l=await sl({instanceClient:n,auth:{username:e,password:t}});return jt.flagForBasicAuth(r,{username:e,password:t}),{message:i,user:l}}catch(l){throw l}const o=es({id:r,forceFabricConnect:!0}),a=await sl({instanceClient:o});return jt.flagForFabricConnect(r,!0),{message:i,user:a,instanceClient:n}}function the(){return ct({mutationFn:HC})}function nhe({cluster:e,instance:t,instanceParams:n}){const r=jn(),i=_n(),{redirect:o}=Rr({strict:!1}),{mutate:a,isPending:l}=the(),d=b.useCallback(async f=>{a({...f,...n},{onSuccess:async({message:m,user:h})=>{if(we.success(m),e?.instances?.length&&!t)for(const y of e.instances)jt.setUserForEntity(y,h);const v=$n;jt.setUserForEntity(v,h),i.invalidate(),await r({to:o?.startsWith("/")?o:ba})}})},[e,t,n,r,o,i,a]);return{isPending:l,submitForm:d}}async function dj(e){const{data:t}=await Gt.get(`/Cluster/${e}`);return t}function Dl(e,t){return{queryKey:[e],queryFn:()=>dj(e),retry:!1,staleTime:1900,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}const f6=Object.freeze({status:"aborted"});function ae(e,t,n){function r(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);const f=a.prototype,m=Object.keys(f);for(let h=0;h<m.length;h++){const v=m[h];v in l||(l[v]=f[v].bind(l))}}const i=n?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(l){var d;const f=n?.Parent?new o:this;r(f,l),(d=f._zod).deferred??(d.deferred=[]);for(const m of f._zod.deferred)m();return f}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const p6=Symbol("zod_brand");class Rc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _x extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const By={};function Mr(e){return e&&Object.assign(By,e),By}function rhe(e){return e}function ihe(e){return e}function ohe(e){}function ahe(e){throw new Error("Unexpected value in exhaustive check")}function she(e){}function fj(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function je(e,t="|"){return e.map(n=>it(n)).join(t)}function Hy(e,t){return typeof t=="bigint"?t.toString():t}function uh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nu(e){return e==null}function Cx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function m6(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const o=n>i?n:i,a=Number.parseInt(e.toFixed(o).replace(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return a%l/10**o}const E2=Symbol("evaluating");function _t(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E2)return r===void 0&&(r=E2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function lhe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ea(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function che(e){return Ea(e._zod.def)}function uhe(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function dhe(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const i={};for(let o=0;o<t.length;o++)i[t[o]]=r[o];return i})}function fhe(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function qC(e){return JSON.stringify(e)}function h6(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const g6=uh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function zc(e){if(Kd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Kd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kx(e){return zc(e)?{...e}:Array.isArray(e)?[...e]:e}function phe(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const mhe=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},qy=new Set(["string","number","symbol"]),v6=new Set(["string","number","bigint","boolean","symbol","undefined"]);function us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function hhe(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,o){return t??(t=e()),Reflect.set(t,r,i,o)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function it(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function y6(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const b6={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},x6={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function w6(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ea(e._zod.def,{get shape(){const a={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=n.shape[l])}return Pl(this,"shape",a),a},checks:[]});return Oo(e,o)}function S6(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ea(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return Pl(this,"shape",a),a},checks:[]});return Oo(e,o)}function _6(e,t){if(!zc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ea(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Pl(this,"shape",o),o}});return Oo(e,i)}function C6(e,t){if(!zc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ea(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Pl(this,"shape",r),r}});return Oo(e,n)}function k6(e,t){const n=Ea(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Pl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Oo(e,n)}function E6(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Ea(t._zod.def,{get shape(){const l=t._zod.def.shape,d={...l};if(n)for(const f in n){if(!(f in l))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:l[f]}):l[f])}else for(const f in l)d[f]=e?new e({type:"optional",innerType:l[f]}):l[f];return Pl(this,"shape",d),d},checks:[]});return Oo(t,a)}function j6(e,t,n){const r=Ea(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new e({type:"nonoptional",innerType:i[a]});return Pl(this,"shape",o),o}});return Oo(t,r)}function wc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Vo(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Xp(e){return typeof e=="string"?e:e?.message}function Ro(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Xp(e.inst?._zod.def?.error?.(e))??Xp(t?.error?.(e))??Xp(n.customError?.(e))??Xp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ex(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function jx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function st(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Gd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function ghe(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function I6(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function R6(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function vhe(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return I6(t+n)}function yhe(e){return R6(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bhe(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function xhe(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class whe{constructor(...t){}}const T6=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:x6,Class:whe,NUMBER_FORMAT_RANGES:b6,aborted:wc,allowsEval:g6,assert:she,assertEqual:rhe,assertIs:ohe,assertNever:ahe,assertNotEqual:ihe,assignProp:Pl,base64ToUint8Array:I6,base64urlToUint8Array:vhe,cached:uh,captureStackTrace:pj,cleanEnum:ghe,cleanRegex:Cx,clone:Oo,cloneDef:che,createTransparentProxy:hhe,defineLazy:_t,esc:qC,escapeRegex:us,extend:_6,finalizeIssue:Ro,floatSafeRemainder:m6,getElementAtPath:uhe,getEnumValues:fj,getLengthableOrigin:jx,getParsedType:mhe,getSizableOrigin:Ex,hexToUint8Array:bhe,isObject:Kd,isPlainObject:zc,issue:Gd,joinValues:je,jsonStringifyReplacer:Hy,merge:k6,mergeDefs:Ea,normalizeParams:Ce,nullish:nu,numKeys:phe,objectClone:lhe,omit:S6,optionalKeys:y6,parsedType:st,partial:E6,pick:w6,prefixIssues:Vo,primitiveTypes:v6,promiseAllObject:dhe,propertyKeyTypes:qy,randomString:fhe,required:j6,safeExtend:C6,shallowClone:kx,slugify:h6,stringifyPrimitive:it,uint8ArrayToBase64:R6,uint8ArrayToBase64url:yhe,uint8ArrayToHex:xhe,unwrapMessage:Xp},Symbol.toStringTag,{value:"Module"})),N6=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Hy,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ix=ae("$ZodError",N6),eo=ae("$ZodError",N6,{Parent:Error});function mj(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function hj(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let a=n,l=0;for(;l<o.path.length;){const d=o.path[l];l===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(o))):a[d]=a[d]||{_errors:[]},a=a[d],l++}}};return r(e),n}function A6(e,t=n=>n.message){const n={errors:[]},r=(i,o=[])=>{var a,l;for(const d of i.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>r({issues:f},d.path));else if(d.code==="invalid_key")r({issues:d.issues},d.path);else if(d.code==="invalid_element")r({issues:d.issues},d.path);else{const f=[...o,...d.path];if(f.length===0){n.errors.push(t(d));continue}let m=n,h=0;for(;h<f.length;){const v=f[h],y=h===f.length-1;typeof v=="string"?(m.properties??(m.properties={}),(a=m.properties)[v]??(a[v]={errors:[]}),m=m.properties[v]):(m.items??(m.items=[]),(l=m.items)[v]??(l[v]={errors:[]}),m=m.items[v]),y&&m.errors.push(t(d)),h++}}};return r(e),n}function O6(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function $6(e){const t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(`  → at ${O6(r.path)}`);return t.join(`
`)}const dh=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new Rc;if(a.issues.length){const l=new(i?.Err??e)(a.issues.map(d=>Ro(d,o,Mr())));throw pj(l,i?.callee),l}return a.value},Ky=dh(eo),fh=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new(i?.Err??e)(a.issues.map(d=>Ro(d,o,Mr())));throw pj(l,i?.callee),l}return a.value},Gy=fh(eo),ph=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Rc;return o.issues.length?{success:!1,error:new(e??Ix)(o.issues.map(a=>Ro(a,i,Mr())))}:{success:!0,data:o.value}},D6=ph(eo),mh=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Ro(a,i,Mr())))}:{success:!0,data:o.value}},P6=mh(eo),gj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return dh(e)(t,n,i)},She=gj(eo),vj=e=>(t,n,r)=>dh(e)(t,n,r),_he=vj(eo),yj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fh(e)(t,n,i)},Che=yj(eo),bj=e=>async(t,n,r)=>fh(e)(t,n,r),khe=bj(eo),xj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ph(e)(t,n,i)},Ehe=xj(eo),wj=e=>(t,n,r)=>ph(e)(t,n,r),jhe=wj(eo),Sj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mh(e)(t,n,i)},Ihe=Sj(eo),_j=e=>async(t,n,r)=>mh(e)(t,n,r),Rhe=_j(eo),M6=/^[cC][^\s-]{8,}$/,z6=/^[0-9a-z]+$/,L6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,F6=/^[0-9a-vA-V]{20}$/,U6=/^[A-Za-z0-9]{27}$/,V6=/^[a-zA-Z0-9_-]{21}$/,B6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,The=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,H6=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zd=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Nhe=Zd(4),Ahe=Zd(6),Ohe=Zd(7),q6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$he=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Dhe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,K6=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Phe=K6,Mhe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function G6(){return new RegExp(zhe,"u")}const Z6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,W6=e=>{const t=us(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},X6=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,J6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Q6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cj=/^[A-Za-z0-9_-]*$/,e3=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,t3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,n3=/^\+[1-9]\d{6,14}$/,r3="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",i3=new RegExp(`^${r3}$`);function o3(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function a3(e){return new RegExp(`^${o3(e)}$`)}function s3(e){const t=o3({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${r3}T(?:${r})$`)}const l3=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},c3=/^-?\d+n?$/,u3=/^-?\d+$/,kj=/^-?\d+(?:\.\d+)?$/,d3=/^(?:true|false)$/i,f3=/^null$/i,p3=/^undefined$/i,m3=/^[^A-Z]*$/,h3=/^[^a-z]*$/,g3=/^[0-9a-fA-F]*$/;function hh(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function gh(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Lhe=/^[0-9a-fA-F]{32}$/,Fhe=hh(22,"=="),Uhe=gh(22),Vhe=/^[0-9a-fA-F]{40}$/,Bhe=hh(27,"="),Hhe=gh(27),qhe=/^[0-9a-fA-F]{64}$/,Khe=hh(43,"="),Ghe=gh(43),Zhe=/^[0-9a-fA-F]{96}$/,Yhe=hh(64,""),Whe=gh(64),Xhe=/^[0-9a-fA-F]{128}$/,Jhe=hh(86,"=="),Qhe=gh(86),Ej=Object.freeze(Object.defineProperty({__proto__:null,base64:Q6,base64url:Cj,bigint:c3,boolean:d3,browserEmail:Mhe,cidrv4:X6,cidrv6:J6,cuid:M6,cuid2:z6,date:i3,datetime:s3,domain:t3,duration:B6,e164:n3,email:q6,emoji:G6,extendedDuration:The,guid:H6,hex:g3,hostname:e3,html5Email:$he,idnEmail:Phe,integer:u3,ipv4:Z6,ipv6:Y6,ksuid:U6,lowercase:m3,mac:W6,md5_base64:Fhe,md5_base64url:Uhe,md5_hex:Lhe,nanoid:V6,null:f3,number:kj,rfc5322Email:Dhe,sha1_base64:Bhe,sha1_base64url:Hhe,sha1_hex:Vhe,sha256_base64:Khe,sha256_base64url:Ghe,sha256_hex:qhe,sha384_base64:Yhe,sha384_base64url:Whe,sha384_hex:Zhe,sha512_base64:Jhe,sha512_base64url:Qhe,sha512_hex:Xhe,string:l3,time:a3,ulid:L6,undefined:p3,unicodeEmail:K6,uppercase:h3,uuid:Zd,uuid4:Nhe,uuid6:Ahe,uuid7:Ohe,xid:F6},Symbol.toStringTag,{value:"Module"})),Nn=ae("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),v3={number:"number",bigint:"bigint",object:"date"},jj=ae("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const n=v3[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ij=ae("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const n=v3[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),y3=ae("$ZodCheckMultipleOf",(e,t)=>{Nn.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):m6(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),b3=ae("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=b6[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=i,l.maximum=o,n&&(l.pattern=u3)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<i&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),x3=ae("$ZodCheckBigIntFormat",(e,t)=>{Nn.init(e,t);const[n,r]=x6[t.format];e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,o.minimum=n,o.maximum=r}),e._zod.check=i=>{const o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),w3=ae("$ZodCheckMaxSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:Ex(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),S3=ae("$ZodCheckMinSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:Ex(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),_3=ae("$ZodCheckSizeEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,o=i.size;if(o===t.size)return;const a=o>t.size;r.issues.push({origin:Ex(i),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),C3=ae("$ZodCheckMaxLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=jx(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),k3=ae("$ZodCheckMinLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=jx(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),E3=ae("$ZodCheckLengthEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!nu(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,o=i.length;if(o===t.length)return;const a=jx(i),l=o>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),vh=ae("$ZodCheckStringFormat",(e,t)=>{var n,r;Nn.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),j3=ae("$ZodCheckRegex",(e,t)=>{vh.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),I3=ae("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=m3),vh.init(e,t)}),R3=ae("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=h3),vh.init(e,t)}),T3=ae("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const n=us(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),N3=ae("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`^${us(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),A3=ae("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`.*${us(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function j2(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues))}const O3=ae("$ZodCheckProperty",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{const r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>j2(i,n,t.property));j2(r,n,t.property)}}),$3=ae("$ZodCheckMimeType",(e,t)=>{Nn.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),D3=ae("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class P3{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(o=>`  ${o}`)];return new t(...n,i.join(`
`))}}const M3={major:4,minor:3,patch:5},ft=ae("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=M3;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const o of i._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,l,d)=>{let f=wc(a),m;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(f)continue;const v=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&d?.async===!1)throw new Rc;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,a.issues.length!==v&&(f||(f=wc(a,v)))});else{if(a.issues.length===v)continue;f||(f=wc(a,v))}}return m?m.then(()=>a):a},o=(a,l,d)=>{if(wc(a))return a.aborted=!0,a;const f=i(l,r,d);if(f instanceof Promise){if(d.async===!1)throw new Rc;return f.then(m=>e._zod.parse(m,d))}return e._zod.parse(f,d)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const f=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return f instanceof Promise?f.then(m=>o(m,a,l)):o(f,a,l)}const d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new Rc;return d.then(f=>i(f,r,l))}return i(d,r,l)}}_t(e,"~standard",()=>({validate:i=>{try{const o=D6(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return P6(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),yh=ae("$ZodString",(e,t)=>{ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??l3(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),hn=ae("$ZodStringFormat",(e,t)=>{vh.init(e,t),yh.init(e,t)}),z3=ae("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=H6),hn.init(e,t)}),L3=ae("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zd(r))}else t.pattern??(t.pattern=Zd());hn.init(e,t)}),F3=ae("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=q6),hn.init(e,t)}),U3=ae("$ZodURL",(e,t)=>{hn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),V3=ae("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=G6()),hn.init(e,t)}),B3=ae("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=V6),hn.init(e,t)}),H3=ae("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=M6),hn.init(e,t)}),q3=ae("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=z6),hn.init(e,t)}),K3=ae("$ZodULID",(e,t)=>{t.pattern??(t.pattern=L6),hn.init(e,t)}),G3=ae("$ZodXID",(e,t)=>{t.pattern??(t.pattern=F6),hn.init(e,t)}),Z3=ae("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=U6),hn.init(e,t)}),Y3=ae("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=s3(t)),hn.init(e,t)}),W3=ae("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=i3),hn.init(e,t)}),X3=ae("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=a3(t)),hn.init(e,t)}),J3=ae("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=B6),hn.init(e,t)}),Q3=ae("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Z6),hn.init(e,t),e._zod.bag.format="ipv4"}),e5=ae("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Y6),hn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),t5=ae("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=W6(t.delimiter)),hn.init(e,t),e._zod.bag.format="mac"}),n5=ae("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=X6),hn.init(e,t)}),r5=ae("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=J6),hn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Rj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const i5=ae("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Q6),hn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Rj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function o5(e){if(!Cj.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Rj(n)}const a5=ae("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Cj),hn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{o5(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),s5=ae("$ZodE164",(e,t)=>{t.pattern??(t.pattern=n3),hn.init(e,t)});function l5(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const c5=ae("$ZodJWT",(e,t)=>{hn.init(e,t),e._zod.check=n=>{l5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),u5=ae("$ZodCustomStringFormat",(e,t)=>{hn.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Tj=ae("$ZodNumber",(e,t)=>{ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??kj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),d5=ae("$ZodNumberFormat",(e,t)=>{b3.init(e,t),Tj.init(e,t)}),Nj=ae("$ZodBoolean",(e,t)=>{ft.init(e,t),e._zod.pattern=d3,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Aj=ae("$ZodBigInt",(e,t)=>{ft.init(e,t),e._zod.pattern=c3,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),f5=ae("$ZodBigIntFormat",(e,t)=>{x3.init(e,t),Aj.init(e,t)}),p5=ae("$ZodSymbol",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),m5=ae("$ZodUndefined",(e,t)=>{ft.init(e,t),e._zod.pattern=p3,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),h5=ae("$ZodNull",(e,t)=>{ft.init(e,t),e._zod.pattern=f3,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),g5=ae("$ZodAny",(e,t)=>{ft.init(e,t),e._zod.parse=n=>n}),v5=ae("$ZodUnknown",(e,t)=>{ft.init(e,t),e._zod.parse=n=>n}),y5=ae("$ZodNever",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),b5=ae("$ZodVoid",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),x5=ae("$ZodDate",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function I2(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const w5=ae("$ZodArray",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const l=i[a],d=t.element._zod.run({value:l,issues:[]},r);d instanceof Promise?o.push(d.then(f=>I2(f,n,a))):I2(d,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function Zy(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Vo(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function S5(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=y6(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function _5(e,t,n,r,i,o){const a=[],l=i.keySet,d=i.catchall._zod,f=d.def.type,m=d.optout==="optional";for(const h in t){if(l.has(h))continue;if(f==="never"){a.push(h);continue}const v=d.run({value:t[h],issues:[]},r);v instanceof Promise?e.push(v.then(y=>Zy(y,n,h,t,m))):Zy(v,n,h,t,m)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const C5=ae("$ZodObject",(e,t)=>{if(ft.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...l};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=uh(()=>S5(t));_t(e._zod,"propValues",()=>{const l=t.shape,d={};for(const f in l){const m=l[f]._zod;if(m.values){d[f]??(d[f]=new Set);for(const h of m.values)d[f].add(h)}}return d});const i=Kd,o=t.catchall;let a;e._zod.parse=(l,d)=>{a??(a=r.value);const f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),l;l.value={};const m=[],h=a.shape;for(const v of a.keys){const y=h[v],x=y._zod.optout==="optional",S=y._zod.run({value:f[v],issues:[]},d);S instanceof Promise?m.push(S.then(C=>Zy(C,l,v,f,x))):Zy(S,l,v,f,x)}return o?_5(m,f,l,d,r.value,e):m.length?Promise.all(m).then(()=>l):l}}),k5=ae("$ZodObjectJIT",(e,t)=>{C5.init(e,t);const n=e._zod.parse,r=uh(()=>S5(t)),i=v=>{const y=new P3(["shape","payload","ctx"]),x=r.value,S=j=>{const I=qC(j);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};y.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const j of x.keys)C[j]=`key_${k++}`;y.write("const newResult = {};");for(const j of x.keys){const I=C[j],N=qC(j),A=v[j]?._zod?.optout==="optional";y.write(`const ${I} = ${S(j)};`),A?y.write(`
        if (${I}.issues.length) {
          if (${N} in input) {
            payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${N}, ...iss.path] : [${N}]
            })));
          }
        }
        
        if (${I}.value === undefined) {
          if (${N} in input) {
            newResult[${N}] = undefined;
          }
        } else {
          newResult[${N}] = ${I}.value;
        }
        
      `):y.write(`
        if (${I}.issues.length) {
          payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${N}, ...iss.path] : [${N}]
          })));
        }
        
        if (${I}.value === undefined) {
          if (${N} in input) {
            newResult[${N}] = undefined;
          }
        } else {
          newResult[${N}] = ${I}.value;
        }
        
      `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(j,I)=>E(v,j,I)};let o;const a=Kd,l=!By.jitless,f=l&&g6.value,m=t.catchall;let h;e._zod.parse=(v,y)=>{h??(h=r.value);const x=v.value;return a(x)?l&&f&&y?.async===!1&&y.jitless!==!0?(o||(o=i(t.shape)),v=o(v,y),m?_5([],x,v,y,h,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),v)}});function R2(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const i=e.filter(o=>!wc(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>Ro(a,r,Mr())))}),t)}const Rx=ae("$ZodUnion",(e,t)=>{ft.init(e,t),_t(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),_t(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),_t(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),_t(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Cx(o.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1;const l=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);if(f instanceof Promise)l.push(f),a=!0;else{if(f.issues.length===0)return f;l.push(f)}}return a?Promise.all(l).then(d=>R2(d,i,e,o)):R2(l,i,e,o)}});function T2(e,t,n,r){const i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>Ro(a,r,Mr())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const E5=ae("$ZodXor",(e,t)=>{Rx.init(e,t),t.inclusive=!1;const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1;const l=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);f instanceof Promise?(l.push(f),a=!0):l.push(f)}return a?Promise.all(l).then(d=>T2(d,i,e,o)):T2(l,i,e,o)}}),j5=ae("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Rx.init(e,t);const n=e._zod.parse;_t(e._zod,"propValues",()=>{const i={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[l,d]of Object.entries(a)){i[l]||(i[l]=new Set);for(const f of d)i[l].add(f)}}return i});const r=uh(()=>{const i=t.options,o=new Map;for(const a of i){const l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of l){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,a)}}return o});e._zod.parse=(i,o)=>{const a=i.value;if(!Kd(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const l=r.value.get(a?.[t.discriminator]);return l?l._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),I5=ae("$ZodIntersection",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([d,f])=>N2(n,d,f)):N2(n,o,a)}});function KC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(zc(e)&&zc(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of r){const a=KC(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t[r],a=KC(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function N2(e,t,n){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const d of l.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const d of l.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(l);const o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&e.issues.push({...i,keys:o}),wc(e))return e;const a=KC(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Oj=ae("$ZodTuple",(e,t)=>{ft.init(e,t);const n=t.items;e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const a=[],l=[...n].reverse().findIndex(m=>m._zod.optin!=="optional"),d=l===-1?0:n.length-l;if(!t.rest){const m=o.length>n.length,h=o.length<d-1;if(m||h)return r.issues.push({...m?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:e,origin:"array"}),r}let f=-1;for(const m of n){if(f++,f>=o.length&&f>=d)continue;const h=m._zod.run({value:o[f],issues:[]},i);h instanceof Promise?a.push(h.then(v=>kv(v,r,f))):kv(h,r,f)}if(t.rest){const m=o.slice(n.length);for(const h of m){f++;const v=t.rest._zod.run({value:h,issues:[]},i);v instanceof Promise?a.push(v.then(y=>kv(y,r,f))):kv(v,r,f)}}return a.length?Promise.all(a).then(()=>r):r}});function kv(e,t,n){e.issues.length&&t.issues.push(...Vo(n,e.issues)),t.value[n]=e.value}const R5=ae("$ZodRecord",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!zc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[],a=t.keyType._zod.values;if(a){n.value={};const l=new Set;for(const f of a)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){l.add(typeof f=="number"?f.toString():f);const m=t.valueType._zod.run({value:i[f],issues:[]},r);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&n.issues.push(...Vo(f,h.issues)),n.value[f]=h.value})):(m.issues.length&&n.issues.push(...Vo(f,m.issues)),n.value[f]=m.value)}let d;for(const f in i)l.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&kj.test(l)&&d.issues.length&&d.issues.some(h=>h.code==="invalid_type"&&h.expected==="number")){const h=t.keyType._zod.run({value:Number(l),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?n.value[l]=i[l]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>Ro(h,r,Mr())),input:l,path:[l],inst:e});continue}const m=t.valueType._zod.run({value:i[l],issues:[]},r);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&n.issues.push(...Vo(l,h.issues)),n.value[d.value]=h.value})):(m.issues.length&&n.issues.push(...Vo(l,m.issues)),n.value[d.value]=m.value)}}return o.length?Promise.all(o).then(()=>n):n}}),T5=ae("$ZodMap",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;const o=[];n.value=new Map;for(const[a,l]of i){const d=t.keyType._zod.run({value:a,issues:[]},r),f=t.valueType._zod.run({value:l,issues:[]},r);d instanceof Promise||f instanceof Promise?o.push(Promise.all([d,f]).then(([m,h])=>{A2(m,h,n,a,i,e,r)})):A2(d,f,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function A2(e,t,n,r,i,o,a){e.issues.length&&(qy.has(typeof r)?n.issues.push(...Vo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(l=>Ro(l,a,Mr()))})),t.issues.length&&(qy.has(typeof r)?n.issues.push(...Vo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(l=>Ro(l,a,Mr()))})),n.value.set(e.value,t.value)}const N5=ae("$ZodSet",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;const o=[];n.value=new Set;for(const a of i){const l=t.valueType._zod.run({value:a,issues:[]},r);l instanceof Promise?o.push(l.then(d=>O2(d,n))):O2(l,n)}return o.length?Promise.all(o).then(()=>n):n}});function O2(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const A5=ae("$ZodEnum",(e,t)=>{ft.init(e,t);const n=fj(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>qy.has(typeof i)).map(i=>typeof i=="string"?us(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:n,input:a,inst:e}),i}}),O5=ae("$ZodLiteral",(e,t)=>{if(ft.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?us(r):r?us(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),$5=ae("$ZodFile",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return i instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),n}}),D5=ae("$ZodTransform",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new Rc;return n.value=i,n}});function $2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $j=ae("$ZodOptional",(e,t)=>{ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>$2(o,n.value)):$2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),P5=ae("$ZodExactOptional",(e,t)=>{$j.init(e,t),_t(e._zod,"values",()=>t.innerType._zod.values),_t(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),M5=ae("$ZodNullable",(e,t)=>{ft.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Cx(n.source)}|null)$`):void 0}),_t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),z5=ae("$ZodDefault",(e,t)=>{ft.init(e,t),e._zod.optin="optional",_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>D2(o,t)):D2(i,t)}});function D2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const L5=ae("$ZodPrefault",(e,t)=>{ft.init(e,t),e._zod.optin="optional",_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),F5=ae("$ZodNonOptional",(e,t)=>{ft.init(e,t),_t(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>P2(o,e)):P2(i,e)}});function P2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const U5=ae("$ZodSuccess",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x("ZodSuccess");const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.issues.length===0,n)):(n.value=i.issues.length===0,n)}}),V5=ae("$ZodCatch",(e,t)=>{ft.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>Ro(a,r,Mr()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Ro(o,r,Mr()))},input:n.value}),n.issues=[]),n)}}),B5=ae("$ZodNaN",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),H5=ae("$ZodPipe",(e,t)=>{ft.init(e,t),_t(e._zod,"values",()=>t.in._zod.values),_t(e._zod,"optin",()=>t.in._zod.optin),_t(e._zod,"optout",()=>t.out._zod.optout),_t(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>Ev(a,t.in,r)):Ev(o,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Ev(o,t.out,r)):Ev(i,t.out,r)}});function Ev(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Dj=ae("$ZodCodec",(e,t)=>{ft.init(e,t),_t(e._zod,"values",()=>t.in._zod.values),_t(e._zod,"optin",()=>t.in._zod.optin),_t(e._zod,"optout",()=>t.out._zod.optout),_t(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(a=>jv(a,t,r)):jv(o,t,r)}else{const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>jv(a,t,r)):jv(o,t,r)}}});function jv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){const i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>Iv(e,o,t.out,n)):Iv(e,i,t.out,n)}else{const i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>Iv(e,o,t.in,n)):Iv(e,i,t.in,n)}}function Iv(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const q5=ae("$ZodReadonly",(e,t)=>{ft.init(e,t),_t(e._zod,"propValues",()=>t.innerType._zod.propValues),_t(e._zod,"values",()=>t.innerType._zod.values),_t(e._zod,"optin",()=>t.innerType?._zod?.optin),_t(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(M2):M2(i)}});function M2(e){return e.value=Object.freeze(e.value),e}const K5=ae("$ZodTemplateLiteral",(e,t)=>{ft.init(e,t);const n=[];for(const r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const i=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;n.push(i.slice(o,a))}else if(r===null||v6.has(typeof r))n.push(us(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,i)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),G5=ae("$ZodFunction",(e,t)=>(ft.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...r){const i=e._def.input?Ky(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?Ky(e._def.output,o):o}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){const i=e._def.input?await Gy(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await Gy(e._def.output,o):o}},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new Oj({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{const r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),Z5=ae("$ZodPromise",(e,t)=>{ft.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),Y5=ae("$ZodLazy",(e,t)=>{ft.init(e,t),_t(e._zod,"innerType",()=>t.getter()),_t(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),_t(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),_t(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),_t(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),W5=ae("$ZodCustom",(e,t)=>{Nn.init(e,t),ft.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>z2(o,n,r,e));z2(i,n,r,e)}});function z2(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Gd(i))}}const ege=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(i){return e[i]??null}const n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${i.expected}، ولكن تم إدخال ${l}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${l}`}case"invalid_value":return i.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${it(i.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?` أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${o} ${i.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${o} ${i.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${i.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${n[o.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${je(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function tge(){return{localeError:ege()}}const nge=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Yanlış dəyər: gözlənilən instanceof ${i.expected}, daxil olan ${l}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${l}`}case"invalid_value":return i.values.length===1?`Yanlış dəyər: gözlənilən ${it(i.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${o}${i.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Çox kiçik: gözlənilən ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[o.format]??i.format}`}case"not_multiple_of":return`Yanlış ədəd: ${i.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${i.keys.length>1?"lar":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${i.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function rge(){return{localeError:nge()}}function L2(e,t,n,r){const i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?n:r}const ige=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(i){return e[i]??null}const n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Няправільны ўвод: чакаўся instanceof ${i.expected}, атрымана ${l}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${l}`}case"invalid_value":return i.values.length===1?`Няправільны ўвод: чакалася ${it(i.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=L2(l,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна ${a.verb} ${o}${i.maximum.toString()} ${d}`}return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна быць ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const l=Number(i.minimum),d=L2(l,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${i.origin} павінна ${a.verb} ${o}${i.minimum.toString()} ${d}`}return`Занадта малы: чакалася, што ${i.origin} павінна быць ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${n[o.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${je(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function oge(){return{localeError:ige()}}const age=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(i){return e[i]??null}const n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},r={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Невалиден вход: очакван instanceof ${i.expected}, получен ${l}`:`Невалиден вход: очакван ${o}, получен ${l}`}case"invalid_value":return i.values.length===1?`Невалиден вход: очакван ${it(i.values[0])}`:`Невалидна опция: очаквано едно от ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Твърде голямо: очаква се ${i.origin??"стойност"} да съдържа ${o}${i.maximum.toString()} ${a.unit??"елемента"}`:`Твърде голямо: очаква се ${i.origin??"стойност"} да бъде ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Твърде малко: очаква се ${i.origin} да съдържа ${o}${i.minimum.toString()} ${a.unit}`:`Твърде малко: очаква се ${i.origin} да бъде ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let a="Невалиден";return o.format==="emoji"&&(a="Невалидно"),o.format==="datetime"&&(a="Невалидно"),o.format==="date"&&(a="Невалидна"),o.format==="time"&&(a="Невалидно"),o.format==="duration"&&(a="Невалидна"),`${a} ${n[o.format]??i.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${i.divisor}`;case"unrecognized_keys":return`Неразпознат${i.keys.length>1?"и":""} ключ${i.keys.length>1?"ове":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${i.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${i.origin}`;default:return"Невалиден вход"}}};function sge(){return{localeError:age()}}const lge=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}const n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Tipus invàlid: s'esperava instanceof ${i.expected}, s'ha rebut ${l}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${l}`}case"invalid_value":return i.values.length===1?`Valor invàlid: s'esperava ${it(i.values[0])}`:`Opció invàlida: s'esperava una de ${je(i.values," o ")}`;case"too_big":{const o=i.inclusive?"com a màxim":"menys de",a=t(i.origin);return a?`Massa gran: s'esperava que ${i.origin??"el valor"} contingués ${o} ${i.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"com a mínim":"més de",a=t(i.origin);return a?`Massa petit: s'esperava que ${i.origin} contingués ${o} ${i.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${n[o.format]??i.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${i.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${i.origin}`;default:return"Entrada invàlida"}}};function cge(){return{localeError:lge()}}const uge=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(i){return e[i]??null}const n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Neplatný vstup: očekáváno instanceof ${i.expected}, obdrženo ${l}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${l}`}case"invalid_value":return i.values.length===1?`Neplatný vstup: očekáváno ${it(i.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Hodnota je příliš velká: ${i.origin??"hodnota"} musí mít ${o}${i.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${i.origin??"hodnota"} musí být ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Hodnota je příliš malá: ${i.origin??"hodnota"} musí mít ${o}${i.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${i.origin??"hodnota"} musí být ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${n[o.format]??i.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${i.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${je(i.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${i.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${i.origin}`;default:return"Neplatný vstup"}}};function dge(){return{localeError:uge()}}const fge=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}const n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${l}`:`Ugyldigt input: forventede ${o}, fik ${l}`}case"invalid_value":return i.values.length===1?`Ugyldig værdi: forventede ${it(i.values[0])}`:`Ugyldigt valg: forventede en af følgende ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=r[i.origin]??i.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${o} ${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=r[i.origin]??i.origin;return a?`For lille: forventede ${l} ${a.verb} ${o} ${i.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${je(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${i.origin}`;default:return"Ugyldigt input"}}};function pge(){return{localeError:fge()}}const mge=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}const n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ungültige Eingabe: erwartet instanceof ${i.expected}, erhalten ${l}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${l}`}case"invalid_value":return i.values.length===1?`Ungültige Eingabe: erwartet ${it(i.values[0])}`:`Ungültige Option: erwartet eine von ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Zu groß: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${n[o.format]??i.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${je(i.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${i.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${i.origin}`;default:return"Ungültige Eingabe"}}};function hge(){return{localeError:mge()}}const gge=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return`Invalid input: expected ${o}, received ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${it(i.values[0])}`:`Invalid option: expected one of ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function X5(){return{localeError:gge()}}const vge=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}const n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendiĝis instanceof ${i.expected}, riceviĝis ${l}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${l}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendiĝis ${it(i.values[0])}`:`Nevalida opcio: atendiĝis unu el ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Tro malgranda: atendiĝis ke ${i.origin} havu ${o}${i.minimum.toString()} ${a.unit}`:`Tro malgranda: atendiĝis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function yge(){return{localeError:vge()}}const bge=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}const n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrada inválida: se esperaba instanceof ${i.expected}, recibido ${l}`:`Entrada inválida: se esperaba ${o}, recibido ${l}`}case"invalid_value":return i.values.length===1?`Entrada inválida: se esperaba ${it(i.values[0])}`:`Opción inválida: se esperaba una de ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=r[i.origin]??i.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=r[i.origin]??i.origin;return a?`Demasiado pequeño: se esperaba que ${l} tuviera ${o}${i.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${l} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${n[o.format]??i.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[i.origin]??i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[i.origin]??i.origin}`;default:return"Entrada inválida"}}};function xge(){return{localeError:bge()}}const wge=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(i){return e[i]??null}const n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ورودی نامعتبر: می‌بایست instanceof ${i.expected} می‌بود، ${l} دریافت شد`:`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${l} دریافت شد`}case"invalid_value":return i.values.length===1?`ورودی نامعتبر: می‌بایست ${it(i.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${je(i.values,"|")} می‌بود`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`خیلی بزرگ: ${i.origin??"مقدار"} باید ${o}${i.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${i.origin??"مقدار"} باید ${o}${i.maximum.toString()} باشد`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`خیلی کوچک: ${i.origin} باید ${o}${i.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${i.origin} باید ${o}${i.minimum.toString()} باشد`}case"invalid_format":{const o=i;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${n[o.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${je(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function Sge(){return{localeError:wge()}}const _ge=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(i){return e[i]??null}const n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${l}`}case"invalid_value":return i.values.length===1?`Virheellinen syöte: täytyy olla ${it(i.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${o}${i.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${o}${i.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${je(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Cge(){return{localeError:_ge()}}const kge=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return e[i]??null}const n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrée invalide : instanceof ${i.expected} attendu, ${l} reçu`:`Entrée invalide : ${o} attendu, ${l} reçu`}case"invalid_value":return i.values.length===1?`Entrée invalide : ${it(i.values[0])} attendu`:`Option invalide : une valeur parmi ${je(i.values,"|")} attendue`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Trop grand : ${i.origin??"valeur"} doit ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${i.origin??"valeur"} doit être ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Trop petit : ${i.origin} doit ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : ${i.origin} doit être ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${n[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${je(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function Ege(){return{localeError:kge()}}const jge=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(i){return e[i]??null}const n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Entrée invalide : attendu instanceof ${i.expected}, reçu ${l}`:`Entrée invalide : attendu ${o}, reçu ${l}`}case"invalid_value":return i.values.length===1?`Entrée invalide : attendu ${it(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"≤":"<",a=t(i.origin);return a?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"≥":">",a=t(i.origin);return a?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${je(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function Ige(){return{localeError:jge()}}const Rge=()=>{const e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=f=>f?e[f]:void 0,r=f=>{const m=n(f);return m?m.label:f??e.unknown.label},i=f=>`ה${r(f)}`,o=f=>(n(f)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=f=>f?t[f]??null:null,l={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},d={nan:"NaN"};return f=>{switch(f.code){case"invalid_type":{const m=f.expected,h=d[m??""]??r(m),v=st(f.input),y=d[v]??e[v]?.label??v;return/^[A-Z]/.test(f.expected)?`קלט לא תקין: צריך להיות instanceof ${f.expected}, התקבל ${y}`:`קלט לא תקין: צריך להיות ${h}, התקבל ${y}`}case"invalid_value":{if(f.values.length===1)return`ערך לא תקין: הערך חייב להיות ${it(f.values[0])}`;const m=f.values.map(y=>it(y));if(f.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${m[0]} או ${m[1]}`;const h=m[m.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${m.slice(0,-1).join(", ")} או ${h}`}case"too_big":{const m=a(f.origin),h=i(f.origin??"value");if(f.origin==="string")return`${m?.longLabel??"ארוך"} מדי: ${h} צריכה להכיל ${f.maximum.toString()} ${m?.unit??""} ${f.inclusive?"או פחות":"לכל היותר"}`.trim();if(f.origin==="number"){const x=f.inclusive?`קטן או שווה ל-${f.maximum}`:`קטן מ-${f.maximum}`;return`גדול מדי: ${h} צריך להיות ${x}`}if(f.origin==="array"||f.origin==="set"){const x=f.origin==="set"?"צריכה":"צריך",S=f.inclusive?`${f.maximum} ${m?.unit??""} או פחות`:`פחות מ-${f.maximum} ${m?.unit??""}`;return`גדול מדי: ${h} ${x} להכיל ${S}`.trim()}const v=f.inclusive?"<=":"<",y=o(f.origin??"value");return m?.unit?`${m.longLabel} מדי: ${h} ${y} ${v}${f.maximum.toString()} ${m.unit}`:`${m?.longLabel??"גדול"} מדי: ${h} ${y} ${v}${f.maximum.toString()}`}case"too_small":{const m=a(f.origin),h=i(f.origin??"value");if(f.origin==="string")return`${m?.shortLabel??"קצר"} מדי: ${h} צריכה להכיל ${f.minimum.toString()} ${m?.unit??""} ${f.inclusive?"או יותר":"לפחות"}`.trim();if(f.origin==="number"){const x=f.inclusive?`גדול או שווה ל-${f.minimum}`:`גדול מ-${f.minimum}`;return`קטן מדי: ${h} צריך להיות ${x}`}if(f.origin==="array"||f.origin==="set"){const x=f.origin==="set"?"צריכה":"צריך";if(f.minimum===1&&f.inclusive){const C=(f.origin==="set","לפחות פריט אחד");return`קטן מדי: ${h} ${x} להכיל ${C}`}const S=f.inclusive?`${f.minimum} ${m?.unit??""} או יותר`:`יותר מ-${f.minimum} ${m?.unit??""}`;return`קטן מדי: ${h} ${x} להכיל ${S}`.trim()}const v=f.inclusive?">=":">",y=o(f.origin??"value");return m?.unit?`${m.shortLabel} מדי: ${h} ${y} ${v}${f.minimum.toString()} ${m.unit}`:`${m?.shortLabel??"קטן"} מדי: ${h} ${y} ${v}${f.minimum.toString()}`}case"invalid_format":{const m=f;if(m.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${m.prefix}"`;if(m.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${m.suffix}"`;if(m.format==="includes")return`המחרוזת חייבת לכלול "${m.includes}"`;if(m.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${m.pattern}`;const h=l[m.format],v=h?.label??m.format,x=(h?.gender??"m")==="f"?"תקינה":"תקין";return`${v} לא ${x}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${f.divisor}`;case"unrecognized_keys":return`מפתח${f.keys.length>1?"ות":""} לא מזוה${f.keys.length>1?"ים":"ה"}: ${je(f.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i(f.origin??"array")}`;default:return"קלט לא תקין"}}};function Tge(){return{localeError:Rge()}}const Nge=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}const n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Érvénytelen bemenet: a várt érték instanceof ${i.expected}, a kapott érték ${l}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${l}`}case"invalid_value":return i.values.length===1?`Érvénytelen bemenet: a várt érték ${it(i.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Túl nagy: ${i.origin??"érték"} mérete túl nagy ${o}${i.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${i.origin??"érték"} túl nagy: ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Túl kicsi: a bemeneti érték ${i.origin} mérete túl kicsi ${o}${i.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${i.origin} túl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[o.format]??i.format}`}case"not_multiple_of":return`Érvénytelen szám: ${i.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${i.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${i.origin}`;default:return"Érvénytelen bemenet"}}};function Age(){return{localeError:Nge()}}function F2(e,t,n){return Math.abs(e)===1?t:n}function rd(e){if(!e)return"";const t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}const Oge=()=>{const e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(i){return e[i]??null}const n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${i.expected}, ստացվել է ${l}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${l}`}case"invalid_value":return i.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${it(i.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=F2(l,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${rd(i.origin??"արժեք")} կունենա ${o}${i.maximum.toString()} ${d}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${rd(i.origin??"արժեք")} լինի ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const l=Number(i.minimum),d=F2(l,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${rd(i.origin)} կունենա ${o}${i.minimum.toString()} ${d}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${rd(i.origin)} լինի ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${n[o.format]??i.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${i.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${i.keys.length>1?"ներ":""}. ${je(i.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${rd(i.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${rd(i.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function $ge(){return{localeError:Oge()}}const Dge=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}const n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${o}, diterima ${l}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${it(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function Pge(){return{localeError:Dge()}}const Mge=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(i){return e[i]??null}const n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Rangt gildi: Þú slóst inn ${l} þar sem á að vera instanceof ${i.expected}`:`Rangt gildi: Þú slóst inn ${l} þar sem á að vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert ráð fyrir ${it(i.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${a.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} sé ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Of lítið: gert er ráð fyrir að ${i.origin} hafi ${o}${i.minimum.toString()} ${a.unit}`:`Of lítið: gert er ráð fyrir að ${i.origin} sé ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??i.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`Óþekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${je(i.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${i.origin}`;default:return"Rangt gildi"}}};function zge(){return{localeError:Mge()}}const Lge=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}const n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${l}`:`Input non valido: atteso ${o}, ricevuto ${l}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${it(i.values[0])}`:`Opzione non valida: atteso uno tra ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${je(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function Fge(){return{localeError:Lge()}}const Uge=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(i){return e[i]??null}const n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`無効な入力: instanceof ${i.expected}が期待されましたが、${l}が入力されました`:`無効な入力: ${o}が期待されましたが、${l}が入力されました`}case"invalid_value":return i.values.length===1?`無効な入力: ${it(i.values[0])}が期待されました`:`無効な選択: ${je(i.values,"、")}のいずれかである必要があります`;case"too_big":{const o=i.inclusive?"以下である":"より小さい",a=t(i.origin);return a?`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${a.unit??"要素"}${o}必要があります`:`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${o}必要があります`}case"too_small":{const o=i.inclusive?"以上である":"より大きい",a=t(i.origin);return a?`小さすぎる値: ${i.origin}は${i.minimum.toString()}${a.unit}${o}必要があります`:`小さすぎる値: ${i.origin}は${i.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=i;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${n[o.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${je(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function Vge(){return{localeError:Uge()}}const Bge=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(i){return e[i]??null}const n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${i.expected}, მიღებული ${l}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${l}`}case"invalid_value":return i.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${it(i.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${je(i.values,"|")}-დან`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} იყოს ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`ზედმეტად პატარა: მოსალოდნელი ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${i.origin} იყოს ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${n[o.format]??i.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${i.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${i.keys.length>1?"ები":"ი"}: ${je(i.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${i.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${i.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Hge(){return{localeError:Bge()}}const qge=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(i){return e[i]??null}const n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${i.expected} ប៉ុន្តែទទួលបាន ${l}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${l}`}case"invalid_value":return i.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${it(i.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${o} ${i.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`តូចពេក៖ ត្រូវការ ${i.origin} ${o} ${i.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[o.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${je(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function J5(){return{localeError:qge()}}function Kge(){return J5()}const Gge=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`잘못된 입력: 예상 타입은 instanceof ${i.expected}, 받은 타입은 ${l}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${l}입니다`}case"invalid_value":return i.values.length===1?`잘못된 입력: 값은 ${it(i.values[0])} 이어야 합니다`:`잘못된 옵션: ${je(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=i.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",l=t(i.origin),d=l?.unit??"요소";return l?`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${o}${a}`}case"too_small":{const o=i.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",l=t(i.origin),d=l?.unit??"요소";return l?`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()} ${o}${a}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[o.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${je(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`;default:return"잘못된 입력"}}};function Zge(){return{localeError:Gge()}}const Lp=e=>e.charAt(0).toUpperCase()+e.slice(1);function U2(e){const t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}const Yge=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(i,o,a,l){const d=e[i]??null;return d===null?d:{unit:d.unit[o],verb:d.verb[l][a?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${l}, o tikėtasi - instanceof ${i.expected}`:`Gautas tipas ${l}, o tikėtasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo būti ${it(i.values[0])}`:`Privalo būti vienas iš ${je(i.values,"|")} pasirinkimų`;case"too_big":{const o=r[i.origin]??i.origin,a=t(i.origin,U2(Number(i.maximum)),i.inclusive??!1,"smaller");if(a?.verb)return`${Lp(o??i.origin??"reikšmė")} ${a.verb} ${i.maximum.toString()} ${a.unit??"elementų"}`;const l=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Lp(o??i.origin??"reikšmė")} turi būti ${l} ${i.maximum.toString()} ${a?.unit}`}case"too_small":{const o=r[i.origin]??i.origin,a=t(i.origin,U2(Number(i.minimum)),i.inclusive??!1,"bigger");if(a?.verb)return`${Lp(o??i.origin??"reikšmė")} ${a.verb} ${i.minimum.toString()} ${a.unit??"elementų"}`;const l=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Lp(o??i.origin??"reikšmė")} turi būti ${l} ${i.minimum.toString()} ${a?.unit}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??i.format}`}case"not_multiple_of":return`Skaičius privalo būti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${je(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const o=r[i.origin]??i.origin;return`${Lp(o??i.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Wge(){return{localeError:Yge()}}const Xge=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(i){return e[i]??null}const n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},r={nan:"NaN",number:"број",array:"низа"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Грешен внес: се очекува instanceof ${i.expected}, примено ${l}`:`Грешен внес: се очекува ${o}, примено ${l}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${it(i.values[0])}`:`Грешана опција: се очекува една ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Премногу голем: се очекува ${i.origin??"вредноста"} да има ${o}${i.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${i.origin??"вредноста"} да биде ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Премногу мал: се очекува ${i.origin} да има ${o}${i.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${i.origin} да биде ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${je(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function Jge(){return{localeError:Xge()}}const Qge=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}const n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${l}`:`Input tidak sah: dijangka ${o}, diterima ${l}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${it(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Terlalu besar: dijangka ${i.origin??"nilai"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Terlalu kecil: dijangka ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${je(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function eve(){return{localeError:Qge()}}const tve=()=>{const e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}const n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${o}, ontving ${l}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${it(i.values[0])}`:`Ongeldige optie: verwacht één van ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin),l=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin),l=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function nve(){return{localeError:tve()}}const rve=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(i){return e[i]??null}const n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${l}`:`Ugyldig input: forventet ${o}, fikk ${l}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${it(i.values[0])}`:`Ugyldig valg: forventet en av ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`For stor(t): forventet ${i.origin??"value"} til å ha ${o}${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til å ha ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`For lite(n): forventet ${i.origin} til å ha ${o}${i.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${i.origin} til å ha ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${n[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${je(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function ive(){return{localeError:rve()}}const ove=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(i){return e[i]??null}const n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Fâsit giren: umulan instanceof ${i.expected}, alınan ${l}`:`Fâsit giren: umulan ${o}, alınan ${l}`}case"invalid_value":return i.values.length===1?`Fâsit giren: umulan ${it(i.values[0])}`:`Fâsit tercih: mûteberler ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Fazla büyük: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmalıydı.`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Fazla küçük: ${i.origin}, ${o}${i.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${i.origin}, ${o}${i.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${n[o.format]??i.format}`}case"not_multiple_of":return`Fâsit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function ave(){return{localeError:ove()}}const sve=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(i){return e[i]??null}const n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ناسم ورودي: باید instanceof ${i.expected} وای, مګر ${l} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${l} ترلاسه شو`}case"invalid_value":return i.values.length===1?`ناسم ورودي: باید ${it(i.values[0])} وای`:`ناسم انتخاب: باید یو له ${je(i.values,"|")} څخه وای`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`ډیر لوی: ${i.origin??"ارزښت"} باید ${o}${i.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${i.origin??"ارزښت"} باید ${o}${i.maximum.toString()} وي`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`ډیر کوچنی: ${i.origin} باید ${o}${i.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${i.origin} باید ${o}${i.minimum.toString()} وي`}case"invalid_format":{const o=i;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${n[o.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${je(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function lve(){return{localeError:sve()}}const cve=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(i){return e[i]??null}const n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},r={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${i.expected}, otrzymano ${l}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${l}`}case"invalid_value":return i.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${it(i.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Za duża wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${o}${i.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Za mała wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${o}${i.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${n[o.format]??i.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${i.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${i.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function uve(){return{localeError:cve()}}const dve=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return e[i]??null}const n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"número",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Tipo inválido: esperado instanceof ${i.expected}, recebido ${l}`:`Tipo inválido: esperado ${o}, recebido ${l}`}case"invalid_value":return i.values.length===1?`Entrada inválida: esperado ${it(i.values[0])}`:`Opção inválida: esperada uma das ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${n[o.format]??i.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Chave inválida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${i.origin}`;default:return"Campo inválido"}}};function fve(){return{localeError:dve()}}function V2(e,t,n,r){const i=Math.abs(e),o=i%10,a=i%100;return a>=11&&a<=19?r:o===1?t:o>=2&&o<=4?n:r}const pve=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(i){return e[i]??null}const n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Неверный ввод: ожидалось instanceof ${i.expected}, получено ${l}`:`Неверный ввод: ожидалось ${o}, получено ${l}`}case"invalid_value":return i.values.length===1?`Неверный ввод: ожидалось ${it(i.values[0])}`:`Неверный вариант: ожидалось одно из ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const l=Number(i.maximum),d=V2(l,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет иметь ${o}${i.maximum.toString()} ${d}`}return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);if(a){const l=Number(i.minimum),d=V2(l,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${i.origin} будет иметь ${o}${i.minimum.toString()} ${d}`}return`Слишком маленькое значение: ожидалось, что ${i.origin} будет ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${n[o.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function mve(){return{localeError:pve()}}const hve=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}const n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"število",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pričakovano instanceof ${i.expected}, prejeto ${l}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${l}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pričakovano ${it(i.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Premajhno: pričakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i ključi":" ključ"}: ${je(i.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function gve(){return{localeError:hve()}}const vve=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(i){return e[i]??null}const n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: förväntat instanceof ${i.expected}, fick ${l}`:`Ogiltig inmatning: förväntat ${o}, fick ${l}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: förväntat ${it(i.values[0])}`:`Ogiltigt val: förväntade en av ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`För stor(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${i.origin??"värdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`För lite(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${i.origin??"värdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${je(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${i.origin??"värdet"}`;default:return"Ogiltig input"}}};function yve(){return{localeError:vve()}}const bve=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(i){return e[i]??null}const n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${i.expected}, பெறப்பட்டது ${l}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${l}`}case"invalid_value":return i.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${it(i.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${je(i.values,"|")} இல் ஒன்று`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${o}${i.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${o}${i.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${o}${i.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=i;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[o.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function xve(){return{localeError:bve()}}const wve=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(i){return e[i]??null}const n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${i.expected} แต่ได้รับ ${l}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${l}`}case"invalid_value":return i.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${it(i.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(i.origin);return a?`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${o} ${i.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${o} ${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?"อย่างน้อย":"มากกว่า",a=t(i.origin);return a?`น้อยกว่ากำหนด: ${i.origin} ควรมี${o} ${i.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${i.origin} ควรมี${o} ${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[o.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${je(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Sve(){return{localeError:wve()}}const _ve=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}const n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Geçersiz değer: beklenen instanceof ${i.expected}, alınan ${l}`:`Geçersiz değer: beklenen ${o}, alınan ${l}`}case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${it(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Çok büyük: beklenen ${i.origin??"değer"} ${o}${i.maximum.toString()} ${a.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Çok küçük: beklenen ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`Çok küçük: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${n[o.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Cve(){return{localeError:_ve()}}const kve=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(i){return e[i]??null}const n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Неправильні вхідні дані: очікується instanceof ${i.expected}, отримано ${l}`:`Неправильні вхідні дані: очікується ${o}, отримано ${l}`}case"invalid_value":return i.values.length===1?`Неправильні вхідні дані: очікується ${it(i.values[0])}`:`Неправильна опція: очікується одне з ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Занадто велике: очікується, що ${i.origin??"значення"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${i.origin??"значення"} буде ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Занадто мале: очікується, що ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${i.origin} буде ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${n[o.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${je(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function Q5(){return{localeError:kve()}}function Eve(){return Q5()}const jve=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(i){return e[i]??null}const n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`غلط ان پٹ: instanceof ${i.expected} متوقع تھا، ${l} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${l} موصول ہوا`}case"invalid_value":return i.values.length===1?`غلط ان پٹ: ${it(i.values[0])} متوقع تھا`:`غلط آپشن: ${je(i.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`بہت بڑا: ${i.origin??"ویلیو"} کے ${o}${i.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${i.origin??"ویلیو"} کا ${o}${i.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`بہت چھوٹا: ${i.origin} کے ${o}${i.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${i.origin} کا ${o}${i.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=i;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${n[o.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${je(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Ive(){return{localeError:jve()}}const Rve=()=>{const e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(i){return e[i]??null}const n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${l}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${l}`}case"invalid_value":return i.values.length===1?`Noto‘g‘ri kirish: kutilgan ${it(i.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[o.format]??i.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${i.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${i.keys.length>1?"lar":""}: ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${i.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Tve(){return{localeError:Rve()}}const Nve=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(i){return e[i]??null}const n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},r={nan:"NaN",number:"số",array:"mảng"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${i.expected}, nhận được ${l}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${l}`}case"invalid_value":return i.values.length===1?`Đầu vào không hợp lệ: mong đợi ${it(i.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Quá lớn: mong đợi ${i.origin??"giá trị"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${i.origin??"giá trị"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Quá nhỏ: mong đợi ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${n[o.format]??i.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${i.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${je(i.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${i.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${i.origin}`;default:return"Đầu vào không hợp lệ"}}};function Ave(){return{localeError:Nve()}}const Ove=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(i){return e[i]??null}const n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`无效输入:期望 instanceof ${i.expected},实际接收 ${l}`:`无效输入:期望 ${o},实际接收 ${l}`}case"invalid_value":return i.values.length===1?`无效输入:期望 ${it(i.values[0])}`:`无效选项:期望以下之一 ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`数值过大:期望 ${i.origin??"值"} ${o}${i.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${i.origin??"值"} ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`数值过小:期望 ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`数值过小:期望 ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${n[o.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${je(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function $ve(){return{localeError:Ove()}}const Dve=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(i){return e[i]??null}const n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`無效的輸入值:預期為 instanceof ${i.expected},但收到 ${l}`:`無效的輸入值:預期為 ${o},但收到 ${l}`}case"invalid_value":return i.values.length===1?`無效的輸入值:預期為 ${it(i.values[0])}`:`無效的選項:預期為以下其中之一 ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`數值過大:預期 ${i.origin??"值"} 應為 ${o}${i.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${i.origin??"值"} 應為 ${o}${i.maximum.toString()}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`數值過小:預期 ${i.origin} 應為 ${o}${i.minimum.toString()} ${a.unit}`:`數值過小:預期 ${i.origin} 應為 ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${n[o.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${je(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Pve(){return{localeError:Dve()}}const Mve=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(i){return e[i]??null}const n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return i=>{switch(i.code){case"invalid_type":{const o=r[i.expected]??i.expected,a=st(i.input),l=r[a]??a;return/^[A-Z]/.test(i.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${i.expected}, àmọ̀ a rí ${l}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${l}`}case"invalid_value":return i.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${it(i.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${je(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${i.origin??"iye"} ${a.verb} ${o}${i.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${i.maximum}`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${i.origin} ${a.verb} ${o}${i.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${i.minimum}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${n[o.format]??i.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${i.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${je(i.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${i.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${i.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function zve(){return{localeError:Mve()}}const eV=Object.freeze(Object.defineProperty({__proto__:null,ar:tge,az:rge,be:oge,bg:sge,ca:cge,cs:dge,da:pge,de:hge,en:X5,eo:yge,es:xge,fa:Sge,fi:Cge,fr:Ege,frCA:Ige,he:Tge,hu:Age,hy:$ge,id:Pge,is:zge,it:Fge,ja:Vge,ka:Hge,kh:Kge,km:J5,ko:Zge,lt:Wge,mk:Jge,ms:eve,nl:nve,no:ive,ota:ave,pl:uve,ps:lve,pt:fve,ru:mve,sl:gve,sv:yve,ta:xve,th:Sve,tr:Cve,ua:Eve,uk:Q5,ur:Ive,uz:Tve,vi:Ave,yo:zve,zhCN:$ve,zhTW:Pve},Symbol.toStringTag,{value:"Module"}));var B2;const tV=Symbol("ZodOutput"),nV=Symbol("ZodInput");class rV{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Pj(){return new rV}(B2=globalThis).__zod_globalRegistry??(B2.__zod_globalRegistry=Pj());const ko=globalThis.__zod_globalRegistry;function iV(e,t){return new e({type:"string",...Ce(t)})}function oV(e,t){return new e({type:"string",coerce:!0,...Ce(t)})}function Mj(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function Yy(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function zj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function Lj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function Fj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function Uj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function Tx(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function Vj(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function Bj(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function Hj(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function qj(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function Kj(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function Gj(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function Zj(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function Yj(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function Wj(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function aV(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Ce(t)})}function Xj(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function Jj(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function Qj(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function eI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function tI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function nI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}const sV={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function lV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function cV(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function uV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function dV(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function fV(e,t){return new e({type:"number",checks:[],...Ce(t)})}function pV(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function mV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function hV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Ce(t)})}function gV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Ce(t)})}function vV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Ce(t)})}function yV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Ce(t)})}function bV(e,t){return new e({type:"boolean",...Ce(t)})}function xV(e,t){return new e({type:"boolean",coerce:!0,...Ce(t)})}function wV(e,t){return new e({type:"bigint",...Ce(t)})}function SV(e,t){return new e({type:"bigint",coerce:!0,...Ce(t)})}function _V(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ce(t)})}function CV(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ce(t)})}function kV(e,t){return new e({type:"symbol",...Ce(t)})}function EV(e,t){return new e({type:"undefined",...Ce(t)})}function jV(e,t){return new e({type:"null",...Ce(t)})}function IV(e){return new e({type:"any"})}function RV(e){return new e({type:"unknown"})}function TV(e,t){return new e({type:"never",...Ce(t)})}function NV(e,t){return new e({type:"void",...Ce(t)})}function AV(e,t){return new e({type:"date",...Ce(t)})}function OV(e,t){return new e({type:"date",coerce:!0,...Ce(t)})}function $V(e,t){return new e({type:"nan",...Ce(t)})}function wl(e,t){return new jj({check:"less_than",...Ce(t),value:e,inclusive:!1})}function jo(e,t){return new jj({check:"less_than",...Ce(t),value:e,inclusive:!0})}function Sl(e,t){return new Ij({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function xi(e,t){return new Ij({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function rI(e){return Sl(0,e)}function iI(e){return wl(0,e)}function oI(e){return jo(0,e)}function aI(e){return xi(0,e)}function Yd(e,t){return new y3({check:"multiple_of",...Ce(t),value:e})}function Sf(e,t){return new w3({check:"max_size",...Ce(t),maximum:e})}function _l(e,t){return new S3({check:"min_size",...Ce(t),minimum:e})}function bh(e,t){return new _3({check:"size_equals",...Ce(t),size:e})}function xh(e,t){return new C3({check:"max_length",...Ce(t),maximum:e})}function Lc(e,t){return new k3({check:"min_length",...Ce(t),minimum:e})}function wh(e,t){return new E3({check:"length_equals",...Ce(t),length:e})}function Nx(e,t){return new j3({check:"string_format",format:"regex",...Ce(t),pattern:e})}function Ax(e){return new I3({check:"string_format",format:"lowercase",...Ce(e)})}function Ox(e){return new R3({check:"string_format",format:"uppercase",...Ce(e)})}function $x(e,t){return new T3({check:"string_format",format:"includes",...Ce(t),includes:e})}function Dx(e,t){return new N3({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function Px(e,t){return new A3({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function sI(e,t,n){return new O3({check:"property",property:e,schema:t,...Ce(n)})}function Mx(e,t){return new $3({check:"mime_type",mime:e,...Ce(t)})}function gs(e){return new D3({check:"overwrite",tx:e})}function zx(e){return gs(t=>t.normalize(e))}function Lx(){return gs(e=>e.trim())}function Fx(){return gs(e=>e.toLowerCase())}function Ux(){return gs(e=>e.toUpperCase())}function Vx(){return gs(e=>h6(e))}function DV(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function Lve(e,t,n){return new e({type:"union",options:t,...Ce(n)})}function Fve(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Ce(n)})}function Uve(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...Ce(r)})}function Vve(e,t,n){return new e({type:"intersection",left:t,right:n})}function Bve(e,t,n,r){const i=n instanceof ft,o=i?r:n,a=i?n:null;return new e({type:"tuple",items:t,rest:a,...Ce(o)})}function Hve(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...Ce(r)})}function qve(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...Ce(r)})}function Kve(e,t,n){return new e({type:"set",valueType:t,...Ce(n)})}function Gve(e,t,n){const r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...Ce(n)})}function Zve(e,t,n){return new e({type:"enum",entries:t,...Ce(n)})}function Yve(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Ce(n)})}function PV(e,t){return new e({type:"file",...Ce(t)})}function Wve(e,t){return new e({type:"transform",transform:t})}function Xve(e,t){return new e({type:"optional",innerType:t})}function Jve(e,t){return new e({type:"nullable",innerType:t})}function Qve(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():kx(n)}})}function eye(e,t,n){return new e({type:"nonoptional",innerType:t,...Ce(n)})}function tye(e,t){return new e({type:"success",innerType:t})}function nye(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function rye(e,t,n){return new e({type:"pipe",in:t,out:n})}function iye(e,t){return new e({type:"readonly",innerType:t})}function oye(e,t,n){return new e({type:"template_literal",parts:t,...Ce(n)})}function aye(e,t){return new e({type:"lazy",getter:t})}function sye(e,t){return new e({type:"promise",innerType:t})}function MV(e,t,n){const r=Ce(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function zV(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function LV(e){const t=FV(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Gd(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Gd(i))}},e(n.value,n)));return t}function FV(e,t){const n=new Nn({check:"custom",...Ce(t)});return n._zod.check=e,n}function UV(e){const t=new Nn({check:"describe"});return t._zod.onattach=[n=>{const r=ko.get(n)??{};ko.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function VV(e){const t=new Nn({check:"meta"});return t._zod.onattach=[n=>{const r=ko.get(n)??{};ko.add(n,{...r,...e})}],t._zod.check=()=>{},t}function BV(e,t){const n=Ce(t);let r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(y=>typeof y=="string"?y.toLowerCase():y),i=i.map(y=>typeof y=="string"?y.toLowerCase():y));const o=new Set(r),a=new Set(i),l=e.Codec??Dj,d=e.Boolean??Nj,f=e.String??yh,m=new f({type:"string",error:n.error}),h=new d({type:"boolean",error:n.error}),v=new l({type:"pipe",in:m,out:h,transform:((y,x)=>{let S=y;return n.case!=="sensitive"&&(S=S.toLowerCase()),o.has(S)?!0:a.has(S)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:x.value,inst:v,continue:!1}),{})}),reverseTransform:((y,x)=>y===!0?r[0]||"true":i[0]||"false"),error:n.error});return v}function Sh(e,t,n,r={}){const i=Ce(r),o={...Ce(r),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:l=>n.test(l),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Wd(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ko,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ln(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,m);else{const v=a.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,m)}const h=e._zod.parent;h&&(a.ref||(a.ref=h),ln(h,t,m),t.seen.get(h).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&qr(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Xd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const l=e.metadataRegistry.get(a[0])?.id;if(l){const d=r.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,a[0])}}const i=a=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(a[0])?.id,v=e.external.uri??(x=>x);if(h)return{ref:v(h)};const y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${v("__shared")}#/${l}/${y}`}}if(a[1]===n)return{ref:"#"};const f=`#/${l}/`,m=a[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:f+m}},o=a=>{if(a[1].schema.$ref)return;const l=a[1],{ref:d,defId:f}=i(a);l.def={...l.schema},f&&(l.defId=f);const m=l.schema;for(const h in m)delete m[h];m.$ref=d};if(e.cycles==="throw")for(const a of e.seen.entries()){const l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const l=a[1];if(t===a[0]){o(a);continue}if(e.external){const f=e.external.registry.get(a[0])?.id;if(t!==a[0]&&f){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(l.cycle){o(a);continue}if(l.count>1&&e.reused==="ref"){o(a);continue}}}function Jd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const l=e.seen.get(a);if(l.ref===null)return;const d=l.def??l.schema,f={...d},m=l.ref;if(l.ref=null,m){r(m);const v=e.seen.get(m),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(y)):Object.assign(d,y),Object.assign(d,f),a._zod.parent===m)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(y.$ref)for(const S in d)S==="$ref"||S==="allOf"||S in v.def&&JSON.stringify(d[S])===JSON.stringify(v.def[S])&&delete d[S]}const h=a._zod.parent;if(h&&h!==m){r(h);const v=e.seen.get(h);if(v?.schema.$ref&&(d.$ref=v.schema.$ref,v.def))for(const y in d)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(d[y])===JSON.stringify(v.def[y])&&delete d[y]}e.override({zodSchema:a,jsonSchema:d,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,n.def??n.schema);const o=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Em(t,"input",e.processors),output:Em(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function qr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return qr(r.element,n);if(r.type==="set")return qr(r.valueType,n);if(r.type==="lazy")return qr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return qr(r.innerType,n);if(r.type==="intersection")return qr(r.left,n)||qr(r.right,n);if(r.type==="record"||r.type==="map")return qr(r.keyType,n)||qr(r.valueType,n);if(r.type==="pipe")return qr(r.in,n)||qr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(qr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(qr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(qr(i,n))return!0;return!!(r.rest&&qr(r.rest,n))}return!1}const HV=(e,t={})=>n=>{const r=Wd({...n,processors:t});return ln(e,r),Xd(r,e),Jd(r,e)},Em=(e,t,n={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=Wd({...i??{},target:o,io:t,processors:n});return ln(e,a),Xd(a,e),Jd(a,e)},lye={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qV=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:o,maximum:a,format:l,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=lye[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const m=[...d];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},KV=(e,t,n,r)=>{const i=n,{minimum:o,maximum:a,format:l,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:m}=e._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m),typeof o=="number"&&(i.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof a=="number"&&(i.maximum=a,typeof f=="number"&&t.target!=="draft-04"&&(f<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},GV=(e,t,n,r)=>{n.type="boolean"},ZV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},YV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},WV=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},XV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},JV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},QV=(e,t,n,r)=>{n.not={}},eB=(e,t,n,r)=>{},tB=(e,t,n,r)=>{},nB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},rB=(e,t,n,r)=>{const i=e._zod.def,o=fj(i.entries);o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o},iB=(e,t,n,r)=>{const i=e._zod.def,o=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),o.every(a=>typeof a=="boolean")&&(n.type="boolean"),o.every(a=>a===null)&&(n.type="null"),n.enum=o},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},aB=(e,t,n,r)=>{const i=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},sB=(e,t,n,r)=>{const i=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(o.minLength=a),l!==void 0&&(o.maxLength=l),d?d.length===1?(o.contentMediaType=d[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(i,o)},lB=(e,t,n,r)=>{n.type="boolean"},cB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},dB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},pB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},mB=(e,t,n,r)=>{const i=n,o=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=ln(o.element,t,{...r,path:[...r.path,"items"]})},hB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=ln(a[f],t,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),d=new Set([...l].filter(f=>{const m=o.shape[f]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));d.size>0&&(i.required=Array.from(d)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=ln(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},lI=(e,t,n,r)=>{const i=e._zod.def,o=i.inclusive===!1,a=i.options.map((l,d)=>ln(l,t,{...r,path:[...r.path,o?"oneOf":"anyOf",d]}));o?n.oneOf=a:n.anyOf=a},gB=(e,t,n,r)=>{const i=e._zod.def,o=ln(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=ln(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=f=>"allOf"in f&&Object.keys(f).length===1,d=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];n.allOf=d},vB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=o.items.map((v,y)=>ln(v,t,{...r,path:[...r.path,a,y]})),f=o.rest?ln(o.rest,t,{...r,path:[...r.path,l,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=d,f&&(i.items=f)):t.target==="openapi-3.0"?(i.items={anyOf:d},f&&i.items.anyOf.push(f),i.minItems=d.length,f||(i.maxItems=d.length)):(i.items=d,f&&(i.additionalItems=f));const{minimum:m,maximum:h}=e._zod.bag;typeof m=="number"&&(i.minItems=m),typeof h=="number"&&(i.maxItems=h)},yB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object";const a=o.keyType,d=a._zod.bag?.patterns;if(o.mode==="loose"&&d&&d.size>0){const m=ln(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of d)i.patternProperties[h.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=ln(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=ln(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=a._zod.values;if(f){const m=[...f].filter(h=>typeof h=="string"||typeof h=="number");m.length>0&&(i.required=m)}},bB=(e,t,n,r)=>{const i=e._zod.def,o=ln(i.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},xB=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},wB=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},SB=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},_B=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},CB=(e,t,n,r)=>{const i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;ln(o,t,r);const a=t.seen.get(e);a.ref=o},kB=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},EB=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},cI=(e,t,n,r)=>{const i=e._zod.def;ln(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},jB=(e,t,n,r)=>{const i=e._zod.innerType;ln(i,t,r);const o=t.seen.get(e);o.ref=i},GC={string:qV,number:KV,boolean:GV,bigint:ZV,symbol:YV,null:WV,undefined:XV,void:JV,never:QV,any:eB,unknown:tB,date:nB,enum:rB,literal:iB,nan:oB,template_literal:aB,file:sB,success:lB,custom:cB,function:uB,transform:dB,map:fB,set:pB,array:mB,object:hB,union:lI,intersection:gB,tuple:vB,record:yB,nullable:bB,nonoptional:xB,default:wB,prefault:SB,catch:_B,pipe:CB,readonly:kB,promise:EB,optional:cI,lazy:jB};function IB(e,t){if("_idmap"in e){const r=e,i=Wd({...t,processors:GC}),o={};for(const d of r._idmap.entries()){const[f,m]=d;ln(m,i)}const a={},l={registry:r,uri:t?.uri,defs:o};i.external=l;for(const d of r._idmap.entries()){const[f,m]=d;Xd(i,m),a[f]=Jd(i,m)}if(Object.keys(o).length>0){const d=i.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:o}}return{schemas:a}}const n=Wd({...t,processors:GC});return ln(e,n),Xd(n,e),Jd(n,e)}class cye{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Wd({processors:GC,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ln(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Xd(this.ctx,t);const r=Jd(this.ctx,t),{"~standard":i,...o}=r;return o}}const uye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dye=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:g5,$ZodArray:w5,$ZodAsyncError:Rc,$ZodBase64:i5,$ZodBase64URL:a5,$ZodBigInt:Aj,$ZodBigIntFormat:f5,$ZodBoolean:Nj,$ZodCIDRv4:n5,$ZodCIDRv6:r5,$ZodCUID:H3,$ZodCUID2:q3,$ZodCatch:V5,$ZodCheck:Nn,$ZodCheckBigIntFormat:x3,$ZodCheckEndsWith:A3,$ZodCheckGreaterThan:Ij,$ZodCheckIncludes:T3,$ZodCheckLengthEquals:E3,$ZodCheckLessThan:jj,$ZodCheckLowerCase:I3,$ZodCheckMaxLength:C3,$ZodCheckMaxSize:w3,$ZodCheckMimeType:$3,$ZodCheckMinLength:k3,$ZodCheckMinSize:S3,$ZodCheckMultipleOf:y3,$ZodCheckNumberFormat:b3,$ZodCheckOverwrite:D3,$ZodCheckProperty:O3,$ZodCheckRegex:j3,$ZodCheckSizeEquals:_3,$ZodCheckStartsWith:N3,$ZodCheckStringFormat:vh,$ZodCheckUpperCase:R3,$ZodCodec:Dj,$ZodCustom:W5,$ZodCustomStringFormat:u5,$ZodDate:x5,$ZodDefault:z5,$ZodDiscriminatedUnion:j5,$ZodE164:s5,$ZodEmail:F3,$ZodEmoji:V3,$ZodEncodeError:_x,$ZodEnum:A5,$ZodError:Ix,$ZodExactOptional:P5,$ZodFile:$5,$ZodFunction:G5,$ZodGUID:z3,$ZodIPv4:Q3,$ZodIPv6:e5,$ZodISODate:W3,$ZodISODateTime:Y3,$ZodISODuration:J3,$ZodISOTime:X3,$ZodIntersection:I5,$ZodJWT:c5,$ZodKSUID:Z3,$ZodLazy:Y5,$ZodLiteral:O5,$ZodMAC:t5,$ZodMap:T5,$ZodNaN:B5,$ZodNanoID:B3,$ZodNever:y5,$ZodNonOptional:F5,$ZodNull:h5,$ZodNullable:M5,$ZodNumber:Tj,$ZodNumberFormat:d5,$ZodObject:C5,$ZodObjectJIT:k5,$ZodOptional:$j,$ZodPipe:H5,$ZodPrefault:L5,$ZodPromise:Z5,$ZodReadonly:q5,$ZodRealError:eo,$ZodRecord:R5,$ZodRegistry:rV,$ZodSet:N5,$ZodString:yh,$ZodStringFormat:hn,$ZodSuccess:U5,$ZodSymbol:p5,$ZodTemplateLiteral:K5,$ZodTransform:D5,$ZodTuple:Oj,$ZodType:ft,$ZodULID:K3,$ZodURL:U3,$ZodUUID:L3,$ZodUndefined:m5,$ZodUnion:Rx,$ZodUnknown:v5,$ZodVoid:b5,$ZodXID:G3,$ZodXor:E5,$brand:p6,$constructor:ae,$input:nV,$output:tV,Doc:P3,JSONSchema:uye,JSONSchemaGenerator:cye,NEVER:f6,TimePrecision:sV,_any:IV,_array:DV,_base64:Qj,_base64url:eI,_bigint:wV,_boolean:bV,_catch:nye,_check:FV,_cidrv4:Xj,_cidrv6:Jj,_coercedBigint:SV,_coercedBoolean:xV,_coercedDate:OV,_coercedNumber:pV,_coercedString:oV,_cuid:Hj,_cuid2:qj,_custom:MV,_date:AV,_decode:vj,_decodeAsync:bj,_default:Qve,_discriminatedUnion:Uve,_e164:tI,_email:Mj,_emoji:Vj,_encode:gj,_encodeAsync:yj,_endsWith:Px,_enum:Gve,_file:PV,_float32:hV,_float64:gV,_gt:Sl,_gte:xi,_guid:Yy,_includes:$x,_int:mV,_int32:vV,_int64:_V,_intersection:Vve,_ipv4:Yj,_ipv6:Wj,_isoDate:cV,_isoDateTime:lV,_isoDuration:dV,_isoTime:uV,_jwt:nI,_ksuid:Zj,_lazy:aye,_length:wh,_literal:Yve,_lowercase:Ax,_lt:wl,_lte:jo,_mac:aV,_map:qve,_max:jo,_maxLength:xh,_maxSize:Sf,_mime:Mx,_min:xi,_minLength:Lc,_minSize:_l,_multipleOf:Yd,_nan:$V,_nanoid:Bj,_nativeEnum:Zve,_negative:iI,_never:TV,_nonnegative:aI,_nonoptional:eye,_nonpositive:oI,_normalize:zx,_null:jV,_nullable:Jve,_number:fV,_optional:Xve,_overwrite:gs,_parse:dh,_parseAsync:fh,_pipe:rye,_positive:rI,_promise:sye,_property:sI,_readonly:iye,_record:Hve,_refine:zV,_regex:Nx,_safeDecode:wj,_safeDecodeAsync:_j,_safeEncode:xj,_safeEncodeAsync:Sj,_safeParse:ph,_safeParseAsync:mh,_set:Kve,_size:bh,_slugify:Vx,_startsWith:Dx,_string:iV,_stringFormat:Sh,_stringbool:BV,_success:tye,_superRefine:LV,_symbol:kV,_templateLiteral:oye,_toLowerCase:Fx,_toUpperCase:Ux,_transform:Wve,_trim:Lx,_tuple:Bve,_uint32:yV,_uint64:CV,_ulid:Kj,_undefined:EV,_union:Lve,_unknown:RV,_uppercase:Ox,_url:Tx,_uuid:zj,_uuidv4:Lj,_uuidv6:Fj,_uuidv7:Uj,_void:NV,_xid:Gj,_xor:Fve,clone:Oo,config:Mr,createStandardJSONSchemaMethod:Em,createToJSONSchemaMethod:HV,decode:_he,decodeAsync:khe,describe:UV,encode:She,encodeAsync:Che,extractDefs:Xd,finalize:Jd,flattenError:mj,formatError:hj,globalConfig:By,globalRegistry:ko,initializeContext:Wd,isValidBase64:Rj,isValidBase64URL:o5,isValidJWT:l5,locales:eV,meta:VV,parse:Ky,parseAsync:Gy,prettifyError:$6,process:ln,regexes:Ej,registry:Pj,safeDecode:jhe,safeDecodeAsync:Rhe,safeEncode:Ehe,safeEncodeAsync:Ihe,safeParse:D6,safeParseAsync:P6,toDotPath:O6,toJSONSchema:IB,treeifyError:A6,util:T6,version:M3},Symbol.toStringTag,{value:"Module"})),fye=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Px,gt:Sl,gte:xi,includes:$x,length:wh,lowercase:Ax,lt:wl,lte:jo,maxLength:xh,maxSize:Sf,mime:Mx,minLength:Lc,minSize:_l,multipleOf:Yd,negative:iI,nonnegative:aI,nonpositive:oI,normalize:zx,overwrite:gs,positive:rI,property:sI,regex:Nx,size:bh,slugify:Vx,startsWith:Dx,toLowerCase:Fx,toUpperCase:Ux,trim:Lx,uppercase:Ox},Symbol.toStringTag,{value:"Module"})),uI=ae("ZodISODateTime",(e,t)=>{Y3.init(e,t),gn.init(e,t)});function RB(e){return lV(uI,e)}const dI=ae("ZodISODate",(e,t)=>{W3.init(e,t),gn.init(e,t)});function TB(e){return cV(dI,e)}const fI=ae("ZodISOTime",(e,t)=>{X3.init(e,t),gn.init(e,t)});function NB(e){return uV(fI,e)}const pI=ae("ZodISODuration",(e,t)=>{J3.init(e,t),gn.init(e,t)});function AB(e){return dV(pI,e)}const OB=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:dI,ZodISODateTime:uI,ZodISODuration:pI,ZodISOTime:fI,date:TB,datetime:RB,duration:AB,time:NB},Symbol.toStringTag,{value:"Module"})),$B=(e,t)=>{Ix.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>hj(e,n)},flatten:{value:n=>mj(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Hy,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Hy,2)}},isEmpty:{get(){return e.issues.length===0}}})},pye=ae("ZodError",$B),to=ae("ZodError",$B,{Parent:Error}),DB=dh(to),PB=fh(to),MB=ph(to),zB=mh(to),LB=gj(to),FB=vj(to),UB=yj(to),VB=bj(to),BB=xj(to),HB=wj(to),qB=Sj(to),KB=_j(to),vt=ae("ZodType",(e,t)=>(ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Em(e,"input"),output:Em(e,"output")}}),e.toJSONSchema=HV(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ea(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Oo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>DB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>MB(e,n,r),e.parseAsync=async(n,r)=>PB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>zB(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>LB(e,n,r),e.decode=(n,r)=>FB(e,n,r),e.encodeAsync=async(n,r)=>UB(e,n,r),e.decodeAsync=async(n,r)=>VB(e,n,r),e.safeEncode=(n,r)=>BB(e,n,r),e.safeDecode=(n,r)=>HB(e,n,r),e.safeEncodeAsync=async(n,r)=>qB(e,n,r),e.safeDecodeAsync=async(n,r)=>KB(e,n,r),e.refine=(n,r)=>e.check(rR(n,r)),e.superRefine=n=>e.check(iR(n)),e.overwrite=n=>e.check(gs(n)),e.optional=()=>Rm(e),e.exactOptional=()=>LI(e),e.nullable=()=>Tm(e),e.nullish=()=>Rm(Tm(e)),e.nonoptional=n=>qI(e,n),e.array=()=>ds(e),e.or=n=>u0([e,n]),e.and=n=>TI(e,n),e.transform=n=>Nm(e,f0(n)),e.default=n=>VI(e,n),e.prefault=n=>HI(e,n),e.catch=n=>ZI(e,n),e.pipe=n=>Nm(e,n),e.readonly=()=>XI(e),e.describe=n=>{const r=e.clone();return ko.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ko.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ko.get(e);const r=e.clone();return ko.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Bx=ae("_ZodString",(e,t)=>{yh.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>qV(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Nx(...r)),e.includes=(...r)=>e.check($x(...r)),e.startsWith=(...r)=>e.check(Dx(...r)),e.endsWith=(...r)=>e.check(Px(...r)),e.min=(...r)=>e.check(Lc(...r)),e.max=(...r)=>e.check(xh(...r)),e.length=(...r)=>e.check(wh(...r)),e.nonempty=(...r)=>e.check(Lc(1,...r)),e.lowercase=r=>e.check(Ax(r)),e.uppercase=r=>e.check(Ox(r)),e.trim=()=>e.check(Lx()),e.normalize=(...r)=>e.check(zx(...r)),e.toLowerCase=()=>e.check(Fx()),e.toUpperCase=()=>e.check(Ux()),e.slugify=()=>e.check(Vx())}),_h=ae("ZodString",(e,t)=>{yh.init(e,t),Bx.init(e,t),e.email=n=>e.check(Mj(Hx,n)),e.url=n=>e.check(Tx(Ch,n)),e.jwt=n=>e.check(nI(o0,n)),e.emoji=n=>e.check(Vj(qx,n)),e.guid=n=>e.check(Yy(jm,n)),e.uuid=n=>e.check(zj(pa,n)),e.uuidv4=n=>e.check(Lj(pa,n)),e.uuidv6=n=>e.check(Fj(pa,n)),e.uuidv7=n=>e.check(Uj(pa,n)),e.nanoid=n=>e.check(Bj(Kx,n)),e.guid=n=>e.check(Yy(jm,n)),e.cuid=n=>e.check(Hj(Gx,n)),e.cuid2=n=>e.check(qj(Zx,n)),e.ulid=n=>e.check(Kj(Yx,n)),e.base64=n=>e.check(Qj(n0,n)),e.base64url=n=>e.check(eI(r0,n)),e.xid=n=>e.check(Gj(Wx,n)),e.ksuid=n=>e.check(Zj(Xx,n)),e.ipv4=n=>e.check(Yj(Jx,n)),e.ipv6=n=>e.check(Wj(Qx,n)),e.cidrv4=n=>e.check(Xj(e0,n)),e.cidrv6=n=>e.check(Jj(t0,n)),e.e164=n=>e.check(tI(i0,n)),e.datetime=n=>e.check(RB(n)),e.date=n=>e.check(TB(n)),e.time=n=>e.check(NB(n)),e.duration=n=>e.check(AB(n))});function tt(e){return iV(_h,e)}const gn=ae("ZodStringFormat",(e,t)=>{hn.init(e,t),Bx.init(e,t)}),Hx=ae("ZodEmail",(e,t)=>{F3.init(e,t),gn.init(e,t)});function mI(e){return Mj(Hx,e)}const jm=ae("ZodGUID",(e,t)=>{z3.init(e,t),gn.init(e,t)});function GB(e){return Yy(jm,e)}const pa=ae("ZodUUID",(e,t)=>{L3.init(e,t),gn.init(e,t)});function ZB(e){return zj(pa,e)}function YB(e){return Lj(pa,e)}function WB(e){return Fj(pa,e)}function XB(e){return Uj(pa,e)}const Ch=ae("ZodURL",(e,t)=>{U3.init(e,t),gn.init(e,t)});function JB(e){return Tx(Ch,e)}function QB(e){return Tx(Ch,{protocol:/^https?$/,hostname:t3,...Ce(e)})}const qx=ae("ZodEmoji",(e,t)=>{V3.init(e,t),gn.init(e,t)});function eH(e){return Vj(qx,e)}const Kx=ae("ZodNanoID",(e,t)=>{B3.init(e,t),gn.init(e,t)});function tH(e){return Bj(Kx,e)}const Gx=ae("ZodCUID",(e,t)=>{H3.init(e,t),gn.init(e,t)});function nH(e){return Hj(Gx,e)}const Zx=ae("ZodCUID2",(e,t)=>{q3.init(e,t),gn.init(e,t)});function rH(e){return qj(Zx,e)}const Yx=ae("ZodULID",(e,t)=>{K3.init(e,t),gn.init(e,t)});function iH(e){return Kj(Yx,e)}const Wx=ae("ZodXID",(e,t)=>{G3.init(e,t),gn.init(e,t)});function oH(e){return Gj(Wx,e)}const Xx=ae("ZodKSUID",(e,t)=>{Z3.init(e,t),gn.init(e,t)});function aH(e){return Zj(Xx,e)}const Jx=ae("ZodIPv4",(e,t)=>{Q3.init(e,t),gn.init(e,t)});function sH(e){return Yj(Jx,e)}const hI=ae("ZodMAC",(e,t)=>{t5.init(e,t),gn.init(e,t)});function lH(e){return aV(hI,e)}const Qx=ae("ZodIPv6",(e,t)=>{e5.init(e,t),gn.init(e,t)});function cH(e){return Wj(Qx,e)}const e0=ae("ZodCIDRv4",(e,t)=>{n5.init(e,t),gn.init(e,t)});function uH(e){return Xj(e0,e)}const t0=ae("ZodCIDRv6",(e,t)=>{r5.init(e,t),gn.init(e,t)});function dH(e){return Jj(t0,e)}const n0=ae("ZodBase64",(e,t)=>{i5.init(e,t),gn.init(e,t)});function fH(e){return Qj(n0,e)}const r0=ae("ZodBase64URL",(e,t)=>{a5.init(e,t),gn.init(e,t)});function pH(e){return eI(r0,e)}const i0=ae("ZodE164",(e,t)=>{s5.init(e,t),gn.init(e,t)});function mH(e){return tI(i0,e)}const o0=ae("ZodJWT",(e,t)=>{c5.init(e,t),gn.init(e,t)});function hH(e){return nI(o0,e)}const _f=ae("ZodCustomStringFormat",(e,t)=>{u5.init(e,t),gn.init(e,t)});function gH(e,t,n={}){return Sh(_f,e,t,n)}function vH(e){return Sh(_f,"hostname",e3,e)}function yH(e){return Sh(_f,"hex",g3,e)}function bH(e,t){const n=t?.enc??"hex",r=`${e}_${n}`,i=Ej[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return Sh(_f,r,i,t)}const kh=ae("ZodNumber",(e,t)=>{Tj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>KV(e,r,i),e.gt=(r,i)=>e.check(Sl(r,i)),e.gte=(r,i)=>e.check(xi(r,i)),e.min=(r,i)=>e.check(xi(r,i)),e.lt=(r,i)=>e.check(wl(r,i)),e.lte=(r,i)=>e.check(jo(r,i)),e.max=(r,i)=>e.check(jo(r,i)),e.int=r=>e.check(Wy(r)),e.safe=r=>e.check(Wy(r)),e.positive=r=>e.check(Sl(0,r)),e.nonnegative=r=>e.check(xi(0,r)),e.negative=r=>e.check(wl(0,r)),e.nonpositive=r=>e.check(jo(0,r)),e.multipleOf=(r,i)=>e.check(Yd(r,i)),e.step=(r,i)=>e.check(Yd(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function a0(e){return fV(kh,e)}const ru=ae("ZodNumberFormat",(e,t)=>{d5.init(e,t),kh.init(e,t)});function Wy(e){return mV(ru,e)}function xH(e){return hV(ru,e)}function wH(e){return gV(ru,e)}function gI(e){return vV(ru,e)}function SH(e){return yV(ru,e)}const Eh=ae("ZodBoolean",(e,t)=>{Nj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GV(e,n,r)});function Xt(e){return bV(Eh,e)}const jh=ae("ZodBigInt",(e,t)=>{Aj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ZV(e,r),e.gte=(r,i)=>e.check(xi(r,i)),e.min=(r,i)=>e.check(xi(r,i)),e.gt=(r,i)=>e.check(Sl(r,i)),e.gte=(r,i)=>e.check(xi(r,i)),e.min=(r,i)=>e.check(xi(r,i)),e.lt=(r,i)=>e.check(wl(r,i)),e.lte=(r,i)=>e.check(jo(r,i)),e.max=(r,i)=>e.check(jo(r,i)),e.positive=r=>e.check(Sl(BigInt(0),r)),e.negative=r=>e.check(wl(BigInt(0),r)),e.nonpositive=r=>e.check(jo(BigInt(0),r)),e.nonnegative=r=>e.check(xi(BigInt(0),r)),e.multipleOf=(r,i)=>e.check(Yd(r,i));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function _H(e){return wV(jh,e)}const s0=ae("ZodBigIntFormat",(e,t)=>{f5.init(e,t),jh.init(e,t)});function CH(e){return _V(s0,e)}function kH(e){return CV(s0,e)}const vI=ae("ZodSymbol",(e,t)=>{p5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YV(e,n)});function EH(e){return kV(vI,e)}const yI=ae("ZodUndefined",(e,t)=>{m5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XV(e,n)});function Im(e){return EV(yI,e)}const bI=ae("ZodNull",(e,t)=>{h5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WV(e,n,r)});function xI(e){return jV(bI,e)}const wI=ae("ZodAny",(e,t)=>{g5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eB()});function jH(){return IV(wI)}const SI=ae("ZodUnknown",(e,t)=>{v5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tB()});function Fc(){return RV(SI)}const _I=ae("ZodNever",(e,t)=>{y5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QV(e,n,r)});function l0(e){return TV(_I,e)}const CI=ae("ZodVoid",(e,t)=>{b5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JV(e,n)});function IH(e){return NV(CI,e)}const c0=ae("ZodDate",(e,t)=>{x5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>nB(e,r),e.min=(r,i)=>e.check(xi(r,i)),e.max=(r,i)=>e.check(jo(r,i));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function RH(e){return AV(c0,e)}const kI=ae("ZodArray",(e,t)=>{w5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mB(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Lc(n,r)),e.nonempty=n=>e.check(Lc(1,n)),e.max=(n,r)=>e.check(xh(n,r)),e.length=(n,r)=>e.check(wh(n,r)),e.unwrap=()=>e.element});function ds(e,t){return DV(kI,e,t)}function TH(e){const t=e._zod.def.shape;return Ml(Object.keys(t))}const Ih=ae("ZodObject",(e,t)=>{k5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hB(e,n,r,i),_t(e,"shape",()=>t.shape),e.keyof=()=>Ml(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Fc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Fc()}),e.strict=()=>e.clone({...e._zod.def,catchall:l0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>_6(e,n),e.safeExtend=n=>C6(e,n),e.merge=n=>k6(e,n),e.pick=n=>w6(e,n),e.omit=n=>S6(e,n),e.partial=(...n)=>E6(p0,e,n[0]),e.required=(...n)=>j6(m0,e,n[0])});function $t(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new Ih(n)}function NH(e,t){return new Ih({type:"object",shape:e,catchall:l0(),...Ce(t)})}function AH(e,t){return new Ih({type:"object",shape:e,catchall:Fc(),...Ce(t)})}const Rh=ae("ZodUnion",(e,t)=>{Rx.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lI(e,n,r,i),e.options=t.options});function u0(e,t){return new Rh({type:"union",options:e,...Ce(t)})}const EI=ae("ZodXor",(e,t)=>{Rh.init(e,t),E5.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lI(e,n,r,i),e.options=t.options});function OH(e,t){return new EI({type:"union",options:e,inclusive:!1,...Ce(t)})}const jI=ae("ZodDiscriminatedUnion",(e,t)=>{Rh.init(e,t),j5.init(e,t)});function II(e,t,n){return new jI({type:"union",options:t,discriminator:e,...Ce(n)})}const RI=ae("ZodIntersection",(e,t)=>{I5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gB(e,n,r,i)});function TI(e,t){return new RI({type:"intersection",left:e,right:t})}const NI=ae("ZodTuple",(e,t)=>{Oj.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vB(e,n,r,i),e.rest=n=>e.clone({...e._zod.def,rest:n})});function AI(e,t,n){const r=t instanceof ft,i=r?n:t,o=r?t:null;return new NI({type:"tuple",items:e,rest:o,...Ce(i)})}const Th=ae("ZodRecord",(e,t)=>{R5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yB(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function d0(e,t,n){return new Th({type:"record",keyType:e,valueType:t,...Ce(n)})}function $H(e,t,n){const r=Oo(e);return r._zod.values=void 0,new Th({type:"record",keyType:r,valueType:t,...Ce(n)})}function DH(e,t,n){return new Th({type:"record",keyType:e,valueType:t,mode:"loose",...Ce(n)})}const OI=ae("ZodMap",(e,t)=>{T5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fB(e,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(_l(...n)),e.nonempty=n=>e.check(_l(1,n)),e.max=(...n)=>e.check(Sf(...n)),e.size=(...n)=>e.check(bh(...n))});function PH(e,t,n){return new OI({type:"map",keyType:e,valueType:t,...Ce(n)})}const $I=ae("ZodSet",(e,t)=>{N5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pB(e,n),e.min=(...n)=>e.check(_l(...n)),e.nonempty=n=>e.check(_l(1,n)),e.max=(...n)=>e.check(Sf(...n)),e.size=(...n)=>e.check(bh(...n))});function MH(e,t){return new $I({type:"set",valueType:e,...Ce(t)})}const Qd=ae("ZodEnum",(e,t)=>{A5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>rB(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const o={};for(const a of r)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Qd({...t,checks:[],...Ce(i),entries:o})},e.exclude=(r,i)=>{const o={...t.entries};for(const a of r)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Qd({...t,checks:[],...Ce(i),entries:o})}});function Ml(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Qd({type:"enum",entries:n,...Ce(t)})}function zH(e,t){return new Qd({type:"enum",entries:e,...Ce(t)})}const DI=ae("ZodLiteral",(e,t)=>{O5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iB(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Cf(e,t){return new DI({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const PI=ae("ZodFile",(e,t)=>{$5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sB(e,n,r),e.min=(n,r)=>e.check(_l(n,r)),e.max=(n,r)=>e.check(Sf(n,r)),e.mime=(n,r)=>e.check(Mx(Array.isArray(n)?n:[n],r))});function LH(e){return PV(PI,e)}const MI=ae("ZodTransform",(e,t)=>{D5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dB(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _x(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Gd(o,n.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Gd(a))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function f0(e){return new MI({type:"transform",transform:e})}const p0=ae("ZodOptional",(e,t)=>{$j.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cI(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Rm(e){return new p0({type:"optional",innerType:e})}const zI=ae("ZodExactOptional",(e,t)=>{P5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cI(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LI(e){return new zI({type:"optional",innerType:e})}const FI=ae("ZodNullable",(e,t)=>{M5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Tm(e){return new FI({type:"nullable",innerType:e})}function FH(e){return Rm(Tm(e))}const UI=ae("ZodDefault",(e,t)=>{z5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VI(e,t){return new UI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kx(t)}})}const BI=ae("ZodPrefault",(e,t)=>{L5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function HI(e,t){return new BI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kx(t)}})}const m0=ae("ZodNonOptional",(e,t)=>{F5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qI(e,t){return new m0({type:"nonoptional",innerType:e,...Ce(t)})}const KI=ae("ZodSuccess",(e,t)=>{U5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lB(e,n,r),e.unwrap=()=>e._zod.def.innerType});function UH(e){return new KI({type:"success",innerType:e})}const GI=ae("ZodCatch",(e,t)=>{V5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_B(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZI(e,t){return new GI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const YI=ae("ZodNaN",(e,t)=>{B5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oB(e,n)});function VH(e){return $V(YI,e)}const h0=ae("ZodPipe",(e,t)=>{H5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CB(e,n,r,i),e.in=t.in,e.out=t.out});function Nm(e,t){return new h0({type:"pipe",in:e,out:t})}const g0=ae("ZodCodec",(e,t)=>{h0.init(e,t),Dj.init(e,t)});function BH(e,t,n){return new g0({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const WI=ae("ZodReadonly",(e,t)=>{q5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function XI(e){return new WI({type:"readonly",innerType:e})}const JI=ae("ZodTemplateLiteral",(e,t)=>{K5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aB(e,n,r)});function HH(e,t){return new JI({type:"template_literal",parts:e,...Ce(t)})}const QI=ae("ZodLazy",(e,t)=>{Y5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jB(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function eR(e){return new QI({type:"lazy",getter:e})}const tR=ae("ZodPromise",(e,t)=>{Z5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function qH(e){return new tR({type:"promise",innerType:e})}const nR=ae("ZodFunction",(e,t)=>{G5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uB(e,n)});function Xy(e){return new nR({type:"function",input:Array.isArray(e?.input)?AI(e?.input):e?.input??ds(Fc()),output:e?.output??Fc()})}const Nh=ae("ZodCustom",(e,t)=>{W5.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cB(e,n)});function KH(e){const t=new Nn({check:"custom"});return t._zod.check=e,t}function GH(e,t){return MV(Nh,e??(()=>!0),t)}function rR(e,t={}){return zV(Nh,e,t)}function iR(e){return LV(e)}const ZH=UV,YH=VV;function WH(e,t={}){const n=new Nh({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Ce(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}const XH=(...e)=>BV({Codec:g0,Boolean:Eh,String:_h},...e);function JH(e){const t=eR(()=>u0([tt(e),a0(),Xt(),xI(),ds(t),d0(tt(),t)]));return t}function QH(e,t){return Nm(f0(e),t)}const mye=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:wI,ZodArray:kI,ZodBase64:n0,ZodBase64URL:r0,ZodBigInt:jh,ZodBigIntFormat:s0,ZodBoolean:Eh,ZodCIDRv4:e0,ZodCIDRv6:t0,ZodCUID:Gx,ZodCUID2:Zx,ZodCatch:GI,ZodCodec:g0,ZodCustom:Nh,ZodCustomStringFormat:_f,ZodDate:c0,ZodDefault:UI,ZodDiscriminatedUnion:jI,ZodE164:i0,ZodEmail:Hx,ZodEmoji:qx,ZodEnum:Qd,ZodExactOptional:zI,ZodFile:PI,ZodFunction:nR,ZodGUID:jm,ZodIPv4:Jx,ZodIPv6:Qx,ZodIntersection:RI,ZodJWT:o0,ZodKSUID:Xx,ZodLazy:QI,ZodLiteral:DI,ZodMAC:hI,ZodMap:OI,ZodNaN:YI,ZodNanoID:Kx,ZodNever:_I,ZodNonOptional:m0,ZodNull:bI,ZodNullable:FI,ZodNumber:kh,ZodNumberFormat:ru,ZodObject:Ih,ZodOptional:p0,ZodPipe:h0,ZodPrefault:BI,ZodPromise:tR,ZodReadonly:WI,ZodRecord:Th,ZodSet:$I,ZodString:_h,ZodStringFormat:gn,ZodSuccess:KI,ZodSymbol:vI,ZodTemplateLiteral:JI,ZodTransform:MI,ZodTuple:NI,ZodType:vt,ZodULID:Yx,ZodURL:Ch,ZodUUID:pa,ZodUndefined:yI,ZodUnion:Rh,ZodUnknown:SI,ZodVoid:CI,ZodXID:Wx,ZodXor:EI,_ZodString:Bx,_default:VI,_function:Xy,any:jH,array:ds,base64:fH,base64url:pH,bigint:_H,boolean:Xt,catch:ZI,check:KH,cidrv4:uH,cidrv6:dH,codec:BH,cuid:nH,cuid2:rH,custom:GH,date:RH,describe:ZH,discriminatedUnion:II,e164:mH,email:mI,emoji:eH,enum:Ml,exactOptional:LI,file:LH,float32:xH,float64:wH,function:Xy,guid:GB,hash:bH,hex:yH,hostname:vH,httpUrl:QB,instanceof:WH,int:Wy,int32:gI,int64:CH,intersection:TI,ipv4:sH,ipv6:cH,json:JH,jwt:hH,keyof:TH,ksuid:aH,lazy:eR,literal:Cf,looseObject:AH,looseRecord:DH,mac:lH,map:PH,meta:YH,nan:VH,nanoid:tH,nativeEnum:zH,never:l0,nonoptional:qI,null:xI,nullable:Tm,nullish:FH,number:a0,object:$t,optional:Rm,partialRecord:$H,pipe:Nm,prefault:HI,preprocess:QH,promise:qH,readonly:XI,record:d0,refine:rR,set:MH,strictObject:NH,string:tt,stringFormat:gH,stringbool:XH,success:UH,superRefine:iR,symbol:EH,templateLiteral:HH,transform:f0,tuple:AI,uint32:SH,uint64:kH,ulid:iH,undefined:Im,union:u0,unknown:Fc,url:JB,uuid:ZB,uuidv4:YB,uuidv6:WB,uuidv7:XB,void:IH,xid:oH,xor:OH},Symbol.toStringTag,{value:"Module"})),hye={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function gye(e){Mr({customError:e})}function vye(){return Mr().customError}var ZC;ZC||(ZC={});const Le={...mye,...fye,iso:OB},yye=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function bye(e,t){const n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function xye(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;const r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){const i=n[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${e}`);return t.defs[i]}throw new Error(`Reference not found: ${e}`)}function e8(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Le.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return Le.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);const o=xye(i,t),a=Or(o,t);return t.refs.set(i,a),t.processing.delete(i),a}if(e.enum!==void 0){const i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return Le.null();if(i.length===0)return Le.never();if(i.length===1)return Le.literal(i[0]);if(i.every(a=>typeof a=="string"))return Le.enum(i);const o=i.map(a=>Le.literal(a));return o.length<2?o[0]:Le.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return Le.literal(e.const);const n=e.type;if(Array.isArray(n)){const i=n.map(o=>{const a={...e,type:o};return e8(a,t)});return i.length===0?Le.never():i.length===1?i[0]:Le.union(i)}if(!n)return Le.any();let r;switch(n){case"string":{let i=Le.string();if(e.format){const o=e.format;o==="email"?i=i.check(Le.email()):o==="uri"||o==="uri-reference"?i=i.check(Le.url()):o==="uuid"||o==="guid"?i=i.check(Le.uuid()):o==="date-time"?i=i.check(Le.iso.datetime()):o==="date"?i=i.check(Le.iso.date()):o==="time"?i=i.check(Le.iso.time()):o==="duration"?i=i.check(Le.iso.duration()):o==="ipv4"?i=i.check(Le.ipv4()):o==="ipv6"?i=i.check(Le.ipv6()):o==="mac"?i=i.check(Le.mac()):o==="cidr"?i=i.check(Le.cidrv4()):o==="cidr-v6"?i=i.check(Le.cidrv6()):o==="base64"?i=i.check(Le.base64()):o==="base64url"?i=i.check(Le.base64url()):o==="e164"?i=i.check(Le.e164()):o==="jwt"?i=i.check(Le.jwt()):o==="emoji"?i=i.check(Le.emoji()):o==="nanoid"?i=i.check(Le.nanoid()):o==="cuid"?i=i.check(Le.cuid()):o==="cuid2"?i=i.check(Le.cuid2()):o==="ulid"?i=i.check(Le.ulid()):o==="xid"?i=i.check(Le.xid()):o==="ksuid"&&(i=i.check(Le.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),r=i;break}case"number":case"integer":{let i=n==="integer"?Le.number().int():Le.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),r=i;break}case"boolean":{r=Le.boolean();break}case"null":{r=Le.null();break}case"object":{const i={},o=e.properties||{},a=new Set(e.required||[]);for(const[d,f]of Object.entries(o)){const m=Or(f,t);i[d]=a.has(d)?m:m.optional()}if(e.propertyNames){const d=Or(e.propertyNames,t),f=e.additionalProperties&&typeof e.additionalProperties=="object"?Or(e.additionalProperties,t):Le.any();if(Object.keys(i).length===0){r=Le.record(d,f);break}const m=Le.object(i).passthrough(),h=Le.looseRecord(d,f);r=Le.intersection(m,h);break}if(e.patternProperties){const d=e.patternProperties,f=Object.keys(d),m=[];for(const v of f){const y=Or(d[v],t),x=Le.string().regex(new RegExp(v));m.push(Le.looseRecord(x,y))}const h=[];if(Object.keys(i).length>0&&h.push(Le.object(i).passthrough()),h.push(...m),h.length===0)r=Le.object({}).passthrough();else if(h.length===1)r=h[0];else{let v=Le.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)v=Le.intersection(v,h[y]);r=v}break}const l=Le.object(i);e.additionalProperties===!1?r=l.strict():typeof e.additionalProperties=="object"?r=l.catchall(Or(e.additionalProperties,t)):r=l.passthrough();break}case"array":{const i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){const a=i.map(d=>Or(d,t)),l=o&&typeof o=="object"&&!Array.isArray(o)?Or(o,t):void 0;l?r=Le.tuple(a).rest(l):r=Le.tuple(a),typeof e.minItems=="number"&&(r=r.check(Le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Le.maxLength(e.maxItems)))}else if(Array.isArray(o)){const a=o.map(d=>Or(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?Or(e.additionalItems,t):void 0;l?r=Le.tuple(a).rest(l):r=Le.tuple(a),typeof e.minItems=="number"&&(r=r.check(Le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(Le.maxLength(e.maxItems)))}else if(o!==void 0){const a=Or(o,t);let l=Le.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),r=l}else r=Le.array(Le.any());break}default:throw new Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Or(e,t){if(typeof e=="boolean")return e?Le.any():Le.never();let n=e8(e,t);const r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const l=e.anyOf.map(f=>Or(f,t)),d=Le.union(l);n=r?Le.intersection(n,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){const l=e.oneOf.map(f=>Or(f,t)),d=Le.xor(l);n=r?Le.intersection(n,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:Le.any();else{let l=r?n:Or(e.allOf[0],t);const d=r?0:1;for(let f=d;f<e.allOf.length;f++)l=Le.intersection(l,Or(e.allOf[f],t));n=l}e.nullable===!0&&t.version==="openapi-3.0"&&(n=Le.nullable(n)),e.readOnly===!0&&(n=Le.readonly(n));const i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const l of o)l in e&&(i[l]=e[l]);const a=["contentEncoding","contentMediaType","contentSchema"];for(const l of a)l in e&&(i[l]=e[l]);for(const l of Object.keys(e))yye.has(l)||(i[l]=e[l]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function wye(e,t){if(typeof e=="boolean")return e?Le.any():Le.never();const n=bye(e,t?.defaultTarget),r=e.$defs||e.definitions||{},i={version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??ko};return Or(e,i)}function Sye(e){return oV(_h,e)}function _ye(e){return pV(kh,e)}function Cye(e){return xV(Eh,e)}function kye(e){return SV(jh,e)}function Eye(e){return OV(c0,e)}const jye=Object.freeze(Object.defineProperty({__proto__:null,bigint:kye,boolean:Cye,date:Eye,number:_ye,string:Sye},Symbol.toStringTag,{value:"Module"}));Mr(X5());const Cl=Object.freeze(Object.defineProperty({__proto__:null,$brand:p6,$input:nV,$output:tV,NEVER:f6,TimePrecision:sV,ZodAny:wI,ZodArray:kI,ZodBase64:n0,ZodBase64URL:r0,ZodBigInt:jh,ZodBigIntFormat:s0,ZodBoolean:Eh,ZodCIDRv4:e0,ZodCIDRv6:t0,ZodCUID:Gx,ZodCUID2:Zx,ZodCatch:GI,ZodCodec:g0,ZodCustom:Nh,ZodCustomStringFormat:_f,ZodDate:c0,ZodDefault:UI,ZodDiscriminatedUnion:jI,ZodE164:i0,ZodEmail:Hx,ZodEmoji:qx,ZodEnum:Qd,ZodError:pye,ZodExactOptional:zI,ZodFile:PI,get ZodFirstPartyTypeKind(){return ZC},ZodFunction:nR,ZodGUID:jm,ZodIPv4:Jx,ZodIPv6:Qx,ZodISODate:dI,ZodISODateTime:uI,ZodISODuration:pI,ZodISOTime:fI,ZodIntersection:RI,ZodIssueCode:hye,ZodJWT:o0,ZodKSUID:Xx,ZodLazy:QI,ZodLiteral:DI,ZodMAC:hI,ZodMap:OI,ZodNaN:YI,ZodNanoID:Kx,ZodNever:_I,ZodNonOptional:m0,ZodNull:bI,ZodNullable:FI,ZodNumber:kh,ZodNumberFormat:ru,ZodObject:Ih,ZodOptional:p0,ZodPipe:h0,ZodPrefault:BI,ZodPromise:tR,ZodReadonly:WI,ZodRealError:to,ZodRecord:Th,ZodSet:$I,ZodString:_h,ZodStringFormat:gn,ZodSuccess:KI,ZodSymbol:vI,ZodTemplateLiteral:JI,ZodTransform:MI,ZodTuple:NI,ZodType:vt,ZodULID:Yx,ZodURL:Ch,ZodUUID:pa,ZodUndefined:yI,ZodUnion:Rh,ZodUnknown:SI,ZodVoid:CI,ZodXID:Wx,ZodXor:EI,_ZodString:Bx,_default:VI,_function:Xy,any:jH,array:ds,base64:fH,base64url:pH,bigint:_H,boolean:Xt,catch:ZI,check:KH,cidrv4:uH,cidrv6:dH,clone:Oo,codec:BH,coerce:jye,config:Mr,core:dye,cuid:nH,cuid2:rH,custom:GH,date:RH,decode:FB,decodeAsync:VB,describe:ZH,discriminatedUnion:II,e164:mH,email:mI,emoji:eH,encode:LB,encodeAsync:UB,endsWith:Px,enum:Ml,exactOptional:LI,file:LH,flattenError:mj,float32:xH,float64:wH,formatError:hj,fromJSONSchema:wye,function:Xy,getErrorMap:vye,globalRegistry:ko,gt:Sl,gte:xi,guid:GB,hash:bH,hex:yH,hostname:vH,httpUrl:QB,includes:$x,instanceof:WH,int:Wy,int32:gI,int64:CH,intersection:TI,ipv4:sH,ipv6:cH,iso:OB,json:JH,jwt:hH,keyof:TH,ksuid:aH,lazy:eR,length:wh,literal:Cf,locales:eV,looseObject:AH,looseRecord:DH,lowercase:Ax,lt:wl,lte:jo,mac:lH,map:PH,maxLength:xh,maxSize:Sf,meta:YH,mime:Mx,minLength:Lc,minSize:_l,multipleOf:Yd,nan:VH,nanoid:tH,nativeEnum:zH,negative:iI,never:l0,nonnegative:aI,nonoptional:qI,nonpositive:oI,normalize:zx,null:xI,nullable:Tm,nullish:FH,number:a0,object:$t,optional:Rm,overwrite:gs,parse:DB,parseAsync:PB,partialRecord:$H,pipe:Nm,positive:rI,prefault:HI,preprocess:QH,prettifyError:$6,promise:qH,property:sI,readonly:XI,record:d0,refine:rR,regex:Nx,regexes:Ej,registry:Pj,safeDecode:HB,safeDecodeAsync:KB,safeEncode:BB,safeEncodeAsync:qB,safeParse:MB,safeParseAsync:zB,set:MH,setErrorMap:gye,size:bh,slugify:Vx,startsWith:Dx,strictObject:NH,string:tt,stringFormat:gH,stringbool:XH,success:UH,superRefine:iR,symbol:EH,templateLiteral:HH,toJSONSchema:IB,toLowerCase:Fx,toUpperCase:Ux,transform:f0,treeifyError:A6,trim:Lx,tuple:AI,uint32:SH,uint64:kH,ulid:iH,undefined:Im,union:u0,unknown:Fc,uppercase:Ox,url:JB,util:T6,uuid:ZB,uuidv4:YB,uuidv6:WB,uuidv7:XB,void:IH,xid:oH,xor:OH},Symbol.toStringTag,{value:"Module"})),kf=mI({error:"Please enter a valid email address."}).toLowerCase().trim(),Ah=tt().nonempty({error:"Please enter your password."}),oR=tt().nonempty({error:"Please enter a username."}),Iye=$t({username:oR,password:Ah}),Rye=$t({email:kf,password:Ah});function Tye({entityId:e,instanceClient:t}){return{queryKey:[e,"health"],queryFn:async()=>{try{return await t.get("/health"),!0}catch{return!1}},retry:2,refetchInterval:5e3}}const H2=["localhost","127.0.0.1"];var YC=(e=>(e.MixedLoopback="MixedLoopback",e.InsecureCookieOutsideChromeAndFirefox="InsecureCookieOutsideChromeAndFirefox",e))(YC||{});function Nye(e,t,n){if(!n||!t||!e)return null;const r=new URL(n).hostname,i=H2.includes(t),o=H2.includes(r);if(i&&o&&r!==t)return"MixedLoopback";if(!i&&o){const a=e.indexOf("Chrome")>=0,l=e.indexOf("Firefox")>=0;if(!a&&!l)return"InsecureCookieOutsideChromeAndFirefox"}return null}const q2=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},WC=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?q2(r.ref,n,e):r&&r.refs&&r.refs.forEach(i=>q2(i,n,e))}},K2=(e,t)=>{t.shouldUseNativeValidation&&WC(e,t);const n={};for(const r in e){const i=De(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Aye(t.names||Object.keys(e),r)){const a=Object.assign({},De(n,r));qt(a,"root",o),qt(n,r,a)}else qt(n,r,o)}return n},Aye=(e,t)=>{const n=G2(t);return e.some(r=>G2(r).match(`^${n}\\.\\d+`))};function G2(e){return e.replace(/\]|\[/g,"")}function Z2(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Oye(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[a]={message:l.message,type:l.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=aj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function $ye(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if(r.code==="invalid_union"&&r.errors.length>0){var l=r.errors[0][0];n[a]={message:l.message,type:l.code}}else n[a]={message:o,type:i};if(r.code==="invalid_union"&&r.errors.forEach(function(m){return m.forEach(function(h){return e.push(h)})}),t){var d=n[a].types,f=d&&d[r.code];n[a]=aj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function vn(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,i,o){try{return Promise.resolve(Z2(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(a){return o.shouldUseNativeValidation&&WC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(l){return Array.isArray(l?.issues)})(a))return{values:{},errors:K2(Oye(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,i,o){try{return Promise.resolve(Z2(function(){return Promise.resolve((n.mode==="sync"?Ky:Gy)(e,r,t)).then(function(a){return o.shouldUseNativeValidation&&WC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(l){return l instanceof Ix})(a))return{values:{},errors:K2($ye(a.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}function aR(){const{clusterId:e,instanceId:t}=rt({strict:!1}),{data:n}=Mt(Dl(e,!0)),r=b.useMemo(()=>t&&n&&n?.instances?.find(k=>k.id===t)||void 0,[n,t]),i=b.useMemo(()=>n?.status&&Sx.includes(n.status),[n?.status]),o="Local",a="instance",l=b.useMemo(()=>n?r?(jt.flagForFabricConnect(r.id,!1),Jk(r)):(jt.flagForFabricConnect(n.id,!1),Xk(n)):null,[n,r]),d=Zt(l),f=b.useMemo(()=>l?.includes("localhost")||l?.includes("127.0.0.1"),[l]),m=b.useMemo(()=>Nye(navigator.userAgent,location.hostname,l),[l]),{data:h}=Mt(Tye(d)),v=cn({resolver:vn(Iye),defaultValues:{username:"",password:""}}),{control:y,handleSubmit:x}=v,{submitForm:S,isPending:C}=nhe({cluster:n,instance:r,instanceParams:d});return!t&&n&&!n?.fqdn?u.jsx(jc,{to:"../instances",replace:!0}):i&&n?.resetPassword?u.jsx(jc,{to:`/${n.organizationId}/${n.id}/finish-setup`,replace:!0}):!i&&n?.resetPassword?u.jsx(jc,{to:`/${n.organizationId}/${n.id}/starting-up`,replace:!0}):u.jsxs(u.Fragment,{children:[!xd,u.jsx("div",{className:"h-screen items-center justify-center flex",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsxs("h2",{className:"text-2xl font-light",children:["Sign in to Harper ",o]}),u.jsx(un,{...v,children:u.jsxs("form",{onSubmit:x(S),className:"my-4",children:[u.jsx($e,{control:y,name:"username",render:({field:k})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{autoComplete:"username",autoFocus:!0,type:"text",...k})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:y,name:"password",render:({field:k})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...k})}),u.jsx(Ae,{})]})}),u.jsx(be,{disabled:C,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Sign In"}),h===!1&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," This ",a," is not responding to GET"," ",u.jsxs("a",{href:`${l}health`,className:"underline",target:"_blank",children:[l,"health"]})," ","checks.",u.jsxs("ol",{className:"list-decimal ml-8 mt-2",children:[u.jsx("li",{children:"Is the server running?"}),u.jsxs("li",{children:["Have you"," ",u.jsx("a",{href:"https://docs.harperdb.io/docs/developers/security/configuration#cors",target:"_blank",rel:"noreferrer",className:"underline",children:"enabled CORS"})," ","for the operations API?"]}),f&&u.jsxs("li",{children:["Have you allowed"," ",u.jsx("a",{href:"https://www.google.com/search?q=How+do+I+enable+local+network+access+in+my+browser%3F",className:"underline",target:"_blank",rel:"noreferrer",children:"local network access"})," ","in your browser?"]})]})]}),m===YC.MixedLoopback&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," ","Your login might not work because you're mixing 127.0.0.1 and localhost. Pick one or the other."]}),m===YC.InsecureCookieOutsideChromeAndFirefox&&u.jsxs("div",{className:"p-4 mt-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Warning!"})," ","Your login might not work because your browser doesn't consider localhost to be secure, so it doesn't pass the cookies along. Firefox or Chromium based browsers should pass the cookies properly."]}),u.jsxs("div",{className:"p-4 mt-4 text-sm rounded-lg bg-purple-950",role:"alert",children:[u.jsx("span",{className:"font-medium",children:"Did you know?"})," ","You can add this instance to your Harper account to manage it remotely.",u.jsx("div",{className:"text-center pt-2",children:u.jsx(Ye,{to:ehe(),target:"_blank",children:u.jsx(be,{type:"button",variant:"positive",children:"Connect to Harper Fabric"})})})]})]})})]})})]})}async function Dye({email:e}){const{data:t}=await Gt.post("/ForgotPassword/",{email:e});if(t)return t;throw new Error("Something went wrong")}function Pye(){return ct({mutationFn:e=>Dye(e)})}const Mye=$t({email:kf});function zye(){const e=jn(),{me:t}=Rr({strict:!1}),n=cn({resolver:vn(Mye),defaultValues:{email:t||""}}),r=n.watch("email"),{setFocus:i,control:o,handleSubmit:a}=n;b.useEffect(()=>{i("email")},[i]);const{mutate:l,isPending:d}=Pye(),f=async m=>{l(m,{onSuccess:h=>{we.success("Success",{description:`${h}`,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),e({to:"/sign-in",search:{me:r}})}})};return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Enter your account email"}),u.jsx("p",{className:"text-sm pt-1",children:"If a matching account exists, we'll send you a password reset link."}),u.jsx(un,{...n,children:u.jsxs("form",{onSubmit:a(f),className:"my-4",children:[u.jsx($e,{control:o,name:"email",render:({field:m})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:d,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsx(be,{type:"submit",variant:"submit",disabled:d,className:"w-full my-2 rounded-full",children:"Send Password Reset Email"})]})}),u.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[u.jsx(Ye,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:r},children:"Sign in to your account"}),u.jsx(Ye,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:r},children:"Sign up for free"})]})]})}const Lye=async({token:e,password:t})=>{const{data:n}=await Gt.put("/ResetPassword/",{token:e,newPassword:t});return n};function Fye(){return ct({mutationFn:e=>Lye(e)})}const Uye=$t({password:Ah.min(8,{error:"Password must be at least 8 characters long."}).max(50,{error:"Password cannot be longer than 50 characters."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function Vye(){const{token:e}=Rr({strict:!1}),t=jn();b.useEffect(()=>{e||t({to:"/sign-in"})},[e,t]);const n=cn({resolver:vn(Uye),defaultValues:{password:"",confirmPassword:""}}),{setFocus:r,control:i,handleSubmit:o}=n;b.useEffect(()=>{r("password")},[r]);const{mutate:a,isPending:l}=Fye(),d=b.useCallback(async f=>{a({token:e,password:f.password},{onSuccess:()=>{we.success("Success",{description:"Your password has been reset successfully.",action:{label:"Dismiss",onClick:()=>we.dismiss()}}),t({to:"/sign-in"})}})},[t,a,e]);return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Reset Password"}),u.jsx(un,{...n,children:u.jsxs("form",{className:"my-4",onSubmit:o(d),children:[u.jsx($e,{control:i,name:"password",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"New Password"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:l,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:i,name:"confirmPassword",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:l,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx(be,{variant:"submit",type:"submit",disabled:l,className:"w-full my-2 rounded-full",children:"Submit New Password"})]})})]})}function t8({text:e}){return u.jsx("a",{href:"/oauth/github/login?redirect=%2F%23%2Fcheck-oauth",children:u.jsxs("button",{className:"github-signin-btn",children:[u.jsx(cE,{className:"github-icon"}),e]})})}function n8({text:e}){return u.jsx("a",{href:"/oauth/google/login?redirect=%2F%23%2Fcheck-oauth",children:u.jsxs("button",{className:"gsi-material-button",children:[u.jsx("div",{className:"gsi-material-button-state"}),u.jsxs("div",{className:"gsi-material-button-content-wrapper",children:[u.jsx("div",{className:"gsi-material-button-icon",children:u.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"block",children:[u.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),u.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),u.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),u.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"}),u.jsx("path",{fill:"none",d:"M0 0h48v48H0z"})]})}),u.jsx("span",{className:"gsi-material-button-contents",children:e}),u.jsx("span",{className:"hidden",children:e})]})]})})}function Bye(){const e=jn(),t=ir(),n=_n(),{redirect:r}=Rr({strict:!1}),{mutate:i,isPending:o}=Hye(),a=b.useCallback(l=>{i(l,{onSuccess:async d=>{jt.setUserForEntity($n,d);const f=Yc(d);UE(d.email),await t.invalidateQueries({queryKey:Nb,refetchType:"none"}),n.invalidate(),await e({to:r?.startsWith("/")?r:f})}})},[e,t,r,n,i]);return{isPending:o,submitForm:a}}function Hye(){return ct({mutationFn:e=>qye(e)})}async function qye({email:e,password:t}){const{data:n}=await Gt.post("/Login/",{email:e,password:t});if(n)return n;throw new Error("Something went wrong")}function Kye(){const{me:e}=Rr({strict:!1}),t=cn({resolver:vn(Rye),defaultValues:{email:e||"",password:""}}),{handleSubmit:n,control:r}=t,i=t.watch("email"),{submitForm:o,isPending:a}=Bye();return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Sign in to Harper Fabric"}),u.jsx(un,{...t,children:u.jsxs("form",{onSubmit:n(o),className:"my-4",children:[u.jsx($e,{control:r,name:"email",render:({field:l})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{type:"email",autoFocus:!0,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r,name:"password",render:({field:l})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...l})}),u.jsx(Ae,{})]})}),u.jsx(be,{type:"submit",variant:"submit",className:"w-full my-2 rounded-full",disabled:a,children:"Sign In"}),u.jsxs("div",{className:"flex px-4 mt-4 underline place-content-between",children:[u.jsx(Ye,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:i},children:"Sign up for free"}),u.jsx(Ye,{className:"text-sm hover:text-blue-300",to:"/forgot-password",search:{me:i},children:"Forgot password?"})]})]})}),u.jsx("hr",{className:"border-gray-600 my-6"}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(n8,{text:"Sign in with Google"}),u.jsx(t8,{text:"Sign in with GitHub"})]})]})}async function Gye(e){const{data:t}=await Gt.post("/User/",e);if(t)return t;throw new Error("Something went wrong")}function Zye(){return ct({mutationFn:e=>Gye(e)})}const Yye=$t({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),firstname:tt().trim().min(2,{error:"Please enter your first name."}).max(40,{error:"First name cannot be longer than 40 characters."}),lastname:tt().trim().min(2,{error:"Please enter your last name."}).max(80,{error:"Last name cannot be longer than 80 characters."}),password:Ah.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function Wye(){const e=jn(),{email:t,me:n}=Rr({strict:!1}),r=cn({resolver:vn(Yye),defaultValues:{firstname:"",lastname:"",email:n||t||"",password:"",confirmPassword:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:l}=r;b.useEffect(()=>{o("firstname")},[o]);const{mutate:d}=Zye(),f=b.useCallback(async m=>{const{confirmPassword:h,...v}=m;d(v,{onSuccess:()=>{UE(v.email),e({to:"/verifying?email="+encodeURIComponent(v.email)})}})},[e,d]);return u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Sign up for Harper Fabric"}),u.jsxs("div",{className:"flex flex-col gap-2 my-6",children:[u.jsx(n8,{text:"Sign up with Google"}),u.jsx(t8,{text:"Sign up with GitHub"})]}),u.jsx("hr",{className:"border-gray-600"}),u.jsx(un,{...r,children:u.jsxs("form",{onSubmit:l(f),className:"grid gap-4 my-4",children:[u.jsx($e,{control:a,name:"firstname",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"First Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a,name:"lastname",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Last Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a,name:"email",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{type:"email",readOnly:!!t,disabled:!!t,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoComplete:"email",autoCapitalize:"none",...m})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a,name:"password",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a,name:"confirmPassword",render:({field:m})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Ae,{})]})}),u.jsxs("p",{className:"text-xs",children:["By creating an account, you agree to the"," ",u.jsx("a",{href:"https://www.harper.fast/resources/privacy-policy",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Privacy Policy"})," ","and"," ",u.jsx("a",{href:"https://www.harper.fast/resources/paas-terms-of-service",target:"_blank",rel:"noreferrer",className:"underline hover:text-blue-300",children:"Terms of Service"})]}),u.jsx(be,{type:"submit",variant:"submit",className:"w-full rounded-full my-4",children:"Sign Up For Free"})]})}),u.jsx("div",{className:"flex px-4 mt-4 underline place-content-between",children:u.jsx(Ye,{className:"m-auto text-sm hover:text-blue-300",to:"/sign-in",search:{me:i},children:"Already have an account? Sign in instead."})})]})}const Xye=async({email:e})=>{const{data:t}=await Gt.post("/ResendVerificationEmail/",{email:e});return t};function r8(){return ct({mutationFn:e=>Xye(e)})}const Jye=async e=>{const{data:t}=await Gt.put("/VerifyEmail/",{token:e.toString()});return t};function Qye(){return ct({mutationFn:e=>Jye(e)})}const ebe=$t({email:kf});function tbe(){const e=jn(),{mutate:t,isPending:n}=r8(),r=cn({resolver:vn(ebe),defaultValues:{email:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:l}=r;b.useEffect(()=>{o("email")},[o]);const d=b.useCallback(async f=>{t(f,{onSuccess:m=>{we.success("Success",{description:`${m}`,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),e({to:"/sign-in",search:{me:i}})}})},[i,e,t]);return u.jsxs(un,{...r,children:[u.jsx("p",{className:"text-sm py-2",children:"Please Enter an Email"}),u.jsxs("form",{onSubmit:l(d),className:"my-4",children:[u.jsx($e,{control:a,name:"email",render:({field:f})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:n,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Ae,{})]})}),u.jsx(be,{type:"submit",variant:"submit",disabled:n,className:"w-full my-2 rounded-full",children:"Send Verification Email"})]})]})}function nbe(){const{token:e}=Rr({strict:!1}),t=jn(),{mutate:n,isPending:r}=Qye(),i=b.useCallback(o=>{n(o,{onSuccess:()=>{we.success("Success",{description:"Email verified successfully",action:{label:"Dismiss",onClick:()=>we.dismiss()}}),t({to:"/sign-in"})}})},[n,t]);return b.useEffect(()=>{e&&i(e)},[i,e]),u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h1",{className:"text-3xl font-light",children:"Verify Email"}),r?u.jsx("p",{className:"text-sm pt-1",children:"Verifying email..."}):u.jsx(tbe,{})]})}function rbe(){const{email:e}=Rr({strict:!1}),{mutate:t,isPending:n}=r8(),r=b.useCallback(i=>(i.preventDefault(),e&&t({email:e},{onSuccess:o=>{we.success("Code Sent",{description:`${o}`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}}),!1),[e,t]);return u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Check your email!"]}),u.jsxs("p",{children:["Your account has been created! You should receive an email with a link to ",u.jsx("strong",{children:"[Verify My Email]"}),"!"]}),u.jsxs("p",{children:["From: ",u.jsx("strong",{children:"harper@notifications.harperfabric.com"})]}),u.jsxs("p",{children:["To: ",u.jsx("strong",{children:e||"your email"})]}),u.jsx("p",{children:"Can you click it? Then we can carry on to more fun things!"}),u.jsxs("div",{className:"underline flex gap-4",children:[u.jsx(Ye,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:e},children:"I did it, let me sign in!"}),u.jsx(Ye,{className:"text-sm opacity-50 hover:text-blue-300",to:void 0,onClick:r,disabled:n,children:"Send me another code, please."})]})]})}const zl=nt({getParentRoute:()=>ix,id:"_authLayout",component:Lfe}),ibe=nt({getParentRoute:()=>zl,path:"sign-in",component:Kye,beforeLoad:({context:e,location:t})=>{const n=e.authentication[$n]?.user;if(n){const r=t?.search,i=Yc(n);throw Kc({to:r?.redirect?.startsWith("/")?r.redirect:i})}}}),obe=nt({getParentRoute:()=>ix,path:"sign-in",component:aR,beforeLoad:({context:e,location:t})=>{if(e.authentication[$n]?.user){const n=t?.search;throw Kc({to:n?.redirect?.startsWith("/")?n.redirect:ba})}}}),abe=nt({getParentRoute:()=>zl,path:"sign-up",component:Wye}),sbe=nt({getParentRoute:()=>zl,path:"forgot-password",component:zye}),lbe=nt({getParentRoute:()=>zl,path:"verify-email",component:nbe}),cbe=nt({getParentRoute:()=>zl,path:"verifying",component:rbe}),ube=nt({getParentRoute:()=>zl,path:"check-oauth",component:Vfe}),dbe=nt({getParentRoute:()=>zl,path:"reset-password",component:Vye});zl.addChildren([ibe,abe,ube,sbe,lbe,cbe,dbe]);const fbe=[obe];function vs({children:e}){return u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 py-2 px-4 md:px-12 bg-grey-700",children:u.jsxs("div",{className:"flex items-center h-full space-x-2",children:[u.jsx(vx,{}),e]})})}function i8(e){if(XC(e)||JC(e))return"warning";if(o8(e))return"success";switch(e){case"STOPPED":return"secondary";case"TERMINATING":case"TERMINATED":case"FAILED":case"REMOVED":case"ERROR":return"destructive";default:return"default"}}function o8(e){switch(e){case"RUNNING":case"UPDATED":return!0;default:return!1}}function Oh(e){return e==="FAILED"}function sR(e){return e==="TERMINATED"}function XC(e){return e==="CLONE_PENDING"}function JC(e){switch(e){case"PROVISIONING":case"CLONING":case"CLONE_READY":case"UPDATING_HDB_NODES":case"UPDATING":return!0;default:return!1}}var o1="focusScope.autoFocusOnMount",a1="focusScope.autoFocusOnUnmount",Y2={bubbles:!1,cancelable:!0},pbe="FocusScope",v0=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,d]=b.useState(null),f=Tn(i),m=Tn(o),h=b.useRef(null),v=pt(t,S=>d(S)),y=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(j){if(y.paused||!l)return;const I=j.target;l.contains(I)?h.current=I:Zs(h.current,{select:!0})},C=function(j){if(y.paused||!l)return;const I=j.relatedTarget;I!==null&&(l.contains(I)||Zs(h.current,{select:!0}))},k=function(j){if(document.activeElement===document.body)for(const N of j)N.removedNodes.length>0&&Zs(l)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return l&&E.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[r,l,y.paused]),b.useEffect(()=>{if(l){X2.add(y);const S=document.activeElement;if(!l.contains(S)){const k=new CustomEvent(o1,Y2);l.addEventListener(o1,f),l.dispatchEvent(k),k.defaultPrevented||(mbe(bbe(a8(l)),{select:!0}),document.activeElement===S&&Zs(l))}return()=>{l.removeEventListener(o1,f),setTimeout(()=>{const k=new CustomEvent(a1,Y2);l.addEventListener(a1,m),l.dispatchEvent(k),k.defaultPrevented||Zs(S??document.body,{select:!0}),l.removeEventListener(a1,m),X2.remove(y)},0)}}},[l,f,m,y]);const x=b.useCallback(S=>{if(!n&&!r||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[j,I]=hbe(E);j&&I?!S.shiftKey&&k===I?(S.preventDefault(),n&&Zs(j,{select:!0})):S.shiftKey&&k===j&&(S.preventDefault(),n&&Zs(I,{select:!0})):k===E&&S.preventDefault()}},[n,r,y.paused]);return u.jsx(We.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});v0.displayName=pbe;function mbe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function hbe(e){const t=a8(e),n=W2(t,e),r=W2(t.reverse(),e);return[n,r]}function a8(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W2(e,t){for(const n of e)if(!gbe(n,{upTo:t}))return n}function gbe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function vbe(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vbe(e)&&t&&e.select()}}var X2=ybe();function ybe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=J2(e,t),e.unshift(t)},remove(t){e=J2(e,t),e[0]?.resume()}}}function J2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bbe(e){return e.filter(t=>t.tagName!=="A")}var s1=0;function lR(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Q2()),document.body.insertAdjacentElement("beforeend",e[1]??Q2()),s1++,()=>{s1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),s1--}},[])}function Q2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var QC=function(e,t){return QC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},QC(e,t)};function N2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");QC(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ca=function(){return ca=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ca.apply(this,arguments)};function s8(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function iu(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(l,d)}f((r=r.apply(e,t||[])).next())})}function xbe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var fy="right-scroll-bar-position",py="width-before-scroll-bar",wbe="with-scroll-bars-hidden",Sbe="--removed-body-scroll-bar-size";function l1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _be(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Cbe=typeof window<"u"?b.useLayoutEffect:b.useEffect,eP=new WeakMap;function kbe(e,t){var n=_be(null,function(r){return e.forEach(function(i){return l1(i,r)})});return Cbe(function(){var r=eP.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||l1(l,null)}),o.forEach(function(l){i.has(l)||l1(l,a)})}eP.set(n,e)},[e]),n}function Ebe(e){return e}function jbe(e,t){t===void 0&&(t=Ebe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var d=function(){var m=a;a=[],m.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(m){a.push(m),f()},filter:function(m){return a=a.filter(m),n}}}};return i}function Ibe(e){e===void 0&&(e={});var t=jbe(null);return t.options=ca({async:!0,ssr:!1},e),t}var l8=function(e){var t=e.sideCar,n=s8(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,ca({},n))};l8.isSideCarExport=!0;function Rbe(e,t){return e.useMedium(t),l8}var c8=Ibe(),c1=function(){},y0=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:c1,onWheelCapture:c1,onTouchMoveCapture:c1}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,d=e.className,f=e.removeScrollBar,m=e.enabled,h=e.shards,v=e.sideCar,y=e.noRelative,x=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,j=e.gapMode,I=s8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,T=kbe([n,t]),A=ca(ca({},I),i);return b.createElement(b.Fragment,null,m&&b.createElement(N,{sideCar:c8,removeScrollBar:f,shards:h,noRelative:y,noIsolation:x,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:j}),a?b.cloneElement(b.Children.only(l),ca(ca({},A),{ref:T})):b.createElement(E,ca({},A,{className:d,ref:T}),l))});y0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};y0.classNames={fullWidth:py,zeroRight:fy};var Tbe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Nbe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Tbe();return t&&e.setAttribute("nonce",t),e}function Abe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Obe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $be=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nbe())&&(Abe(t,n),Obe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Dbe=function(){var e=$be();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},u8=function(){var e=Dbe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Pbe={left:0,top:0,right:0,gap:0},u1=function(e){return parseInt(e||"",10)||0},Mbe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[u1(n),u1(r),u1(i)]},zbe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pbe;var t=Mbe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lbe=u8(),jd="data-scroll-locked",Fbe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(wbe,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(jd,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(fy,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(py,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(fy," .").concat(fy,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(py," .").concat(py,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(jd,`] {
    `).concat(Sbe,": ").concat(l,`px;
  }
`)},tP=function(){var e=parseInt(document.body.getAttribute(jd)||"0",10);return isFinite(e)?e:0},Ube=function(){b.useEffect(function(){return document.body.setAttribute(jd,(tP()+1).toString()),function(){var e=tP()-1;e<=0?document.body.removeAttribute(jd):document.body.setAttribute(jd,e.toString())}},[])},Vbe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Ube();var o=b.useMemo(function(){return zbe(i)},[i]);return b.createElement(Lbe,{styles:Fbe(o,!t,i,n?"":"!important")})},ek=!1;if(typeof window<"u")try{var Rv=Object.defineProperty({},"passive",{get:function(){return ek=!0,!0}});window.addEventListener("test",Rv,Rv),window.removeEventListener("test",Rv,Rv)}catch{ek=!1}var id=ek?{passive:!1}:!1,Bbe=function(e){return e.tagName==="TEXTAREA"},d8=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Bbe(e)&&n[t]==="visible")},Hbe=function(e){return d8(e,"overflowY")},qbe=function(e){return d8(e,"overflowX")},nP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=f8(e,r);if(i){var o=p8(e,r),a=o[1],l=o[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Kbe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gbe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},f8=function(e,t){return e==="v"?Hbe(t):qbe(t)},p8=function(e,t){return e==="v"?Kbe(t):Gbe(t)},Zbe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ybe=function(e,t,n,r,i){var o=Zbe(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,d=t.contains(l),f=!1,m=a>0,h=0,v=0;do{if(!l)break;var y=p8(e,l),x=y[0],S=y[1],C=y[2],k=S-C-o*x;(x||k)&&f8(e,l)&&(h+=k,v+=x);var E=l.parentNode;l=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(m&&Math.abs(h)<1||!m&&Math.abs(v)<1)&&(f=!0),f},Tv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rP=function(e){return[e.deltaX,e.deltaY]},iP=function(e){return e&&"current"in e?e.current:e},Wbe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xbe=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Jbe=0,od=[];function Qbe(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(Jbe++)[0],o=b.useState(u8)[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=xbe([e.lockRef.current],(e.shards||[]).map(iP),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=b.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!a.current.allowPinchZoom;var k=Tv(S),E=n.current,j="deltaX"in S?S.deltaX:E[0]-k[0],I="deltaY"in S?S.deltaY:E[1]-k[1],N,T=S.target,A=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in S&&A==="h"&&T.type==="range")return!1;var D=nP(A,T);if(!D)return!0;if(D?N=A:(N=A==="v"?"h":"v",D=nP(A,T)),!D)return!1;if(!r.current&&"changedTouches"in S&&(j||I)&&(r.current=N),!N)return!0;var F=r.current||N;return Ybe(F,C,S,F==="h"?j:I)},[]),d=b.useCallback(function(S){var C=S;if(!(!od.length||od[od.length-1]!==o)){var k="deltaY"in C?rP(C):Tv(C),E=t.current.filter(function(N){return N.name===C.type&&(N.target===C.target||C.target===N.shadowParent)&&Wbe(N.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var j=(a.current.shards||[]).map(iP).filter(Boolean).filter(function(N){return N.contains(C.target)}),I=j.length>0?l(C,j[0]):!a.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),f=b.useCallback(function(S,C,k,E){var j={name:S,delta:C,target:k,should:E,shadowParent:exe(k)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),m=b.useCallback(function(S){n.current=Tv(S),r.current=void 0},[]),h=b.useCallback(function(S){f(S.type,rP(S),S.target,l(S,e.lockRef.current))},[]),v=b.useCallback(function(S){f(S.type,Tv(S),S.target,l(S,e.lockRef.current))},[]);b.useEffect(function(){return od.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",d,id),document.addEventListener("touchmove",d,id),document.addEventListener("touchstart",m,id),function(){od=od.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,id),document.removeEventListener("touchmove",d,id),document.removeEventListener("touchstart",m,id)}},[]);var y=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(o,{styles:Xbe(i)}):null,y?b.createElement(Vbe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function exe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const txe=Rbe(c8,Qbe);var b0=b.forwardRef(function(e,t){return b.createElement(y0,ca({},e,{ref:t,sideCar:txe}))});b0.classNames=y0.classNames;var nxe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ad=new WeakMap,Nv=new WeakMap,Av={},d1=0,m8=function(e){return e&&(e.host||m8(e.parentNode))},rxe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=m8(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ixe=function(e,t,n,r){var i=rxe(t,Array.isArray(e)?e:[e]);Av[n]||(Av[n]=new WeakMap);var o=Av[n],a=[],l=new Set,d=new Set(i),f=function(h){!h||l.has(h)||(l.add(h),f(h.parentNode))};i.forEach(f);var m=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(v){if(l.has(v))m(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",S=(ad.get(v)||0)+1,C=(o.get(v)||0)+1;ad.set(v,S),o.set(v,C),a.push(v),S===1&&x&&Nv.set(v,!0),C===1&&v.setAttribute(n,"true"),x||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return m(t),l.clear(),d1++,function(){a.forEach(function(h){var v=ad.get(h)-1,y=o.get(h)-1;ad.set(h,v),o.set(h,y),v||(Nv.has(h)||h.removeAttribute(r),Nv.delete(h)),y||h.removeAttribute(n)}),d1--,d1||(ad=new WeakMap,ad=new WeakMap,Nv=new WeakMap,Av={})}},cR=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=nxe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ixe(r,i,n,"aria-hidden")):function(){return null}},x0="Dialog",[h8]=Qi(x0),[oxe,Qo]=h8(x0),g8=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,l=b.useRef(null),d=b.useRef(null),[f,m]=Ko({prop:r,defaultProp:i??!1,onChange:o,caller:x0});return u.jsx(oxe,{scope:t,triggerRef:l,contentRef:d,contentId:Vi(),titleId:Vi(),descriptionId:Vi(),open:f,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(h=>!h),[m]),modal:a,children:n})};g8.displayName=x0;var v8="DialogTrigger",y8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(v8,n),o=pt(t,i.triggerRef);return u.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fR(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});y8.displayName=v8;var uR="DialogPortal",[axe,b8]=h8(uR,{forceMount:void 0}),x8=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Qo(uR,t);return u.jsx(axe,{scope:t,forceMount:n,children:b.Children.map(r,a=>u.jsx(or,{present:n||o.open,children:u.jsx(oh,{asChild:!0,container:i,children:a})}))})};x8.displayName=uR;var Jy="DialogOverlay",w8=b.forwardRef((e,t)=>{const n=b8(Jy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Qo(Jy,e.__scopeDialog);return o.modal?u.jsx(or,{present:r||o.open,children:u.jsx(lxe,{...i,ref:t})}):null});w8.displayName=Jy;var sxe=Vd("DialogOverlay.RemoveScroll"),lxe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(Jy,n);return u.jsx(b0,{as:sxe,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(We.div,{"data-state":fR(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Uc="DialogContent",S8=b.forwardRef((e,t)=>{const n=b8(Uc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Qo(Uc,e.__scopeDialog);return u.jsx(or,{present:r||o.open,children:o.modal?u.jsx(cxe,{...i,ref:t}):u.jsx(uxe,{...i,ref:t})})});S8.displayName=Uc;var cxe=b.forwardRef((e,t)=>{const n=Qo(Uc,e.__scopeDialog),r=b.useRef(null),i=pt(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return cR(o)},[]),u.jsx(_8,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),uxe=b.forwardRef((e,t)=>{const n=Qo(Uc,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return u.jsx(_8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),_8=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,l=Qo(Uc,n),d=b.useRef(null),f=pt(t,d);return lR(),u.jsxs(u.Fragment,{children:[u.jsx(v0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(gf,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":fR(l.open),...a,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(dxe,{titleId:l.titleId}),u.jsx(pxe,{contentRef:d,descriptionId:l.descriptionId})]})]})}),dR="DialogTitle",C8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(dR,n);return u.jsx(We.h2,{id:i.titleId,...r,ref:t})});C8.displayName=dR;var k8="DialogDescription",E8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(k8,n);return u.jsx(We.p,{id:i.descriptionId,...r,ref:t})});E8.displayName=k8;var j8="DialogClose",I8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qo(j8,n);return u.jsx(We.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});I8.displayName=j8;function fR(e){return e?"open":"closed"}var R8="DialogTitleWarning",[A2e,T8]=$de(R8,{contentName:Uc,titleName:dR,docsSlug:"dialog"}),dxe=({titleId:e})=>{const t=T8(R8),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fxe="DialogDescriptionWarning",pxe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${T8(fxe).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mxe=g8,hxe=y8,gxe=x8,vxe=w8,yxe=S8,bxe=C8,xxe=E8,wxe=I8;function Un({...e}){return u.jsx(mxe,{"data-slot":"dialog",...e})}function N8({...e}){return u.jsx(hxe,{"data-slot":"dialog-trigger",...e})}function Sxe({...e}){return u.jsx(gxe,{"data-slot":"dialog-portal",...e})}function _xe({className:e,...t}){return u.jsx(vxe,{"data-slot":"dialog-overlay",className:Ue("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black-dark/90",e),...t})}function Vn({className:e,children:t,...n}){return u.jsxs(Sxe,{"data-slot":"dialog-portal",children:[u.jsx(_xe,{}),u.jsxs(yxe,{"data-slot":"dialog-content",className:Ue("bg-black data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] lg:max-w-2xl max-h-screen overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md p-6 shadow-lg duration-200",e),...n,children:[t,u.jsxs(wxe,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[u.jsx(B4,{className:"text-white"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yr({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-header",className:Ue("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Yn({className:e,...t}){return u.jsx("div",{"data-slot":"dialog-footer",className:Ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Pn({className:e,...t}){return u.jsx(bxe,{"data-slot":"dialog-title",className:Ue("text-lg leading-none text-white font-semibold",e),...t})}function Ir({className:e,...t}){return u.jsx(xxe,{"data-slot":"dialog-description",className:Ue("text-muted-foreground text-sm",e),...t})}function w0({typeOfThingBeingDeleted:e,nameOfThingBeingDeleted:t,isModalOpen:n,hideDataLossWarning:r,setIsModalOpen:i,deletionConfirmed:o,deletionPending:a,trigger:l,presentParticiple:d="Deleting",transitiveVerb:f="Delete"}){return u.jsxs(Un,{open:n,onOpenChange:i,children:[l&&u.jsx(N8,{asChild:!0,children:l}),u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsxs(yr,{children:[u.jsxs(Pn,{children:["Are you sure you want to ",f.toLowerCase()," this ",e,"?"]}),u.jsx(Ir,{children:"This action cannot be undone."})]}),!r&&u.jsxs("div",{className:"p-3 my-5 text-white rounded-md bg-amber-600",children:[u.jsxs("p",{className:"flex space-x-1 font-semibold align-baseline",children:[u.jsx(Cne,{className:"inline-block size-5"})," ",u.jsx("span",{children:"Warning"})]}),u.jsxs("p",{className:"pt-2 text-base",children:["By ",d.toLowerCase()," ",e," ",u.jsx("span",{className:"font-semibold",children:t})," ","you will lose the data stored in it permanently."]})]}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-center space-x-5",children:[u.jsxs(be,{className:"rounded-full",onClick:()=>i(!1),children:[u.jsx(Pc,{})," Cancel"]}),u.jsxs(be,{variant:"destructive",className:"rounded-full",onClick:o,disabled:a,children:[u.jsx(Ca,{})," ",f]})]})})]})]})}function Yo({className:e,variant:t,asChild:n=!1,...r}){const i=n?aE:"span";return u.jsx(i,{"data-slot":"badge",className:Ue(mU({variant:t}),e),...r})}var f1="rovingFocusGroup.onEntryFocus",Cxe={bubbles:!1,cancelable:!0},$h="RovingFocusGroup",[tk,A8,kxe]=nh($h),[Exe,Ef]=Qi($h,[kxe]),[jxe,Ixe]=Exe($h),O8=b.forwardRef((e,t)=>u.jsx(tk.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(tk.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Rxe,{...e,ref:t})})}));O8.displayName=$h;var Rxe=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,v=b.useRef(null),y=pt(t,v),x=eu(o),[S,C]=Ko({prop:a,defaultProp:l??null,onChange:d,caller:$h}),[k,E]=b.useState(!1),j=Tn(f),I=A8(n),N=b.useRef(!1),[T,A]=b.useState(0);return b.useEffect(()=>{const D=v.current;if(D)return D.addEventListener(f1,j),()=>D.removeEventListener(f1,j)},[j]),u.jsx(jxe,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:S,onItemFocus:b.useCallback(D=>C(D),[C]),onItemShiftTab:b.useCallback(()=>E(!0),[]),onFocusableItemAdd:b.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>A(D=>D-1),[]),children:u.jsx(We.div,{tabIndex:k||T===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{N.current=!0}),onFocus:Re(e.onFocus,D=>{const F=!N.current;if(D.target===D.currentTarget&&F&&!k){const q=new CustomEvent(f1,Cxe);if(D.currentTarget.dispatchEvent(q),!q.defaultPrevented){const ee=I().filter(z=>z.focusable),G=ee.find(z=>z.active),K=ee.find(z=>z.id===S),H=[G,K,...ee].filter(Boolean).map(z=>z.ref.current);P8(H,m)}}N.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),$8="RovingFocusGroupItem",D8=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...l}=e,d=Vi(),f=o||d,m=Ixe($8,n),h=m.currentTabStopId===f,v=A8(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:S}=m;return b.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),u.jsx(tk.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:u.jsx(We.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Re(e.onMouseDown,C=>{r?m.onItemFocus(f):C.preventDefault()}),onFocus:Re(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Re(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=Axe(C,m.orientation,m.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let j=v().filter(I=>I.focusable).map(I=>I.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const I=j.indexOf(C.currentTarget);j=m.loop?Oxe(j,I+1):j.slice(I+1)}setTimeout(()=>P8(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:S!=null}):a})})});D8.displayName=$8;var Txe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nxe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Axe(e,t,n){const r=Nxe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Txe[r]}function P8(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Oxe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pR=O8,mR=D8,nk=["Enter"," "],$xe=["ArrowDown","PageUp","Home"],M8=["ArrowUp","PageDown","End"],Dxe=[...$xe,...M8],Pxe={ltr:[...nk,"ArrowRight"],rtl:[...nk,"ArrowLeft"]},Mxe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dh="Menu",[Am,zxe,Lxe]=nh(Dh),[ou,z8]=Qi(Dh,[Lxe,wf,Ef]),S0=wf(),L8=Ef(),[Fxe,au]=ou(Dh),[Uxe,Ph]=ou(Dh),F8=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,l=S0(t),[d,f]=b.useState(null),m=b.useRef(!1),h=Tn(o),v=eu(i);return b.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),u.jsx(WE,{...l,children:u.jsx(Fxe,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx(Uxe,{scope:t,onClose:b.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:v,modal:a,children:r})})})};F8.displayName=Dh;var Vxe="MenuAnchor",hR=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return u.jsx(XE,{...i,...r,ref:t})});hR.displayName=Vxe;var gR="MenuPortal",[Bxe,U8]=ou(gR,{forceMount:void 0}),V8=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=au(gR,t);return u.jsx(Bxe,{scope:t,forceMount:n,children:u.jsx(or,{present:n||o.open,children:u.jsx(oh,{asChild:!0,container:i,children:r})})})};V8.displayName=gR;var Io="MenuContent",[Hxe,vR]=ou(Io),B8=b.forwardRef((e,t)=>{const n=U8(Io,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=au(Io,e.__scopeMenu),a=Ph(Io,e.__scopeMenu);return u.jsx(Am.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(Am.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(qxe,{...i,ref:t}):u.jsx(Kxe,{...i,ref:t})})})})}),qxe=b.forwardRef((e,t)=>{const n=au(Io,e.__scopeMenu),r=b.useRef(null),i=pt(t,r);return b.useEffect(()=>{const o=r.current;if(o)return cR(o)},[]),u.jsx(yR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Kxe=b.forwardRef((e,t)=>{const n=au(Io,e.__scopeMenu);return u.jsx(yR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Gxe=Vd("MenuContent.ScrollLock"),yR=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,disableOutsideScroll:x,...S}=e,C=au(Io,n),k=Ph(Io,n),E=S0(n),j=L8(n),I=zxe(n),[N,T]=b.useState(null),A=b.useRef(null),D=pt(t,A,C.onContentChange),F=b.useRef(0),q=b.useRef(""),ee=b.useRef(0),G=b.useRef(null),K=b.useRef("right"),V=b.useRef(0),H=x?b0:b.Fragment,z=x?{as:Gxe,allowPinchZoom:!0}:void 0,W=ne=>{const $=q.current+ne,P=I().filter(Q=>!Q.disabled),U=document.activeElement,O=P.find(Q=>Q.ref.current===U)?.textValue,X=P.map(Q=>Q.textValue),pe=o0e(X,$,O),ve=P.find(Q=>Q.textValue===pe)?.ref.current;(function Q(le){q.current=le,window.clearTimeout(F.current),le!==""&&(F.current=window.setTimeout(()=>Q(""),1e3))})($),ve&&setTimeout(()=>ve.focus())};b.useEffect(()=>()=>window.clearTimeout(F.current),[]),lR();const L=b.useCallback(ne=>K.current===G.current?.side&&s0e(ne,G.current?.area),[]);return u.jsx(Hxe,{scope:n,searchRef:q,onItemEnter:b.useCallback(ne=>{L(ne)&&ne.preventDefault()},[L]),onItemLeave:b.useCallback(ne=>{L(ne)||(A.current?.focus(),T(null))},[L]),onTriggerLeave:b.useCallback(ne=>{L(ne)&&ne.preventDefault()},[L]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:b.useCallback(ne=>{G.current=ne},[]),children:u.jsx(H,{...z,children:u.jsx(v0,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,ne=>{ne.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,children:u.jsx(pR,{asChild:!0,...j,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:T,onEntryFocus:Re(d,ne=>{k.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(JE,{role:"menu","aria-orientation":"vertical","data-state":o9(C.open),"data-radix-menu-content":"",dir:k.dir,...E,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,ne=>{const P=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,U=ne.ctrlKey||ne.altKey||ne.metaKey,O=ne.key.length===1;P&&(ne.key==="Tab"&&ne.preventDefault(),!U&&O&&W(ne.key));const X=A.current;if(ne.target!==X||!Dxe.includes(ne.key))return;ne.preventDefault();const ve=I().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);M8.includes(ne.key)&&ve.reverse(),r0e(ve)}),onBlur:Re(e.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(F.current),q.current="")}),onPointerMove:Re(e.onPointerMove,Om(ne=>{const $=ne.target,P=V.current!==ne.clientX;if(ne.currentTarget.contains($)&&P){const U=ne.clientX>V.current?"right":"left";K.current=U,V.current=ne.clientX}}))})})})})})})});B8.displayName=Io;var Zxe="MenuGroup",bR=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(We.div,{role:"group",...r,ref:t})});bR.displayName=Zxe;var Yxe="MenuLabel",H8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(We.div,{...r,ref:t})});H8.displayName=Yxe;var Qy="MenuItem",oP="menu.itemSelect",_0=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=b.useRef(null),a=Ph(Qy,e.__scopeMenu),l=vR(Qy,e.__scopeMenu),d=pt(t,o),f=b.useRef(!1),m=()=>{const h=o.current;if(!n&&h){const v=new CustomEvent(oP,{bubbles:!0,cancelable:!0});h.addEventListener(oP,y=>r?.(y),{once:!0}),$y(h,v),v.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(q8,{...i,ref:d,disabled:n,onClick:Re(e.onClick,m),onPointerDown:h=>{e.onPointerDown?.(h),f.current=!0},onPointerUp:Re(e.onPointerUp,h=>{f.current||h.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,h=>{const v=l.searchRef.current!=="";n||v&&h.key===" "||nk.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});_0.displayName=Qy;var q8=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=vR(Qy,n),l=L8(n),d=b.useRef(null),f=pt(t,d),[m,h]=b.useState(!1),[v,y]=b.useState("");return b.useEffect(()=>{const x=d.current;x&&y((x.textContent??"").trim())},[o.children]),u.jsx(Am.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:u.jsx(mR,{asChild:!0,...l,focusable:!r,children:u.jsx(We.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Re(e.onPointerMove,Om(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Om(x=>a.onItemLeave(x))),onFocus:Re(e.onFocus,()=>h(!0)),onBlur:Re(e.onBlur,()=>h(!1))})})})}),Wxe="MenuCheckboxItem",K8=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(X8,{scope:e.__scopeMenu,checked:n,children:u.jsx(_0,{role:"menuitemcheckbox","aria-checked":eb(n)?"mixed":n,...i,ref:t,"data-state":wR(n),onSelect:Re(i.onSelect,()=>r?.(eb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});K8.displayName=Wxe;var G8="MenuRadioGroup",[Xxe,Jxe]=ou(G8,{value:void 0,onValueChange:()=>{}}),Z8=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Tn(r);return u.jsx(Xxe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(bR,{...i,ref:t})})});Z8.displayName=G8;var Y8="MenuRadioItem",W8=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=Jxe(Y8,e.__scopeMenu),o=n===i.value;return u.jsx(X8,{scope:e.__scopeMenu,checked:o,children:u.jsx(_0,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":wR(o),onSelect:Re(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});W8.displayName=Y8;var xR="MenuItemIndicator",[X8,Qxe]=ou(xR,{checked:!1}),J8=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=Qxe(xR,n);return u.jsx(or,{present:r||eb(o.checked)||o.checked===!0,children:u.jsx(We.span,{...i,ref:t,"data-state":wR(o.checked)})})});J8.displayName=xR;var e0e="MenuSeparator",Q8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Q8.displayName=e0e;var t0e="MenuArrow",e9=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=S0(n);return u.jsx(QE,{...i,...r,ref:t})});e9.displayName=t0e;var n0e="MenuSub",[O2e,t9]=ou(n0e),Jp="MenuSubTrigger",n9=b.forwardRef((e,t)=>{const n=au(Jp,e.__scopeMenu),r=Ph(Jp,e.__scopeMenu),i=t9(Jp,e.__scopeMenu),o=vR(Jp,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},m=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>m,[m]),b.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),d(null)}},[l,d]),u.jsx(hR,{asChild:!0,...f,children:u.jsx(q8,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":o9(n.open),...e,ref:ff(t,i.onTriggerChange),onClick:h=>{e.onClick?.(h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Om(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Re(e.onPointerLeave,Om(h=>{m();const v=n.content?.getBoundingClientRect();if(v){const y=n.content?.dataset.side,x=y==="right",S=x?-5:5,C=v[x?"left":"right"],k=v[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+S,y:h.clientY},{x:C,y:v.top},{x:k,y:v.top},{x:k,y:v.bottom},{x:C,y:v.bottom}],side:y}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,h=>{const v=o.searchRef.current!=="";e.disabled||v&&h.key===" "||Pxe[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});n9.displayName=Jp;var r9="MenuSubContent",i9=b.forwardRef((e,t)=>{const n=U8(Io,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=au(Io,e.__scopeMenu),a=Ph(Io,e.__scopeMenu),l=t9(r9,e.__scopeMenu),d=b.useRef(null),f=pt(t,d);return u.jsx(Am.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(Am.Slot,{scope:e.__scopeMenu,children:u.jsx(yR,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:f,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{a.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Re(e.onFocusOutside,m=>{m.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:Re(e.onKeyDown,m=>{const h=m.currentTarget.contains(m.target),v=Mxe[a.dir].includes(m.key);h&&v&&(o.onOpenChange(!1),l.trigger?.focus(),m.preventDefault())})})})})})});i9.displayName=r9;function o9(e){return e?"open":"closed"}function eb(e){return e==="indeterminate"}function wR(e){return eb(e)?"indeterminate":e?"checked":"unchecked"}function r0e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function i0e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function o0e(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=i0e(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function a0e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],f=l.x,m=l.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function s0e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return a0e(n,t)}function Om(e){return t=>t.pointerType==="mouse"?e(t):void 0}var l0e=F8,c0e=hR,u0e=V8,d0e=B8,f0e=bR,p0e=H8,m0e=_0,h0e=K8,g0e=Z8,v0e=W8,y0e=J8,b0e=Q8,x0e=e9,w0e=n9,S0e=i9,C0="DropdownMenu",[_0e]=Qi(C0,[z8]),ti=z8(),[C0e,a9]=_0e(C0),s9=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,d=ti(t),f=b.useRef(null),[m,h]=Ko({prop:i,defaultProp:o??!1,onChange:a,caller:C0});return u.jsx(C0e,{scope:t,triggerId:Vi(),triggerRef:f,contentId:Vi(),open:m,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(v=>!v),[h]),modal:l,children:u.jsx(l0e,{...d,open:m,onOpenChange:h,dir:r,modal:l,children:n})})};s9.displayName=C0;var l9="DropdownMenuTrigger",c9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=a9(l9,n),a=ti(n);return u.jsx(c0e,{asChild:!0,...a,children:u.jsx(We.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ff(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:Re(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});c9.displayName=l9;var k0e="DropdownMenuPortal",u9=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ti(t);return u.jsx(u0e,{...r,...n})};u9.displayName=k0e;var d9="DropdownMenuContent",f9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=a9(d9,n),o=ti(n),a=b.useRef(!1);return u.jsx(d0e,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{a.current||i.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,l=>{const d=l.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;(!i.modal||m)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});f9.displayName=d9;var E0e="DropdownMenuGroup",j0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(f0e,{...i,...r,ref:t})});j0e.displayName=E0e;var I0e="DropdownMenuLabel",p9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(p0e,{...i,...r,ref:t})});p9.displayName=I0e;var R0e="DropdownMenuItem",m9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(m0e,{...i,...r,ref:t})});m9.displayName=R0e;var T0e="DropdownMenuCheckboxItem",h9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(h0e,{...i,...r,ref:t})});h9.displayName=T0e;var N0e="DropdownMenuRadioGroup",A0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(g0e,{...i,...r,ref:t})});A0e.displayName=N0e;var O0e="DropdownMenuRadioItem",$0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(v0e,{...i,...r,ref:t})});$0e.displayName=O0e;var D0e="DropdownMenuItemIndicator",g9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(y0e,{...i,...r,ref:t})});g9.displayName=D0e;var P0e="DropdownMenuSeparator",v9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(b0e,{...i,...r,ref:t})});v9.displayName=P0e;var M0e="DropdownMenuArrow",z0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(x0e,{...i,...r,ref:t})});z0e.displayName=M0e;var L0e="DropdownMenuSubTrigger",F0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(w0e,{...i,...r,ref:t})});F0e.displayName=L0e;var U0e="DropdownMenuSubContent",V0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ti(n);return u.jsx(S0e,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V0e.displayName=U0e;var B0e=s9,H0e=c9,q0e=u9,K0e=f9,G0e=p9,Z0e=m9,Y0e=h9,W0e=g9,X0e=v9;function Mh({...e}){return u.jsx(B0e,{"data-slot":"dropdown-menu",...e})}function zh({...e}){return u.jsx(H0e,{"data-slot":"dropdown-menu-trigger",...e})}function Lh({className:e,sideOffset:t=4,...n}){return u.jsx(q0e,{children:u.jsx(K0e,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ue("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-grey-700 p-1 shadow-md",e),...n})})}function kr({className:e,inset:t,variant:n="default",...r}){return u.jsx(Z0e,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Ue("focus:bg-accent focus:text-grey data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function J0e({className:e,children:t,checked:n,...r}){return u.jsxs(Y0e,{"data-slot":"dropdown-menu-checkbox-item",className:Ue("focus:bg-primary relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[u.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:u.jsx(W0e,{children:u.jsx(sE,{className:"size-4"})})}),t]})}function tb({className:e,inset:t,...n}){return u.jsx(G0e,{"data-slot":"dropdown-menu-label","data-inset":t,className:Ue("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function nb({className:e,...t}){return u.jsx(X0e,{"data-slot":"dropdown-menu-separator",className:Ue("bg-grey-700 -mx-1 my-1 h-px",e),...t})}function SR(e){return!!e?.plans?.[0]?.planId?.startsWith("self-hosted")}function _R({cluster:e}){const t=ms(e.id),{view:n,update:r}=sx(e.organizationId,e.id),o=!jt.checkForFabricConnect(e.id)&&!!t.user;if(n){if(!e.fqdn)return u.jsx(Ye,{to:`/${e.organizationId}/${e.id}/instances`,className:"text-sm text-nowrap","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Instances ",u.jsx(bi,{className:"inline-block"})]})});if(e.resetPassword)return r?u.jsx(Ye,{to:`/${e.organizationId}/${e.id}/finish-setup`,className:"text-sm text-nowrap","aria-label":`Set Password on ${e.name}`,title:`Set Password on ${e.name}`,children:u.jsxs(be,{variant:"positive",className:"py-2 hover:border-b-2 animate-glow-pulse",children:["Finish Setup ",u.jsx(bi,{className:"inline-block"})]})}):u.jsx("span",{className:"py-2 text-nowrap",children:"Pending Owner Setup"});if(!t.isLoading)return o?u.jsx(Ye,{to:`/${e.organizationId}/${e.id}${ba}`,className:"text-sm text-nowrap","aria-label":`View ${e.name}`,title:`View ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Direct Connect ",u.jsx(bi,{className:"inline-block"})]})}):r&&!SR(e)?u.jsx(Ye,{to:`/${e.organizationId}/${e.id}${ba}`,className:"text-sm text-nowrap","aria-label":`Connect to ${e.name}`,title:`Connect to ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Fabric Connect ",u.jsx(bi,{className:"inline-block"})]})}):u.jsx(Ye,{to:`/${e.organizationId}/${e.id}/sign-in`,className:"text-sm text-nowrap","aria-label":`Sign In to ${e.name}`,title:`Sign In to ${e.name}`,children:u.jsxs("span",{className:"py-2 hover:border-b-2",children:["Direct Sign In ",u.jsx(bi,{className:"inline-block"})]})})}}function Q0e(e,t){const n=[];if(e)for(const r of e)n.push(r[t]);return n}function $m({cluster:e,forceProgressBarVisible:t}){const[n,r]=b.useState(t||!1),{data:i}=Mt(Dl(n&&e.id,2e3));b.useEffect(function(){(XC(e.status)||JC(e.status))&&r(!0)},[n,e.status,i?.instances]);const o=b.useMemo(()=>{const a=Q0e(i?.plans??[],"planId"),l=i?.instances??[];let d=0;const f={};let m=0;const h={};let v=0;const y={};let x=0;const S={};for(const k of l){const E=k.status;!E||sR(E)||(XC(E)?(d+=1,f[E]=`${d} ${wo(E)}`):JC(E)?(m+=1,h[E]=`${m} ${wo(E)}`):Oh(E)?(x+=1,S[E]=`${x} ${wo(E)}`):!k.planId||!a.includes(k.planId)?(m+=1,h.DRAINING_TRAFFIC=`${m} ${wo("Draining Traffic")}`):o8(E)&&(v+=1,y[E]=`${v} ${wo(E)}`))}const C=d+m+v;return{pendingWidth:`${C===0?100:d===0?0:d/C*100}%`,updatingWidth:`${m===0?0:m/C*100}%`,failedWidth:`${x===0?0:x/C*100}%`,runningWidth:`${v===0?0:v/C*100}%`,text:[...Object.values(y).sort(),...Object.values(S).sort(),...Object.values(h).sort(),...Object.values(f).sort()].join(" · ")}},[i]);return n?u.jsxs("div",{className:"w-full text-center",children:[u.jsxs("div",{className:"w-full h-2.5 rounded-full overflow-clip flex shadow",children:[u.jsx("div",{style:{width:o.runningWidth},className:"grow bg-green/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.failedWidth},className:"grow bg-red/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.updatingWidth},className:"grow animate-pulse bg-yellow/80 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"}),u.jsx("div",{style:{width:o.pendingWidth},className:"grow bg-gray-600 transition-[width] duration-1000 ease-in-out motion-reduce:transition-none"})]}),o.text&&u.jsx("div",{className:"text-xs text-muted-foreground font-light mt-2",children:o.text})]}):null}async function y9(e){const{data:t}=await Gt.delete(`/Cluster/${e}`,{timeout:0});return t}function ewe(){return ct({mutationFn:e=>y9(e)})}function b9(...e){return b.useMemo(()=>e.map(t=>(()=>{navigator.clipboard.writeText(t),we.info("Copied to clipboard!",{icon:u.jsx(nte,{}),duration:1e3})})),e)}function Fh(e){try{return e==="null"||e==="undefined"||e===null||e===void 0?null:JSON.parse(e)}catch(t){return console.error("safeParse failed to parse value, returning null instead",t),null}}function twe(e,t){return Fh(localStorage.getItem(e))??t}function nwe(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}function jf(e,t){const n=b.useState(twe(e,t)),[r]=n;return b.useEffect(()=>nwe(e,r),[e,r]),n}var su=(e=>(e.SavedClusterState="SavedClusterState",e))(su||{});function rwe({cluster:e}){const t=_n(),n=ir(),r=b.useMemo(()=>Xk(e),[e]),i=rh(r),o=ms(e.id),[,a]=jf(su.SavedClusterState,null),{view:l,update:d,remove:f,create:m}=sx(e.organizationId,e.id),{mutate:h,isPending:v}=ewe(),[y,x]=b.useState(!1),[S,C]=b.useState(!1),k=b.useMemo(()=>e.status&&Sx.includes(e.status),[e.status]),E=SR(e),j=jt.checkForFabricConnect(e.id),I=!j&&!!o.user,N=b.useMemo(()=>e.status&&uj.includes(e.status),[e.status]),T=b.useMemo(()=>e.status&&Oh(e.status),[e.status]),A=b.useCallback(async()=>{x(!0);const V=await dj(e.id).catch(H=>(console.error("Failed to lookup cluster details, proceeding without checking instances.",H),null));if(await Km({entityId:e.id,instanceClient:i}),V?.instances?.length)for(const H of V.instances)jt.setUserForEntity(H,null);jt.setUserForEntity(e,null)},[e,i]),D=b.useCallback(()=>{a(e),t.navigate({to:`/${e.organizationId}/new-cluster`})},[e,t,a]),F=b.useCallback(()=>C(!0),[]),q=b.useCallback(()=>{const V=e.organizationId;h(e.id,{onSuccess:async()=>{await n.invalidateQueries({queryKey:[V],refetchType:"active"}),await t.invalidate(),we.success("Success",{description:E?"Cluster successfully removed.":"Cluster successfully terminated.",duration:5e3,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),C(!1)},onError:()=>{we.error("Error",{description:E?`Failed to remove cluster: ${e.name}`:`Failed to terminate cluster: ${e.name}.`,duration:5e3,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),C(!1)}})},[t,e.organizationId,e.id,e.name,h,E,n]),[ee,G]=b9(`${e.fqdn}`,`https://${e.fqdn}`),K=[k&&d&&!o.isLoading&&(!I||j)&&u.jsx(Ye,{to:`${e.id}/sign-in`,disabled:y,children:u.jsx(kr,{children:"Direct Sign In"})},"sign-in"),k&&d&&u.jsx(Ye,{to:`${e.id}/edit`,disabled:y,children:u.jsx(kr,{children:"Edit"})},"edit"),k&&l&&u.jsx(Ye,{to:`${e.id}/instances`,disabled:y,children:u.jsx(kr,{children:"Instances"})},"instances"),k&&l&&e.fqdn&&u.jsx(kr,{onClick:ee,disabled:y,children:"Copy Host Name"},"copy-host-name"),k&&l&&e.fqdn&&u.jsx(kr,{onClick:G,disabled:y,children:"Copy API URL"},"copy-api-url"),k&&l&&!!r&&!o.isLoading&&I&&u.jsx(kr,{onClick:A,disabled:y,children:"Direct Sign Out"},"direct-sign-out"),T&&m&&u.jsx(kr,{className:"focus:bg-green/70 focus:text-white",onClick:D,children:"Try Again"},"try-again"),!N&&f&&u.jsx(kr,{className:"focus:bg-red/70 focus:text-white",onClick:F,children:E?"Remove":"Terminate"},"remove")].filter(Jo);return u.jsxs(Dc,{className:"relative h-full justify-between",children:[u.jsxs(Rl,{children:[u.jsxs(Zc,{className:"flex items-center justify-between",children:[e.fqdn?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate max-w-48",children:e.fqdn}),u.jsx(A4,{onClick:ee,size:16,className:"cursor-pointer"}),u.jsx("span",{className:"grow"})]}):u.jsx("span",{children:"Self-Hosted"}),!N&&u.jsxs(Mh,{children:[u.jsx(zh,{children:u.jsx(lE,{"aria-label":"Cluster options"})}),u.jsxs(Lh,{children:[!T&&u.jsxs(u.Fragment,{children:[u.jsx(tb,{className:"text-gray-600 text-xs",children:"Plans"}),e.plans?.map(V=>u.jsxs(tb,{children:[V.planId," / ",V.regionId,u.jsx("br",{}),"Auto Renewal ",u.jsx(Yo,{variant:"success",children:"ON"})]},V.planId+V.regionId)),K.length>0&&u.jsx(nb,{})]}),...K]})]})]}),u.jsx(Tl,{children:u.jsx("h2",{children:e.name})})]}),u.jsxs(hs,{className:"flex items-center justify-between gap-2",children:[u.jsx($m,{cluster:e}),k&&l&&u.jsx(_R,{cluster:e}),T&&e.status&&u.jsxs(u.Fragment,{children:[u.jsx(Yo,{variant:i8(e.status),children:wo(e.status)}),u.jsx("span",{className:"text-xs",children:'Click "..." to choose how to proceed.'})]})]}),u.jsx(w0,{typeOfThingBeingDeleted:"cluster",transitiveVerb:E?"Remove":"Terminate",presentParticiple:E?"Removing":"Terminating",nameOfThingBeingDeleted:e.name,isModalOpen:S,hideDataLossWarning:E,setIsModalOpen:V=>C(V),deletionConfirmed:q,deletionPending:v})]})}function kl({overEmail:e}){return u.jsx("a",{href:e?"mailto:support@harperdb.io":"https://discord.com/channels/1415002037439041710/1415002038286286994",target:"_blank",rel:"noreferrer",className:"underline",children:"Contact us"})}function no({className:e,text:t,centered:n,...r}){const i=n?"flex flex-col items-center justify-center":"";return u.jsxs("div",{className:`text-white h-full w-full ${e||""} ${i}`,...r,children:[u.jsx("img",{src:"/HDBDogOnly.svg",width:"100px",height:"100px",alt:"HDB Dog Logo Loading",className:"inline-block"}),u.jsx("p",{className:"pt-4",children:t||"Loading..."})]})}function Ov({children:e}){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] relative",children:e})]})}async function iwe(e){const{data:t}=await Gt.get("/Plan/",{params:{organizationId:e}});return t}function owe(e){return{queryKey:[e,"instancePlan"],queryFn:()=>iwe(e),retry:!1}}async function awe({organizationId:e,availableHosts:t}={}){const{data:n}=await Gt.get("/Region/",{params:{availableHosts:t,organizationId:e}});return n}function aP({organizationId:e,availableHosts:t}={}){return{queryKey:[e,"regionLocations",t],queryFn:()=>awe({organizationId:e,availableHosts:t}),retry:!1}}function rk(e){return(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1}function sP(e){const t=e.split(".").map(Number);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0}function lP(e){return typeof e!="string"?!1:/^(?:25[0-5]|2[0-4]\d|1?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(e)}function x9(e,t){return e.instanceFqdn===t.instanceFqdn?e.operationsApiPort-t.operationsApiPort:lP(e.instanceFqdn)&&lP(t.instanceFqdn)?sP(e.instanceFqdn)-sP(t.instanceFqdn):e.instanceFqdn>t.instanceFqdn?1:-1}function swe(e,t){const n={};for(const r of e){const i=r[t];if(i!==void 0)if(Array.isArray(i))for(const o of i)n[o]||(n[o]=[]),n[o].push(r);else n[i]||(n[i]=[]),n[i].push(r)}return n}function If(e,t){const n={};for(const r of e){const i=r[t];if(i!==void 0)if(Array.isArray(i))for(const o of i)n[o]=r;else n[i]=r}return n}function ik(e,t,n){const r=swe(e,t),i={};for(const o in r)i[o]=If(r[o],n);return i}function Dm({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:ki("w-full bg-gray-200 rounded-full relative",r?"h-6":"h-2.5"),children:[r&&u.jsx("div",{className:"absolute top-0 h-full w-full font-bold text-xs flex flex-col items-center justify-center text-black/60 text-shadow-2xs",children:r}),u.jsx("div",{className:ki("rounded-full",r?"h-6":"h-2.5",!t?.includes("bg-")&&"bg-purple/40",n&&"transition-[width] duration-1000 ease-in-out motion-reduce:transition-none",t),style:{width:e}})]})}function lwe({duration:e,message:t,lateMessage:n}){const r=b.useRef(0),i=b.useRef(0),[o,a]=b.useState(!1),l=5,[d,f]=b.useState(`${l}%`),m=b.useCallback(function h(v){i.current||(i.current=v);const y=v-i.current,x=Math.min(y/e,1);f(Math.max(l,x*100)+"%"),x<1?r.current=requestAnimationFrame(h):a(!0)},[e]);return b.useEffect(()=>(r.current=requestAnimationFrame(m),()=>cancelAnimationFrame(r.current)),[m]),u.jsxs(u.Fragment,{children:[o?n:t,u.jsx(Dm,{width:d,animated:!1})]})}async function cwe(e){const{data:t}=await Gt.post("/Cluster/",e,{timeout:0});return t}function uwe(){return ct({mutationFn:e=>cwe(e)})}async function dwe(e){const{data:t}=await Gt.put(`/Cluster/${e.id}`,{regionPlans:e.regionPlans},{timeout:0});return t}function fwe(){return ct({mutationFn:e=>dwe(e)})}async function w9(e){const{data:t}=await Gt.get(`/Organization/${e}`);return t}function lu(e){return{queryKey:[e],queryFn:()=>w9(e),retry:!1,refetchInterval:1e4}}const Pm="ENTERPRISE";function S9(e,t){if(t<=0)return"";if(e.length<=t)return e;const n=e.split("-");if(n.length===1)return n[0].slice(0,t);const r=[n[0],...n.slice(1).map(d=>d.charAt(0))],i=r.join("-");if(i.length<=t)return i;const o=r.slice(1).join("").length,a=r.length-1,l=t-o-a;if(l>0)return r[0]=r[0].slice(0,l),r.join("-");{const d=[];let f=0;t>0&&(d.push(n[0].charAt(0)),f=1);for(let m=1;m<r.length&&f+2<=t;m++)d.push(r[m]),f+=2;return d.join("-")}}function pwe(e,t,n="-"){const r=t.split(n)[0];return e.findIndex(i=>i.startsWith(r))!==-1}function k0(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-").replace(/^-+|-+$/g,"")}async function mwe(e){await Gt.put("/Payment/",e)}function hwe(){return ct({mutationFn:e=>mwe(e)})}function _9(e){const{mutate:t}=hwe();return b.useCallback((n,r)=>{t({paymentMethodId:typeof n=="string"?n:n.id,organizationId:e},{onSuccess:()=>{we.success("Success! Your payment method has been saved."),r(!0)},onError:()=>{we.error("Failed to process payment method details. Please try another payment method."),r(!1)}})},[t,e])}const gwe=b.createContext(null);function vwe(){return b.useContext(gwe)}var p1={exports:{}},m1,cP;function ywe(){if(cP)return m1;cP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return m1=e,m1}var h1,uP;function bwe(){if(uP)return h1;uP=1;var e=ywe();function t(){}function n(){}return n.resetWarningCache=t,h1=function(){function r(a,l,d,f,m,h){if(h!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},h1}var dP;function xwe(){return dP||(dP=1,p1.exports=bwe()()),p1.exports}var wwe=xwe();const Qe=of(wwe);function fP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fP(Object(n),!0).forEach(function(r){C9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function my(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?my=function(t){return typeof t}:my=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},my(e)}function C9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Swe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _we(e,t){if(e==null)return{};var n=Swe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cwe(e,t){return kwe(e)||Ewe(e,t)||jwe(e,t)||Iwe()}function kwe(e){if(Array.isArray(e))return e}function Ewe(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var r=[],i=!0,o=!1,a,l;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(d){o=!0,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function jwe(e,t){if(e){if(typeof e=="string")return mP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mP(e,t)}}function mP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Iwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Hr=function(t,n,r){var i=!!r,o=J.useRef(r);J.useEffect(function(){o.current=r},[r]),J.useEffect(function(){if(!i||!t)return function(){};var a=function(){o.current&&o.current.apply(o,arguments)};return t.on(n,a),function(){t.off(n,a)}},[i,n,t,o])},Rwe=function(t){var n=J.useRef(t);return J.useEffect(function(){n.current=t},[t]),n.current},rb=function(t){return t!==null&&my(t)==="object"},hP="[object Object]",Twe=function e(t,n){if(!rb(t)||!rb(n))return t===n;var r=Array.isArray(t),i=Array.isArray(n);if(r!==i)return!1;var o=Object.prototype.toString.call(t)===hP,a=Object.prototype.toString.call(n)===hP;if(o!==a)return!1;if(!o&&!r)return t===n;var l=Object.keys(t),d=Object.keys(n);if(l.length!==d.length)return!1;for(var f={},m=0;m<l.length;m+=1)f[l[m]]=!0;for(var h=0;h<d.length;h+=1)f[d[h]]=!0;var v=Object.keys(f);if(v.length!==l.length)return!1;var y=t,x=n,S=function(k){return e(y[k],x[k])};return v.every(S)},Nwe=function(t,n,r){return rb(t)?Object.keys(t).reduce(function(i,o){var a=!rb(n)||!Twe(t[o],n[o]);return r.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),i):a?pP(pP({},i||{}),{},C9({},o,t[o])):i},null):null},CR=J.createContext(null);CR.displayName="ElementsContext";var k9=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t};Qe.any,Qe.object;var Awe=function(t){var n=J.useContext(CR);return k9(n,t)},Owe=function(){var t=Awe("calls useElements()"),n=t.elements;return n};Qe.func.isRequired;var E9=J.createContext(null);E9.displayName="CheckoutContext";Qe.any,Qe.shape({clientSecret:Qe.oneOfType([Qe.string,Qe.instanceOf(Promise)]).isRequired,elementsOptions:Qe.object}).isRequired;var ok=function(t){var n=J.useContext(E9),r=J.useContext(CR);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CheckoutProvider> and <Elements> providers."));return n}else return k9(r,t)},$we=["mode"],Dwe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Ei=function(t,n){var r="".concat(Dwe(t),"Element"),i=function(d){var f=d.id,m=d.className,h=d.options,v=h===void 0?{}:h,y=d.onBlur,x=d.onFocus,S=d.onReady,C=d.onChange,k=d.onEscape,E=d.onClick,j=d.onLoadError,I=d.onLoaderStart,N=d.onNetworksChange,T=d.onConfirm,A=d.onCancel,D=d.onShippingAddressChange,F=d.onShippingRateChange,q=d.onSavedPaymentMethodRemove,ee=d.onSavedPaymentMethodUpdate,G=ok("mounts <".concat(r,">")),K="elements"in G?G.elements:null,V="checkoutState"in G?G.checkoutState:null,H=V?.type==="success"||V?.type==="loading"?V.sdk:null,z=J.useState(null),W=Cwe(z,2),L=W[0],ne=W[1],$=J.useRef(null),P=J.useRef(null);Hr(L,"blur",y),Hr(L,"focus",x),Hr(L,"escape",k),Hr(L,"click",E),Hr(L,"loaderror",j),Hr(L,"loaderstart",I),Hr(L,"networkschange",N),Hr(L,"confirm",T),Hr(L,"cancel",A),Hr(L,"shippingaddresschange",D),Hr(L,"shippingratechange",F),Hr(L,"savedpaymentmethodremove",q),Hr(L,"savedpaymentmethodupdate",ee),Hr(L,"change",C);var U;S&&(t==="expressCheckout"?U=S:U=function(){S(L)}),Hr(L,"ready",U),J.useLayoutEffect(function(){if($.current===null&&P.current!==null&&(K||H)){var X=null;if(H)switch(t){case"paymentForm":X=H.createPaymentFormElement();break;case"payment":X=H.createPaymentElement(v);break;case"address":if("mode"in v){var pe=v.mode,ve=_we(v,$we);if(pe==="shipping")X=H.createShippingAddressElement(ve);else if(pe==="billing")X=H.createBillingAddressElement(ve);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":X=H.createExpressCheckoutElement(v);break;case"currencySelector":X=H.createCurrencySelectorElement();break;case"taxId":X=H.createTaxIdElement(v);break;default:throw new Error("Invalid Element type ".concat(r,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else K&&(X=K.create(t,v));$.current=X,ne(X),X&&X.mount(P.current)}},[K,H,v]);var O=Rwe(v);return J.useEffect(function(){if($.current){var X=Nwe(v,O,["paymentRequest"]);X&&"update"in $.current&&$.current.update(X)}},[v,O]),J.useLayoutEffect(function(){return function(){if($.current&&typeof $.current.destroy=="function")try{$.current.destroy(),$.current=null}catch{}}},[]),J.createElement("div",{id:f,className:m,ref:P})},o=function(d){ok("mounts <".concat(r,">"));var f=d.id,m=d.className;return J.createElement("div",{id:f,className:m})},a=n?o:i;return a.propTypes={id:Qe.string,className:Qe.string,onChange:Qe.func,onBlur:Qe.func,onFocus:Qe.func,onReady:Qe.func,onEscape:Qe.func,onClick:Qe.func,onLoadError:Qe.func,onLoaderStart:Qe.func,onNetworksChange:Qe.func,onConfirm:Qe.func,onCancel:Qe.func,onShippingAddressChange:Qe.func,onShippingRateChange:Qe.func,onSavedPaymentMethodRemove:Qe.func,onSavedPaymentMethodUpdate:Qe.func,options:Qe.object},a.displayName=r,a.__elementType=t,a},ji=typeof window>"u",Pwe=J.createContext(null);Pwe.displayName="EmbeddedCheckoutProviderContext";var j9=function(){var t=ok("calls useStripe()"),n=t.stripe;return n};Ei("auBankAccount",ji);Ei("card",ji);Ei("cardNumber",ji);Ei("cardExpiry",ji);Ei("cardCvc",ji);Ei("iban",ji);var Mwe=Ei("payment",ji);Ei("expressCheckout",ji);Ei("paymentRequestButton",ji);Ei("linkAuthentication",ji);var zwe=Ei("address",ji);Ei("shippingAddress",ji);Ei("paymentMethodMessaging",ji);Ei("taxId",ji);function Lwe({hasExistingBilling:e,onPaymentAdded:t,onSaveStateForBillingRedirect:n}){const{organizationId:r}=rt({strict:!1}),i=j9(),o=vwe(),a=Owe(),[l,d]=b.useState(!1),f=_9(r),m=b.useCallback(()=>{t(!1)},[t]),h=b.useCallback(async v=>{if(v.preventDefault(),!i||!a)return;d(!0),await a.submit(),n?.(!0);const y=await i.confirmSetup({clientSecret:o.clientSecret,elements:a,redirect:"if_required",confirmParams:{return_url:`${window.location.origin}/#/${r}/billing/confirm`}});y.error?(console.error(y.error.message),we.error(y.error.message),d(!1),n?.(!1)):y.setupIntent.payment_method&&(f(y.setupIntent.payment_method,t),n?.(!1))},[a,t,n,r,f,i,o.clientSecret]);return u.jsxs("form",{onSubmit:h,className:"max-w-xl",children:[u.jsx(Mwe,{}),u.jsx(zwe,{options:{mode:"billing"}}),u.jsxs("div",{className:"mt-4 flex gap-8 items-center",children:[u.jsxs(be,{disabled:!i||!a||l,variant:"submit",className:"rounded-full",children:[u.jsx(To,{})," Add Payment Method"]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"text-xs text-gray-600",children:"Your existing payment method will be overwritten."}),u.jsx(be,{variant:"defaultOutline",type:"button",onClick:m,children:"Cancel"})]})]})]})}var Fwe="clover",I9="https://js.stripe.com",Uwe="".concat(I9,"/").concat(Fwe,"/stripe.js"),Vwe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Bwe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var Hwe=function(t){return Vwe.test(t)||Bwe.test(t)},qwe=function(){for(var t=document.querySelectorAll('script[src^="'.concat(I9,'"]')),n=0;n<t.length;n++){var r=t[n];if(Hwe(r.src))return r}return null},gP=function(t){var n="",r=document.createElement("script");r.src="".concat(Uwe).concat(n);var i=document.head||document.body;if(!i)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return i.appendChild(r),r},Fp=null,$v=null,Dv=null,Kwe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Gwe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Zwe=function(t){return Fp!==null?Fp:(Fp=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe){n(window.Stripe);return}try{var i=qwe();if(!(i&&t)){if(!i)i=gP(t);else if(i&&Dv!==null&&$v!==null){var o;i.removeEventListener("load",Dv),i.removeEventListener("error",$v),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=gP(t)}}Dv=Gwe(n,r),$v=Kwe(r),i.addEventListener("load",Dv),i.addEventListener("error",$v)}catch(a){r(a);return}}),Fp.catch(function(n){return Fp=null,Promise.reject(n)}))},Up,Ywe=function(){return Up||(Up=Zwe(null).catch(function(t){return Up=null,Promise.reject(t)}),Up)};Promise.resolve().then(function(){return Ywe()}).catch(function(e){console.warn(e)});async function Wwe(e){const{data:t}=await Gt.post("/StripeAccount/",e);return t}function Xwe(){return ct({mutationFn:e=>Wwe(e)})}async function Jwe(e){const{data:t}=await Gt.post("/Payment/",{organizationId:e.organizationId});return t}function Qwe(){return ct({mutationFn:e=>Jwe(e)})}function eSe(e){const{enabled:t,existingStripeId:n,organizationId:r}=e,{mutate:i}=Xwe(),{mutate:o}=Qwe(),[a,l]=b.useState(void 0),d=b.useCallback(f=>{l(f.clientSecret)},[]);return b.useEffect(()=>{},[i,t,n,o,d,r]),a}function R9({children:e}){const{organizationId:t}=rt({strict:!1}),{data:n}=Mt(lu(t)),r=eSe({organizationId:t,enabled:!!n,existingStripeId:n?.stripeId});return b.useMemo(()=>({clientSecret:r||"",appearance:{theme:"night"}}),[r]),console.error("No VITE_PUBLIC_STRIPE_KEY is configured for this environment."),u.jsx("div",{className:"mt-20 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"Setting up your billing is currently disabled. Please check back again later."})}function tSe({onPaymentAdded:e,onSaveStateForBillingRedirect:t}){const{organizationId:n}=rt({strict:!1}),{data:r}=Mt(lu(n)),i=r?.billing,o=i?.paymentMethod;return u.jsxs(R9,{children:[u.jsx("div",{className:"mt-2 mb-6",children:!o&&"You currently have no payment method on file. Please fill out the secure form below."}),u.jsx(Lwe,{hasExistingBilling:!!i,onSaveStateForBillingRedirect:t,onPaymentAdded:e})]})}var ma=(e=>(e.PASS="pass",e.FAIL="fail",e.PENDING="pending",e.ERROR="error",e))(ma||{});function nSe(e){switch(e){case ma.PASS:return"success";case ma.FAIL:case ma.ERROR:return"destructive";case ma.PENDING:default:return"default"}}function rSe(e){switch(e){case ma.PASS:return"READY";case ma.FAIL:case ma.ERROR:case ma.PENDING:default:return e.toUpperCase()}}function iSe(e,t){const n=String(e).padStart(2,"0"),r=String(t%100).padStart(2,"0");return`${n}/${r}`}function T9(e){const{onSaveStateForBillingRedirect:t,onReplacingPaymentMethod:n}=e??{},{organizationId:r}=rt({strict:!1}),{update:i}=ax(r),{data:o,refetch:a}=Mt(lu(r)),d=o?.billing?.paymentMethod,[f,m]=b.useState(!1),h=b.useCallback(()=>{m(!f),n?.(!f)},[n,f]),v=b.useCallback(y=>{m(!1),n?.(!1),y&&a()},[n,a]);return o?.type===Pm?u.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your payment methods on this page. Want to explore your solution with Harper more? ",u.jsx(kl,{}),", we would love to talk!"]}):d&&!f?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mt-2",children:[d.brand?.toUpperCase()??"Card"," ending in ",d.last4??"••••",d.expMonth&&d.expYear?u.jsxs(u.Fragment,{children:["(exp ",iSe(d.expMonth,d.expYear),")"]}):null,d.status?u.jsxs(u.Fragment,{children:["—"," ",u.jsx(Yo,{variant:nSe(d.status),children:rSe(d.status)})]}):null]}),i&&u.jsx("div",{className:"mt-2 mb-6",children:u.jsx(be,{variant:"defaultOutline",type:"button",onClick:h,children:"Replace Payment Method"})})]}):i?u.jsx(tSe,{onSaveStateForBillingRedirect:t,onPaymentAdded:v}):u.jsx("div",{children:"This org doesn't have a payment method, and you don't have access to add one. Please contact your administrator."})}function qn(e){return e!==void 0&&e>0}function oSe({clusterId:e,isPending:t,onGoBackToDetails:n,onSaveStateForBillingRedirect:r,onSubmit:i,organizationId:o,selectedPlan:a}){const{data:l}=Mt(lu(o)),d=l?.billing,f=l?.type===Pm,m=f||d?.paymentMethod?.status===ma.PASS,[h,v]=b.useState(!1),y=qn(a?.planLimits?.expirationMonths)&&a.planLimits.expirationMonths<1e3&&a.planLimits.expirationMonths,x=u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end mt-3 max-w-xl",children:[u.jsxs(be,{type:"button",variant:"defaultOutline",className:"rounded-full",disabled:t,onClick:n,children:[u.jsx(Pc,{})," Back to Details"]}),u.jsxs(be,{disabled:t||!m||h,type:"submit",variant:"submit",className:"rounded-full",onClick:i,children:[e?"Edit Cluster":"Create New Cluster"," ",u.jsx(bi,{})]})]})});if(f)return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6 max-w-lg",children:[u.jsx("li",{children:"Reminder: you will be billed at your contracted rate for any additional infrastructure."}),u.jsxs("li",{children:["Your account representative can work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",u.jsx(kl,{overEmail:!0}),", we are here to help."]})]}),x]});const S=y&&`, or ${Yr(y,"month","months")} elapse`;return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6 mb-6",children:[u.jsx("li",{children:"You will be billed for this cluster today, and will receive a license for the block of usage you've requested."}),e&&u.jsx("li",{children:"If you scale up, you'll be charged for the additional blocks you've purchased now, and your next auto renewal will be for all purchased blocks."}),e&&u.jsx("li",{children:"If you remove a region, that region's usage block will not be used anymore (because it is specific to that region)."}),u.jsxs("li",{children:["When that block is used up",S,", you will be automatically renewed."]}),u.jsx("li",{children:"While refunds are not available, we’d be happy to assist you with troubleshooting."}),u.jsxs("li",{children:["We would love to work with you to sort out more precise details, and to help accomplish your objectives with this cluster. ",u.jsx(kl,{overEmail:!0}),", we are here to help."]})]}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Payment method:"}),u.jsx(T9,{onSaveStateForBillingRedirect:r,onReplacingPaymentMethod:v}),x]})}function Pr({className:e}={}){const t=b.useMemo(()=>ki("animate-pulse h-2.5 bg-gray-200 rounded-full dark:bg-gray-700",!e?.includes("mb-")&&"mb-4 ",!e?.includes("w-")&&"w-48 ",e),[e]);return u.jsx("div",{className:t})}function ak(e,[t,n]){return Math.min(n,Math.max(t,e))}var aSe=[" ","Enter","ArrowUp","ArrowDown"],sSe=[" ","Enter"],Vc="Select",[E0,j0,lSe]=nh(Vc),[Rf]=Qi(Vc,[lSe,wf]),I0=wf(),[cSe,Ll]=Rf(Vc),[uSe,dSe]=Rf(Vc),N9=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:l,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:v,required:y,form:x}=e,S=I0(t),[C,k]=b.useState(null),[E,j]=b.useState(null),[I,N]=b.useState(!1),T=eu(f),[A,D]=Ko({prop:r,defaultProp:i??!1,onChange:o,caller:Vc}),[F,q]=Ko({prop:a,defaultProp:l,onChange:d,caller:Vc}),ee=b.useRef(null),G=C?x||!!C.closest("form"):!0,[K,V]=b.useState(new Set),H=Array.from(K).map(z=>z.props.value).join(";");return u.jsx(WE,{...S,children:u.jsxs(cSe,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:I,onValueNodeHasChildrenChange:N,contentId:Vi(),value:F,onValueChange:q,open:A,onOpenChange:D,dir:T,triggerPointerDownPosRef:ee,disabled:v,children:[u.jsx(E0.Provider,{scope:t,children:u.jsx(uSe,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(z=>{V(W=>new Set(W).add(z))},[]),onNativeOptionRemove:b.useCallback(z=>{V(W=>{const L=new Set(W);return L.delete(z),L})},[]),children:n})}),G?u.jsxs(tq,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:h,value:F,onChange:z=>q(z.target.value),disabled:v,form:x,children:[F===void 0?u.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};N9.displayName=Vc;var A9="SelectTrigger",O9=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=I0(n),a=Ll(A9,n),l=a.disabled||r,d=pt(t,a.onTriggerChange),f=j0(n),m=b.useRef("touch"),[h,v,y]=rq(S=>{const C=f().filter(j=>!j.disabled),k=C.find(j=>j.value===a.value),E=iq(C,S,k);E!==void 0&&a.onValueChange(E.value)}),x=S=>{l||(a.onOpenChange(!0),y()),S&&(a.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return u.jsx(XE,{asChild:!0,...o,children:u.jsx(We.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":nq(a.value)?"":void 0,...i,ref:d,onClick:Re(i.onClick,S=>{S.currentTarget.focus(),m.current!=="mouse"&&x(S)}),onPointerDown:Re(i.onPointerDown,S=>{m.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(x(S),S.preventDefault())}),onKeyDown:Re(i.onKeyDown,S=>{const C=h.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&aSe.includes(S.key)&&(x(),S.preventDefault())})})})});O9.displayName=A9;var $9="SelectValue",D9=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...l}=e,d=Ll($9,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,h=pt(t,d.onValueNodeChange);return rr(()=>{f(m)},[f,m]),u.jsx(We.span,{...l,ref:h,style:{pointerEvents:"none"},children:nq(d.value)?u.jsx(u.Fragment,{children:a}):o})});D9.displayName=$9;var fSe="SelectIcon",P9=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});P9.displayName=fSe;var pSe="SelectPortal",M9=e=>u.jsx(oh,{asChild:!0,...e});M9.displayName=pSe;var Bc="SelectContent",z9=b.forwardRef((e,t)=>{const n=Ll(Bc,e.__scopeSelect),[r,i]=b.useState();if(rr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?cf.createPortal(u.jsx(L9,{scope:e.__scopeSelect,children:u.jsx(E0.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(F9,{...e,ref:t})});z9.displayName=Bc;var Lo=10,[L9,Fl]=Rf(Bc),mSe="SelectContentImpl",hSe=Vd("SelectContent.RemoveScroll"),F9=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C,...k}=e,E=Ll(Bc,n),[j,I]=b.useState(null),[N,T]=b.useState(null),A=pt(t,Q=>I(Q)),[D,F]=b.useState(null),[q,ee]=b.useState(null),G=j0(n),[K,V]=b.useState(!1),H=b.useRef(!1);b.useEffect(()=>{if(j)return cR(j)},[j]),lR();const z=b.useCallback(Q=>{const[le,...Se]=G().map(Fe=>Fe.ref.current),[ke]=Se.slice(-1),Pe=document.activeElement;for(const Fe of Q)if(Fe===Pe||(Fe?.scrollIntoView({block:"nearest"}),Fe===le&&N&&(N.scrollTop=0),Fe===ke&&N&&(N.scrollTop=N.scrollHeight),Fe?.focus(),document.activeElement!==Pe))return},[G,N]),W=b.useCallback(()=>z([D,j]),[z,D,j]);b.useEffect(()=>{K&&W()},[K,W]);const{onOpenChange:L,triggerPointerDownPosRef:ne}=E;b.useEffect(()=>{if(j){let Q={x:0,y:0};const le=ke=>{Q={x:Math.abs(Math.round(ke.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(ne.current?.y??0))}},Se=ke=>{Q.x<=10&&Q.y<=10?ke.preventDefault():j.contains(ke.target)||L(!1),document.removeEventListener("pointermove",le),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",Se,{capture:!0})}}},[j,L,ne]),b.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[$,P]=rq(Q=>{const le=G().filter(Pe=>!Pe.disabled),Se=le.find(Pe=>Pe.ref.current===document.activeElement),ke=iq(le,Q,Se);ke&&setTimeout(()=>ke.ref.current.focus())}),U=b.useCallback((Q,le,Se)=>{const ke=!H.current&&!Se;(E.value!==void 0&&E.value===le||ke)&&(F(Q),ke&&(H.current=!0))},[E.value]),O=b.useCallback(()=>j?.focus(),[j]),X=b.useCallback((Q,le,Se)=>{const ke=!H.current&&!Se;(E.value!==void 0&&E.value===le||ke)&&ee(Q)},[E.value]),pe=r==="popper"?sk:U9,ve=pe===sk?{side:l,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return u.jsx(L9,{scope:n,content:j,viewport:N,onViewportChange:T,itemRefCallback:U,selectedItem:D,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:W,selectedItemText:q,position:r,isPositioned:K,searchRef:$,children:u.jsx(b0,{as:hSe,allowPinchZoom:!0,children:u.jsx(v0,{asChild:!0,trapped:E.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Re(i,Q=>{E.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:u.jsx(gf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:u.jsx(pe,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Q=>Q.preventDefault(),...k,...ve,onPlaced:()=>V(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,Q=>{const le=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!le&&Q.key.length===1&&P(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ke=G().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Pe=Q.target,Fe=ke.indexOf(Pe);ke=ke.slice(Fe+1)}setTimeout(()=>z(ke)),Q.preventDefault()}})})})})})})});F9.displayName=mSe;var gSe="SelectItemAlignedPosition",U9=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ll(Bc,n),a=Fl(Bc,n),[l,d]=b.useState(null),[f,m]=b.useState(null),h=pt(t,A=>m(A)),v=j0(n),y=b.useRef(!1),x=b.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:E}=a,j=b.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&f&&S&&C&&k){const A=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),q=k.getBoundingClientRect();if(o.dir!=="rtl"){const Pe=q.left-D.left,Fe=F.left-Pe,ut=A.left-Fe,Ze=A.width+ut,Pt=Math.max(Ze,D.width),dn=window.innerWidth-Lo,tn=ak(Fe,[Lo,Math.max(Lo,dn-Pt)]);l.style.minWidth=Ze+"px",l.style.left=tn+"px"}else{const Pe=D.right-q.right,Fe=window.innerWidth-F.right-Pe,ut=window.innerWidth-A.right-Fe,Ze=A.width+ut,Pt=Math.max(Ze,D.width),dn=window.innerWidth-Lo,tn=ak(Fe,[Lo,Math.max(Lo,dn-Pt)]);l.style.minWidth=Ze+"px",l.style.right=tn+"px"}const ee=v(),G=window.innerHeight-Lo*2,K=S.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),z=parseInt(V.paddingTop,10),W=parseInt(V.borderBottomWidth,10),L=parseInt(V.paddingBottom,10),ne=H+z+K+L+W,$=Math.min(C.offsetHeight*5,ne),P=window.getComputedStyle(S),U=parseInt(P.paddingTop,10),O=parseInt(P.paddingBottom,10),X=A.top+A.height/2-Lo,pe=G-X,ve=C.offsetHeight/2,Q=C.offsetTop+ve,le=H+z+Q,Se=ne-le;if(le<=X){const Pe=ee.length>0&&C===ee[ee.length-1].ref.current;l.style.bottom="0px";const Fe=f.clientHeight-S.offsetTop-S.offsetHeight,ut=Math.max(pe,ve+(Pe?O:0)+Fe+W),Ze=le+ut;l.style.height=Ze+"px"}else{const Pe=ee.length>0&&C===ee[0].ref.current;l.style.top="0px";const ut=Math.max(X,H+S.offsetTop+(Pe?U:0)+ve)+Se;l.style.height=ut+"px",S.scrollTop=le-X+S.offsetTop}l.style.margin=`${Lo}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=G+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,l,f,S,C,k,o.dir,r]);rr(()=>j(),[j]);const[I,N]=b.useState();rr(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const T=b.useCallback(A=>{A&&x.current===!0&&(j(),E?.(),x.current=!1)},[j,E]);return u.jsx(ySe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:T,children:u.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:u.jsx(We.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});U9.displayName=gSe;var vSe="SelectPopperPosition",sk=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Lo,...o}=e,a=I0(n);return u.jsx(JE,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});sk.displayName=vSe;var[ySe,kR]=Rf(Bc,{}),lk="SelectViewport",V9=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Fl(lk,n),a=kR(lk,n),l=pt(t,o.onViewportChange),d=b.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(E0.Slot,{scope:n,children:u.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Re(i.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=a;if(v?.current&&h){const y=Math.abs(d.current-m.scrollTop);if(y>0){const x=window.innerHeight-Lo*2,S=parseFloat(h.style.minHeight),C=parseFloat(h.style.height),k=Math.max(S,C);if(k<x){const E=k+y,j=Math.min(x,E),I=E-j;h.style.height=j+"px",h.style.bottom==="0px"&&(m.scrollTop=I>0?I:0,h.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});V9.displayName=lk;var B9="SelectGroup",[bSe,xSe]=Rf(B9),H9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Vi();return u.jsx(bSe,{scope:n,id:i,children:u.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});H9.displayName=B9;var q9="SelectLabel",K9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=xSe(q9,n);return u.jsx(We.div,{id:i.id,...r,ref:t})});K9.displayName=q9;var ib="SelectItem",[wSe,G9]=Rf(ib),Z9=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,l=Ll(ib,n),d=Fl(ib,n),f=l.value===r,[m,h]=b.useState(o??""),[v,y]=b.useState(!1),x=pt(t,E=>d.itemRefCallback?.(E,r,i)),S=Vi(),C=b.useRef("touch"),k=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(wSe,{scope:n,value:r,disabled:i,textId:S,isSelected:f,onItemTextChange:b.useCallback(E=>{h(j=>j||(E?.textContent??"").trim())},[]),children:u.jsx(E0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:u.jsx(We.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":f&&v,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:x,onFocus:Re(a.onFocus,()=>y(!0)),onBlur:Re(a.onBlur,()=>y(!1)),onClick:Re(a.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Re(a.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Re(a.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:Re(a.onPointerMove,E=>{C.current=E.pointerType,i?d.onItemLeave?.():C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(a.onPointerLeave,E=>{E.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Re(a.onKeyDown,E=>{d.searchRef?.current!==""&&E.key===" "||(sSe.includes(E.key)&&k(),E.key===" "&&E.preventDefault())})})})})});Z9.displayName=ib;var Qp="SelectItemText",Y9=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Ll(Qp,n),l=Fl(Qp,n),d=G9(Qp,n),f=dSe(Qp,n),[m,h]=b.useState(null),v=pt(t,k=>h(k),d.onItemTextChange,k=>l.itemTextRefCallback?.(k,d.value,d.disabled)),y=m?.textContent,x=b.useMemo(()=>u.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=f;return rr(()=>(S(x),()=>C(x)),[S,C,x]),u.jsxs(u.Fragment,{children:[u.jsx(We.span,{id:d.textId,...o,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?cf.createPortal(o.children,a.valueNode):null]})});Y9.displayName=Qp;var W9="SelectItemIndicator",X9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return G9(W9,n).isSelected?u.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});X9.displayName=W9;var ck="SelectScrollUpButton",J9=b.forwardRef((e,t)=>{const n=Fl(ck,e.__scopeSelect),r=kR(ck,e.__scopeSelect),[i,o]=b.useState(!1),a=pt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(eq,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop-d.offsetHeight)}}):null});J9.displayName=ck;var uk="SelectScrollDownButton",Q9=b.forwardRef((e,t)=>{const n=Fl(uk,e.__scopeSelect),r=kR(uk,e.__scopeSelect),[i,o]=b.useState(!1),a=pt(t,r.onScrollButtonChange);return rr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;o(m)};const d=n.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(eq,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:d}=n;l&&d&&(l.scrollTop=l.scrollTop+d.offsetHeight)}}):null});Q9.displayName=uk;var eq=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Fl("SelectScrollButton",n),a=b.useRef(null),l=j0(n),d=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>d(),[d]),rr(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),u.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Re(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Re(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Re(i.onPointerLeave,()=>{d()})})}),SSe="SelectSeparator",_Se=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});_Se.displayName=SSe;var dk="SelectArrow",CSe=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=I0(n),o=Ll(dk,n),a=Fl(dk,n);return o.open&&a.position==="popper"?u.jsx(QE,{...i,...r,ref:t}):null});CSe.displayName=dk;var kSe="SelectBubbleInput",tq=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=b.useRef(null),o=pt(r,i),a=NE(t);return b.useEffect(()=>{const l=i.current;if(!l)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(a!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[a,t]),u.jsx(We.select,{...n,style:{...ZF,...n.style},ref:o,defaultValue:t})});tq.displayName=kSe;function nq(e){return e===""||e===void 0}function rq(e){const t=Tn(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(a=>{const l=n.current+a;t(l),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(l)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function iq(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=ESe(e,Math.max(o,0));i.length===1&&(a=a.filter(f=>f!==n));const d=a.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function ESe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jSe=N9,ISe=O9,RSe=D9,TSe=P9,NSe=M9,ASe=z9,OSe=V9,$Se=H9,DSe=K9,PSe=Z9,MSe=Y9,zSe=X9,LSe=J9,FSe=Q9;function Gi({...e}){return u.jsx(jSe,{"data-slot":"select",...e})}function Wo({...e}){return u.jsx($Se,{"data-slot":"select-group",...e})}function Zi({...e}){return u.jsx(RSe,{"data-slot":"select-value",...e})}function Yi({className:e,children:t,...n}){return u.jsxs(ISe,{"data-slot":"select-trigger",className:Ue("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-grey-700 px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:truncate *:data-[slot=select-value]:block *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[t,u.jsx(TSe,{asChild:!0,children:u.jsx(R4,{className:"opacity-50 size-4"})})]})}function Wi({className:e,children:t,position:n="popper",...r}){return u.jsx(NSe,{children:u.jsxs(ASe,{"data-slot":"select-content",className:Ue("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[u.jsx(USe,{}),u.jsx(OSe,{className:Ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),u.jsx(VSe,{})]})})}function ER({className:e,...t}){return u.jsx(DSe,{"data-slot":"select-label",className:Ue("px-2 py-1.5 text-sm font-medium",e),...t})}function Ot({className:e,children:t,...n}){return u.jsxs(PSe,{"data-slot":"select-item",className:Ue("focus:bg-grey-200 focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[u.jsx(MSe,{children:t}),u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(zSe,{children:u.jsx(sE,{className:"size-4"})})})]})}function USe({className:e,...t}){return u.jsx(LSe,{"data-slot":"select-scroll-up-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Xee,{className:"size-4"})})}function VSe({className:e,...t}){return u.jsx(FSe,{"data-slot":"select-scroll-down-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(R4,{className:"size-4"})})}const vP=new RegExp(/^\d+/);function BSe(e,t){const n=parseInt(e.match(vP)?.[0]||"0",10),r=parseInt(t.match(vP)?.[0]||"0",10);return n===r?0:n>r?1:-1}const oq=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],aq=["secs","mins","hrs"],ob={bytes:1e3,secs:60};function HSe(e,t,n){let r,i;switch(t){case"bytes":{r=oq,i=ob.bytes;break}case"secs":{r=aq,i=ob.secs;break}default:return e}const o=r.indexOf(n);if(o===-1)return e;const a=i**o;return e/a}function qSe(e,t){let n,r;switch(e){case"bytes":n=oq,r=ob.bytes;break;case"secs":n=aq,r=ob.secs;break;default:return e}let i=0;for(;t>=r&&i<n.length-1;)t/=r,i++;return n[i]}function Fo(e,t=1){const n=e*t,r=qSe("bytes",n),i=HSe(n,"bytes",r);return`${new Intl.NumberFormat().format(Math.round(i))} ${r}`}function hy(e){return new Intl.NumberFormat().format(e)}const yP=["K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","Dc"];function mo(e){let n=e;if(Math.abs(n)<1e3)return String(Math.round(n));let r=-1;const i=10;do n/=1e3,++r;while(Math.round(Math.abs(n)*i)/i>=1e3&&r<yP.length-1);return`${hy(Math.round(n))} ${yP[r]}`}function KSe({planLimits:e,resourcesPerInstance:t,selectedRegion:n,isEnterprise:r}){const[i,o]=b.useState(!1),a=b.useCallback(()=>{o(!i)},[i,o]),l=qn(e?.expirationMonths)&&e.expirationMonths<1e3&&e.expirationMonths,d=n?.purchasedBlockMultiplier??1,f=b.useMemo(()=>e?[qn(e.totalReadCount)&&{label:"Total Reads",value:`${mo(e.totalReadCount*d)} reads`},qn(e.totalReadsBytes)&&{label:"Total Read Transfer",value:`${Fo(e.totalReadsBytes*d)}`},qn(e.readsPerMinuteCount)&&{label:"Read Rate",value:`${mo(e.readsPerMinuteCount*60*d)}/min`},qn(e.readsPerMinuteBytes)&&{label:"Read Bandwidth",value:`${Fo(e.readsPerMinuteBytes*60*d)}/min`},qn(e.totalWriteCount)&&{label:"Total Writes",value:`${mo(e.totalWriteCount)} reads`},qn(e.totalWritesBytes)&&{label:"Total Write Transfer",value:`${Fo(e.totalWritesBytes)}`},qn(e.writesPerMinuteCount)&&{label:"Write Rate",value:`${mo(e.writesPerMinuteCount*60)}/min`},qn(e.writesPerMinuteBytes)&&{label:"Write Bandwidth",value:`${Fo(e.writesPerMinuteBytes*60)}/min`},qn(e.totalRealTimeMessageDeliveries)&&{label:"Total Real-Time Messages",value:`${mo(e.totalRealTimeMessageDeliveries*d)} messages`},qn(e.totalRealTimeMessageDeliveryBytes)&&{label:"Total Real-Time Message Transfer",value:`${Fo(e.totalRealTimeMessageDeliveryBytes*d)}`},qn(e.realTimeMessageDeliveriesPerMinute)&&{label:"Real-Time Message Rate",value:`${mo(e.realTimeMessageDeliveriesPerMinute*60*d)}/min`},qn(e.realTimeMessageDeliveryBytesPerMinute)&&{label:"Real-Time Message Bandwidth",value:`${Fo(e.realTimeMessageDeliveryBytesPerMinute*60*d)}/min`},qn(e.tlsHandshakes)&&{label:"TLS Handshakes",value:`${mo(e.tlsHandshakes*60*d)}`},qn(e.applicationComputeHours)&&{label:"Application Compute Hours",value:`${mo(e.applicationComputeHours*60*d)}`},t&&qn(t.storageGb)&&{label:"Storage",value:`${Fo(t.storageGb*1e9)}`},l&&{label:"Expiration",value:Yr(l,"month","months")}].filter(Jo):[],[l,e,t,d]);if(!e)return"";if(!qn(e.totalReadCount))return"This plan has no usage limits.";const m=r?" Pricing subject to contracted rate.":" Beta pricing subject to change.",h=qn(e.readsPerMinuteCount)?`${mo(e.readsPerMinuteCount*d)} reads/min & `:"",v=qn(e.writesPerMinuteCount)?` ${mo(e.writesPerMinuteCount)} writes/min & `:" ",y=qn(e.readsPerMinuteCount)?"in "+(n?.region??"")+" region":"per server",x=l?`, for ${Yr(l,"month","months")}`:"",S=r?"for the contracted rate":"for the price listed above",C=l?` in ${Yr(l,"month","months")} or`:"";return u.jsxs(Te,{className:"basis-full",children:[u.jsxs(Ne,{onClick:a,children:["Purchasing usage block for ",h,mo(e.totalReadCount*d)," total reads ",y,",",u.jsx("br",{className:"hidden sm:block"}),v," ",mo(e.totalWriteCount)," total writes",x,".",m,u.jsx("br",{className:"block sm:hidden"}),u.jsxs(be,{type:"button",variant:"link",className:"text-white",children:["Learn More ",i?u.jsx(Mb,{}):u.jsx(bi,{})]})]}),u.jsx(Oe,{children:u.jsxs("dl",{className:Ue("divide-y divide-black overflow-hidden transition-[max-height] duration-200 ease-in",i?"max-h-fit":"max-h-0"),children:[u.jsxs("div",{className:"text-sm mb-3 max-w-lg",children:["This plan licenses Harper for the usage limits below, ",S,". The usage license expires",C," ","when any usage limit is reached. New usage blocks are automatically purchased/billed as blocks are consumed."]}),f.map((k,E)=>u.jsxs("div",{className:Ue("px-4 py-1 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-3",E%2===0&&"bg-gray-700"),children:[u.jsx("dt",{className:"text-sm/6 font-medium text-gray-300",children:k.label}),u.jsx("dd",{className:"mt-1 text-sm/6 sm:col-span-2 sm:mt-0",children:k.value})]},k.label))]})}),u.jsx(Ae,{})]})}function GSe({control:e,fieldArray:t,form:n,index:r,regionNameToLatencyToRegion:i,selectedPlan:o,isEnterprise:a}){const l=b.useMemo(()=>Object.keys(i).sort(),[i]),d=n.watch("deploymentDescription")?.startsWith("Dedicated"),f=n.watch(`regionPlans.${r}.regionName`),m=n.watch(`regionPlans.${r}.latencyDescription`),h=b.useMemo(()=>Object.keys(i[f]||{}).sort(BSe).reverse(),[i,f]);b.useEffect(function(){if(f&&h?.length&&!h?.includes(m)){const x=m?.split(" ")[0].toLowerCase(),S=h.find(C=>x?C.split(" ")[0].toLowerCase()===x:!0)||h[0];n.setValue(`regionPlans.${r}.latencyDescription`,S),n.trigger()}},[h,n,r,m,f]);const v=b.useCallback(()=>{t?.remove(r),n.trigger()},[t,n,r]);return u.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[u.jsx($e,{control:e,name:`regionPlans.${r}.regionName`,render:({field:y})=>u.jsxs(Te,{className:"flex-1",children:[u.jsxs(Ne,{children:["Region ",t.fields.length>1?r+1:""]}),u.jsx(Oe,{children:u.jsxs(Gi,{onValueChange:x=>{y.onChange(x),n.trigger()},...y,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Region"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:l.map(x=>u.jsx(Ot,{value:x,children:x},x))})})]})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e,name:`regionPlans.${r}.latencyDescription`,render:({field:y})=>u.jsxs(Te,{className:"flex-1",children:[u.jsxs(Ne,{children:["Estimated ",d?"P95":"P90"," Latency, Distribution"]}),u.jsx(Oe,{children:u.jsxs(Gi,{onValueChange:x=>{y.onChange(x),n.trigger()},...y,disabled:!h?.length,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Latency Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:h.map(x=>u.jsx(Ot,{value:x,children:x},x))})})]})}),u.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(be,{type:"button",variant:"destructiveOutline",size:"sm",onClick:v,children:[u.jsx(Ca,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})}),u.jsx(KSe,{planLimits:o?.planLimits,resourcesPerInstance:o?.resourcesPerInstance,selectedRegion:i[f]?.[m],isEnterprise:a})]})}function ZSe({form:e,regionLocations:t,regionNameToLatencyToRegion:n,selectedPlan:r,totalPrice:i,isEnterprise:o}){const a=e.watch("regionPlans"),l=cj({control:e.control,name:"regionPlans"}),d=b.useMemo(()=>{const m=a.map(h=>n?.[h.regionName]?.[h.latencyDescription]?.region);return i?t?.find(h=>!m.includes(h.region)):null},[t,n,a,i]),f=b.useCallback(()=>{d&&(l.append({regionName:d.region,latencyDescription:d.latencyDescription}),e.trigger())},[e,d,l]);return t?.length?u.jsxs(u.Fragment,{children:[l.fields.map((m,h)=>u.jsx(GSe,{control:e.control,fieldArray:l,form:e,index:h,regionNameToLatencyToRegion:n,selectedPlan:r,isEnterprise:o},m.id)),d&&u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(be,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:f,children:[u.jsx(Jr,{}),"Add Additional Region Usage"]})})]}):u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsx(Ry,{className:"mt-0 m-0",title:"No Regions Available",showReturnToHome:!1,error:{message:u.jsxs(u.Fragment,{children:["The deployment type you selected currently has no available regions. Please try a different deployment type, try again later, or ",u.jsx(kl,{}),"."]})}})})}const sq=0,lq=65535;function YSe({control:e,fieldArray:t,form:n,index:r}){const i=b.useCallback(()=>{t?.remove(r)},[t,r]);return u.jsxs("div",{className:"md:col-span-6 col-span-3 p-4 rounded-md bg-accent gap-6 flex flex-wrap items-start",children:[u.jsx($e,{control:e,name:`instances.${r}.secure`,render:({field:o})=>u.jsxs(Te,{children:[u.jsxs(Ne,{children:["Instance ",t.fields.length>1?r+1:""]}),u.jsx(Oe,{children:u.jsxs(Gi,{...o,onValueChange:a=>{o.onChange(a),n.trigger()},children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"https://"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(Ot,{value:"true",children:"https://"}),u.jsx(Ot,{value:"false",children:"http://"})]})})]})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e,name:`instances.${r}.fqdn`,render:({field:o})=>u.jsxs(Te,{className:"flex-3",children:[u.jsx(Ne,{children:"Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...o,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e,name:`instances.${r}.port`,render:({field:o})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Operations API Port"}),u.jsx(Oe,{children:u.jsx(ze,{...o,type:"number",min:sq,max:lq,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:String(Nd),onChange:a=>{o.onChange(a.target.value?parseInt(a.target.value,10):void 0),n.trigger()}})}),u.jsx(Ae,{})]})}),t?.fields?.length&&t?.fields?.length>1&&u.jsx("div",{className:"flex-none mt-6",children:u.jsxs(be,{type:"button",variant:"destructiveOutline",size:"sm",onClick:i,children:[u.jsx(Ca,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})})]})}function WSe({form:e}){const t=cj({control:e.control,name:"instances"}),n=b.useCallback(()=>{t.append({secure:"true",fqdn:"",port:Nd})},[t]);return u.jsxs(u.Fragment,{children:[t.fields.map((r,i)=>u.jsx(YSe,{control:e.control,fieldArray:t,form:e,index:i},r.id)),u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(be,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:n,children:[u.jsx(Jr,{}),"Add Instance"]})})]})}const bP=/(^$|^(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,})$)/i,ab=$t({clusterName:tt().nonempty("Please enter a cluster name.").max(255,"Cluster name cannot be longer than 255 characters long."),abbreviatedName:tt().max(20,"Must be at most 20 characters long.").regex(/^[a-z0-9-]*$/,"Can only contain lowercase letters, numbers and dashes").optional(),fqdn:tt().regex(bP,"Please enter a valid host name without the port or any path.").optional(),deploymentDescription:tt().nonempty("Please select a deployment tier."),performanceDescription:tt().nonempty("Please select a performance tier."),regionPlans:ds($t({regionName:tt().nonempty("Please select a region."),latencyDescription:tt().nonempty("Please select a latency tier.")})).max(50,{error:"A maximum of 50 regions can be selected for each cluster. "}),instances:ds($t({secure:Ml(["true","false"]),fqdn:tt().nonempty("Please enter the host name of your instance.").regex(bP,"Please enter a valid host name without the port or any path."),port:a0().min(sq,"Positive thinking only, please.").max(lq,"That port number is too high.").optional()})).max(100,{error:"A maximum of 100 instances can be added to each cluster."}),skipToBilling:Xt().optional(),sourceClusterId:tt().optional()}),xP={Colocated:"Shared infrastructure for optimized value",Dedicated:"Dedicated infrastructure for consistent performance","Self-Hosted":"Your own infrastructure"};function XSe({calculatedNames:e,clusterId:t,deploymentToPerformanceToPlan:n,form:r,isPending:i,regionLocations:o,regionNameToLatencyToRegion:a,selectedDeployment:l,selectedPerformance:d,selectedPlan:f,totalPrice:m,isEnterprise:h}){const{isDirty:v,isValid:y}=oj(),x=b.useMemo(()=>Object.keys(n[l]||{}).map(k=>{const E=k.slice(0,-1).split("(");if(E.length>1)return{performanceTier:k,name:E[0],description:E[1]};const j=k.split(" for ");return j.length>1?{performanceTier:k,name:j[0],description:"For "+j[1]}:{performanceTier:k,name:k,description:""}}),[n,l]),S=b.useMemo(()=>Object.keys(n).sort(),[n]);b.useEffect(function(){x?.length&&!x.find(E=>E.performanceTier===d)&&(r.setValue("performanceDescription",x[0].performanceTier),r.trigger())},[l,d,x,r]);const C=l==="Self-Hosted";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid grid-cols-3 gap-6 text-white md:grid-cols-6",children:[u.jsx($e,{control:r.control,name:"clusterName",render:({field:k})=>u.jsxs(Te,{className:"col-span-3 md:col-span-6",children:[u.jsx(Ne,{className:"pb-1",children:"Cluster Name"}),u.jsx(Oe,{children:u.jsx(ze,{autoFocus:!0,type:"text",maxLength:ab.shape.clusterName.maxLength,autoCapitalize:"words",disabled:!!t,...k})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"deploymentDescription",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Harper Deployment"}),u.jsx(b.Suspense,{fallback:u.jsx(Pr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...k,disabled:!!t,onValueChange:E=>{k.onChange(E),r.trigger()},children:[u.jsx(Yi,{className:"w-full h-auto",children:u.jsx(Zi,{placeholder:"Choose Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:S.map(E=>u.jsxs(Ot,{value:E,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:E}),xP[E]&&u.jsx("dd",{className:"font-light",children:xP[E]})]},E))})})]})})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"performanceDescription",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsxs(Ne,{className:"pb-1",children:[l.startsWith("Self")?"Support":"Performance"," & Usage"]}),u.jsx(b.Suspense,{fallback:u.jsx(Pr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...k,onValueChange:E=>{k.onChange(E),r.trigger()},disabled:!x?.length,children:[u.jsx(Yi,{className:"w-full h-auto",children:u.jsx(Zi,{placeholder:"Choose Tier"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:x.map(E=>u.jsxs(Ot,{value:E.performanceTier,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:E.name}),E.description&&u.jsx("dd",{className:"font-light",children:E.description})]},E.name))})})]})})}),u.jsx(Ae,{})]})}),C?u.jsx(u.Fragment,{children:u.jsx($e,{control:r.control,name:"fqdn",render:({field:k})=>u.jsxs(Te,{className:"md:col-span-6 col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Optional Cluster Load Balancer Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...k,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"example.your-company.com",disabled:!!t})}),u.jsx(Ae,{})]})})}):u.jsxs(u.Fragment,{children:[u.jsx($e,{control:r.control,name:"abbreviatedName",render:({field:k})=>u.jsxs(Te,{className:"col-span-3",children:[u.jsx(Ne,{className:"pb-1",children:"Host Name"}),u.jsx(Oe,{children:u.jsx(ze,{...k,type:"text",maxLength:ab.shape.abbreviatedName.unwrap().maxLength,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:e.suggestedAbbreviatedName,disabled:!!t})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{className:"col-span-3 ",children:[u.jsx(Ne,{className:"pb-1",children:"Full Host Name"}),u.jsx(Oe,{children:u.jsx("span",{children:e.fullHostName})}),u.jsx(Ae,{})]})]}),C?u.jsx(WSe,{form:r}):u.jsx(ZSe,{form:r,regionLocations:o,regionNameToLatencyToRegion:a,selectedPlan:f,totalPrice:m,isEnterprise:h})]}),u.jsx(Yn,{className:"mt-3 mb-12",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:i||t&&!v||!y,children:[m>0?"Confirm Payment Details":t?"Edit Cluster":"Create New Cluster",u.jsx(bi,{})]})})]})}function cq(e){const{fqdn:t}=e;let{secure:n,port:r}=e;return r||(r=Nd),r===443&&n==="false"&&(n="true"),r===80&&n==="true"&&(n="false"),`${n==="true"?"https":"http"}://${t}${r===443||r===80?"":":"+r}`.toLowerCase()}function uq(e,t,n){const r=e.find(o=>(n?!!o.priceUsd:!o.priceUsd)&&o.deploymentType==="colocated")||e.find(o=>o.deploymentType==="colocated")||e[0],i=r?.allowedRegionIds;if(r){const o=i?t.filter(l=>i.includes(l.id)):t,a=o.find(l=>l.region==="US")||o[0];if(a)return{deploymentDescription:r.deploymentDescription,performanceDescription:r.performanceDescription,regionPlans:[{regionName:a.region,latencyDescription:a.latencyDescription}]}}return null}function JSe(e,t,n){if(t&&n){const r=e.getValues();if(!r.deploymentDescription||!r.performanceDescription||!r.regionPlans.length){const i=uq(t,n);i&&(!r.deploymentDescription&&!r.performanceDescription&&(e.setValue("deploymentDescription",i.deploymentDescription),e.setValue("performanceDescription",i.performanceDescription)),r.regionPlans.length||e.setValue("regionPlans",i.regionPlans))}}}function QSe({price:e}){const n=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).formatToParts(e||0);return u.jsx("span",{className:"text-4xl",children:n.map((r,i)=>u.jsx(e_e,{type:r.type,value:r.value},i))})}function e_e({type:e,value:t}){switch(e){case"currency":case"decimal":case"fraction":return u.jsx("sup",{className:"font-light text-xl",children:t});default:return t}}function t_e({alreadyUsingFree:e,clusterId:t,defaultValues:n,deploymentToPerformanceToPlan:r,organization:i,organizationId:o,planTypes:a,regionLocationsColocated:l,regionLocationsDedicated:d,setSavedClusterState:f,startOffOnBilling:m}){const h=jn(),v=_n(),y=i?.type===Pm,x=ir(),{mutate:S,isPending:C}=uwe(),{mutate:k,isPending:E}=fwe(),[j,I]=b.useState(m),N=b.useMemo(()=>ik(l?.sort(rk("latencyDescription"))||[],"region","latencyDescription"),[l]),T=b.useMemo(()=>ik(d?.sort(rk("latencyDescription"))||[],"region","latencyDescription"),[d]),A=b.useCallback((le,Se)=>{const ke=new Set,Pe=r?.[le.deploymentDescription]?.[le.performanceDescription];if(le.deploymentDescription==="Self-Hosted")for(let ut=0;ut<le.instances.length;ut++){const Ze=cq(le.instances[ut]);ke.has(Ze)?Se.addIssue({code:"custom",path:[`instances.${ut}.fqdn`],message:"Every instance url must be unique!"}):ke.add(Ze)}else{Pe?.priceUsd===0&&e&&Se.addIssue({code:"custom",path:["performanceDescription"],message:"Only one free cluster is allowed per organization."});const ut=Pe?.deploymentDescription!=="Dedicated"?N:T;for(let Ze=0;Ze<le.regionPlans.length;Ze++){const Pt=le.regionPlans[Ze],dn=ut[Pt.regionName]?.[Pt.latencyDescription];ke.has(Pt.regionName)?Se.addIssue({code:"custom",path:[`regionPlans.${Ze}.regionName`],message:"You can only select a region once!"}):ke.add(Pt.regionName),Pe?.allowedRegionIds?.length&&dn?.id&&(Pe.allowedRegionIds.includes(dn.id)?Ze>=1&&Se.addIssue({code:"custom",path:[`regionPlans.${Ze}.regionName`],message:"You can only select one region with this performance tier!"}):pwe(Pe.allowedRegionIds,dn.id)?Se.addIssue({code:"custom",path:[`regionPlans.${Ze}.latencyDescription`],message:"This latency is not available with the selected performance tier!"}):Se.addIssue({code:"custom",path:[`regionPlans.${Ze}.regionName`],message:"This region is not available with the selected performance tier!"}))}}},[e,N,T,r]),D=cn({mode:"onChange",resolver:vn(ab.superRefine(A)),defaultValues:n}),[F,q]=b.useState(!0);b.useEffect(()=>{F&&n&&(f(null),q(!1))},[n,F,f]);const ee=D.watch("clusterName"),G=D.watch("abbreviatedName"),K=D.watch("deploymentDescription"),V=D.watch("performanceDescription"),H=D.watch("regionPlans"),z=D.watch("instances"),W=K!=="Dedicated"?N:T,L=K!=="Dedicated"?l:d;b.useEffect(function(){const Se=D.getValues(),ke=K==="Self-Hosted";K&&(ke?(Se.abbreviatedName&&D.setValue("abbreviatedName",""),Se.regionPlans.length&&D.setValue("regionPlans",[]),Se.instances.length||D.setValue("instances",[{secure:"true",fqdn:"",port:Nd}])):(Se.fqdn&&D.setValue("fqdn",""),Se.instances.length&&D.setValue("instances",[]),Se.regionPlans.length||JSe(D,a,L)))},[D,a,L,K]);const ne=b.useMemo(()=>{const le=S9(k0(ee),ab.shape.abbreviatedName.unwrap().maxLength);return{suggestedAbbreviatedName:le,fullHostName:`${G||le}.${i.subdomain||"your-org"}.harperfabric.com`}},[ee,G,i]),$=b.useMemo(()=>r?.[K]?.[V],[r,K,V]);b.useEffect(function(){const Se=$?.allowedRegionIds;if(Se?.length&&H?.length===1){const ke=H[0],Pe=W?.[ke.regionName]?.[ke.latencyDescription];if(!Se.includes(Pe?.id)){const Fe=L?.filter(Ze=>Se.includes(Ze.id)),ut=Fe?.find(Ze=>Ze.region==="US")||Fe?.[0];ut&&(D.setValue("regionPlans.0.regionName",ut.region),D.setValue("regionPlans.0.latencyDescription",ut.latencyDescription),D.trigger())}}},[$,H,D,W,L]),b.useEffect(function(){if(!(K==="Self-Hosted")&&Object.keys(W).length&&H.length)for(let ke=0;ke<H.length;ke++){const Pe=H[ke];W[Pe.regionName]||D.setValue(`regionPlans.${ke}.regionName`,"")}},[D,W,K,H]);const P=$?.priceUsd?K==="Self-Hosted"?z.length*$.priceUsd:H.reduce((le,Se)=>{const ke=W?.[Se.regionName]?.[Se.latencyDescription];return le+(ke?$.priceUsd*ke.instanceCount/2:0)},0):0,U=b.useCallback(({creating:le,deploymentDescription:Se})=>we.message(le?"Creating Cluster":"Updating Cluster",{description:u.jsx(lwe,{message:"This may take a little bit, hold tight!",lateMessage:"Still working on it... why don't you grab a coffee, and I'll let you know when it's done?",duration:Se==="Dedicated"?6e4:5e3}),duration:12e4}),[]),O=b.useCallback(async({clusterId:le,sourceClusterId:Se,creating:ke,toastId:Pe,isSelfManaged:Fe})=>{if(Se){const Ze=(await w9(o)).clusters?.find(Pt=>Pt.id===Se);Oh(Ze?.status)&&await y9(Se)}x.invalidateQueries({queryKey:[o],refetchType:"active"}),ke||x.invalidateQueries({queryKey:[le],refetchType:"active"}),v.invalidate(),h(Fe?{to:`/${o}/${le}/instances`}:ke?{to:`/${o}/${le}/starting-up`}:{to:`/${o}/${le}/scaling`}),D.reset(),we.success(ke?"Cluster Created":"Cluster Updated",{id:Pe,description:Fe?void 0:ke?"It is being provisioned now.":"The updates are being provisioned now.",duration:5e3})},[x,v,h,o,D]),X=b.useCallback(async()=>{const le=D.getValues(),Se=[],ke=r[le.deploymentDescription][le.performanceDescription],Pe=le.deploymentDescription==="Self-Hosted";if(Pe)for(const Ze of le.instances)Se.push({autoRenew:!0,instanceFqdn:Ze.fqdn,operationsApiPort:Ze.port||Nd,operationsApiSecure:Ze.secure==="true",planId:ke.id});else for(const Ze of le.regionPlans){const Pt=W[Ze.regionName][Ze.latencyDescription];Se.push({autoRenew:!0,planId:ke.id,regionId:Pt.id})}f(null);const Fe=U({creating:!t,deploymentDescription:le.deploymentDescription}),ut=()=>we.dismiss(Fe);t?k({id:t,regionPlans:Se},{onSuccess:Ze=>O({clusterId:Ze.id,sourceClusterId:le.sourceClusterId,isSelfManaged:Pe,creating:!1,toastId:Fe}),onError:ut}):S({abbreviatedName:Pe?void 0:le.abbreviatedName||ne.suggestedAbbreviatedName,autoRenew:!0,fqdn:Pe&&le.fqdn||void 0,name:le.clusterName,organizationId:o,regionPlans:Se},{onSuccess:Ze=>O({clusterId:Ze.id,sourceClusterId:le.sourceClusterId,isSelfManaged:Pe,creating:!0,toastId:Fe}),onError:ut})},[ne.suggestedAbbreviatedName,t,r,D,O,U,o,W,f,k,S]),pe=b.useCallback(()=>{if(P>0){I(!0);return}return X()},[X,P]),ve=b.useCallback(le=>{f(le?{clusterId:t,...D.getValues(),skipToBilling:!0}:null)},[t,D,f]),Q=b.useCallback(()=>{I(!1)},[]);return u.jsxs(u.Fragment,{children:[!y&&u.jsxs("div",{className:"absolute top-3 right-12 text-right",children:[u.jsx("dt",{className:"font-light",children:"Total Price"}),u.jsx("dd",{className:"font-bold",children:u.jsx(QSe,{price:P})})]}),u.jsx(un,{...D,children:j?u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Billing"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:"Please confirm the following billing details:"}),u.jsx(oSe,{clusterId:t,isPending:C||E,onGoBackToDetails:Q,onSaveStateForBillingRedirect:ve,onSubmit:X,organizationId:o,selectedPlan:$})]}):u.jsxs(u.Fragment,{children:[u.jsx("h1",{className:"text-lg leading-none text-white font-semibold mb-4",children:"Cluster Configuration"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Configure your Harper cluster and define deployment plans."}),u.jsx("form",{onSubmit:D.handleSubmit(pe),children:u.jsx(XSe,{calculatedNames:ne,clusterId:t,deploymentToPerformanceToPlan:r,form:D,isPending:C||E,regionLocations:L,regionNameToLatencyToRegion:W,selectedDeployment:K,selectedPerformance:V,selectedPlan:$,totalPrice:P,isEnterprise:y})})]})})]})}function wP(e){return e?.clusterName!==void 0}function jR(){const{organizationId:e,clusterId:t}=rt({strict:!1}),{create:n,update:r}=sx(e),{organization:i,cluster:o}=Zm({strict:!1}),[a,l]=jf(su.SavedClusterState,null),{data:d}=Mt(owe(e)),{data:f}=Mt(aP({availableHosts:!0,organizationId:e})),{data:m}=Mt(aP({organizationId:e})),h=b.useMemo(()=>{for(const S of i?.clusters??[])if(S.id!==o?.id&&d&&!sR(S.status)&&!Oh(S.status)&&S.plans)for(const C of S.plans){const k=d.find(E=>E.id===C.planId);if(k?.priceUsd===0&&!k.id.startsWith("self-hosted"))return!0}return!1},[o?.id,i?.clusters,d]),v=b.useMemo(()=>ik(d?.sort(rk("priceUsd"))||[],"deploymentDescription","performanceDescription"),[d]),y=b.useMemo(()=>{if(!d||!f||!m||t&&!o)return null;let S=o;if(a){if(wP(a))return{...a,clusterName:a.clusterName||"",abbreviatedName:a.abbreviatedName||"",deploymentDescription:a.deploymentDescription||"",performanceDescription:a.performanceDescription||"",fqdn:a.fqdn||"",regionPlans:a.regionPlans||[],instances:a.instances||[]};S=a}const C=d?.find(T=>T.id===o?.plans?.[0].planId),k=[],E=[],j=C?.deploymentDescription!=="Dedicated"?f:m,I=uq(d,j,h);let N=!1;if(S){if(S.plans){for(const T of S.plans)if(T.regionId){const A=j.find(D=>D.id===T.regionId);A&&k.push({regionName:A.region,latencyDescription:A.latencyDescription})}}if(!k.length&&S.instances){const T=S.instances.filter(A=>A.status&&!uj.includes(A.status)).sort(x9);for(const A of T)N=!0,E.push({fqdn:A.instanceFqdn,port:A.operationsApiPort,secure:A.operationsApiSecure?"true":"false"})}}else I&&k.push(...I.regionPlans);return!N&&!k.length&&k.push({regionName:"",latencyDescription:""}),{sourceClusterId:S?.id,autoRenew:S?.plans?.[0]?.autoRenew??!0,clusterName:S?.name??"",abbreviatedName:S?.abbreviatedName??"",deploymentDescription:C?.deploymentDescription??I?.deploymentDescription??"",performanceDescription:C?.performanceDescription??I?.performanceDescription??"",fqdn:N?S?.fqdn??"":"",instances:E,regionPlans:k}},[h,o,t,d,f,m,a]);return!y||!i||!d||!f||!m?u.jsx(Ov,{children:u.jsx(no,{centered:!0,text:"Loading..."})}):(o?.id?!r:!n)?u.jsx(Ov,{children:u.jsx(Ry,{title:"Not Allowed",error:{message:u.jsxs(u.Fragment,{children:["You do not have permission to ",o?.id?"update":"create"," clusters in this org."]})}})}):d.length===0?u.jsx(Ov,{children:u.jsx(Ry,{title:`Cluster ${t?"Modification":"Creation"} Not Currently Allowed`,error:{message:u.jsxs(u.Fragment,{children:["There are no available deployment types right now! Please try again later, or ",u.jsx(kl,{}),"."]})}})}):u.jsx(Ov,{children:u.jsx(t_e,{alreadyUsingFree:h,clusterId:t,defaultValues:y,deploymentToPerformanceToPlan:v,organization:i,organizationId:e,planTypes:d,regionLocationsColocated:f,regionLocationsDedicated:m,setSavedClusterState:l,startOffOnBilling:wP(a)&&a.skipToBilling===!0})})}const fk={FAILED:0,UPDATING:1,PROVISIONING:2,RUNNING:3,TERMINATED:4},Pv=fk.RUNNING;function n_e(e,t){if(e.status===t.status)return e.name.localeCompare(t.name);const n=e.status?fk[e.status]??Pv:Pv,r=t.status?fk[t.status]??Pv:Pv;return n-r}function dq(e,t){const n=t.toLowerCase();return r=>{for(const i of e){const o=r[i];if(o!=null)if(typeof o=="string"){if(o.toLowerCase().includes(n))return!0}else if(typeof o=="boolean"){if(o&&(n==="yes"||n==="true"||n==="1")||!o&&(n==="no"||n==="false"||n==="0"))return!0}else throw new Error("curryFilterByFuzzySearch has not implemented support for "+typeof o+" fields yet!")}return!1}}function r_e(){const{organizationId:e}=rt({strict:!1}),{create:t}=sx(e),{data:n,isSuccess:r}=Ji(lu(e)),[i]=jf(su.SavedClusterState,null),[o,a]=b.useState(""),l=b.useCallback(()=>a(""),[]),d=b.useCallback(h=>{a(h.currentTarget.value?.toLowerCase()||"")},[]),f=b.useMemo(()=>n?.clusters?.slice().filter(h=>!sR(h.status)).sort(n_e)||[],[n?.clusters]),m=b.useMemo(()=>f.filter(dq(["id","name"],o))||[],[o,f]);return n&&f.length===0&&t?u.jsx(jR,{}):i?u.jsx(jc,{to:`/${e}/new-cluster`}):u.jsxs(u.Fragment,{children:[u.jsx(vs,{children:r?u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:o,onChange:d}),t&&u.jsx(Ye,{to:"new-cluster",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Jr,{})," ",u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Cluster"})]})]})})]}):null}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 mb-4",children:[m.map(h=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(rwe,{cluster:h})},h.id)),!m.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:l,children:"Clear Filters"})]})]})})]})}function fq(){const e=URL.parse(location.href);return e?.hash?e.hash.startsWith("#/")?e.hash.slice(1):e.hash:"/"}function pq(){return"/#"+fq()}function i_e(){const{organizationId:e}=rt({strict:!1}),t=jn(),r=new URLSearchParams(window.location.search).get("setup_intent_client_secret"),{setup_intent_client_secret:i}=Rr({strict:!1}),[o]=jf(su.SavedClusterState,null),a=r||i,l=j9(),d=_9(e),f=b.useCallback(()=>{const m=o?o.clusterId?`../../${o.clusterId}/edit`:"../../new-cluster":"../";window.history.replaceState(null,"",pq()),t({search:void 0,to:m})},[t,o]);return b.useEffect(()=>{!l||!a||!d||!e||!f||(async function(){try{const{setupIntent:m}=await l.retrieveSetupIntent(a);switch(m?.status){case"succeeded":m.payment_method!==null?d(m.payment_method,f):(we.error("Failed to process payment method details. Please try another payment method."),f());break;case"processing":we.warning("Processing payment method. Please check back later."),f();break;case"requires_payment_method":we.error("Failed to process payment method details. Please try another payment method."),f();break;default:we.error("Failed to process payment method details. Please try another payment method."),f();break}}catch(m){console.error(m),we.error("Failed to process payment method details. Please try another payment method."),f()}})()},[a,f,e,d,l]),u.jsx(no,{centered:!0})}function o_e(){return u.jsx(R9,{children:u.jsx(i_e,{})})}function ur({clusterId:e,instanceId:t,organizationId:n},r){return"/"+[n,e,t&&"instance",t,r].filter(Jo).join("/")}const sm="flex items-center p-2 rounded-lg group",sb={className:"text-white hover:bg-gray-700"},lb={className:"text-black bg-white pointer-events-none cursor-default"};function a_e(){const{organizationId:e}=rt({strict:!1}),{update:t}=ax(e);return t?u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))] mb-12",children:[u.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[u.jsx(s_e,{}),u.jsx(l_e,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:u.jsx(jl,{})})]})})]}):u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:"You don't have access to manage payments for this organization. Please contact your administrator."})}function s_e(){const e=rt({strict:!1});return u.jsxs("div",{className:"hidden md:block",children:[u.jsxs("span",{className:sm,children:[u.jsx(sne,{className:"inline-block"}),u.jsx("h3",{className:"ms-3 text-2xl font-extrabold dark:text-white",children:"Billing"})]}),u.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"billing"),className:sm,activeOptions:{exact:!0},inactiveProps:sb,activeProps:lb,children:[u.jsx(O4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"billing/invoices"),className:sm,inactiveProps:sb,activeProps:lb,children:[u.jsx(F4,{className:"inline-block"}),u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})]})}function l_e(){const e=rt({strict:!1});return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"billing"),className:sm,activeOptions:{exact:!0},inactiveProps:sb,activeProps:lb,children:[u.jsx(O4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"billing/invoices"),className:sm,inactiveProps:sb,activeProps:lb,children:[u.jsx(F4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})}function R0(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function nl(e,t){return typeof e=="function"?e(t):e}function Xi(e,t){return n=>{t.setState(r=>({...r,[e]:nl(n,r[e])}))}}function T0(e){return e instanceof Function}function c_e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function u_e(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function ot(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(o);if(!(l.length!==r.length||l.some((m,h)=>r[h]!==m)))return i;r=l;let f;if(n.key&&n.debug&&(f=Date.now()),i=t(...l),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const m=Math.round((Date.now()-a)*100)/100,h=Math.round((Date.now()-f)*100)/100,v=h/16,y=(x,S)=>{for(x=String(x);x.length<S;)x=" "+x;return x};console.info(`%c⏱ ${y(h,5)} /${y(m,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return i}}function at(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function d_e(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:ot(()=>[e,n,t,o],(a,l,d,f)=>({table:a,column:l,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function f_e(e,t,n,r){var i,o;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let f=(i=(o=l.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof l.header=="string"?l.header:void 0,m;if(l.accessorFn?m=l.accessorFn:d&&(d.includes(".")?m=v=>{let y=v;for(const S of d.split(".")){var x;y=(x=y)==null?void 0:x[S]}return y}:m=v=>v[l.accessorKey]),!f)throw new Error;let h={id:`${String(f)}`,accessorFn:m,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:ot(()=>[!0],()=>{var v;return[h,...(v=h.columns)==null?void 0:v.flatMap(y=>y.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:ot(()=>[e._getOrderColumnsFn()],v=>{var y;if((y=h.columns)!=null&&y.length){let x=h.columns.flatMap(S=>S.getLeafColumns());return v(x)}return[h]},at(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(h,e);return h}const Nr="debugHeaders";function SP(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const p_e={createTable:e=>{e.getHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const l=(o=r?.map(h=>n.find(v=>v.id===h)).filter(Boolean))!=null?o:[],d=(a=i?.map(h=>n.find(v=>v.id===h)).filter(Boolean))!=null?a:[],f=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(i!=null&&i.includes(h.id)));return Mv(t,[...l,...f,...d],e)},at(e.options,Nr)),e.getCenterHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Mv(t,n,e,"center")),at(e.options,Nr)),e.getLeftHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?i:[];return Mv(t,o,e,"left")},at(e.options,Nr)),e.getRightHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?i:[];return Mv(t,o,e,"right")},at(e.options,Nr)),e.getFooterGroups=ot(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getLeftFooterGroups=ot(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getCenterFooterGroups=ot(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getRightFooterGroups=ot(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getFlatHeaders=ot(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getLeftFlatHeaders=ot(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getCenterFlatHeaders=ot(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getRightFlatHeaders=ot(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getCenterLeafHeaders=ot(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getLeftLeafHeaders=ot(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getRightLeafHeaders=ot(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getLeafHeaders=ot(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,l,d,f;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(m=>m.getLeafHeaders()).flat()},at(e.options,Nr))}};function Mv(e,t,n,r){var i,o;let a=0;const l=function(v,y){y===void 0&&(y=1),a=Math.max(a,y),v.filter(x=>x.getIsVisible()).forEach(x=>{var S;(S=x.columns)!=null&&S.length&&l(x.columns,y+1)},0)};l(e);let d=[];const f=(v,y)=>{const x={depth:y,id:[r,`${y}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const k=[...S].reverse()[0],E=C.column.depth===x.depth;let j,I=!1;if(E&&C.column.parent?j=C.column.parent:(j=C.column,I=!0),k&&k?.column===j)k.subHeaders.push(C);else{const N=SP(n,j,{id:[r,y,j.id,C?.id].filter(Boolean).join("_"),isPlaceholder:I,placeholderId:I?`${S.filter(T=>T.column===j).length}`:void 0,depth:y,index:S.length});N.subHeaders.push(C),S.push(N)}x.headers.push(C),C.headerGroup=x}),d.push(x),y>0&&f(S,y-1)},m=t.map((v,y)=>SP(n,v,{depth:a,index:y}));f(m,a-1),d.reverse();const h=v=>v.filter(x=>x.column.getIsVisible()).map(x=>{let S=0,C=0,k=[0];x.subHeaders&&x.subHeaders.length?(k=[],h(x.subHeaders).forEach(j=>{let{colSpan:I,rowSpan:N}=j;S+=I,k.push(N)})):S=1;const E=Math.min(...k);return C=C+E,x.colSpan=S,x.rowSpan=C,{colSpan:S,rowSpan:C}});return h((i=(o=d[0])==null?void 0:o.headers)!=null?i:[]),d}const m_e=(e,t,n,r,i,o,a)=>{let l={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return l._valuesCache[d]=f.accessorFn(l.original,r),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=f.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=l.getValue(d))!=null?f:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>u_e(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],f=l;for(;;){const m=f.getParentRow();if(!m)break;d.push(m),f=m}return d.reverse()},getAllCells:ot(()=>[e.getAllLeafColumns()],d=>d.map(f=>d_e(e,l,f,f.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:ot(()=>[l.getAllCells()],d=>d.reduce((f,m)=>(f[m.column.id]=m,f),{}),at(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const f=e._features[d];f==null||f.createRow==null||f.createRow(l,e)}return l},h_e={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},mq=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};mq.autoRemove=e=>Bo(e);const hq=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};hq.autoRemove=e=>Bo(e);const gq=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};gq.autoRemove=e=>Bo(e);const vq=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};vq.autoRemove=e=>Bo(e);const yq=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});yq.autoRemove=e=>Bo(e)||!(e!=null&&e.length);const bq=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});bq.autoRemove=e=>Bo(e)||!(e!=null&&e.length);const xq=(e,t,n)=>e.getValue(t)===n;xq.autoRemove=e=>Bo(e);const wq=(e,t,n)=>e.getValue(t)==n;wq.autoRemove=e=>Bo(e);const IR=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};IR.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const l=o;o=a,a=l}return[o,a]};IR.autoRemove=e=>Bo(e)||Bo(e[0])&&Bo(e[1]);const Wa={includesString:mq,includesStringSensitive:hq,equalsString:gq,arrIncludes:vq,arrIncludesAll:yq,arrIncludesSome:bq,equals:xq,weakEquals:wq,inNumberRange:IR};function Bo(e){return e==null||e===""}const g_e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xi("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Wa.includesString:typeof r=="number"?Wa.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wa.equals:Array.isArray(r)?Wa.arrIncludes:Wa.weakEquals},e.getFilterFn=()=>{var n,r;return T0(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Wa[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(m=>m.id===e.id),a=nl(n,o?o.value:void 0);if(_P(i,a,e)){var l;return(l=r?.filter(m=>m.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(o){var f;return(f=r?.map(m=>m.id===e.id?d:m))!=null?f:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=nl(t,i))==null?void 0:o.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(_P(d,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function _P(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const v_e=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),y_e=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},b_e=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},x_e=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},w_e=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},S_e=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!c_e(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},__e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),C_e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,k_e=(e,t)=>t.length,g1={sum:v_e,min:y_e,max:b_e,extent:x_e,mean:w_e,median:S_e,unique:__e,uniqueCount:C_e,count:k_e},E_e={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Xi("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return g1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return g1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return T0(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:g1[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function j_e(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const I_e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ot(n=>[lm(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=lm(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=lm(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ot(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],l=[...i];for(;l.length&&a.length;){const d=a.shift(),f=l.findIndex(m=>m.id===d);f>-1&&o.push(l.splice(f,1)[0])}o=[...o,...l]}return j_e(o,n,r)},at(e.options,"debugTable"))}},v1=()=>({left:[],right:[]}),R_e={getInitialState:e=>({columnPinning:v1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xi("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var l,d;return{left:((l=i?.left)!=null?l:[]).filter(h=>!(r!=null&&r.includes(h))),right:[...((d=i?.right)!=null?d:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var f,m;return{left:[...((f=i?.left)!=null?f:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((m=i?.right)!=null?m:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((o=i?.left)!=null?o:[]).filter(h=>!(r!=null&&r.includes(h))),right:((a=i?.right)!=null?a:[]).filter(h=>!(r!=null&&r.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(l=>r?.includes(l)),a=n.some(l=>i?.includes(l));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),at(t.options,"debugRows")),e.getRightVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),at(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?v1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:v1())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},at(e.options,"debugColumns"))}};function T_e(e){return e||(typeof document<"u"?document:null)}const zv={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},y1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),N_e={getDefaultColumnDef:()=>zv,getInitialState:e=>({columnSizing:{},columnSizingInfo:y1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xi("columnSizing",e),onColumnSizingInfoChange:Xi("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:zv.minSize,(r=o??e.columnDef.size)!=null?r:zv.size),(i=e.columnDef.maxSize)!=null?i:zv.maxSize)},e.getStart=ot(n=>[n,lm(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),at(t.options,"debugColumns")),e.getAfter=ot(n=>[n,lm(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),at(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),b1(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[r.id,r.getSize()]],d=b1(o)?Math.round(o.touches[0].clientX):o.clientX,f={},m=(k,E)=>{typeof E=="number"&&(t.setColumnSizingInfo(j=>{var I,N;const T=t.options.columnResizeDirection==="rtl"?-1:1,A=(E-((I=j?.startOffset)!=null?I:0))*T,D=Math.max(A/((N=j?.startSize)!=null?N:0),-.999999);return j.columnSizingStart.forEach(F=>{let[q,ee]=F;f[q]=Math.round(Math.max(ee+ee*D,0)*100)/100}),{...j,deltaOffset:A,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(j=>({...j,...f})))},h=k=>m("move",k),v=k=>{m("end",k),t.setColumnSizingInfo(E=>({...E,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},y=T_e(n),x={moveHandler:k=>h(k.clientX),upHandler:k=>{y?.removeEventListener("mousemove",x.moveHandler),y?.removeEventListener("mouseup",x.upHandler),v(k.clientX)}},S={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),h(k.touches[0].clientX),!1),upHandler:k=>{var E;y?.removeEventListener("touchmove",S.moveHandler),y?.removeEventListener("touchend",S.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),v((E=k.touches[0])==null?void 0:E.clientX)}},C=A_e()?{passive:!1}:!1;b1(o)?(y?.addEventListener("touchmove",S.moveHandler,C),y?.addEventListener("touchend",S.upHandler,C)):(y?.addEventListener("mousemove",x.moveHandler,C),y?.addEventListener("mouseup",x.upHandler,C)),t.setColumnSizingInfo(k=>({...k,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?y1():(n=e.initialState.columnSizingInfo)!=null?n:y1())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Lv=null;function A_e(){if(typeof Lv=="boolean")return Lv;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Lv=e,Lv}function b1(e){return e.type==="touchstart"}const O_e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xi("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ot(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=ot(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ot(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),at(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function lm(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const $_e={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},D_e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xi("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wa.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return T0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wa[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},P_e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xi("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:l,...d}=a;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},pk=0,mk=10,x1=()=>({pageIndex:pk,pageSize:mk}),M_e={getInitialState:e=>({...e,pagination:{...x1(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xi("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>nl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?x1():(i=e.initialState.pagination)!=null?i:x1())},e.setPageIndex=r=>{e.setPagination(i=>{let o=nl(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?pk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:pk)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?mk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:mk)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,nl(r,i.pageSize)),a=i.pageSize*i.pageIndex,l=Math.floor(a/o);return{...i,pageIndex:l,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=nl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=ot(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},at(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},w1=()=>({top:[],bottom:[]}),z_e={getInitialState:e=>({rowPinning:w1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xi("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(d=>{let{id:f}=d;return f}):[],a=i?e.getParentRows().map(d=>{let{id:f}=d;return f}):[],l=new Set([...a,e.id,...o]);t.setRowPinning(d=>{var f,m;if(n==="bottom"){var h,v;return{top:((h=d?.top)!=null?h:[]).filter(S=>!(l!=null&&l.has(S))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(S=>!(l!=null&&l.has(S))),...Array.from(l)]}}if(n==="top"){var y,x;return{top:[...((y=d?.top)!=null?y:[]).filter(S=>!(l!=null&&l.has(S))),...Array.from(l)],bottom:((x=d?.bottom)!=null?x:[]).filter(S=>!(l!=null&&l.has(S)))}}return{top:((f=d?.top)!=null?f:[]).filter(S=>!(l!=null&&l.has(S))),bottom:((m=d?.bottom)!=null?m:[]).filter(S=>!(l!=null&&l.has(S)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(l=>r?.includes(l)),a=n.some(l=>i?.includes(l));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?w1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:w1())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},at(e.options,"debugRows"))}},L_e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xi("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{hk(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?S1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const l={...o};return hk(l,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return RR(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return gk(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return gk(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},hk=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>hk(e,l.id,n,r,i))};function S1(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,l){return a.map(d=>{var f;const m=RR(d,n);if(m&&(r.push(d),i[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:o(d.subRows)}),m)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function RR(e,t){var n;return(n=t[e.id])!=null?n:!1}function gk(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(RR(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const l=gk(a,t);l==="all"?o=!0:(l==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const vk=/([0-9]+)/gm,F_e=(e,t,n)=>Sq(El(e.getValue(n)).toLowerCase(),El(t.getValue(n)).toLowerCase()),U_e=(e,t,n)=>Sq(El(e.getValue(n)),El(t.getValue(n))),V_e=(e,t,n)=>TR(El(e.getValue(n)).toLowerCase(),El(t.getValue(n)).toLowerCase()),B_e=(e,t,n)=>TR(El(e.getValue(n)),El(t.getValue(n))),H_e=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},q_e=(e,t,n)=>TR(e.getValue(n),t.getValue(n));function TR(e,t){return e===t?0:e>t?1:-1}function El(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Sq(e,t){const n=e.split(vk).filter(Boolean),r=t.split(vk).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),l=parseInt(o,10),d=[a,l].sort();if(isNaN(d[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-r.length}const Vp={alphanumeric:F_e,alphanumericCaseSensitive:U_e,text:V_e,textCaseSensitive:B_e,datetime:H_e,basic:q_e},K_e={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xi("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Vp.datetime;if(typeof o=="string"&&(r=!0,o.split(vk).length>1))return Vp.alphanumeric}return r?Vp.text:Vp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return T0(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Vp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(y=>y.id===e.id),d=a?.findIndex(y=>y.id===e.id);let f=[],m,h=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?l?m="toggle":m="add":a!=null&&a.length&&d!==a.length-1?m="replace":l?m="toggle":m="replace",m==="toggle"&&(o||i||(m="remove")),m==="add"){var v;f=[...a,{id:e.id,desc:h}],f.splice(0,f.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else m==="toggle"?f=a.map(y=>y.id===e.id?{...y,desc:h}:y):m==="remove"?f=a.filter(y=>y.id!==e.id):f=[{id:e.id,desc:h}];return f})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},G_e=[p_e,O_e,I_e,R_e,h_e,g_e,$_e,D_e,K_e,E_e,P_e,M_e,z_e,L_e,N_e];function Z_e(e){var t,n;const r=[...G_e,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((v,y)=>Object.assign(v,y.getDefaultOptions==null?void 0:y.getDefaultOptions(i)),{}),a=v=>i.options.mergeOptions?i.options.mergeOptions(o,v):{...o,...v};let d={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(v=>{var y;d=(y=v.getInitialState==null?void 0:v.getInitialState(d))!=null?y:d});const f=[];let m=!1;const h={_features:r,options:{...o,...e},initialState:d,_queue:v=>{f.push(v),m||(m=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();m=!1}).catch(y=>setTimeout(()=>{throw y})))},reset:()=>{i.setState(i.initialState)},setOptions:v=>{const y=nl(v,i.options);i.options=a(y)},getState:()=>i.options.state,setState:v=>{i.options.onStateChange==null||i.options.onStateChange(v)},_getRowId:(v,y,x)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(v,y,x))!=null?S:`${x?[x.id,y].join("."):y}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(v,y)=>{let x=(y?i.getPrePaginationRowModel():i.getRowModel()).rowsById[v];if(!x&&(x=i.getCoreRowModel().rowsById[v],!x))throw new Error;return x},_getDefaultColumnDef:ot(()=>[i.options.defaultColumn],v=>{var y;return v=(y=v)!=null?y:{},{header:x=>{const S=x.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:x=>{var S,C;return(S=(C=x.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...i._features.reduce((x,S)=>Object.assign(x,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},at(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:ot(()=>[i._getColumnDefs()],v=>{const y=function(x,S,C){return C===void 0&&(C=0),x.map(k=>{const E=f_e(i,k,C,S),j=k;return E.columns=j.columns?y(j.columns,E,C+1):[],E})};return y(v)},at(e,"debugColumns")),getAllFlatColumns:ot(()=>[i.getAllColumns()],v=>v.flatMap(y=>y.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:ot(()=>[i.getAllFlatColumns()],v=>v.reduce((y,x)=>(y[x.id]=x,y),{}),at(e,"debugColumns")),getAllLeafColumns:ot(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(v,y)=>{let x=v.flatMap(S=>S.getLeafColumns());return y(x)},at(e,"debugColumns")),getColumn:v=>i._getAllFlatColumnsById()[v]};Object.assign(i,h);for(let v=0;v<i._features.length;v++){const y=i._features[v];y==null||y.createTable==null||y.createTable(i)}return i}function N0(){return e=>ot(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const l=[];for(let f=0;f<i.length;f++){const m=m_e(e,e._getRowId(i[f],f,a),i[f],f,o,void 0,a?.id);if(n.flatRows.push(m),n.rowsById[m.id]=m,l.push(m),e.options.getSubRows){var d;m.originalSubRows=e.options.getSubRows(i[f],f),(d=m.originalSubRows)!=null&&d.length&&(m.subRows=r(m.originalSubRows,o+1,m))}}return l};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Y_e(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function W_e(e){return t=>ot(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:l,rowsById:d}=r;const f=i*o,m=f+i;a=a.slice(f,m);let h;t.options.paginateExpandedRows?h={rows:a,flatRows:l,rowsById:d}:h=Y_e({rows:a,flatRows:l,rowsById:d}),h.flatRows=[];const v=y=>{h.flatRows.push(y),y.subRows.length&&y.subRows.forEach(v)};return h.rows.forEach(v),h},at(t.options,"debugTable"))}function X_e(){return e=>ot(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(d=>{var f;return(f=e.getColumn(d.id))==null?void 0:f.getCanSort()}),a={};o.forEach(d=>{const f=e.getColumn(d.id);f&&(a[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const l=d=>{const f=d.map(m=>({...m}));return f.sort((m,h)=>{for(let y=0;y<o.length;y+=1){var v;const x=o[y],S=a[x.id],C=S.sortUndefined,k=(v=x?.desc)!=null?v:!1;let E=0;if(C){const j=m.getValue(x.id),I=h.getValue(x.id),N=j===void 0,T=I===void 0;if(N||T){if(C==="first")return N?-1:1;if(C==="last")return N?1:-1;E=N&&T?0:N?C:-C}}if(E===0&&(E=S.sortingFn(m,h,x.id)),E!==0)return k&&(E*=-1),S.invertSorting&&(E*=-1),E}return m.index-h.index}),f.forEach(m=>{var h;i.push(m),(h=m.subRows)!=null&&h.length&&(m.subRows=l(m.subRows))}),f};return{rows:l(n.rows),flatRows:i,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Hc(e,t){return e?J_e(e)?b.createElement(e,t):e:null}function J_e(e){return Q_e(e)||typeof e=="function"||e1e(e)}function Q_e(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function e1e(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function A0(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=b.useState(()=>({current:Z_e(t)})),[r,i]=b.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function O0({className:e,containerClassName:t,...n}){return u.jsx("div",{"data-slot":"table-container",className:Ue("relative w-full overflow-x-auto",t),children:u.jsx("table",{"data-slot":"table",className:Ue("w-full caption-bottom text-sm",e),...n})})}function Uh({className:e,...t}){return u.jsx("thead",{"data-slot":"table-header",className:Ue("[&_tr]:border-b",e),...t})}function $0({className:e,...t}){return u.jsx("tbody",{"data-slot":"table-body",className:Ue("[&_tr:last-child]:border-0",e),...t})}function Hi({className:e,...t}){return u.jsx("tr",{"data-slot":"table-row",className:Ue("border-b border-grey-700 transition-colors",e),...t})}function NR({className:e,...t}){return u.jsx("th",{"data-slot":"table-head",className:Ue("h-10 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function _q({header:e,onColumnClick:t,...n}){const r=b.useCallback(()=>{e.column.toggleSorting(e.column.getIsSorted()==="asc");const d=e.column.getIsSorted()===!1||e.column.getIsSorted()!=="asc";t?.(e.column.columnDef.accessorKey,d)},[e,t]),i=e.column.columnDef.enableSorting,o=e.column.columnDef.enableResizing,a=e.isPlaceholder?null:Hc(e.column.columnDef.header,e.getContext()),l=b.useCallback(()=>{e.column.resetSize()},[e]);return u.jsx(NR,{...n,style:{width:`${e.getSize()}px`},className:i?"px-0":"px-2",children:u.jsxs("div",{className:"flex items-center justify-between",children:[i?u.jsxs(be,{type:"button",variant:"ghost",className:Ue("rounded-none",!e.column.getIsSorted()||e.column.getIsSorted()==="asc"?"cursor-n-resize":"cursor-s-resize"),onClick:r,children:[a,e.column.getIsSorted()==="asc"?u.jsx(Lee,{}):e.column.getIsSorted()==="desc"?u.jsx(Mb,{}):u.jsx(Mee,{className:"text-gray-600"})]}):a,o&&u.jsx(be,{type:"button",variant:"ghost",className:"cursor-col-resize",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),onDoubleClick:l,style:{transform:e.column.getIsResizing()?`translateX(${e.getContext().table.getState().columnSizingInfo.deltaOffset}px)`:""},children:u.jsx(Ote,{})})]})})}function fs({className:e,...t}){return u.jsx("td",{"data-slot":"table-cell",className:Ue("align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Tf({columns:e,data:t,isFetching:n,onRowClick:r,onColumnClick:i,sortingState:o,children:a}){const l=A0({data:t,columns:e,getCoreRowModel:N0(),getSortedRowModel:X_e(),initialState:{sorting:o}});return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-end space-x-2 pb-4",children:[u.jsx("div",{className:"grow lg:hidden"}),a,u.jsx("div",{className:"grow hidden lg:visible"})]}),u.jsxs(O0,{containerClassName:"rounded-md bg-black-dark",children:[u.jsx(Uh,{children:l.getHeaderGroups().map(d=>u.jsx(Hi,{className:"border-none",children:d.headers.map(f=>u.jsx(_q,{header:f,onColumnClick:i},f.id))},d.id))}),u.jsx($0,{className:"bg-black border border-grey-700",children:l.getRowModel().rows?.length?l.getRowModel().rows.map(d=>u.jsx(Hi,{"data-state":d.getIsSelected()&&"selected",onClick:()=>r?.(d),className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted",r&&"cursor-pointer"),children:d.getVisibleCells().map(f=>u.jsx(fs,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:Hc(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:n?u.jsx("div",{children:u.jsx(no,{className:"p-12"})}):u.jsx("span",{children:"No results."})})})})]})]})}function t1e(e){switch(e){case"paid":return"success";case"void":case"uncollectible":return"destructive";default:return"default"}}function _1(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e)}function Tc(e,t){if(e<45)return"a few seconds ago";if(e<120)return"a minute ago";const n=Math.floor(e/60);if(n<60)return`${n} minutes ago`;if(n<120)return"an hour ago";const r=Math.floor(e/3600);return r>48?new Date(t).toLocaleString():`${r} hours ago`}const n1e=[{header:"Invoice Id",accessorKey:"id",enableSorting:!1},{header:"Status",accessorKey:"status",enableSorting:!1,cell:({cell:e})=>u.jsx(Yo,{variant:t1e(e.getValue()),children:e.getValue()})},{header:"Date",accessorKey:"periodStart",enableSorting:!1,cell:({cell:e})=>{const t=e.row.original.periodStart*1e3,n=e.row.original.periodEnd*1e3,r=(Date.now()-t)/1e3,i=(Date.now()-n)/1e3;return Math.abs(r-i)<1e3?Tc(r,t):[t?Tc(r,t):"-",n?Tc(i,n):"-"].join(" to ")}},{header:"Amount Due",accessorKey:"amountDue",enableSorting:!1,cell:({cell:e})=>_1(e.getValue()?e.getValue()/100:0)},{header:"Amount Paid",accessorKey:"amountPaid",enableSorting:!1,cell:({cell:e})=>_1(e.getValue()?e.getValue()/100:0)},{header:"Lines",accessorKey:"lines",enableSorting:!1,cell:({cell:e})=>{const t=e.getValue(),n=[];for(const r of t)n.push(`${r.quantity}x ${r.description} @ ${_1(r.amount/100)}`);return n.join(`
`)}}];function Ul(e){return b.useCallback(async()=>{const t=we.loading("Refreshing..."),n=Date.now();await e(),Date.now()-n<500&&await qc(500),we.dismiss(t),we.success("Refreshed!")},[e])}async function r1e(e){const{data:t}=await Gt.get(`/Invoice/${e}`);return t}function i1e(e,t){return{queryKey:[e,"invoices"],queryFn:()=>r1e(e),retry:!1,enabled:!!e,refetchInterval:void 0}}function o1e(){const{organizationId:e}=rt({strict:!1}),{data:t}=Mt(lu(e)),{data:n,refetch:r,isLoading:i,isFetching:o,isRefetching:a}=Mt(i1e(t?.type!==Pm&&t?.id)),l=Ul(r);return t?.type===Pm?u.jsxs("span",{children:["You are part of an enterprise organization! We don’t currently show your invoices on this page. Want to explore your solution with Harper more? ",u.jsx(kl,{}),", we would love to talk!"]}):i?u.jsx(no,{centered:!0}):!n||!n.length?u.jsxs("span",{children:["Your invoices will be shown here once one is available! Want to explore your solution with Harper more?"," ",u.jsx(kl,{overEmail:!0}),", we would love to talk!"]}):u.jsx(Tf,{data:n,columns:n1e,children:u.jsxs(be,{variant:"defaultOutline",onClick:l,accessKey:"r",disabled:o||a,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]})})}function a1e(e){const t=nt({getParentRoute:()=>e,path:"billing",component:a_e}),n=nt({getParentRoute:()=>t,path:"/",component:T9}),r=nt({getParentRoute:()=>t,path:"invoices",component:o1e}),i=nt({getParentRoute:()=>t,path:"confirm",component:o_e});return t.addChildren([n,r,i])}async function s1e(e){const{data:t}=await Gt.get(`/OrganizationRole/${e}`);return t}function D0(e){return{queryKey:[e,"roles"],queryFn:()=>s1e(e),retry:!1,refetchInterval:10*1e3}}const l1e=R0(),c1e=[{header:"Role Name",accessorKey:"roleName",enableSorting:!1},l1e.display({header:"Users Assigned",enableSorting:!1,id:"userIds",cell:e=>!e.row.original.userIds||e.row.original.userIds.length===0?"No users assigned":e.row.original.userIds.length})];async function u1e(e){const{data:t}=await Gt.post("/Role/",e);return t}function d1e(){return ct({mutationFn:u1e})}const Cq=$t({name:tt().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),update:Xt(),delete:Xt()});$t({roles:$t({create:Xt(),delete:Xt(),update:Xt(),view:Xt()}),clusters:$t({create:Xt(),delete:Xt(),update:Xt(),view:Xt(),resources:ds($t({id:tt(),delete:Xt(),update:Xt(),view:Xt(),instances:$t({create:Xt(),delete:Xt(),update:Xt(),view:Xt()})}))})});function f1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CP(Object(n),!0).forEach(function(r){f1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p1e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function m1e(e,t){if(e==null)return{};var n=p1e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h1e(e,t){return g1e(e)||v1e(e,t)||y1e(e,t)||b1e()}function g1e(e){if(Array.isArray(e))return e}function v1e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),l;!(r=(l=a.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(d){i=!0,o=d}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function y1e(e,t){if(e){if(typeof e=="string")return EP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EP(e,t)}}function EP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jP(Object(n),!0).forEach(function(r){x1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w1e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function em(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return t.apply(n,[].concat(i,l))}}}function cb(e){return{}.toString.call(e).includes("Object")}function S1e(e){return!Object.keys(e).length}function Mm(e){return typeof e=="function"}function _1e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C1e(e,t){return cb(t)||pl("changeType"),Object.keys(t).some(function(n){return!_1e(e,n)})&&pl("changeField"),t}function k1e(e){Mm(e)||pl("selectorType")}function E1e(e){Mm(e)||cb(e)||pl("handlerType"),cb(e)&&Object.values(e).some(function(t){return!Mm(t)})&&pl("handlersType")}function j1e(e){e||pl("initialIsRequired"),cb(e)||pl("initialType"),S1e(e)&&pl("initialContent")}function I1e(e,t){throw new Error(e[t]||e.default)}var R1e={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},pl=em(I1e)(R1e),Fv={changes:C1e,selector:k1e,handler:E1e,initial:j1e};function T1e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Fv.initial(e),Fv.handler(t);var n={current:e},r=em(O1e)(n,t),i=em(A1e)(n),o=em(Fv.changes)(e),a=em(N1e)(n);function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return Fv.selector(f),f(n.current)}function d(f){w1e(r,i,o,a)(f)}return[l,d]}function N1e(e,t){return Mm(t)?t(e.current):t}function A1e(e,t){return e.current=IP(IP({},e.current),t),t}function O1e(e,t,n){return Mm(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var $1e={create:T1e},D1e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function P1e(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var a=arguments.length,l=new Array(a),d=0;d<a;d++)l[d]=arguments[d];return t.apply(n,[].concat(i,l))}}}function M1e(e){return{}.toString.call(e).includes("Object")}function z1e(e){return e||RP("configIsRequired"),M1e(e)||RP("configType"),e.urls?(L1e(),{paths:{vs:e.urls.monacoBase}}):e}function L1e(){console.warn(kq.deprecation)}function F1e(e,t){throw new Error(e[t]||e.default)}var kq={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `},RP=P1e(F1e)(kq),U1e={config:z1e},V1e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,a){return a(o)},i)}};function Eq(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Eq(e[n],t[n]))}),kP(kP({},e),t)}var B1e={type:"cancelation",msg:"operation is manually canceled"};function C1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(B1e):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var H1e=$1e.create({config:D1e,isInitialized:!1,resolve:null,reject:null,monaco:null}),jq=h1e(H1e,2),Vh=jq[0],P0=jq[1];function q1e(e){var t=U1e.config(e),n=t.monaco,r=m1e(t,["monaco"]);P0(function(i){return{config:Eq(i.config,r),monaco:n}})}function K1e(){var e=Vh(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(P0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),C1(k1);if(window.monaco&&window.monaco.editor)return Iq(window.monaco),e.resolve(window.monaco),C1(k1);V1e(G1e,Y1e)(W1e)}return C1(k1)}function G1e(e){return document.body.appendChild(e)}function Z1e(e){var t=document.createElement("script");return e&&(t.src=e),t}function Y1e(e){var t=Vh(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Z1e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function W1e(){var e=Vh(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){Iq(n),e.resolve(n)},function(n){e.reject(n)})}function Iq(e){Vh().monaco||P0({monaco:e})}function X1e(){return Vh(function(e){var t=e.monaco;return t})}var k1=new Promise(function(e,t){return P0({resolve:e,reject:t})}),Rq={config:q1e,init:K1e,__getMonacoInstance:X1e},J1e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},E1=J1e,Q1e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},eCe=Q1e;function tCe({children:e}){return J.createElement("div",{style:eCe.container},e)}var nCe=tCe,rCe=nCe;function iCe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return J.createElement("section",{style:{...E1.wrapper,width:e,height:t},...a},!n&&J.createElement(rCe,null,r),J.createElement("div",{ref:i,style:{...E1.fullWidth,...!n&&E1.hide},className:o}))}var oCe=iCe,Tq=b.memo(oCe);function aCe(e){b.useEffect(e,[])}var Nq=aCe;function sCe(e,t,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var zi=sCe;function cm(){}function yd(e,t,n,r){return lCe(e,r)||cCe(e,t,n,r)}function lCe(e,t){return e.editor.getModel(Aq(e,t))}function cCe(e,t,n,r){return e.editor.createModel(t,n,r?Aq(e,r):void 0)}function Aq(e,t){return e.Uri.parse(t)}function uCe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:m="Loading...",options:h={},height:v="100%",width:y="100%",className:x,wrapperProps:S={},beforeMount:C=cm,onMount:k=cm}){let[E,j]=b.useState(!1),[I,N]=b.useState(!0),T=b.useRef(null),A=b.useRef(null),D=b.useRef(null),F=b.useRef(k),q=b.useRef(C),ee=b.useRef(!1);Nq(()=>{let H=Rq.init();return H.then(z=>(A.current=z)&&N(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>T.current?V():H.cancel()}),zi(()=>{if(T.current&&A.current){let H=T.current.getOriginalEditor(),z=yd(A.current,e||"",r||n||"text",o||"");z!==H.getModel()&&H.setModel(z)}},[o],E),zi(()=>{if(T.current&&A.current){let H=T.current.getModifiedEditor(),z=yd(A.current,t||"",i||n||"text",a||"");z!==H.getModel()&&H.setModel(z)}},[a],E),zi(()=>{let H=T.current.getModifiedEditor();H.getOption(A.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],E),zi(()=>{T.current?.getModel()?.original.setValue(e||"")},[e],E),zi(()=>{let{original:H,modified:z}=T.current.getModel();A.current.editor.setModelLanguage(H,r||n||"text"),A.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],E),zi(()=>{A.current?.editor.setTheme(f)},[f],E),zi(()=>{T.current?.updateOptions(h)},[h],E);let G=b.useCallback(()=>{if(!A.current)return;q.current(A.current);let H=yd(A.current,e||"",r||n||"text",o||""),z=yd(A.current,t||"",i||n||"text",a||"");T.current?.setModel({original:H,modified:z})},[n,t,i,e,r,o,a]),K=b.useCallback(()=>{!ee.current&&D.current&&(T.current=A.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...h}),G(),A.current?.editor.setTheme(f),j(!0),ee.current=!0)},[h,f,G]);b.useEffect(()=>{E&&F.current(T.current,A.current)},[E]),b.useEffect(()=>{!I&&!E&&K()},[I,E,K]);function V(){let H=T.current?.getModel();l||H?.original?.dispose(),d||H?.modified?.dispose(),T.current?.dispose()}return J.createElement(Tq,{width:y,height:v,isEditorReady:E,loading:m,_ref:D,className:x,wrapperProps:S})}var dCe=uCe;b.memo(dCe);function fCe(e){let t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}var pCe=fCe,Uv=new Map;function mCe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:l,loading:d="Loading...",options:f={},overrideServices:m={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:x="100%",className:S,wrapperProps:C={},beforeMount:k=cm,onMount:E=cm,onChange:j,onValidate:I=cm}){let[N,T]=b.useState(!1),[A,D]=b.useState(!0),F=b.useRef(null),q=b.useRef(null),ee=b.useRef(null),G=b.useRef(E),K=b.useRef(k),V=b.useRef(),H=b.useRef(r),z=pCe(o),W=b.useRef(!1),L=b.useRef(!1);Nq(()=>{let P=Rq.init();return P.then(U=>(F.current=U)&&D(!1)).catch(U=>U?.type!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>q.current?$():P.cancel()}),zi(()=>{let P=yd(F.current,e||r||"",t||i||"",o||n||"");P!==q.current?.getModel()&&(h&&Uv.set(z,q.current?.saveViewState()),q.current?.setModel(P),h&&q.current?.restoreViewState(Uv.get(o)))},[o],N),zi(()=>{q.current?.updateOptions(f)},[f],N),zi(()=>{!q.current||r===void 0||(q.current.getOption(F.current.editor.EditorOption.readOnly)?q.current.setValue(r):r!==q.current.getValue()&&(L.current=!0,q.current.executeEdits("",[{range:q.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),q.current.pushUndoStop(),L.current=!1))},[r],N),zi(()=>{let P=q.current?.getModel();P&&i&&F.current?.editor.setModelLanguage(P,i)},[i],N),zi(()=>{l!==void 0&&q.current?.revealLine(l)},[l],N),zi(()=>{F.current?.editor.setTheme(a)},[a],N);let ne=b.useCallback(()=>{if(!(!ee.current||!F.current)&&!W.current){K.current(F.current);let P=o||n,U=yd(F.current,r||e||"",t||i||"",P||"");q.current=F.current?.editor.create(ee.current,{model:U,automaticLayout:!0,...f},m),h&&q.current.restoreViewState(Uv.get(P)),F.current.editor.setTheme(a),l!==void 0&&q.current.revealLine(l),T(!0),W.current=!0}},[e,t,n,r,i,o,f,m,h,a,l]);b.useEffect(()=>{N&&G.current(q.current,F.current)},[N]),b.useEffect(()=>{!A&&!N&&ne()},[A,N,ne]),H.current=r,b.useEffect(()=>{N&&j&&(V.current?.dispose(),V.current=q.current?.onDidChangeModelContent(P=>{L.current||j(q.current.getValue(),P)}))},[N,j]),b.useEffect(()=>{if(N){let P=F.current.editor.onDidChangeMarkers(U=>{let O=q.current.getModel()?.uri;if(O&&U.find(X=>X.path===O.path)){let X=F.current.editor.getModelMarkers({resource:O});I?.(X)}});return()=>{P?.dispose()}}return()=>{}},[N,I]);function $(){V.current?.dispose(),v?h&&Uv.set(o,q.current.saveViewState()):q.current.getModel()?.dispose(),q.current.dispose()}return J.createElement(Tq,{width:y,height:x,isEditorReady:N,loading:d,_ref:ee,className:S,wrapperProps:C})}var hCe=mCe,Bh=b.memo(hCe),M0=Bh;const TP={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function gCe({isModalOpen:e,setIsModalOpen:t}){const n=ir(),{organizationId:r}=rt({strict:!1}),[i,o]=b.useState(!0),[a,l]=b.useState(JSON.stringify(TP,null,2)),{mutate:d,isPending:f}=d1e(),m=cn({resolver:vn(Cq),defaultValues:{name:"",update:!1,delete:!1}}),h=b.useCallback(y=>{o(y.length===0)},[o]),v=b.useCallback(async y=>{const x=Fh(a);if(!x)return;const S={...y,...x,organizationId:r};y&&i&&d(S,{onSuccess:()=>{we.success("Organization role added successfully!"),t(!1),n.invalidateQueries({queryKey:[r,"roles"],refetchType:"active"}),m.reset()},onError:C=>{we.error(`Failed to add organization role: ${C.message}`)}})},[i,a,d,m,n,t,r]);return u.jsx(Un,{onOpenChange:t,open:e,children:u.jsxs(Vn,{children:[u.jsx(Pn,{children:"Add New Organization Role"}),u.jsx(Ir,{children:"Set the new organization role permissions."}),u.jsx(un,{...m,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:m.handleSubmit(v),children:[u.jsx($e,{control:m.control,name:"name",render:({field:y})=>u.jsxs(Te,{className:"col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Role Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"",...y})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:m.control,name:"update",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:m.control,name:"delete",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Bh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&l(y)},defaultValue:JSON.stringify(TP,null,2)})}),u.jsx(Yn,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>t(!1),disabled:f,children:"Cancel"}),u.jsx(be,{variant:"submit",className:"rounded-full",disabled:f||!i||!m.formState.isValid,children:"Save Changes"})]})})]})})]})})}async function vCe({roleId:e}){const{data:t}=await Gt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function yCe(){return ct({mutationFn:({roleId:e})=>vCe({roleId:e})})}async function bCe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Gt.put(`/Role/${e}`,t);return n}function xCe(){return ct({mutationFn:({roleId:e,updatedRoleInfo:t})=>bCe({roleId:e,updatedRoleInfo:t})})}function wCe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>SCe(t),refetchInterval:10*1e3}}async function SCe(e){const{data:t}=await Gt.get(`/Role/${e}`);return t}function _Ce({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n}){return u.jsxs(u.Fragment,{children:[u.jsx(Pn,{children:"Confirm Role Deletion"}),u.jsx(Ir,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Yn,{children:[u.jsx(be,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(be,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]})}function CCe({data:e,isModalOpen:t,closeModal:n}){const r=ir(),{data:i}=Ji(wCe({roleId:e.id,organizationId:e.organizationId})),o=Il(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:l,remove:d}=vf(e.organizationId),{mutate:f,isPending:m}=xCe(),{mutate:h,isPending:v}=yCe(),[y,x]=b.useState(!1),S=cn({resolver:vn(Cq),defaultValues:{name:e.roleName,update:i.organization.update||!1,delete:i.organization.delete||!1}}),C=b.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{we.success("Role deleted successfully!"),n(!0),S.reset()},onError:D=>{we.error("Error",{description:`Failed to delete role: ${D instanceof Error?D.message:String(D)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[e.id,h,S,n]),[k,E]=b.useState(!0),[j,I]=b.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),N=b.useCallback(D=>{E(D.length===0)},[E]),T=b.useCallback(async D=>{if(!l)return;const F=Fh(j);if(!F)return;const q={...D,...F,organizationId:e.organizationId};j&&k&&f({roleId:e.id,updatedRoleInfo:q},{onSuccess:async()=>{we.success("Role updated successfully!"),await r.invalidateQueries({queryKey:[e.organizationId,"roles",e.id]}),n(!1),S.reset()},onError:ee=>{we.error("Error",{description:`Failed to update role: ${ee instanceof Error?ee.message:String(ee)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[n,e.id,e.organizationId,S,k,r,i,l,j,f]),A=b.useCallback(()=>n(!1),[n]);return u.jsx(Un,{onOpenChange:A,open:t,children:u.jsx(Vn,{children:y?u.jsx(_Ce,{onRoleDeleteClick:C,setIsConfirmingRoleDeletion:x,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Pn,{children:[a||!l?"View":"Edit",' Organization Role "',e.roleName,'"']}),u.jsx(un,{...S,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:S.handleSubmit(T),children:[u.jsx($e,{control:S.control,name:"name",render:({field:D})=>u.jsxs(Te,{className:"col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Role Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"",...D,disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:S.control,name:"update",render:({field:D})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!l,readOnly:a||!l,checked:D.value,onChange:F=>D.onChange(F.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:S.control,name:"delete",render:({field:D})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6 ml-2",disabled:a||!l,readOnly:a||!l,checked:D.value,onChange:F=>D.onChange(F.target.checked)})}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Bh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:N,onChange:D=>{D&&I(D)},options:a||!l?{readOnly:!0}:void 0,defaultValue:j})}),!a&&(d||l)&&u.jsx(Yn,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>x(!0),disabled:m,children:"Delete Role"}),l&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!k||m||!S.formState.isValid||!S.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}function Oq(){const e=jn(),t=ir(),{organizationId:n,orgRoleId:r}=rt({strict:!1}),{create:i}=vf(n),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(D0(n)),f=b.useMemo(()=>o&&o?.find(E=>E.id===r),[o,r]),m=!!r&&!!f,[h,v]=b.useState(!1),y=b.useCallback(async(E,j)=>{const I=[r?"..":"",E].filter(Boolean);await e({to:I.join("/")}),j&&await t.invalidateQueries({queryKey:[n,"roles"],refetchType:"active"})},[r,e,t]),x=b.useCallback(()=>{v(!0)},[v]),S=b.useCallback(E=>y(E.original.id,!1),[y]),C=b.useCallback(E=>y(void 0,E),[y]),k=Ul(a);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-(--spacing(32)))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(Tf,{data:o,columns:c1e,onRowClick:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),i&&u.jsxs(be,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:h,children:[u.jsx(Jr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),i&&u.jsx(gCe,{isModalOpen:h,setIsModalOpen:v}),m&&u.jsx(CCe,{data:f,isModalOpen:m,closeModal:C})]})})]})}const kCe=R0(),ECe=[{header:"User Id",accessorKey:"id",enableSorting:!1},{header:"Email",accessorKey:"email",enableSorting:!1},{header:"First Name",accessorKey:"firstname",enableSorting:!1},{header:"Last Name",accessorKey:"lastname",enableSorting:!1},kCe.display({header:"Roles",enableSorting:!1,id:"roles",cell:e=>e.row.original.roles?.map(t=>t.roleName)?.sort()?.join(", ")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],jCe=Cl.object({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cl.string().nonempty({error:"Please select a role."})});async function ICe(e){const{data:t}=await Gt.post("/OrganizationRole/",e);return t}function $q(){return ct({mutationFn:e=>ICe(e)})}Cl.object({email:kf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cl.string().nonempty({error:"Please select a role."})});async function RCe(e){const{data:t}=await Gt.post("/UserInvite/",e);return t}function TCe(){return ct({mutationFn:e=>RCe(e)})}function NCe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=rt({strict:!1}),{data:i}=Ji(D0(r)),[o,a]=b.useState(!1),l=cn({resolver:vn(jCe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=$q(),{mutate:m,isPending:h}=TCe(),v=b.useCallback(async y=>{y&&(o?m:d)(y,{onSuccess:()=>{const x=y.roleId;l.reset(),l.setValue("roleId",x),t(),we.success("User invited successfully!"),n(!1),a(!1)},onError:x=>{x?.status===404&&a(!0)}})},[d,l,m,t,n,o]);return u.jsx(Un,{onOpenChange:()=>{n(!1),a(!1),l.reset()},open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(un,{...l,children:u.jsxs("form",{onSubmit:l.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Pn,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:l.control,name:"email",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Email"}),u.jsx(Oe,{children:u.jsx(ze,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:l.control,name:"roleId",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Roles"}),u.jsx(b.Suspense,{fallback:u.jsx(Pr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...y,onValueChange:x=>y.onChange(x),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(ER,{children:"Role"}),i?.map(x=>u.jsx(Ot,{value:x.id,children:x.roleName},x.id))]})})]})})}),u.jsx(Ae,{})]})}),o&&u.jsxs(Ir,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(Zte,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(To,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function ACe({roleId:e,userId:t}){const{data:n}=await Gt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function OCe(){return ct({mutationFn:({roleId:e,userId:t})=>ACe({roleId:e,userId:t})})}function Dq(e){const[t,n]=b.useState(e||!1),r=b.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function $Ce({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:l}=$q(),{mutate:d,isPending:f}=OCe(),m=!!i[r.roleName],[h,v]=b.useState(m),[y,x]=Dq(m);return b.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),we.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(ch,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:t||l||f||!n&&y,checked:y,onChange:x}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function DCe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=rt({strict:!1}),o=Il(),{update:a,remove:l}=vf(i),d=o.user?.email===t.email,{data:f}=Ji(D0(i)),m=b.useMemo(()=>t.roles?If(t.roles,"roleName"):{},[t]),[h,v]=b.useState(!1);return u.jsx(Un,{onOpenChange:h?r:e,open:n,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsx(yr,{children:u.jsxs(Pn,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(Ir,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx($Ce,{readOnly:!a,canRemove:l,data:t,orgRole:y,selectedRoles:m,setChangesMade:v},y.id))]})})}function PCe(e,t){return e.email>t.email?1:-1}function Pq(){const e=jn(),{organizationId:t,orgUserId:n}=rt({strict:!1}),{update:r}=vf(t),{data:i,refetch:o,isFetching:a,isRefetching:l}=Ji(D0(t)),d=b.useMemo(()=>{const T={};for(const A of i)if(A.users)for(const D of A.users)T[D.id]||(T[D.id]={...D,roles:[]}),T[D.id].roles.push(A);return Object.values(T).sort(PCe)},[i]),f=b.useMemo(()=>d?.find(T=>T.id===n),[d,n]),m=b.useCallback(T=>{const A=[n?"..":"",T].filter(Boolean);e({to:A.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"email",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{o(),y(!1)},[o,y]),E=b.useCallback(T=>{m(T.original.id)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),I=b.useCallback(()=>{o(),m(void 0)},[m,o]),N=Ul(o);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(Tf,{data:d,isFetching:a||l,columns:ECe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:N,accessKey:"r",disabled:a||l,children:[u.jsx(xa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Jr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(NCe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(DCe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function MCe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=ax(n),l=a,{view:d}=vf(n),f=b.useCallback(()=>{t(e)},[t,e]);return u.jsxs(Dc,{className:"relative h-full justify-between",children:[u.jsxs(Rl,{children:[u.jsxs(Zc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Mh,{children:[u.jsx(zh,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(lE,{"aria-label":"Options"})}),u.jsxs(Lh,{children:[u.jsx(tb,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(nb,{}),u.jsx(Ye,{to:`${n}`,children:u.jsx(kr,{children:"Clusters"})}),d&&u.jsx(Ye,{to:`${n}/roles`,children:u.jsx(kr,{children:"Roles"})}),d&&u.jsx(Ye,{to:`${n}/users`,children:u.jsx(kr,{children:"Users"})}),l&&u.jsx(Ye,{to:`${n}/billing`,children:u.jsx(kr,{children:"Billing"})}),u.jsx(nb,{}),o&&u.jsx(kr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(Tl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(hs,{className:"flex justify-between",children:[u.jsx(Yo,{children:wo(i)}),u.jsx(Ye,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(bi,{className:"inline-block"})]})})]})]})}async function zCe(e){const{data:t}=await Gt.delete(`/Organization/${e}`);return t}function LCe(){return ct({mutationFn:e=>zCe(e)})}async function FCe(e){const{data:t}=await Gt.post("/Organization/",{...e});return t}function UCe(){return ct({mutationFn:e=>FCe(e)})}const Vv=$t({name:tt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:tt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-z0-9-]*$/,{error:"Please only use lowercase letters, digits and dashes (-) in the subdomain."})});function VCe(){const{user:e}=Il(),t=jn(),n=cn({resolver:vn(Vv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;b.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,l=i("subdomain"),d=b.useMemo(()=>{const y=S9(k0(a),Vv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${l||y}.harperfabric.com`}},[a,l]),{mutate:f,isPending:m}=UCe(),h=ir(),v=b.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:x=>{h.invalidateQueries({queryKey:Nb,refetchType:"active"}),jt.reloadUser($n),t({to:`/${x.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(un,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx($e,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",maxLength:Vv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Subdomain"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",maxLength:Vv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Full Host Name"}),u.jsx(Oe,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(Ae,{})]}),u.jsx(Yn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:m,children:["Create New Organization ",u.jsx(bi,{})]})})]})})})}function Mq(){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(VCe,{})})]})}function BCe(){const e=ir(),{data:t}=Ji(PX()),{mutate:n,isPending:r}=LCe(),[i,o]=b.useState(!1),[a,l]=b.useState(null),[d,f]=b.useState(""),m=b.useCallback(()=>f(""),[]),h=b.useMemo(()=>{const C=t?.roles||{},k=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:k[I].organizationName,roleName:k[I].role})).filter(dq(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=b.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=b.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{we.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),x=b.useCallback(C=>{l(C),o(!0)},[]),{createCluster:S}=Rr({strict:!1});return h.length===1&&!d.length&&S?u.jsx(jc,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(Mq,{}):u.jsxs(u.Fragment,{children:[u.jsx(vs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(ze,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:d,onChange:v}),u.jsx(Ye,{to:"/new-org",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Jr,{}),u.jsxs("span",{className:"hidden sm:inline-block",children:[u.jsx("u",{children:"N"}),"ew ",u.jsx("span",{className:"hidden md:inline-block",children:"Organization"})]})]})})]})}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(MCe,{organizationRole:C,onDeleteOrgModal:x})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(be,{variant:"outline",onClick:m,children:"Clear Filters"})]})]})}),a&&u.jsx(w0,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function HCe(){const{isLoading:e}=Gc(),{createCluster:t}=Rr({strict:!1}),[,n]=jf(su.SavedClusterState,null);return b.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(no,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(yU,{})}),u.jsx("main",{children:u.jsx(jl,{})})]})}const qCe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function zq(){const e=fq();return!qCe.includes(e)&&{redirect:e}}const z0=nt({getParentRoute:()=>ix,id:"_dashboardLayout",component:HCe,beforeLoad:({context:e})=>{const t=e.authentication[$n];if(t&&!t.isLoading&&!t.user)throw Kc({to:"/sign-in",search:zq()})}}),AR=nt({getParentRoute:()=>z0,id:"_orgsLayout"});nt({getParentRoute:()=>AR,path:"/",component:BCe});nt({getParentRoute:()=>AR,path:"/new-org",component:Mq});const cu=nt({getParentRoute:()=>AR,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(lu(e.params.organizationId))})}),KCe=nt({getParentRoute:()=>cu,path:"/roles",component:Oq}),GCe=nt({getParentRoute:()=>cu,path:"/roles/$orgRoleId",component:Oq}),ZCe=nt({getParentRoute:()=>cu,path:"/users",component:Pq}),YCe=nt({getParentRoute:()=>cu,path:"/users/$orgUserId",component:Pq});a1e(cu);const Lq=nt({getParentRoute:()=>cu,id:"_clusterLayout"});nt({getParentRoute:()=>Lq,path:"/",component:r_e});nt({getParentRoute:()=>cu,path:"/new-cluster",component:jR});nt({getParentRoute:()=>ps,path:"/edit",component:jR});function WCe(){return u.jsx(jl,{})}const ps=nt({getParentRoute:()=>Lq,path:"$clusterId",component:WCe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Dl(t.clusterId))})}),bd=$t({username:oR,role:tt().nonempty({error:"Please select a role."}),password:Ah.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:tt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function XCe(e){await Gt.patch(`/ResetPasswordUpdater/${e}`)}async function Fq(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function JCe(){return ct({mutationFn:Fq})}async function Uq({username:e,password:t,role:n,active:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"alter_user",username:e,password:t,role:n,active:r});return o}function QCe(){return ct({mutationFn:Uq})}async function Vq({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function eke(){return ct({mutationFn:Vq})}async function tke({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");let a=o;try{const l=await HC({username:t,password:i,instanceClient:a,entityId:e});return l.instanceClient&&(a=l.instanceClient),n===X1?await Uq({username:n,password:r,instanceClient:a}):(await Fq({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await Vq({username:X1,instanceClient:a}),await HC({username:n,password:r,instanceClient:a,entityId:e})),await XCe(e),l}catch(l){throw await Km({entityId:e,instanceClient:a}),l}}function nke(){return ct({mutationFn:tke})}function rke(){const{user:e}=Il(),{clusterId:t}=rt({strict:!1}),{data:n}=Mt(Dl(t,!0)),r=jn(),i=b.useMemo(()=>Xk(n),[n]),o=rh(i),{redirect:a}=Rr({strict:!1}),l=_n(),d=cn({resolver:vn(bd),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:m,handleSubmit:h}=d;b.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:x}=nke(),S=b.useCallback(async C=>{if(!i){we.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:X1,desiredUsername:C.username},{onSuccess:async({message:k,user:E})=>{we.success(k),jt.setUserForEntity(n,E),l.invalidate(),await r({to:a?.startsWith("/")?a:Fk})}})},[n,t,o,r,i,a,l,y,v]);return n&&!n.resetPassword?u.jsx(jc,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(vx,{})}),u.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),u.jsx("p",{className:"text-muted-foreground",children:"You are ready to create your first user in your new cluster. These credentials belong to you alone, and you can create more users and roles once you create this first one."}),u.jsx(un,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:m,name:"username",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{autoComplete:"username",type:"text",...C})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:m,name:"password",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:m,name:"confirmPassword",render:({field:C})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",...C})}),u.jsx(Ae,{})]})}),u.jsx(be,{disabled:x,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(Aee,{size:36,className:"flex-none"}),u.jsx("span",{children:"These credentials will be used to sign into your cluster directly, providing you a secure connection from your browser to your cluster."})]})]})})]})}function ike({columns:e,data:t}){const n=A0({data:t,columns:e,getCoreRowModel:N0()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(O0,{children:[u.jsx(Uh,{children:n.getHeaderGroups().map(r=>u.jsx(Hi,{className:"border-none",children:r.headers.map(i=>u.jsx(NR,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:Hc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx($0,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Hi,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(fs,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:Hc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function oke(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function ake({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=ms(t.id),i=b.useMemo(()=>Jk(t),[t]),o=rh(i),{update:a}=Dfe(),l=jt.checkForFabricConnect(t.id),d=b.useCallback(async()=>{await Km({instanceClient:o,entityId:t.id}),jt.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(M4,{className:"animate-spin",color:"gray"}):!n||l?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ye,{to:`../instance/${t.id}${ba}`,className:"text-sm","aria-label":`Connect to ${t.name} instance`,title:`Connect to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Fabric Connect"})}),u.jsx(Ye,{to:`../instance/${t.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${t.name} instance`,title:`Sign in to ${t.name} instance`,children:u.jsx(be,{variant:a?"defaultOutline":"positiveOutline",children:"Direct Sign In"})})]}):u.jsxs("span",{className:"flex gap-4",children:[u.jsx(Ye,{to:`../instance/${t.id}${ba}`,className:"text-sm","aria-label":`Go to ${t.name} instance`,title:`Go to ${t.name} instance`,children:u.jsx(be,{variant:"positiveOutline",children:"Direct Connect"})}),u.jsx(be,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${t.name} instance`,title:`Sign out from ${t.name} instance`,onClick:d,children:"Direct Sign Out"})]})}function ske(){const{clusterId:e}=rt({strict:!1}),{data:t,isLoading:n}=Mt(Dl(e,!0)),r=SR(t),i=b.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(ake,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>cq({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const l=a.getValue();return u.jsx(Yo,{variant:i8(l),children:wo(l)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const l=a.getValue();return Fo(l,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const l=a.getValue();return Fo(l,Math.pow(1024,2))}}].filter(Jo),[r]),o=b.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!uj.includes(a.status)).sort(x9):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(Dc,{className:"p-0 mt-4 min-h-96",children:u.jsx(hs,{className:"p-0 min-h-96",children:n?u.jsx(Pr,{}):o.length?u.jsx(ike,{data:o,columns:i}):u.jsx(oke,{})})})})]})}function Sc({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx("div",{className:ki("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function lke(){const{clusterId:e}=rt({strict:!1}),{data:t,isLoading:n}=Mt(Dl(e,2e3)),r=t?.status,i=b.useMemo(()=>r&&Sx.includes(r),[r]);return n||!t?u.jsx(Sc,{className:"flex justify-center",children:u.jsx(Pr,{})}):i?u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx($m,{cluster:t,forceProgressBarVisible:!0}),u.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),u.jsx("div",{className:"text-center",children:u.jsx(_R,{cluster:t})})]})}):u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx($m,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function cke(){const e=_n(),{clusterId:t}=rt({strict:!1}),{data:n,isLoading:r}=Mt(Dl(t,2e3)),i=n?.status,o=b.useMemo(()=>i&&Sx.includes(i),[i]),a=Oh(i),[,l]=jf(su.SavedClusterState,null),d=b.useCallback(()=>{l(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,l]);return r||!n?u.jsx(Sc,{className:"flex justify-center",children:u.jsx(Pr,{})}):a?u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(ite,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(kl,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx($m,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now."," ",u.jsxs("span",{className:"text-muted-foreground",children:["Did you know during this step, you connect straight to your cluster, providing a private secure connection? That's ",u.jsx("em",{children:"Direct Connect"}),"! Once you create your user, you will have the option to"," ",u.jsx("em",{children:"Fabric Connect"})," from your Fabric account without having to sign in again."]})]}),u.jsx("div",{className:"text-center",children:u.jsx(_R,{cluster:n})})]})}):u.jsx(Sc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx($m,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going."," ",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on"," ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",rel:"noreferrer",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}nt({getParentRoute:()=>ps,path:"instances",component:ske});nt({getParentRoute:()=>ps,path:"starting-up",component:cke});nt({getParentRoute:()=>ps,path:"scaling",component:lke});nt({getParentRoute:()=>ps,path:"sign-in",component:aR,beforeLoad:({context:e,location:t,params:n})=>{const r=jt.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Kc({to:i?.redirect?.startsWith("/")?i.redirect:Fk})}}});nt({getParentRoute:()=>ps,path:"instance/$instanceId/sign-in",component:aR,beforeLoad:({context:e,location:t,params:n})=>{if(!(jt.checkForFabricConnect(n.clusterId)||jt.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Kc({to:i?.redirect?.startsWith("/")?i.redirect:Fk})}}});nt({getParentRoute:()=>ps,path:"finish-setup",component:rke});function uke(e){return nt({getParentRoute:()=>e,path:"apis"}).lazy(()=>th(()=>import("./index.lazy-CXvjAEyW.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}function NP(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function tm(e,t){const[n,r]=b.useState(t),[i,o]=b.useState(e);return b.useEffect(()=>{NP(n,t)||(r(t),o(e))},[n,t,e]),NP(n,t)?[i,o]:[e,o]}const fd={};function ub(e,t,n){const r=b.useCallback((i,o)=>t(i,o),[n]);b.useEffect(()=>(fd[e]||(fd[e]=[]),fd[e].push(r),function(){const o=fd[e].indexOf(r);o>=0&&fd[e].splice(o,1)}),[e,t,r])}function Hh(e,t,n){const r=fd[e];if(r)for(const i of r)i(t,n)}function Bq(e,t,n){return r=>Hh(e,t,r)}function j1(e,t,n){return b.useCallback(r=>Hh(e,t,r),[e,t,n])}function AP(e,t){return Fh(sessionStorage.getItem(String(e)))??t}function dke(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function Id(e,t){const n=tm(AP(e,t),[e]),[r,i]=n;return b.useEffect(()=>{dke(e,r),Hh(`Session:${e}`,r)},[e,r]),ub(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),b.useEffect(function(){const a=l=>{l.key===e&&i(AP(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function fke(e,t=!1){const[n,r]=Id(e,t),i=b.useCallback(l=>{l?.preventDefault?.(),r(d=>!d)},[r]),o=b.useCallback(l=>{l?.preventDefault?.(),r(!0)},[r]),a=b.useCallback(l=>{l?.preventDefault?.(),r(!1)},[r]);return b.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}const Hq=b.createContext(null);function Lr(){return b.useContext(Hq)}async function qq({file:e,project:t,entityType:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_component",file:e||void 0,project:t,replicated:n==="cluster"});return i}function L0(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}function Kq(e){switch(L0(e).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}async function Gq({instanceClient:e,file:t,project:n,encoding:r}){const{data:i}=await e.post("/",{operation:"get_component_file",file:t,project:n,encoding:r??(Kq(t)?"base64":"utf8")});return{file:t,project:n,...i}}function pke(e){return{queryKey:Zq(e),queryFn:()=>Gq(e),enabled:!!e.file&&!!e.project,retry:!1}}function Zq(e){return[e.entityId,"get_component_file",e.file,e.project,e.encoding]}async function OR({file:e,payload:t,project:n,entityType:r,instanceClient:i,encoding:o}){const{data:a}=await i.post("/",{operation:"set_component_file",file:e,payload:t,project:n,encoding:o,replicated:r==="cluster"},{timeout:3e5});return a}function Yq(){return ct({mutationFn:OR})}function Wq(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=Lr(),r=Zt();return b.useCallback(async i=>{let o=!1;const a=i.filter(y=>y.from!==y.to);if(a.length===0)return;const l=`Renaming ${Yr(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=we.loading(l,{...d,description:u.jsx(Dm,{animated:!0,width:"0%"})});const m=a.length*3;let h=0;function v(){h+=1,we.loading(l,{...d,description:u.jsx(Dm,{animated:!0,width:(h===0?0:h/m*100)+"%"})})}for(const y of a){const x=y.from.split("/"),S=x.shift(),C=x.join("/"),k=y.to.split("/"),E=k.shift(),j=k.join("/"),I=await Gq({...r,file:C,project:S,encoding:"base64"});if(o||(v(),await OR({...r,file:j,project:E,encoding:"base64",payload:I.message}),o)||(v(),await qq({...r,file:C,project:S}),o))break;v()}h>=m?we.success(`Renamed ${Yr(a.length,"File","Files")}`,{id:d.id,description:"All done!",duration:3e3,action:{label:"OK",onClick:()=>{}}}):we.warning("Rename Cancelled",{id:d.id,description:`${h} of ${m} steps completed.`,duration:1e4,action:{label:"OK",onClick:()=>{}}}),e(),n(y=>{const x=y.slice();for(const S of a){const C=x.indexOf(S.from);C>=0?x.splice(C,1,S.to):x.push(S.to)}return x}),t(y=>{for(const x of a)if(y===x.from)return x.to;return y})},[r,e,t,n])}function mke(e,t){return e[t]!==void 0}function Xq(e){return t=>mke(t,e)}function Vl(e,t){const[n,r]=b.useState({value:t});return ub(e,(i,o)=>r({value:i,trigger:o}),[r]),n}function ni(e,t,n){Hh(e,t,n)}function F0(e,t,n){return r=>ni(e,t,r)}function Xa(e,t,n){return b.useCallback(r=>{ni(e,t,r)},[e,t,n])}const hke={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e==="Delete")return ni("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(e){return{id:"delete-file",label:"Delete File",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:F0("ShowDeleteDirectoryOrFileModal",!0)}}},gke={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e==="˜")return ni("ShowAddDirectoryOrFileModalType","directory"),!0},addEditorAction(e){return{id:"new-directory",label:"New Directory",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyMod.Shift|e.KeyCode.KeyN],run:F0("ShowAddDirectoryOrFileModalType","directory")}}},vke={handleGlobal(e,t){if(t.ctrl&&e==="n")return ni("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(e){return{id:"new-file",label:"New File",keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:F0("ShowAddDirectoryOrFileModalType","file")}}},yke={handleGlobal(e){if(e==="F2")return ni("ShowRenameFileModal","file"),!0},addEditorAction(e){return{id:"rename-file",label:"Rename File",keybindings:[e.KeyMod.WinCtrl|e.KeyMod.Alt|e.KeyCode.KeyR,e.KeyCode.F2],run:F0("ShowRenameFileModal",!0)}}},bke={addEditorAction(){return{id:"revert-file",label:"Revert File",run:Bq("RevertChanges",!0)}}},xke={handleGlobal(e,t){if(t.cmd&&e==="s")return Hh("SaveFile",!0),!0},addEditorAction(e){return{id:"save-file",label:"Save Changes",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:Bq("SaveFile",!0)}}},Jq=[hke,gke,vke,yke,bke,xke],wke=Jq.filter(Xq("addEditorAction")),Ske=Jq.filter(Xq("handleGlobal"));function _ke(e){const[t,n]=e,r=wke.map(i=>t.addAction(i.addEditorAction(n)));return()=>{for(const i of r)i?.dispose()}}function Cke(){b.useEffect(()=>(document.addEventListener("keydown",OP),()=>{document.removeEventListener("keydown",OP)}),[])}function OP(e){const t=e.getModifierState("Meta"),n=e.getModifierState("Alt"),r=e.getModifierState("Shift"),i=e.getModifierState("Control"),o={cmd:t,alt:n,shift:r,ctrl:i};for(const a of Ske)if(a.handleGlobal(e.key,o)){e.preventDefault();return}}function kke(e){return e.split("/").pop()}function $R(...e){return e.flat(1).join("/")}var ns;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(ns||(ns={}));var db=function(){return db=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},db.apply(this,arguments)},Eke=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return db(db({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},ef=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},jke=(function(){function e(t){this.mode=ns.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!ef(a)):ef(a)&&!l?i.isSelected?r.unselectItem():r.addToSelectedItems():r.selectItem()},onDoubleClick:function(){r.focusItem(),r.selectItem(),t.isFolder&&r.toggleExpandedState(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction()},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),Ike=(function(){function e(t){this.mode=ns.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!ef(a)):ef(a)&&!l?i.isSelected?r.unselectItem():r.addToSelectedItems():(t.isFolder&&r.toggleExpandedState(),r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),Rke=(function(){function e(t){this.mode=ns.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var l=a.detail===0;r.focusItem(),a.shiftKey&&!l?r.selectUpTo(!ef(a)):ef(a)&&!l?i.isSelected?r.unselectItem():r.addToSelectedItems():(r.selectItem(),(!t.isFolder||o.environment.canInvokePrimaryActionOnItemContainer)&&r.primaryAction())},onFocus:function(){r.focusItem()},onDragStart:function(a){a.dataTransfer.dropEffect="move",r.startDragging()},onDragOver:function(a){a.preventDefault()},draggable:i.canDrag&&!i.isRenaming,tabIndex:i.isRenaming?void 0:i.isFocused?0:-1}},e})(),$P=function(e,t){switch(e){case ns.DoubleClickItemToExpand:return new jke(t);case ns.ClickItemToExpand:return new Ike(t);case ns.ClickArrowToExpand:return new Rke(t);default:throw Error("Unknown interaction mode ".concat(e))}},Qq=b.createContext(null),Tke=function(){return b.useContext(Qq)},Nke=function(e){var t=e.children,n=yn(),r=n.defaultInteractionMode,i=b.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?Eke(r,$P(r.extends,n)):r:$P((o=r)!==null&&o!==void 0?o:ns.ClickItemToExpand,n)},[]);return b.createElement(Qq.Provider,{value:i},t)},e7=function(){var e=yn();return b.useCallback(function(t,n){if(t.targetType==="between-items"){if(!e.canReorderItems)return!1}else if(t.targetType==="root"){if(!e.canDropOnFolder)return!1}else{var r=e.items[t.targetItem];if(!r||!e.canDropOnFolder&&r.isFolder||!e.canDropOnNonFolder&&!r.isFolder||n.some(function(i){return i.index===t.targetItem}))return!1}return!(e.canDropAt&&(!n||!e.canDropAt(n,t)))},[e])},t7=function(){var e=yn();return b.useCallback(function(t,n){for(var r=e.linearItems[n],i=r[t].depth,o=t;r[o]&&r[o].depth!==i-1;o-=1);var a=r[o];return a||(a={item:e.trees[n].rootItem,depth:0},o=0),{parent:a,parentLinearIndex:o}},[e.linearItems,e.trees])},Ake=function(){var e=yn(),t=t7(),n=e7(),r=b.useCallback(function(i,o,a){var l=t(o,i),d=l.parent,f=l.parentLinearIndex;return a.some(function(m){return m.index===d.item})?!0:d.depth===0?!1:r(i,f,a)},[t]);return b.useCallback(function(i,o){for(var a,l,d,f,m=e.linearItems[i],h=[],v=-1,y=0;y<m.length;y++){var x=m[y],S=x.item,C=x.depth;if(!(v!==-1&&C>v)){v=-1;var k=t(y,i).parent,E=e.items[k.item].children.indexOf(S);if(r(i,y,o)){v=C+1;continue}var j={targetType:"item",parentItem:k.item,targetItem:S,linearIndex:y,depth:C,treeId:i},I={targetType:"between-items",parentItem:k.item,linePosition:"top",childIndex:E,depth:C,treeId:i,linearIndex:y},N={targetType:"between-items",parentItem:k.item,linePosition:"bottom",linearIndex:y+1,childIndex:E+1,depth:C,treeId:i},T=(l=(a=m[y-1])===null||a===void 0?void 0:a.depth)!==null&&l!==void 0?l:-1,A=(f=(d=m[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,D=C===T,F=C===A-1;!D&&n(I,o)&&h.push(I),n(j,o)&&h.push(j),!F&&n(N,o)&&h.push(N)}}return h},[n,e.items,e.linearItems,t,r])},Bv=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},fb=function(e,t,n){var r=b.useRef();b.useEffect(function(){if(!r.current)r.current=Bv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=Bv([],n,!0),e())}},Bv(Bv([],t,!0),n,!0))},pb=function(){return pb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},pb.apply(this,arguments)},n7=function(e,t){return e.map(function(n){return[n,t(n)]}).reduce(function(n,r){var i,o=r[0],a=r[1];return pb(pb({},n),(i={},i[o]=a,i))},{})},_o=function(){return typeof document<"u"?document:void 0};function Nf(e){e===void 0&&(e=!1);var t=b.useRef(new Array);return b.useEffect(function(){if(e)return function(){};var n=t.current;return function(){return n.forEach(function(r){return cancelAnimationFrame(r)})}},[e,t]),b.useCallback(function(n){var r=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(r),1),n()});t.current.push(r)},[t])}var mb=function(e){var t=b.useRef(e);return t.current=e,t},Co=function(e){var t=mb(e);return b.useCallback((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.current.apply(t,n)}),[t])},r7=function(){var e=yn();return Co(function(t,n){return n.map(function(r){return[r,e.linearItems[t].findIndex(function(i){return i.item===r.index})]}).sort(function(r,i){r[0];var o=r[1];i[0];var a=i[1];return o-a}).map(function(r){var i=r[0];return i})})},Oke=function(e){var t,n=(t=_o())===null||t===void 0?void 0:t.querySelector('[data-rct-tree="'.concat(e,'"] [data-rct-item-container="true"]'));if(n){var r=getComputedStyle(n);return n.offsetHeight+Math.max(parseFloat(r.marginTop),parseFloat(r.marginBottom))}return 5},i7=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},$ke=(function(){function e(t,n,r,i,o,a){this.env=t,this.e=n,this.treeId=r,this.linearIndex=i.linearIndex,this.offset=i.offset,this.indentation=i.indentation,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex],this.getParentOfLinearItem=a,this.draggingItems=o}return e.prototype.getEmptyTreeDragPosition=function(){return{targetType:"root",treeId:this.treeId,depth:0,linearIndex:0,targetItem:this.env.trees[this.treeId].rootItem}},e.prototype.maybeRedirectToParent=function(){var t=!this.env.canReorderItems&&!this.env.canDropOnNonFolder&&!this.env.items[this.targetItem.item].isFolder;if(t){var n=this.getParentOfLinearItem(this.linearIndex,this.treeId),r=n.parentLinearIndex,i=n.parent;this.targetItem=i,this.linearIndex=r}},e.prototype.maybeReparentUpwards=function(){var t,n;if(this.indentation!==void 0){var r=this.env.linearItems[this.treeId],i=r[this.linearIndex].depth,o=i-((n=(t=r[this.linearIndex+1])===null||t===void 0?void 0:t.depth)!==null&&n!==void 0?n:0),a=this.offset==="bottom"&&o>0;if(a){for(var l=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,m=i;m>=l;m-=1)f=d,d=this.getParentOfLinearItem(d.parentLinearIndex,this.treeId);if(this.indentation!==r[this.linearIndex].depth&&f){var h=this.env.items[d.parent.item].children.indexOf(f.parent.item)+1;if(!(this.draggingItems&&this.isDescendant(this.treeId,d.parentLinearIndex+1,this.draggingItems)))return{targetType:"between-items",treeId:this.treeId,parentItem:d.parent.item,depth:l,linearIndex:this.linearIndex+1,childIndex:h,linePosition:"bottom"}}}}},e.prototype.maybeRedirectInsideOpenFolder=function(){var t=this.env.linearItems[this.treeId][this.linearIndex+1],n=!this.env.canDropBelowOpenFolders&&t&&this.targetItem.depth===t.depth-1&&this.offset==="bottom";n&&(this.targetItem=t,this.linearIndex+=1,this.offset="top")},e.prototype.maybeMapToBottomOffset=function(){var t=this.env.linearItems[this.treeId][this.linearIndex-1];if(!(!t||t?.depth===void 0)){var n=t.depth-this.targetItem.depth;this.offset==="top"&&(n===0||n>0&&this.indentation!==void 0)&&(this.offset="bottom",this.linearIndex-=1,this.targetItem=this.env.linearItems[this.treeId][this.linearIndex])}},e.prototype.canDropAtCurrentTarget=function(){var t=this,n,r=this.env.items[this.targetItem.item];return!(!this.offset&&!this.env.canDropOnNonFolder&&!r.isFolder||!this.offset&&!this.env.canDropOnFolder&&r.isFolder||this.offset&&!this.env.canReorderItems||!((n=this.draggingItems)===null||n===void 0)&&n.some(function(i){return i.index===t.targetItem.item}))},e.prototype.getDraggingPosition=function(){if(this.env.linearItems[this.treeId].length===0)return this.getEmptyTreeDragPosition();if(!(!this.draggingItems||this.linearIndex<0||this.linearIndex>=this.env.linearItems[this.treeId].length)){this.maybeRedirectToParent(),this.maybeRedirectInsideOpenFolder(),this.maybeMapToBottomOffset();var t=this.maybeReparentUpwards();if(t)return t;if(this.areDraggingItemsDescendantOfTarget()||!this.canDropAtCurrentTarget())return"invalid";var n=this.getParentOfLinearItem(this.linearIndex,this.treeId).parent,r=this.env.items[n.item].children.indexOf(this.targetItem.item)+(this.offset==="top"?0:1);return this.offset?{targetType:"between-items",treeId:this.treeId,parentItem:n.item,depth:this.targetItem.depth,linearIndex:this.linearIndex+(this.offset==="top"?0:1),childIndex:r,linePosition:this.offset}:{targetType:"item",treeId:this.treeId,parentItem:n.item,targetItem:this.targetItem.item,depth:this.targetItem.depth,linearIndex:this.linearIndex}}},e.prototype.isDescendant=function(t,n,r){var i=this.getParentOfLinearItem(n,t),o=i.parentLinearIndex,a=i.parent;return r.some(function(l){return l.index===a.item})?!0:a.depth===0?!1:this.isDescendant(t,o,r)},e.prototype.areDraggingItemsDescendantOfTarget=function(){return this.draggingItems&&this.isDescendant(this.treeId,this.linearIndex,this.draggingItems)},e})(),Dke=function(){var e=b.useRef("initial"),t=b.useState(void 0),n=t[0],r=t[1],i=b.useRef(0),o=yn(),a=t7(),l=Co(function(v,y,x){if(!x)return!1;var S=x.offset,C=x.linearIndex,k="".concat(y,"__").concat(C,"__").concat(S??"","__").concat(x.indentation);return k!==e.current?(e.current=k,!0):!1}),d=Co(function(v,y,x){if(x.current){var S=x.current.getBoundingClientRect();if(!i7(v,S)){var C=(v.clientY-S.top)/i.current,k=o.linearItems[y],E=Math.min(Math.max(0,Math.floor(C)),k.length-1);if(k.length===0)return{linearIndex:0,offset:"bottom",indentation:0};var j=k[E],I=o.items[j.item],N=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,T,A=o.canReorderItems?I?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=k.length-1?T="bottom":C%1<A?T="top":C%1>1-A&&(T="bottom"),{linearIndex:E,offset:T,indentation:N}}}}),f=Co(function(v,y,x){var S=d(v,y,x);if(l(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new $ke(o,v,y,S,n,a).getDraggingPosition()}),m=Co(function(v,y){r(y),e.current="initial",i.current=Oke(v)}),h=Co(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:m,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},o7=b.createContext(null),ja=function(){return b.useContext(o7)},Pke=function(e){var t=e.children,n=yn(),r=b.useState(!1),i=r[0],o=r[1],a=b.useState({}),l=a[0],d=a[1],f=b.useState(0),m=f[0],h=f[1],v=b.useState(),y=v[0],x=v[1],S=Ake(),C=Nf(),k=r7(),E=Dke(),j=E.initiateDraggingPosition,I=E.resetDraggingPosition,N=E.draggingItems,T=E.getDraggingPosition,A=E.itemHeight,D=b.useCallback(function(U,O){var X;if(n.activeTreeId&&(!((X=n.viewState[n.activeTreeId])===null||X===void 0)&&X.focusedItem)&&n.linearItems&&O){var pe=n.viewState[n.activeTreeId].focusedItem,ve=S(n.activeTreeId,O),Q=ve.findIndex(function(le){return le.targetType==="item"?le.targetItem===pe:le.targetType==="between-items"?n.items[le.parentItem].children[le.childIndex]===pe:!1});h(Q?Math.min(Q+1,ve.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),F=Co(function(){o(!1),d({}),h(0),x(void 0),I()});fb(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&l[n.activeTreeId]&&D(l[n.activeTreeId],N)},[N,n.activeTreeId,n.linearItems,D,l],[n.activeTreeId]),fb(function(){i&&n.activeTreeId&&x(l[n.activeTreeId][m])},[m,n.activeTreeId,i,l],[m,n.activeTreeId]);var q=e7(),ee=function(U){var O;N&&!q(U,N)||(x(U),n.setActiveTree(U.treeId),N&&n.activeTreeId!==U.treeId&&((O=n.onSelectItems)===null||O===void 0||O.call(n,N.map(function(X){return X.index}),U.treeId)))},G=Co(function(U,O,X){if(N){var pe=T(U,O,X);if(pe){if(pe==="invalid"){x(void 0);return}ee(pe)}}}),K=Co(function(U,O){O.current&&i7(U,O.current.getBoundingClientRect())&&x(void 0)}),V=Co(function(){!N||!y||!n.onDrop||(n.onDrop(N,y),C(function(){var U;(U=n.onFocusItem)===null||U===void 0||U.call(n,N[0],y.treeId),F()}))}),H=b.useCallback(function(U,O){var X=n7(n.treeIds,function(pe){return S(pe,U)});j(O,U),d(X),n.activeTreeId&&D(X[n.activeTreeId],U)},[n.activeTreeId,n.treeIds,S,j,D]),z=b.useCallback(function(){var U,O,X;if(n.canDragAndDrop&&n.activeTreeId){var pe=(O=(U=n.viewState[n.activeTreeId])===null||U===void 0?void 0:U.selectedItems)!==null&&O!==void 0?O:[(X=n.viewState[n.activeTreeId])===null||X===void 0?void 0:X.focusedItem];if(pe.length===0||pe[0]===void 0)return;var ve=k(n.activeTreeId,pe.map(function(Q){return n.items[Q]}));if(n.canDrag&&!n.canDrag(ve))return;H(ve,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,k,H]),W=b.useCallback(function(){F()},[F]),L=b.useCallback(function(){V(),F()},[V,F]),ne=b.useCallback(function(){h(function(U){return Math.max(0,U-1)})},[]),$=b.useCallback(function(){n.activeTreeId&&h(function(U){return Math.min(l[n.activeTreeId].length-1,U+1)})},[n.activeTreeId,l]),P=b.useMemo(function(){return{onStartDraggingItems:H,startProgrammaticDrag:z,abortProgrammaticDrag:W,completeProgrammaticDrag:L,programmaticDragUp:ne,programmaticDragDown:$,draggingItems:N,draggingPosition:y,itemHeight:A.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:G,onDragLeaveContainerHandler:K,viableDragPositions:l}},[W,L,N,y,i,A,G,K,H,$,ne,z,l]);return b.useEffect(function(){return window.addEventListener("dragend",F),window.addEventListener("drop",V),function(){window.removeEventListener("dragend",F),window.removeEventListener("drop",V)}},[V,F]),b.createElement(o7.Provider,{value:P},t)},um=function(){return um=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},um.apply(this,arguments)},Mke=function(e,t){var n=yn(),r=ja();b.useImperativeHandle(e,function(){return um(um(um({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},a7=function(e,t,n){return t===void 0&&(t=50),n===void 0&&(n=1e4),new Promise(function(r){e()&&r();var i,o=setInterval(function(){e()&&i()},t),a=setTimeout(function(){i()},n);i=function(){clearInterval(o),clearTimeout(a),r()}})},yk=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(m){try{f(r.next(m))}catch(h){a(h)}}function d(m){try{f(r.throw(m))}catch(h){a(h)}}function f(m){m.done?o(m.value):i(m.value).then(l,d)}f((r=r.apply(e,t||[])).next())})},bk=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(f){return function(m){return d([f,m])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(m){f=[6,m],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},DP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},s7=b.createContext(null),zke=function(){return b.useContext(s7)},l7=function(e,t,n){return yk(void 0,void 0,void 0,function(){var r,i,o,a,l,d,f;return bk(this,function(m){for(r=function(h){a7(function(){var v;return!!(!((v=t.current)===null||v===void 0)&&v[h])}).then(function(){var v,y=(v=t.current)===null||v===void 0?void 0:v[h];y?.isFolder&&(n(y),l7(h,t,n))})},i=0,o=(f=(d=(l=t.current)===null||l===void 0?void 0:l[e])===null||d===void 0?void 0:d.children)!==null&&f!==void 0?f:[];i<o.length;i++)a=o[i],r(a);return[2]})})},Lke=b.forwardRef(function(e,t){var n=yn(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,l=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,m=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,x=ja(),S=x.abortProgrammaticDrag,C=x.completeProgrammaticDrag,k=x.programmaticDragDown,E=x.programmaticDragUp,j=x.startProgrammaticDrag,I=mb(i),N=b.useCallback(function($,P){r?.(i[$],P)},[i,r]),T=b.useCallback(function($,P){l?.(i[$],P)},[i,l]),A=b.useCallback(function($,P,U){U===void 0&&(U=!0),d?.(i[$],P,U)},[i,d]),D=b.useCallback(function($,P){P===void 0&&(P=!0),f($,P)},[f]),F=b.useCallback(function($){var P=y[$],U=P.findIndex(function(pe){var ve,Q=pe.item;return Q===((ve=a[$])===null||ve===void 0?void 0:ve.focusedItem)}),O=U!==void 0?Math.min(P.length-1,U+1):0,X=i[P[O].item];d?.(X,$)},[i,y,d,a]),q=b.useCallback(function($){var P=y[$],U=P.findIndex(function(pe){var ve,Q=pe.item;return Q===((ve=a[$])===null||ve===void 0?void 0:ve.focusedItem)}),O=U!==void 0?Math.max(0,U-1):0,X=i[P[O].item];d?.(X,$)},[i,y,d,a]),ee=b.useCallback(function($,P,U){m?.(i[$],P,U)},[i,m]),G=b.useCallback(function($,P){h?.($,P)},[h]),K=b.useCallback(function($,P){var U,O;!((O=(U=a[P])===null||U===void 0?void 0:U.expandedItems)===null||O===void 0)&&O.includes($)?r?.(i[$],P):l?.(i[$],P)},[i,r,l,a]),V=b.useCallback(function($,P){var U,O,X,pe,ve;!((O=(U=a[P])===null||U===void 0?void 0:U.selectedItems)===null||O===void 0)&&O.includes($)?h?.((pe=(X=a[P].selectedItems)===null||X===void 0?void 0:X.filter(function(Q){return Q!==$}))!==null&&pe!==void 0?pe:[],P):h?.(DP(DP([],(ve=a[P].selectedItems)!==null&&ve!==void 0?ve:[],!0),[$],!1),P)},[h,a]),H=b.useCallback(function($,P){v?.(i[$],P)},[i,v]),z=b.useCallback(function($,P){return yk(void 0,void 0,void 0,function(){var U,O;return bk(this,function(X){switch(X.label){case 0:return U=P[0],O=P.slice(1),[4,a7(function(){var pe;return!!(!((pe=I.current)===null||pe===void 0)&&pe[U])}).then(function(){var pe=I.current[U];return pe?(l?.(pe,$),O.length>0?z($,O):Promise.resolve()):Promise.resolve()})];case 1:return X.sent(),[2]}})})},[I,l]),W=b.useCallback(function($){return yk(void 0,void 0,void 0,function(){return bk(this,function(P){switch(P.label){case 0:return[4,l7(o[$].rootItem,I,function(U){return l?.(U,$)})];case 1:return P.sent(),[2]}})})},[I,l,o]),L=b.useCallback(function($){for(var P,U,O=0,X=(U=(P=a[$])===null||P===void 0?void 0:P.expandedItems)!==null&&U!==void 0?U:[];O<X.length;O++){var pe=X[O];r?.(i[pe],$)}},[i,r,a]),ne=b.useMemo(function(){return{collapseItem:N,expandItem:T,focusItem:A,focusTree:D,moveFocusDown:F,moveFocusUp:q,renameItem:ee,selectItems:G,toggleItemExpandedState:K,toggleItemSelectStatus:V,invokePrimaryAction:H,expandAll:W,expandSubsequently:z,collapseAll:L,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:k,moveProgrammaticDragPositionUp:E,startProgrammaticDrag:j}},[N,T,A,D,F,q,ee,G,K,V,H,W,z,L,S,C,k,E,j]);return Mke(t,ne),b.createElement(s7.Provider,{value:ne},e.children)}),Fke=function(e){var t,n,r,i;if(e)if(e.scrollIntoViewIfNeeded)e.scrollIntoViewIfNeeded();else{var o=e.getBoundingClientRect(),a=o.top>=0&&o.left>=0&&o.bottom<=(window.innerHeight||!!(!((n=(t=_o())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=_o())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},hi=function(){return hi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},hi.apply(this,arguments)},Ks=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},Uke=function(e,t){return{renderItemTitle:function(n){var r=n.title,i=n.context,o=n.info;if(!o.isSearching||!i.isSearchMatching)return r;var a=r.toLowerCase().indexOf(o.search.toLowerCase());return J.createElement(J.Fragment,null,a>0&&J.createElement("span",null,r.slice(0,a)),J.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&J.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(n){var r=n.item,i=n.context;return J.createElement("div",hi({className:Ks(r.isFolder&&"rct-tree-item-arrow-isFolder",i.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},i.arrowProps),r.isFolder&&(i.isExpanded?J.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},J.createElement("g",null,J.createElement("g",null,J.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"})))):J.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},J.createElement("g",null,J.createElement("g",null,J.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z",className:"rct-tree-item-arrow-path"}))))))},renderItem:function(n){var r=n.item,i=n.depth,o=n.children,a=n.title,l=n.context,d=n.arrow,f=l.isRenaming?"div":"button",m=l.isRenaming?void 0:"button";return J.createElement("li",hi({},l.itemContainerWithChildrenProps,{className:Ks("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",l.isSelected&&"rct-tree-item-li-selected",l.isExpanded&&"rct-tree-item-li-expanded",l.isFocused&&"rct-tree-item-li-focused",l.isDraggingOver&&"rct-tree-item-li-dragging-over",l.isSearchMatching&&"rct-tree-item-li-search-match")}),J.createElement("div",hi({},l.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:Ks("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",l.isSelected&&"rct-tree-item-title-container-selected",l.isExpanded&&"rct-tree-item-title-container-expanded",l.isFocused&&"rct-tree-item-title-container-focused",l.isDraggingOver&&"rct-tree-item-title-container-dragging-over",l.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,J.createElement(f,hi({type:m},l.interactiveElementProps,{className:Ks("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",l.isSelected&&"rct-tree-item-button-selected",l.isExpanded&&"rct-tree-item-button-expanded",l.isFocused&&"rct-tree-item-button-focused",l.isDraggingOver&&"rct-tree-item-button-dragging-over",l.isSearchMatching&&"rct-tree-item-button-search-match")}),a)),o)},renderRenameInput:function(n){var r=n.inputProps,i=n.inputRef,o=n.submitButtonProps,a=n.submitButtonRef,l=n.formProps;return J.createElement("form",hi({},l,{className:"rct-tree-item-renaming-form"}),J.createElement("input",hi({},r,{ref:i,className:"rct-tree-item-renaming-input"})),J.createElement("input",hi({},o,{ref:a,type:"submit",className:"rct-tree-item-renaming-submit-button",value:"🗸"})))},renderTreeContainer:function(n){var r=n.children,i=n.containerProps,o=n.info;return J.createElement("div",{className:Ks("rct-tree-root",o.isFocused&&"rct-tree-root-focus",o.isRenaming&&"rct-tree-root-renaming",o.areItemsSelected&&"rct-tree-root-itemsselected",t)},J.createElement("div",hi({},i,{style:hi({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return J.createElement("ul",hi({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return J.createElement("div",hi({},i,{style:{left:"".concat(r.depth*e,"px")},className:Ks("rct-tree-drag-between-line",r.targetType==="between-items"&&r.linePosition==="top"&&"rct-tree-drag-between-line-top",r.targetType==="between-items"&&r.linePosition==="bottom"&&"rct-tree-drag-between-line-bottom")}))},renderSearchInput:function(n){var r=n.inputProps;return J.createElement("div",{className:Ks("rct-tree-search-input-container")},J.createElement("span",{className:"rct-tree-input-icon"}),J.createElement("input",hi({},r,{className:Ks("rct-tree-search-input")})))},renderLiveDescriptorContainer:function(n){var r=n.tree,i=n.children;return J.createElement("div",{id:"rct-livedescription-".concat(r.treeId),style:{clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}},i)},renderDepthOffset:e}},Vke=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,l=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,m=e.renderDepthOffset,h=b.useMemo(function(){return Uke(m??10)},[m]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:l,renderSearchInput:d,renderLiveDescriptorContainer:f,renderDepthOffset:m},y=Object.entries(h).reduce(function(x,S){var C=S[0],k=S[1],E=C;return v[E]?x[E]=v[E]:x[E]=k,x},{});return y.renderItem.displayName="RenderItem",y.renderItemTitle.displayName="RenderItemTitle",y.renderItemArrow.displayName="RenderItemArrow",y.renderRenameInput.displayName="RenderRenameInput",y.renderItemsContainer.displayName="RenderItemsContainer",y.renderTreeContainer.displayName="RenderTreeContainer",y.renderDragBetweenLine.displayName="RenderDragBetweenLine",y.renderSearchInput.displayName="RenderSearchInput",y},DR=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var l=[],d=0,f=(o=(i=n[e])===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[];d<f.length;d++){var m=f[d],h=n[m];l.push({item:m,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(m))&&l.push.apply(l,DR(m,t,n,r+1))}return l},mc=function(){return mc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},mc.apply(this,arguments)},Bke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Hke=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=Bke(e,["onExpandItem","onCollapseItem","onDrop"]),o=b.useState({}),a=o[0],l=o[1],d=b.useState(),f=d[0],m=d[1],h=b.useMemo(function(){return Object.keys(a)},[a]),v=i.onFocusItem,y=i.autoFocus,x=i.onRegisterTree,S=i.onUnregisterTree,C=i.items,k=i.viewState,E=mb(v),j=mb(k),I=b.useMemo(function(){return n7(h,function(V){var H;return DR(a[V].rootItem,(H=k[V])!==null&&H!==void 0?H:{},C)})},[a,C,h,k]),N=b.useCallback(function(V,H,z){var W,L,ne,$,P,U,O,X,pe;if(z===void 0&&(z=!0),(y??!0)&&z){var ve=(L=(W=_o())===null||W===void 0?void 0:W.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id="').concat(V.index,'"]')))!==null&&L!==void 0?L:(ne=_o())===null||ne===void 0?void 0:ne.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id]'));((U=(P=($=_o())===null||$===void 0?void 0:$.activeElement)===null||P===void 0?void 0:P.attributes.getNamedItem("data-rct-search-input"))===null||U===void 0?void 0:U.value)!=="true"?(O=ve?.focus)===null||O===void 0||O.call(ve):Fke(ve)}((X=j.current[H])===null||X===void 0?void 0:X.focusedItem)!==V.index&&((pe=E.current)===null||pe===void 0||pe.call(E,V,H))},[y,E,j]),T=b.useCallback(function(V){l(function(H){var z;return mc(mc({},H),(z={},z[V.treeId]=V,z))}),x?.(V)},[x]),A=b.useCallback(function(V){S?.(a[V]),delete a[V],l(a)},[S,a]),D=b.useCallback(function(V,H){n?.(V,H),l(function(z){return z})},[n]),F=b.useCallback(function(V,H){t?.(V,H),l(function(z){return z})},[t]),q=b.useCallback(function(V,H){r?.(V,H),l(function(z){return z})},[r]),ee=b.useCallback(function(V){var H,z,W=(H=_o())===null||H===void 0?void 0:H.querySelector('[data-rct-tree="'.concat(V,'"] [data-rct-item-focus="true"]'));(z=W?.focus)===null||z===void 0||z.call(W)},[]),G=b.useCallback(function(V,H){H===void 0&&(H=!0);var z=function(L){var ne,$;H&&(y??!0)&&L&&!(!(($=(ne=_o())===null||ne===void 0?void 0:ne.querySelector('[data-rct-tree="'.concat(L,'"]')))===null||$===void 0)&&$.contains(document.activeElement))&&ee(L)};if(typeof V=="function")m(function(L){var ne=V(L);return ne!==L&&z(ne),ne});else{var W=V;m(W),z(W)}},[y,ee]),K=Vke(i);return mc(mc(mc({},K),i),{onFocusItem:N,registerTree:T,unregisterTree:A,onExpandItem:F,onCollapseItem:D,onDrop:q,setActiveTree:G,treeIds:h,trees:a,activeTreeId:f,linearItems:I})},c7=b.createContext(null),yn=function(){return b.useContext(c7)},qke=b.forwardRef(function(e,t){var n=Hke(e),r=e.viewState,i=e.onFocusItem;return b.useEffect(function(){for(var o,a,l,d=0,f=Object.keys(n.trees);d<f.length;d++){var m=f[d],h=(a=(o=e.items[n.trees[m].rootItem])===null||o===void 0?void 0:o.children)===null||a===void 0?void 0:a[0],v=h&&e.items[h];!(!((l=r[m])===null||l===void 0)&&l.focusedItem)&&n.trees[m]&&v&&i?.(v,m,!1)}},[n.trees,i,e.items,r]),b.createElement(c7.Provider,{value:n},b.createElement(Nke,null,b.createElement(Pke,null,b.createElement(Lke,{ref:t},e.children))))}),Kke=function(e){var t,n=e.treeId,r=ja(),i=r.draggingPosition,o=r.itemHeight,a=ri().renderers,l=i&&i.targetType==="between-items"&&i.treeId===n;if(!l)return null;var d={onDragOver:function(f){return f.preventDefault()}};return b.createElement("div",{style:{position:"absolute",left:"0",right:"0",top:"".concat(((t=i?.linearIndex)!==null&&t!==void 0?t:0)*o,"px")}},a.renderDragBetweenLine({draggingPosition:i,lineProps:d}))},tf=function(e,t,n){var r=Co(n);b.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},Gke=function(e,t,n){var r=b.useState(!1),i=r[0],o=r[1],a=b.useRef(!1),l=Nf();return tf(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),tf(e,"focusout",function(){a.current=!0,l(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},Hv=function(e,t,n){tf(_o(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},PP={expandSiblings:["control+*"],moveFocusToFirstItem:["home"],moveFocusToLastItem:["end"],primaryAction:["enter"],renameItem:["f2"],abortRenameItem:["escape"],toggleSelectItem:["control+ "],abortSearch:["escape","enter"],startSearch:[],selectAll:["control+a"],startProgrammaticDnd:["control+shift+d"],completeProgrammaticDnd:["enter"],abortProgrammaticDnd:["escape"]},hb=function(){return hb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},hb.apply(this,arguments)},u7=function(){var e=yn();return b.useMemo(function(){return e.keyboardBindings?hb(hb({},PP),e.keyboardBindings):PP},[e.keyboardBindings])},Zke=["input","textarea"],go=function(e,t,n,r){r===void 0&&(r=!1);var i=b.useRef([]),o=u7(),a=Nf(),l=b.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);tf(_o(),"keydown",function(d){var f;if(n!==!1&&!((Zke.includes((f=d.target.tagName)===null||f===void 0?void 0:f.toLowerCase())||d.target.isContentEditable)&&!r)&&!i.current.includes(d.key)){i.current.push(d.key);var m=i.current.map(function(v){return v.toLowerCase()}),h=l.map(function(v){return m.map(function(y){return v.includes(y.toLowerCase())}).reduce(function(y,x){return y&&x},!0)}).reduce(function(v,y){return v||y},!1);h&&(i.current.length>1||!/^[a-zA-Z\s]$/.test(d.key))&&d.preventDefault()}}),tf(_o(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),m=l.map(function(h){return h.map(function(v){return f.includes(v.toLowerCase())}).reduce(function(v,y){return v&&y},!0)}).reduce(function(h,v){return h||v},!1);m&&a(function(){return t(d)}),i.current=i.current.filter(function(h){return h!==d.key})}})},qh=function(){var e,t=ri().treeId,n=yn().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},U0=function(e){return yn().linearItems[e]},Yke=function(){var e=ri().treeId,t=yn(),n=t.onFocusItem,r=t.items,i=U0(e),o=qh();return Co(function(a){var l,d=(l=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&l!==void 0?l:0,f=a(d,i),m=Math.max(0,Math.min(i.length-1,f)),h=r[i[m].item];return n?.(h,e),h})},MP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Wke=function(e){var t=b.useRef({target:e,previous:void 0});return t.current.target!==e&&(t.current.previous=t.current.target,t.current.target=e),t.current.previous},d7=function(e){var t=qh(),n=ri().treeId,r=U0(n),i=yn().onSelectItems,o=Wke(t.focusedItem);return b.useCallback(function(a,l){var d,f;l===void 0&&(l=!1);var m=a.index,h=function(C,k){var E=MP(MP([],l?[]:C,!0),k.filter(function(j){return l||!C.includes(j)}),!0);i?.(E,n)};if(t&&t.selectedItems&&t.selectedItems.length>0){var v=t.focusedItem===m?o:t.focusedItem,y=e==="last-focus"?r.findIndex(function(C){return v===C.item}):r.findIndex(function(C){var k;return(k=t.selectedItems)===null||k===void 0?void 0:k.includes(C.item)}),x=r.findIndex(function(C){return C.item===m});if(y<x){var S=r.slice(y,x+1).map(function(C){var k=C.item;return k});h((d=t.selectedItems)!==null&&d!==void 0?d:[],S)}else{var S=r.slice(x,y+1).map(function(k){var E=k.item;return E});h((f=t.selectedItems)!==null&&f!==void 0?f:[],S)}}else i?.([m],n)},[t,i,n,e,r,o])},zP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Xke=function(){var e,t=yn(),n=ri(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,l=U0(r),d=ja(),f=qh(),m=Yke(),h=d7("first-selected"),v=t.activeTreeId===r,y=!!a,x=t.disableArrowKeys,S=!x&&v&&!y;Hv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var k=m(function(E){return E+1});C.shiftKey&&h(k)}},S),Hv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var k=m(function(E){return E-1});C.shiftKey&&h(k)}},S),go("moveFocusToFirstItem",function(C){C.preventDefault(),m(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),go("moveFocusToLastItem",function(C){C.preventDefault(),m(function(k,E){return E.length-1})},v&&!d.isProgrammaticallyDragging&&!y),Hv("arrowright",function(C){C.preventDefault(),m(function(k,E){var j,I,N=t.items[E[k].item];if(N.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(N.index))return k+1;(I=t.onExpandItem)===null||I===void 0||I.call(t,N,r)}return k})},S&&!d.isProgrammaticallyDragging),Hv("arrowleft",function(C){C.preventDefault(),m(function(k,E){var j,I,N=t.items[E[k].item],T=E[k].depth;if(N.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(N.index)))(I=t.onCollapseItem)===null||I===void 0||I.call(t,N,r);else if(T>0){var A=k;for(A;E[A].depth!==T-1;A-=1);return A}return k})},S&&!d.isProgrammaticallyDragging),go("primaryAction",function(C){var k,E;C.preventDefault(),f.focusedItem!==void 0&&((k=t.onSelectItems)===null||k===void 0||k.call(t,[f.focusedItem],r),(E=t.onPrimaryAction)===null||E===void 0||E.call(t,t.items[f.focusedItem],r))},v&&!d.isProgrammaticallyDragging&&!y),go("toggleSelectItem",function(C){var k,E,j;C.preventDefault(),C.stopPropagation(),f.focusedItem!==void 0&&(f.selectedItems&&f.selectedItems.includes(f.focusedItem)?(k=t.onSelectItems)===null||k===void 0||k.call(t,f.selectedItems.filter(function(I){return I!==f.focusedItem}),r):(E=t.onSelectItems)===null||E===void 0||E.call(t,zP(zP([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),go("selectAll",function(C){var k;C.preventDefault(),(k=t.onSelectItems)===null||k===void 0||k.call(t,l.map(function(E){var j=E.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),go("renameItem",function(C){var k;if(f.focusedItem!==void 0){C.preventDefault();var E=t.items[f.focusedItem];E.canRename!==!1&&((k=t.onStartRenamingItem)===null||k===void 0||k.call(t,E,r),i(E.index))}},v&&((e=t.canRename)!==null&&e!==void 0?e:!0)&&!y),go("startSearch",function(C){var k,E;C.preventDefault(),o(""),(E=(k=document.querySelector('[data-rct-search-input="true"]'))===null||k===void 0?void 0:k.focus)===null||E===void 0||E.call(k)},v&&!d.isProgrammaticallyDragging&&!y),go("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),go("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),go("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},f7=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},Jke=function(){var e=yn(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=ri(),a=o.search,l=o.treeId,d=U0(l),f=Nf();fb(function(){a&&a.length>0&&f(function(){var m=d.find(function(h){var v=h.item;return(t??f7)(a,n[v],r(n[v]))});m&&i?.(n[m.item],l)})},[t,r,d,n,i,a,l,f],[a])},xk=function(){return xk=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},xk.apply(this,arguments)},Qke=function(e){var t,n=e.containerRef,r=ri(),i=r.search,o=r.setSearch,a=r.treeId,l=r.renderers,d=r.renamingItem,f=yn();qh();var m=f.activeTreeId===a,h=Nf();Jke();var v=function(){var y,x,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(x=_o())===null||x===void 0?void 0:x.querySelector('[data-rct-tree="'.concat(a,'"] [data-rct-item-focus="true"]'));(S=C?.focus)===null||S===void 0||S.call(C)}};return go("abortSearch",function(){h(function(){v()})},m&&i!==null,!0),tf(n,"keydown",function(y){var x,S,C=y.key.charCodeAt(0);(!((x=f.canSearch)!==null&&x!==void 0)||x)&&(!((S=f.canSearchByStartingTyping)!==null&&S!==void 0)||S)&&m&&i===null&&!d&&!y.ctrlKey&&!y.shiftKey&&!y.altKey&&!y.metaKey&&(C>=48&&C<=57||C>=97&&C<=122)&&o("")}),!(!((t=f.canSearch)!==null&&t!==void 0)||t)||i===null?null:l.renderSearchInput({inputProps:xk({value:i,onChange:function(y){return o(y.target.value)},onBlur:function(){v()},ref:function(y){var x;(x=y?.focus)===null||x===void 0||x.call(y)},"aria-label":"Search for items"},{"data-rct-search-input":"true"})})},eEe={introduction:`
    <p>Accessibility guide for tree {treeLabel}.</p>
    <p>
      Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
    </p>
    <ul>
      <li>{keybinding:primaryAction} to execute primary action on focused item</li>
      <li>{keybinding:renameItem} to start renaming the focused item</li>
      <li>{keybinding:abortRenameItem} to abort renaming an item</li>
      <li>{keybinding:startProgrammaticDnd} to start dragging selected items</li>
    </ul>
  `,renamingItem:`
    <p>Renaming the item {renamingItem}.</p>
    <p>Use the keybinding {keybinding:abortRenameItem} to abort renaming.</p>
  `,searching:`
    <p>Searching</p>
  `,programmaticallyDragging:`
    <p>Dragging items {dragItems}.</p>
    <p>Press the arrow keys to move the drag target.</p>
    <p>Press {keybinding:completeProgrammaticDnd} to drop or {keybinding:abortProgrammaticDnd} to abort.</p>
  `,programmaticallyDraggingTarget:`
    <p>Drop target is {dropTarget}.</p>
  `},Bp=function(e,t,n,r,i){var o=function(a){return t.getItemTitle(t.items[a])};return e.replace(/({[^\s}]+)}/g,function(a){var l,d,f,m=a.slice(1,-1);switch(m){case"treeLabel":return(l=r.treeLabel)!==null&&l!==void 0?l:"";case"renamingItem":return r.renamingItem?o(r.renamingItem):"None";case"dragItems":return(f=(d=n.draggingItems)===null||d===void 0?void 0:d.map(function(y){return t.getItemTitle(y)}).join(", "))!==null&&f!==void 0?f:"None";case"dropTarget":{if(!n.draggingPosition)return"None";if(n.draggingPosition.targetType==="item"||n.draggingPosition.targetType==="root")return"within ".concat(o(n.draggingPosition.targetItem));var h=t.items[n.draggingPosition.parentItem],v=t.getItemTitle(h);return n.draggingPosition.childIndex===0?"within ".concat(v," at the start"):"within ".concat(v," after ").concat(o(h.children[n.draggingPosition.childIndex-1]))}default:if(m.startsWith("keybinding:"))return i[m.slice(11)][0];throw Error("Unknown live descriptor variable {".concat(m,"}"))}})},Hp=function(e){var t=e.children,n=e.live;return b.createElement("div",{"aria-live":n,dangerouslySetInnerHTML:{__html:t}})},tEe=function(){var e=yn(),t=ri(),n=ja(),r=u7(),i=b.useMemo(function(){var a;return(a=e.liveDescriptors)!==null&&a!==void 0?a:eEe},[e.liveDescriptors]),o=t.renderers.renderLiveDescriptorContainer;return t.treeInformation.isRenaming?b.createElement(o,{tree:t},b.createElement(Hp,{live:"polite"},Bp(i.renamingItem,e,n,t,r))):t.treeInformation.isSearching?b.createElement(o,{tree:t},b.createElement(Hp,{live:"polite"},Bp(i.searching,e,n,t,r))):t.treeInformation.isProgrammaticallyDragging?b.createElement(o,{tree:t},b.createElement(Hp,{live:"polite"},Bp(i.programmaticallyDragging,e,n,t,r)),b.createElement(Hp,{live:"assertive"},Bp(i.programmaticallyDraggingTarget,e,n,t,r))):b.createElement(o,{tree:t},b.createElement(Hp,{live:"off"},Bp(i.introduction,e,n,t,r)))},nEe=function(){var e,t=yn();return!((e=t.showLiveDescription)!==null&&e!==void 0)||e?b.createElement(tEe,null):null},wk=function(){return wk=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},wk.apply(this,arguments)},rEe=function(){var e=ri(),t=e.treeId,n=e.rootItem,r=e.renderers,i=e.treeInformation,o=yn(),a=b.useRef(),l=ja();Xke(),Gke(a.current,function(){o.setActiveTree(t)},function(){o.setActiveTree(function(h){return h===t?void 0:h})});var d=o.items[n].children,f=b.createElement(b.Fragment,null,b.createElement(nEe,null),b.createElement(m7,{depth:0,parentId:n},d??[]),b.createElement(Kke,{treeId:t}),b.createElement(Qke,{containerRef:a.current})),m=wk({onDragOver:function(h){h.preventDefault(),l.onDragOverTreeHandler(h,t,a)},onDragLeave:function(h){l.onDragLeaveContainerHandler(h,a)},onMouseDown:function(){return l.abortProgrammaticDrag()},ref:a,style:{position:"relative"},role:"tree","aria-label":i.treeLabelledBy?void 0:i.treeLabel,"aria-labelledby":i.treeLabelledBy},{"data-rct-tree":t});return r.renderTreeContainer({children:f,info:i,containerProps:m})},iEe=function(e,t,n){var r,i=yn(),o=ja(),a=(r=i.viewState[e.treeId])===null||r===void 0?void 0:r.selectedItems;return b.useMemo(function(){var l,d;return{isFocused:i.activeTreeId===e.treeId,isRenaming:!!t,areItemsSelected:((l=a?.length)!==null&&l!==void 0?l:0)>0,isSearching:n!==null,search:n,isProgrammaticallyDragging:(d=o.isProgrammaticallyDragging)!==null&&d!==void 0?d:!1,treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy}},[i.activeTreeId,e.treeId,e.rootItem,e.treeLabel,e.treeLabelledBy,t,a?.length,n,o.isProgrammaticallyDragging])},dm=function(){return dm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},dm.apply(this,arguments)},oEe=function(e,t){var n=yn(),r=ri(),i=ja();b.useImperativeHandle(e,function(){return dm(dm(dm({},t),{treeEnvironmentContext:n,dragAndDropContext:i,treeContext:r}),r.treeInformation)})},aEe=b.createContext(null),sEe=b.forwardRef(function(e,t){yn();var n=ri();ja();var r=zke(),i=b.useMemo(function(){return{abortRenamingItem:function(){n.setRenamingItem(null)},abortSearch:function(){n.setSearch(null)},collapseItem:function(o){r.collapseItem(o,n.treeId)},completeRenamingItem:function(){},expandItem:function(o){r.expandItem(o,n.treeId)},focusItem:function(o,a){a===void 0&&(a=!0),r.focusItem(o,n.treeId,a)},focusTree:function(o){o===void 0&&(o=!0),r.focusTree(n.treeId,o)},invokePrimaryAction:function(o){r.invokePrimaryAction(o,n.treeId)},moveFocusDown:function(){r.moveFocusDown(n.treeId)},moveFocusUp:function(){r.moveFocusUp(n.treeId)},renameItem:function(o,a){r.renameItem(o,a,n.treeId)},selectItems:function(o){r.selectItems(o,n.treeId)},setSearch:function(o){n.setSearch(o)},startRenamingItem:function(o){n.setRenamingItem(o)},stopRenamingItem:function(){n.setRenamingItem(null)},toggleItemExpandedState:function(o){r.toggleItemExpandedState(o,n.treeId)},toggleItemSelectStatus:function(o){r.toggleItemSelectStatus(o,n.treeId)},expandAll:function(){r.expandAll(n.treeId)},collapseAll:function(){r.collapseAll(n.treeId)},expandSubsequently:function(o){return r.expandSubsequently(n.treeId,o)}}},[r,n]);return oEe(t,i),b.createElement(aEe.Provider,{value:i},e.children)}),gb=function(){return gb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},gb.apply(this,arguments)},p7=b.createContext(null),ri=function(){return b.useContext(p7)},lEe=b.forwardRef(function(e,t){var n,r=yn(),i=b.useMemo(function(){return gb(gb({},r),e)},[e,r]),o=b.useState(null),a=o[0],l=o[1],d=b.useState(null),f=d[0],m=d[1],h=r.items[e.rootItem],v=r.viewState[e.treeId];b.useEffect(function(){return r.registerTree({treeId:e.treeId,rootItem:e.rootItem}),function(){return r.unregisterTree(e.treeId)}},[e.treeId,e.rootItem]);var y=iEe(e,f,a),x=b.useMemo(function(){return{treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy,getItemsLinearly:function(){return DR(e.rootItem,v??{},r.items)},treeInformation:y,search:a,setSearch:l,renamingItem:f,setRenamingItem:m,renderers:i}},[r.items,e.rootItem,e.treeId,e.treeLabel,e.treeLabelledBy,f,i,a,y,v]);return h===void 0?((n=r.onMissingItems)===null||n===void 0||n.call(r,[e.rootItem]),null):b.createElement(p7.Provider,{value:x},b.createElement(sEe,{ref:t},b.createElement(rEe,null)))}),m7=function(e){for(var t=ri(),n=t.renderers,r=t.treeInformation,i=[],o=0,a=e.children;o<a.length;o++){var l=a[o];i.push(J.createElement(dEe,{key:l,itemIndex:l,depth:e.depth}))}if(i.length===0)return null;var d={role:e.depth!==0?"group":void 0};return n.renderItemsContainer({children:i,info:r,containerProps:d,depth:e.depth,parentId:e.parentId})},Ws=function(){return Ws=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ws.apply(this,arguments)},LP=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},cEe=function(e){var t,n,r,i,o=ri(),a=o.treeId,l=o.search,d=o.renamingItem,f=o.setRenamingItem,m=yn(),h=Tke(),v=ja(),y=d7("last-focus"),x=e&&m.getItemTitle(e),S=r7(),C=b.useMemo(function(){var I;return l===null||l.length===0||!e||!x?!1:((I=m.doesSearchMatchItem)!==null&&I!==void 0?I:f7)(l,e,x)},[l,e,x,m.doesSearchMatchItem]),k=e&&((n=(t=m.viewState[a])===null||t===void 0?void 0:t.selectedItems)===null||n===void 0?void 0:n.includes(e.index)),E=e&&((i=(r=m.viewState[a])===null||r===void 0?void 0:r.expandedItems)===null||i===void 0?void 0:i.includes(e.index)),j=e&&d===e.index;return b.useMemo(function(){var I,N,T,A,D,F,q,ee,G;if(e){var K=m.viewState[a],V=((N=(I=K?.selectedItems)===null||I===void 0?void 0:I.map(function(Q){return m.items[Q]}))!==null&&N!==void 0?N:K?.focusedItem?[m.items[K?.focusedItem]]:[]).filter(function(Q){return!!Q}),H=!!V.find(function(Q){return Q.index===e.index}),z=V&&((A=(T=m.canDrag)===null||T===void 0?void 0:T.call(m,V))!==null&&A!==void 0?A:!0)&&V.map(function(Q){var le;return(le=Q.canMove)!==null&&le!==void 0?le:!0}).reduce(function(Q,le){return Q&&le},!0),W=((F=(D=m.canDrag)===null||D===void 0?void 0:D.call(m,[e]))!==null&&F!==void 0?F:!0)&&((q=e.canMove)!==null&&q!==void 0?q:!0),L=m.canDragAndDrop&&(H&&z||!H&&W),ne=m.canDragAndDrop&&!!(!((G=(ee=v.viableDragPositions)===null||ee===void 0?void 0:ee[a])===null||G===void 0)&&G.find(function(Q){return Q.targetType==="item"&&Q.targetItem===e.index})),$={primaryAction:function(){var Q;(Q=m.onPrimaryAction)===null||Q===void 0||Q.call(m,m.items[e.index],a)},collapseItem:function(){var Q;(Q=m.onCollapseItem)===null||Q===void 0||Q.call(m,e,a)},expandItem:function(){var Q;(Q=m.onExpandItem)===null||Q===void 0||Q.call(m,e,a)},toggleExpandedState:function(){var Q,le;E?(Q=m.onCollapseItem)===null||Q===void 0||Q.call(m,e,a):(le=m.onExpandItem)===null||le===void 0||le.call(m,e,a)},selectItem:function(){var Q;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,[e.index],a)},addToSelectedItems:function(){var Q,le;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,LP(LP([],(le=K?.selectedItems)!==null&&le!==void 0?le:[],!0),[e.index],!1),a)},unselectItem:function(){var Q,le,Se;(Q=m.onSelectItems)===null||Q===void 0||Q.call(m,(Se=(le=K?.selectedItems)===null||le===void 0?void 0:le.filter(function(ke){return ke!==e.index}))!==null&&Se!==void 0?Se:[],a)},selectUpTo:function(Q){y(e,Q)},startRenamingItem:function(){f(e.index)},stopRenamingItem:function(){f(null)},focusItem:function(Q){var le;Q===void 0&&(Q=!0),(le=m.onFocusItem)===null||le===void 0||le.call(m,e,a,Q)},startDragging:function(){var Q,le,Se=(Q=K?.selectedItems)!==null&&Q!==void 0?Q:[];if(Se.includes(e.index)||(Se=[e.index],(le=m.onSelectItems)===null||le===void 0||le.call(m,Se,a)),L){var ke=S(a,Se.map(function(Pe){return m.items[Pe]}));v.onStartDraggingItems(ke,a)}}},P={isSelected:k,isExpanded:E,isFocused:K?.focusedItem===e.index,isRenaming:j,isDraggingOver:v.draggingPosition&&v.draggingPosition.targetType==="item"&&v.draggingPosition.targetItem===e.index&&v.draggingPosition.treeId===a,isDraggingOverParent:!1,isSearchMatching:C,canDrag:L,canDropOn:ne},U=Ws(Ws({},h.createInteractiveElementProps(e,a,$,P,K)),{"data-rct-item-interactive":!0,"data-rct-item-focus":P.isFocused?"true":"false","data-rct-item-id":e.index}),O=Ws({},{"data-rct-item-container":"true"}),X={role:"treeitem","aria-selected":P.isSelected,"aria-expanded":e.isFolder?P.isExpanded?"true":"false":void 0},pe={onClick:function(){e.isFolder&&$.toggleExpandedState(),$.selectItem()},onFocus:function(){$.focusItem()},onDragOver:function(Q){Q.preventDefault()},"aria-hidden":!0,tabIndex:-1},ve=K?Object.entries(K).reduce(function(Q,le){var Se=le[0],ke=le[1];return Q[Se]=Array.isArray(ke)?ke.includes(e.index):ke===e.index,Q},{}):{};return Ws(Ws(Ws({},$),P),{interactiveElementProps:U,itemContainerWithChildrenProps:X,itemContainerWithoutChildrenProps:O,arrowProps:pe,viewStateFlags:ve})}},[e,m,a,v,k,E,j,C,h,y,f,S])},uEe=function(e){var t=ri(),n=t.renderers,r=t.treeInformation,i=t.setRenamingItem,o=t.treeId,a=yn(),l=b.useRef(null),d=b.useRef(null),f=a.items[e.itemIndex],m=b.useState(a.getItemTitle(f)),h=m[0],v=m[1],y=Nf(!0),x=function(){var j;(j=a.onAbortRenamingItem)===null||j===void 0||j.call(a,f,r.treeId),i(null),y(function(){a.setActiveTree(o)})},S=function(){var j;(j=a.onRenameItem)===null||j===void 0||j.call(a,f,h,r.treeId),i(null),y(function(){a.setActiveTree(o)})};fb(function(){var j,I,N,T;a.setActiveTree(o),(!((j=a.autoFocus)!==null&&j!==void 0)||j)&&((I=l.current)===null||I===void 0||I.select(),(T=(N=l.current)===null||N===void 0?void 0:N.focus)===null||T===void 0||T.call(N))},[a,o],[]),go("abortRenameItem",function(){x()},!0,!0);var C={value:h,onChange:function(j){v(j.target.value)},onBlur:function(j){(!j.relatedTarget||j.relatedTarget!==d.current)&&x()},"aria-label":"New item name",tabIndex:0},k={onClick:function(j){j.stopPropagation(),S()}},E={onSubmit:function(j){j.preventDefault(),S()}};return n.renderRenameInput({item:f,inputRef:l,submitButtonProps:k,submitButtonRef:d,formProps:E,inputProps:C})},dEe=function(e){var t,n,r,i,o=b.useState(!1),a=o[0],l=o[1],d=ri(),f=d.renderers,m=d.treeInformation,h=d.renamingItem,v=yn(),y=qh(),x=v.items[e.itemIndex],S=b.useMemo(function(){var T;return(T=y.expandedItems)===null||T===void 0?void 0:T.includes(e.itemIndex)},[e.itemIndex,y.expandedItems]),C=cEe(x);if(x===void 0||C===void 0)return a||(l(!0),(t=v.onMissingItems)===null||t===void 0||t.call(v,[e.itemIndex])),null;var k=(r=(n=v.shouldRenderChildren)===null||n===void 0?void 0:n.call(v,x,C))!==null&&r!==void 0?r:x.isFolder&&S,E=x.children&&k&&J.createElement(m7,{depth:e.depth+1,parentId:e.itemIndex},x.children),j=v.getItemTitle(x),I=h===e.itemIndex?J.createElement(uEe,{itemIndex:e.itemIndex}):f.renderItemTitle({info:m,context:C,title:j,item:x}),N=f.renderItemArrow({info:m,context:C,item:v.items[e.itemIndex]});return(i=f.renderItem({item:v.items[e.itemIndex],depth:e.depth,title:I,arrow:N,context:C,info:m,children:E}))!==null&&i!==void 0?i:null};function Er(e){return!!e?.entries}const I1="__root__",Xs="importedApplications",Eo="newApplication";function fEe(e){const t={},n=[],r=[],i=[];for(const o of e)Er(o)?o.package?r.push(o.path):n.push(o.path):i.push(o.path),h7(t,o);return t[I1]={index:I1,isFolder:!0,children:[Eo,Xs,...n,...i],data:void 0,canMove:!1,canRename:!1},t[Xs]={index:Xs,isFolder:!0,children:r,data:{name:"Imported Applications",path:Xs,package:Xs,project:"",entries:[]},canMove:!1,canRename:!1},t[Eo]={index:Eo,isFolder:!1,data:{name:"New Application",path:Eo,project:""},canMove:!1,canRename:!1},{items:t,rootId:I1}}function h7(e,t){const n=t.path;if(Er(t)){const r=t,i=[],o=[];for(const a of r.entries)Er(a)?i.push(a.path):o.push(a.path);e[n]={index:n,isFolder:!0,children:[...i,...o],data:t,canMove:!1,canRename:!1};for(const a of r.entries)h7(e,a)}else e[n]={index:n,isFolder:!1,data:t,canMove:!t.package,canRename:!t.package}}function pEe(){const[e,t]=b.useState(!1),[n,r]=b.useState(void 0),i=b.useCallback(l=>{if(!l.dataTransfer?.types?.includes("Files"))return;const f=l.target;if(f instanceof Element&&f.classList.contains("rct-tree-item-button-isFolder")){const m=f.getAttribute("data-rct-item-id");!f.querySelector(".packageIsLocked")&&m&&m!==Xs&&m!==Eo&&r(v=>v!==f?(v?.classList?.remove?.("rct-tree-item-title-container-dragging-over"),f.classList.add("rct-tree-item-title-container-dragging-over"),f):v)}t(!0)},[]),o=b.useCallback(()=>{t(!1),r(l=>{l&&l.classList.remove("rct-tree-item-title-container-dragging-over")})},[]),a=b.useCallback(l=>{if(!l.dataTransfer?.types?.includes("Files")||l.detail===1337)return;t(!1),n&&(n.classList.remove("rct-tree-item-title-container-dragging-over"),r(void 0));const f=document.getElementById("dropTarget");return f?f.dispatchEvent(new DragEvent("drop",{bubbles:!0,detail:1337,cancelable:!0,dataTransfer:l.dataTransfer})):!1},[n]);return b.useEffect(()=>(document.addEventListener("dragenter",i),document.addEventListener("dragover",i),document.addEventListener("dragleave",o),document.addEventListener("drop",a),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragover",i),document.removeEventListener("dragleave",o),document.removeEventListener("drop",a)}),[i,a,o]),b.useMemo(()=>({dragging:e,dragTarget:n}),[e,n])}function mEe(e){return new Promise((t,n)=>{const r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}const hEe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function nf(e,t,n){const r=gEe(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&FP(r,"path",o),FP(r,"relativePath",o),r}function gEe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=hEe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function FP(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const vEe=[".DS_Store","Thumbs.db"];function yEe(e){return iu(this,void 0,void 0,function*(){return vb(e)&&bEe(e.dataTransfer)?_Ee(e.dataTransfer,e.type):xEe(e)?wEe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?SEe(e):[]})}function bEe(e){return vb(e)}function xEe(e){return vb(e)&&vb(e.target)}function vb(e){return typeof e=="object"&&e!==null}function wEe(e){return Sk(e.target.files).map(t=>nf(t))}function SEe(e){return iu(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>nf(n))})}function _Ee(e,t){return iu(this,void 0,void 0,function*(){if(e.items){const n=Sk(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(CEe));return UP(g7(r))}return UP(Sk(e.files).map(n=>nf(n)))})}function UP(e){return e.filter(t=>vEe.indexOf(t.name)===-1)}function Sk(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function CEe(e){if(typeof e.webkitGetAsEntry!="function")return VP(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?v7(t):VP(e,t)}function g7(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?g7(n):[n]],[])}function VP(e,t){return iu(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const a=yield o.getFile();return a.handle=o,nf(a)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return nf(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function kEe(e){return iu(this,void 0,void 0,function*(){return e.isDirectory?v7(e):EEe(e)})}function v7(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(a=>iu(this,void 0,void 0,function*(){if(a.length){const l=Promise.all(a.map(kEe));i.push(l),o()}else try{const l=yield Promise.all(i);n(l)}catch(l){r(l)}}),a=>{r(a)})}o()})}function EEe(e){return iu(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=nf(r,e.fullPath);t(i)},r=>{n(r)})})})}var qv={},BP;function jEe(){return BP||(BP=1,qv.__esModule=!0,qv.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):i===l})}return!0}),qv}var IEe=jEe();const R1=of(IEe);function HP(e){return NEe(e)||TEe(e)||b7(e)||REe()}function REe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NEe(e){if(Array.isArray(e))return _k(e)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zm(e,t){return $Ee(e)||OEe(e,t)||b7(e,t)||AEe()}function AEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b7(e,t){if(e){if(typeof e=="string")return _k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _k(e,t)}}function _k(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OEe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,l;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(d){o=!0,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function $Ee(e){if(Array.isArray(e))return e}var DEe=typeof R1=="function"?R1:R1.default,PEe="file-invalid-type",MEe="file-too-large",zEe="file-too-small",LEe="too-many-files",FEe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:PEe,message:"File type must be ".concat(r)}},GP=function(t){return{code:MEe,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},ZP=function(t){return{code:zEe,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},UEe={code:LEe,message:"Too many files"};function x7(e,t){var n=e.type==="application/x-moz-file"||DEe(e,t);return[n,n?null:FEe(t)]}function w7(e,t,n){if(hc(e.size))if(hc(t)&&hc(n)){if(e.size>n)return[!1,GP(n)];if(e.size<t)return[!1,ZP(t)]}else{if(hc(t)&&e.size<t)return[!1,ZP(t)];if(hc(n)&&e.size>n)return[!1,GP(n)]}return[!0,null]}function hc(e){return e!=null}function VEe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,l=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(d){var f=x7(d,n),m=zm(f,1),h=m[0],v=w7(d,r,i),y=zm(v,1),x=y[0],S=l?l(d):null;return h&&x&&!S})}function yb(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kv(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function YP(e){e.preventDefault()}function BEe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function HEe(e){return e.indexOf("Edge/")!==-1}function qEe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return BEe(e)||HEe(e)}function sa(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(l){return!yb(r)&&l&&l.apply(void 0,[r].concat(o)),yb(r)})}}function KEe(){return"showOpenFilePicker"in window}function GEe(e){if(hc(e)){var t=Object.entries(e).filter(function(n){var r=zm(n,2),i=r[0],o=r[1],a=!0;return S7(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(o)||!o.every(_7))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=zm(r,2),o=i[0],a=i[1];return KP(KP({},n),{},y7({},o,a))},{});return[{description:"Files",accept:t}]}return e}function ZEe(e){if(hc(e))return Object.entries(e).reduce(function(t,n){var r=zm(n,2),i=r[0],o=r[1];return[].concat(HP(t),[i],HP(o))},[]).filter(function(t){return S7(t)||_7(t)}).join(",")}function YEe(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function WEe(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function S7(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function _7(e){return/^.*\.[\w]+$/.test(e)}var XEe=["children"],JEe=["open"],QEe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],eje=["refKey","onChange","onClick"];function tje(e){return ije(e)||rje(e)||C7(e)||nje()}function nje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ije(e){if(Array.isArray(e))return Ck(e)}function T1(e,t){return sje(e)||aje(e,t)||C7(e,t)||oje()}function oje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C7(e,t){if(e){if(typeof e=="string")return Ck(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ck(e,t)}}function Ck(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,l;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(d){o=!0,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function sje(e){if(Array.isArray(e))return e}function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){kk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bb(e,t){if(e==null)return{};var n=lje(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lje(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var PR=b.forwardRef(function(e,t){var n=e.children,r=bb(e,XEe),i=E7(r),o=i.open,a=bb(i,JEe);return b.useImperativeHandle(t,function(){return{open:o}},[o]),J.createElement(b.Fragment,null,n(On(On({},a),{},{open:o})))});PR.displayName="Dropzone";var k7={disabled:!1,getFilesFromEvent:yEe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};PR.defaultProps=k7;PR.propTypes={children:Qe.func,accept:Qe.objectOf(Qe.arrayOf(Qe.string)),multiple:Qe.bool,preventDropOnDocument:Qe.bool,noClick:Qe.bool,noKeyboard:Qe.bool,noDrag:Qe.bool,noDragEventsBubbling:Qe.bool,minSize:Qe.number,maxSize:Qe.number,maxFiles:Qe.number,disabled:Qe.bool,getFilesFromEvent:Qe.func,onFileDialogCancel:Qe.func,onFileDialogOpen:Qe.func,useFsAccessApi:Qe.bool,autoFocus:Qe.bool,onDragEnter:Qe.func,onDragLeave:Qe.func,onDragOver:Qe.func,onDrop:Qe.func,onDropAccepted:Qe.func,onDropRejected:Qe.func,onError:Qe.func,validator:Qe.func};var Ek={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function E7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=On(On({},k7),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,l=t.multiple,d=t.maxFiles,f=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,x=t.onDropRejected,S=t.onFileDialogCancel,C=t.onFileDialogOpen,k=t.useFsAccessApi,E=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,N=t.noKeyboard,T=t.noDrag,A=t.noDragEventsBubbling,D=t.onError,F=t.validator,q=b.useMemo(function(){return ZEe(n)},[n]),ee=b.useMemo(function(){return GEe(n)},[n]),G=b.useMemo(function(){return typeof C=="function"?C:XP},[C]),K=b.useMemo(function(){return typeof S=="function"?S:XP},[S]),V=b.useRef(null),H=b.useRef(null),z=b.useReducer(cje,Ek),W=T1(z,2),L=W[0],ne=W[1],$=L.isFocused,P=L.isFileDialogActive,U=b.useRef(typeof window<"u"&&window.isSecureContext&&k&&KEe()),O=function(){!U.current&&P&&setTimeout(function(){if(H.current){var me=H.current.files;me.length||(ne({type:"closeDialog"}),K())}},300)};b.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[H,P,K,U]);var X=b.useRef([]),pe=function(me){V.current&&V.current.contains(me.target)||(me.preventDefault(),X.current=[])};b.useEffect(function(){return j&&(document.addEventListener("dragover",YP,!1),document.addEventListener("drop",pe,!1)),function(){j&&(document.removeEventListener("dragover",YP),document.removeEventListener("drop",pe))}},[V,j]),b.useEffect(function(){return!r&&E&&V.current&&V.current.focus(),function(){}},[V,E,r]);var ve=b.useCallback(function(ie){D?D(ie):console.error(ie)},[D]),Q=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie),X.current=[].concat(tje(X.current),[ie.target]),Kv(ie)&&Promise.resolve(i(ie)).then(function(me){if(!(yb(ie)&&!A)){var B=me.length,ce=B>0&&VEe({files:me,accept:q,minSize:a,maxSize:o,multiple:l,maxFiles:d,validator:F}),Ee=B>0&&!ce;ne({isDragAccept:ce,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ie)}}).catch(function(me){return ve(me)})},[i,f,ve,A,q,a,o,l,d,F]),le=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie);var me=Kv(ie);if(me&&ie.dataTransfer)try{ie.dataTransfer.dropEffect="copy"}catch{}return me&&h&&h(ie),!1},[h,A]),Se=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie);var me=X.current.filter(function(ce){return V.current&&V.current.contains(ce)}),B=me.indexOf(ie.target);B!==-1&&me.splice(B,1),X.current=me,!(me.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kv(ie)&&m&&m(ie))},[V,m,A]),ke=b.useCallback(function(ie,me){var B=[],ce=[];ie.forEach(function(Ee){var Me=x7(Ee,q),Ke=T1(Me,2),Wt=Ke[0],Vt=Ke[1],Cn=w7(Ee,a,o),zt=T1(Cn,2),fn=zt[0],kt=zt[1],ar=F?F(Ee):null;if(Wt&&fn&&!ar)B.push(Ee);else{var In=[Vt,kt];ar&&(In=In.concat(ar)),ce.push({file:Ee,errors:In.filter(function(dr){return dr})})}}),(!l&&B.length>1||l&&d>=1&&B.length>d)&&(B.forEach(function(Ee){ce.push({file:Ee,errors:[UEe]})}),B.splice(0)),ne({acceptedFiles:B,fileRejections:ce,isDragReject:ce.length>0,type:"setFiles"}),v&&v(B,ce,me),ce.length>0&&x&&x(ce,me),B.length>0&&y&&y(B,me)},[ne,l,q,a,o,d,v,y,x,F]),Pe=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),An(ie),X.current=[],Kv(ie)&&Promise.resolve(i(ie)).then(function(me){yb(ie)&&!A||ke(me,ie)}).catch(function(me){return ve(me)}),ne({type:"reset"})},[i,ke,ve,A]),Fe=b.useCallback(function(){if(U.current){ne({type:"openDialog"}),G();var ie={multiple:l,types:ee};window.showOpenFilePicker(ie).then(function(me){return i(me)}).then(function(me){ke(me,null),ne({type:"closeDialog"})}).catch(function(me){YEe(me)?(K(me),ne({type:"closeDialog"})):WEe(me)?(U.current=!1,H.current?(H.current.value=null,H.current.click()):ve(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ve(me)});return}H.current&&(ne({type:"openDialog"}),G(),H.current.value=null,H.current.click())},[ne,G,K,k,ke,ve,ee,l]),ut=b.useCallback(function(ie){!V.current||!V.current.isEqualNode(ie.target)||(ie.key===" "||ie.key==="Enter"||ie.keyCode===32||ie.keyCode===13)&&(ie.preventDefault(),Fe())},[V,Fe]),Ze=b.useCallback(function(){ne({type:"focus"})},[]),Pt=b.useCallback(function(){ne({type:"blur"})},[]),dn=b.useCallback(function(){I||(qEe()?setTimeout(Fe,0):Fe())},[I,Fe]),tn=function(me){return r?null:me},br=function(me){return N?null:tn(me)},Yt=function(me){return T?null:tn(me)},An=function(me){A&&me.stopPropagation()},Y=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ie.refKey,B=me===void 0?"ref":me,ce=ie.role,Ee=ie.onKeyDown,Me=ie.onFocus,Ke=ie.onBlur,Wt=ie.onClick,Vt=ie.onDragEnter,Cn=ie.onDragOver,zt=ie.onDragLeave,fn=ie.onDrop,kt=bb(ie,QEe);return On(On(kk({onKeyDown:br(sa(Ee,ut)),onFocus:br(sa(Me,Ze)),onBlur:br(sa(Ke,Pt)),onClick:tn(sa(Wt,dn)),onDragEnter:Yt(sa(Vt,Q)),onDragOver:Yt(sa(Cn,le)),onDragLeave:Yt(sa(zt,Se)),onDrop:Yt(sa(fn,Pe)),role:typeof ce=="string"&&ce!==""?ce:"presentation"},B,V),!r&&!N?{tabIndex:0}:{}),kt)}},[V,ut,Ze,Pt,dn,Q,le,Se,Pe,N,T,r]),re=b.useCallback(function(ie){ie.stopPropagation()},[]),se=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ie.refKey,B=me===void 0?"ref":me,ce=ie.onChange,Ee=ie.onClick,Me=bb(ie,eje),Ke=kk({accept:q,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:tn(sa(ce,Pe)),onClick:tn(sa(Ee,re)),tabIndex:-1},B,H);return On(On({},Ke),Me)}},[H,n,l,Pe,r]);return On(On({},L),{},{isFocused:$&&!r,getRootProps:Y,getInputProps:se,rootRef:V,inputRef:H,open:tn(Fe)})}function cje(e,t){switch(t.type){case"focus":return On(On({},e),{},{isFocused:!0});case"blur":return On(On({},e),{},{isFocused:!1});case"openDialog":return On(On({},Ek),{},{isFileDialogActive:!0});case"closeDialog":return On(On({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return On(On({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return On(On({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return On({},Ek);default:return e}}function XP(){}function uje(){const[e,t]=b.useState(""),{clusterId:n}=rt({strict:!1}),{openedEntry:r,restrictPackageModification:i,reloadRootEntries:o,entryExists:a}=Lr(),l=!!r&&!r.package&&!i,d=Zt(),{dragging:f,dragTarget:m}=pEe(),v=m?.getAttribute?.("data-rct-item-id")?.split?.("/")?.pop?.(),y=r?.project;let x=!1,S;if(r?.path){const I=r.path.split("/"),N=Er(r);x=l&&(N?I.slice(1):I.slice(1,-1)).join("/"),S=I[I.length-(N?1:2)]}const C=b.useCallback(async(I,N)=>{const T=m?.getAttribute?.("data-rct-item-id")?.split?.("/"),A=T?.length?T[0]:l?y:!1,D=T?.length?T.slice(1).join("/"):l?x:!1;if(A===!1||A===void 0||D===!1||D===void 0)return;const F=[],q=N.slice();for(const L of I){const ne=JP(D,L);L.name.startsWith(".")||L.relativePath?.includes("/.")?q.push({file:L,errors:[{message:"Sensitive files and folders starting with . are skipped.",code:"dot-ignored"}]}):a(`${A}/${ne}`)?q.push({file:L,errors:[{message:`${ne} already exists`,code:"duplicate"}]}):F.push(L)}let ee=!1;const G="uploading-files",K={label:"Cancel",onClick:()=>{ee=!0}},V={label:"OK",onClick:()=>{}};t(`Uploading ${Yr(F.length,"file","files")}...`);const H=F.reduce((L,ne)=>L+ne.size,0);let z=0,W=0;for(const L of F){W+=1,we.loading("Upload in progress...",{id:G,descriptionClassName:"whitespace-pre",description:`${W} of ${Yr(F.length,"file","files")}
${L.name}
${Fo(z)} of ${Fo(H)}`,action:K});const ne=JP(D,L),P=(await mEe(L)).target.result,U="base64,",O=P.indexOf(U);ee?q.push({file:L,errors:[{message:`${ne} cancelled`,code:"cancelled"}]}):(await OR({...d,file:ne,project:A,encoding:"base64",payload:P.slice(O+U.length)}),z+=L.size)}we.loading("Reloading sidebar...",{id:ee?void 0:G,action:V,description:""}),await o(),q.length===0?I.length>0&&we.success(`Uploaded ${Yr(F.length,"file","files")}!`,{id:G,action:V,description:""}):(console.log(q),we.error(ee?"Cancelled uploads":"Rejected uploads",{id:ee?void 0:G,action:V,descriptionClassName:"whitespace-pre overflow-y-auto",description:q.slice(0,5).map(L=>L.errors.map(ne=>ne.message).join(`
`)).join(`
`)+(q?.length>5?`
Check the console for the full list.`:"")})),t("")},[m,l,y,x,a,d,o]),k=!!n&&jt.checkForFabricConnect(n),{getRootProps:E,getInputProps:j}=E7({multiple:!0,maxSize:k?SY:wY,onDrop:C});return!l&&!m?f?u.jsxs("div",{className:ki("border-3 border-dashed","pointer-events-auto","cursor-copy text-sm text-center","p-2 w-full fixed bottom-0 h-16","flex flex-col items-center justify-center","bg-red-950 border-red-600"),children:["You cannot upload into",u.jsx("br",{}),u.jsx("strong",{children:S})]}):null:u.jsxs("div",{...E(),className:f?"fixed top-0 bottom-0 w-full pointer-events-none":"",children:[u.jsx("input",{id:"dropTarget",...j()}),u.jsx("div",{className:ki("border-3 border-dashed","pointer-events-auto","cursor-copy text-sm text-center","p-2 w-full fixed bottom-0 h-16","flex flex-col items-center justify-center",f?"animate-glow-pulse bg-green-950 border-green-600":"bg-purple-950 border-purple-600"),children:e||(m?u.jsxs(u.Fragment,{children:["Drop to upload into",u.jsx("br",{}),u.jsx("strong",{children:v})]}):f?u.jsxs(u.Fragment,{children:["Drop to upload into",u.jsx("br",{}),u.jsx("strong",{children:S})]}):u.jsxs(u.Fragment,{children:["Drag and drop to upload",u.jsx("br",{}),"or click to select files."]}))})]})}function JP(e,t){const n=t.relativePath??t.name,r=n.indexOf("/"),i=r===0||r===1?n.slice(r+1):n;return e?`${e}/${i}`:i}function dje(e){const t=e.data;return t&&"name"in t?t.name:"root"}function Kh(e){const{instanceId:t,clusterId:n}=rt({strict:!1}),r=$n,[i,o]=Id(`EditorFileContent/${r}}/${e}`,void 0);return b.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}const Ln="w-6 pointer-events-none ";function fje({opened:e,pkg:t}){return t?e?u.jsx("i",{className:Ln+"fas fa-box-open text-orange-600"}):u.jsx("i",{className:Ln+"fas fa-box text-orange-600"}):e?u.jsx("i",{className:Ln+"fas fa-folder-open text-orange-400"}):u.jsx("i",{className:Ln+"fas fa-folder text-orange-400"})}function pje({extension:e}){switch(e){case"js":return u.jsx("i",{className:Ln+"filetype-js fab fa-js text-yellow"});case"jsx":return u.jsx("i",{className:Ln+"filetype-jsx fab fa-js text-yellow"});case"cjs":return u.jsx("i",{className:Ln+"filetype-cjs fab fa-js text-yellow"});case"yaml":return u.jsx("i",{className:Ln+"filetype-yaml fas fa-file"});case"css":return u.jsx("i",{className:Ln+"filetype-css fas fa-file text-blue"});case"html":return u.jsx("i",{className:Ln+"filetype-unknown far fa-file-alt"});case"json":return u.jsx("i",{className:Ln+"filetype-json fas fa-cog"});case"ts":return u.jsx("i",{className:Ln+"filetype-ts fas fa-file text-blue"});case"tsx":return u.jsx("i",{className:Ln+"filetype-tsx fas fa-file text-blue"});case"png":return u.jsx("i",{className:Ln+"filetype-png fas fa-image"});case"jpg":return u.jsx("i",{className:Ln+"filetype-jpg fas fa-image"});case"jpeg":return u.jsx("i",{className:Ln+"filetype-jpeg fas fa-image"});case"gif":return u.jsx("i",{className:Ln+"filetype-gif fas fa-image"});case"svg":return u.jsx("i",{className:Ln+"filetype-svg fas fa-file-svg"});case"vue":return u.jsx("i",{className:Ln+"filetype-vue fab fa-vuejs text-green"});default:return u.jsx("i",{className:Ln+"filetype-unknown far fa-file-alt"})}}function mje(){return u.jsx("i",{className:Ln+"fas fa-lock text-gray-400 ml-2 packageIsLocked"})}function hje(){return u.jsx("i",{className:Ln+"fas fa-plus text-green"})}function gje({title:e,item:t,context:n}){const{content:r}=Kh(t.data?.path);return u.jsxs(u.Fragment,{children:[t.data?.path===Eo?u.jsx(hje,{}):Er(t.data)?u.jsx(fje,{opened:n.isExpanded,pkg:!!t.data?.package||t.data.path===Xs}):u.jsx(pje,{extension:L0(e)}),u.jsxs("span",{className:"text-nowrap pointer-events-none",children:[e,r?"*":""]}),t.data?.package&&u.jsx(mje,{})]})}function vje(){const{rootEntries:e,openedEntry:t,setOpenedEntry:n,focusedItem:r,setFocusedItem:i,expandedItems:o,setExpandedItems:a,selectedItems:l,setSelectedItems:d}=Lr(),{items:f,rootId:m}=b.useMemo(()=>fEe(e),[e]);Cke(),b.useEffect(function(){if(t?.path!==r&&r){const S=f[r]?.data;S&&n(S)}},[r,f,t?.path,n]);const h=Wq(),v=b.useCallback((y,x)=>{switch(x.targetType){case"item":if(f[x.targetItem]?.data?.package)we.error("Read-Only Imported Application",{description:'To make changes to an application, please click the "Redeploy" button and update the reference.'});else return h(y.map(S=>({from:S.index,to:$R(x.targetItem,kke(S.index))})));break;default:we.error(`${x.targetType} drop not yet supported`);break}},[f,h]);return u.jsxs("div",{className:"h-full overflow-auto pr-1.5 pb-18",children:[u.jsx(qke,{canDragAndDrop:!0,canDropOnFolder:!0,canDropOnNonFolder:!1,canReorderItems:!1,canSearch:!0,canRename:!1,getItemTitle:dje,items:f,onDrop:v,renderItemTitle:gje,viewState:{applicationsTree:{focusedItem:r,expandedItems:o,selectedItems:l}},onFocusItem:y=>i(y.index),onExpandItem:y=>a([...o,y.index]),onCollapseItem:y=>a(o.filter(x=>x!==y.index)),onSelectItems:y=>d(y),children:u.jsx(lEe,{treeId:"applicationsTree",rootItem:m,treeLabel:"Applications file tree"})}),u.jsx(uje,{})]})}async function yje(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await qc(n)}throw i}async function j7({operation:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:e,service:e==="restart_service"?"http":void 0,replicated:t});return await qc(1e4),await yje(()=>sl({instanceClient:n,timeout:3e3}),12,15e3),r}function bje(){return ct({mutationFn:j7})}function xje({onRestartedSuccessfully:e}={}){const{clusterId:t}=rt({strict:!1}),n=ir(),[r,i]=b.useState(!1);return{onRestartClick:b.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const l={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=we.loading("Restarting",{...l,description:u.jsx(Dm,{animated:!0,width:"0%"})}),f=await dj(t),m=jt.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(x=>x.status==="RUNNING").map(x=>es({id:x.id,forceFabricConnect:m,operationsUrl:Jk(x)})).reverse();let y=0;if(v.length)for(let x=0;x<v.length;x++){const S=v[x];if(!a){we.loading(`Restarting Instance ${x+1} of ${v.length}`,{...l,id:d,description:u.jsx(Dm,{animated:!0,width:(x===0?0:x/v.length*100)+"%"})});try{await sl({instanceClient:S}),await j7({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{x+1!==v.length&&(we.loading(`Failed Restarting Instance ${x+1} of ${v.length}`,{...l,id:d,description:"We will carry on momentarily."}),await qc(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)we.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>we.dismiss()}});else if(h.length===y)e?.(),we.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>we.dismiss()}});else{const x=Yr(h.length,"instance","instances"),S=Yr(y,'"RUNNING" instance was','"RUNNING" instances were');we.error("Error",{id:d,description:`Failed to fully restart cluster.
`+([h.length===0&&"No instances were found within the cluster to restart.",y===0&&`No instances were in a "RUNNING" state of ${x}.`,h.length!==y&&`Only ${S} restarted of ${x}.`].filter(Jo).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}},[t,e,n]),isRestartPending:r}}function wje({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=rt({strict:!1}),o="Instance",{mutate:a,isPending:l}=bje(),d=ir();return{onRestartClick:b.useCallback(()=>{const m=we.loading("Restarting",{description:`Restarting ${o.toLowerCase()}. This may take up to 60 seconds.`,duration:18e4,action:{label:"Dismiss",onClick:()=>we.dismiss()}});a({operation:e,replicated:e==="restart_service"&&o==="Cluster",instanceClient:t},{onSuccess:()=>{d.invalidateQueries({queryKey:[r]}),d.invalidateQueries({queryKey:[i]}),we.dismiss(m),we.success("Success",{description:`${o} restarted!`,action:{label:"Dismiss",onClick:()=>we.dismiss()}}),n?.()},onError:()=>{we.dismiss(m),we.error("Error",{description:`Failed to restart ${o.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[r,t,i,n,e,d,a,o]),isRestartPending:l}}function I7({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:l}){const{onRestartClick:d,isRestartPending:f}=xje(),{onRestartClick:m,isRestartPending:h}=wje({operation:i,instanceClient:r});return u.jsxs(mx,{children:[u.jsx(hx,{asChild:!0,children:u.jsxs(be,{variant:l||"positiveOutline",className:ki("mx-0 md:mx-4 rounded-full",e),onClick:o==="Cluster"&&i==="restart"?d:m,disabled:t||h||f,title:`Restart ${o}`,children:[u.jsx(dne,{className:"pointer-events-none"}),n!==!0&&u.jsxs("span",{className:"hidden md:inline-block pointer-events-none",children:["Restart ",u.jsx("span",{className:"hidden 2xl:inline-block",children:o})]})]})}),u.jsx(gx,{side:"bottom",children:a||(i==="restart_service"?"Restarts all service threads to apply changes. No downtime expected. Performance may be briefly slower during restart.":"This fully restarts the Harper service and causes downtime.")})]})}function Sje({toggledSidebar:e,toggleSidebar:t}){const n=Zt(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=Lr(),{content:l}=Kh(i?.path),d=yf(),f=n.entityType==="instance"?"Instance":"Cluster",m=Xa("ShowAddDirectoryOrFileModalType","file"),h=Xa("ShowAddDirectoryOrFileModalType","directory"),v=Xa("ShowDownloadApplicationModal",!0),y=Xa("ShowRenameFileModal",!0),x=Xa("ShowDeleteDirectoryOrFileModal",!0),S=Xa("ShowRedeployApplicationModal",!0),C=j1("SaveFile",!0),k=j1("RevertChanges",!0),E=j1("ShowNewTableModal",!0),j=l===void 0||l===r;return u.jsxs("div",{className:"absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12",children:[u.jsxs(be,{variant:"ghost",className:(e?"toggled-sidebar-toggler":"hidden-sidebar-toggler")+" inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-white hover:text-grey focus:ring-gray-600 rounded-none",onClick:t,children:[u.jsxs("span",{className:"sr-only",children:[e?"Close":"Open"," sidebar"]}),e?u.jsx(nne,{}):u.jsx(ene,{})]}),i&&i?.path!==Eo&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(mx,{children:[u.jsx(hx,{asChild:!0,children:u.jsxs(be,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(Vte,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(gx,{children:a?u.jsxs(u.Fragment,{children:["This application is read-only, and cannot be modified.",u.jsx("br",{}),"It helps govern clustering amongst your instances."]}):u.jsx(u.Fragment,{children:"This application is read-only, and cannot be directly modified. But you can re-deploy or remove it."})})]}),!Er(i)&&!i.package&&d&&u.jsxs(be,{variant:"default",className:"rounded-none",onClick:C,disabled:j||o,title:"Save",children:[u.jsx(To,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!Er(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!j||o,title:"Rename",children:[u.jsx(L4,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:m,title:"New File",children:[u.jsx(bte,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none hidden lg:inline-block",children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden lg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:h,title:"Add Directory",children:[u.jsx(wte,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none hidden lg:inline-block",children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.path.endsWith(".graphql")&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:E,title:"New Table",children:[u.jsx(Jr,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("span",{className:"hidden xl:inline-block",children:"New"})," Table"]})]}),i.project&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:v,title:"Download Application",children:[u.jsx($4,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:["Download",u.jsx("span",{className:"hidden 2xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:S,title:"Redeploy Package",children:[u.jsx(uE,{className:"pointer-events-none"}),u.jsxs("span",{className:"pointer-events-none",children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx(I7,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!j||o}),!Er(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:k,disabled:j||o,title:"Revert Changes",children:[u.jsx(Ene,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden xl:inline-block pointer-events-none",children:["Revert ",u.jsx("span",{className:"hidden 2xl:inline-block",children:"Changes"})]})]}),!a&&d&&u.jsxs(be,{variant:"destructiveGhost",className:"rounded-none",onClick:x,title:"Delete",children:[u.jsx(Ca,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden xl:inline-block pointer-events-none",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function _je(e){return b.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=pq().split("?")[0];switch(t){case"./apis":case"./config":case"./config/roles":case"./config/users":case"./databases":case"./logs":case"./status":return`${i}/${t.slice(2)}`}return`${i}?open=${e}/${t.slice(2)}`}},[e])}function Cje(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kje=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eje=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jje={};function QP(e,t){return(jje.jsx?Eje:kje).test(e)}const Ije=/[ \t\n\f\r]/g;function Rje(e){return typeof e=="object"?e.type==="text"?eM(e.value):!1:eM(e)}function eM(e){return e.replace(Ije,"")===""}class Gh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Gh.prototype.normal={};Gh.prototype.property={};Gh.prototype.space=void 0;function R7(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Gh(n,r,t)}function jk(e){return e.toLowerCase()}class Ii{constructor(t,n){this.attribute=n,this.property=t}}Ii.prototype.attribute="";Ii.prototype.booleanish=!1;Ii.prototype.boolean=!1;Ii.prototype.commaOrSpaceSeparated=!1;Ii.prototype.commaSeparated=!1;Ii.prototype.defined=!1;Ii.prototype.mustUseProperty=!1;Ii.prototype.number=!1;Ii.prototype.overloadedBoolean=!1;Ii.prototype.property="";Ii.prototype.spaceSeparated=!1;Ii.prototype.space=void 0;let Tje=0;const bt=uu(),tr=uu(),Ik=uu(),Ie=uu(),xn=uu(),Rd=uu(),Pi=uu();function uu(){return 2**++Tje}const Rk=Object.freeze(Object.defineProperty({__proto__:null,boolean:bt,booleanish:tr,commaOrSpaceSeparated:Pi,commaSeparated:Rd,number:Ie,overloadedBoolean:Ik,spaceSeparated:xn},Symbol.toStringTag,{value:"Module"})),N1=Object.keys(Rk);class MR extends Ii{constructor(t,n,r,i){let o=-1;if(super(t,n),tM(this,"space",i),typeof r=="number")for(;++o<N1.length;){const a=N1[o];tM(this,N1[o],(r&Rk[a])===Rk[a])}}}MR.prototype.defined=!0;function tM(e,t,n){n&&(e[t]=n)}function Af(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new MR(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jk(r)]=r,n[jk(o.attribute)]=r}return new Gh(t,n,e.space)}const T7=Af({properties:{ariaActiveDescendant:null,ariaAtomic:tr,ariaAutoComplete:null,ariaBusy:tr,ariaChecked:tr,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:xn,ariaCurrent:null,ariaDescribedBy:xn,ariaDetails:null,ariaDisabled:tr,ariaDropEffect:xn,ariaErrorMessage:null,ariaExpanded:tr,ariaFlowTo:xn,ariaGrabbed:tr,ariaHasPopup:null,ariaHidden:tr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xn,ariaLevel:Ie,ariaLive:null,ariaModal:tr,ariaMultiLine:tr,ariaMultiSelectable:tr,ariaOrientation:null,ariaOwns:xn,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:tr,ariaReadOnly:tr,ariaRelevant:null,ariaRequired:tr,ariaRoleDescription:xn,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:tr,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function N7(e,t){return t in e?e[t]:t}function A7(e,t){return N7(e,t.toLowerCase())}const Nje=Af({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Rd,acceptCharset:xn,accessKey:xn,action:null,allow:null,allowFullScreen:bt,allowPaymentRequest:bt,allowUserMedia:bt,alt:null,as:null,async:bt,autoCapitalize:null,autoComplete:xn,autoFocus:bt,autoPlay:bt,blocking:xn,capture:null,charSet:null,checked:bt,cite:null,className:xn,cols:Ie,colSpan:null,content:null,contentEditable:tr,controls:bt,controlsList:xn,coords:Ie|Rd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:bt,defer:bt,dir:null,dirName:null,disabled:bt,download:Ik,draggable:tr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:bt,formTarget:null,headers:xn,height:Ie,hidden:Ik,high:Ie,href:null,hrefLang:null,htmlFor:xn,httpEquiv:xn,id:null,imageSizes:null,imageSrcSet:null,inert:bt,inputMode:null,integrity:null,is:null,isMap:bt,itemId:null,itemProp:xn,itemRef:xn,itemScope:bt,itemType:xn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:bt,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:bt,muted:bt,name:null,nonce:null,noModule:bt,noValidate:bt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:bt,optimum:Ie,pattern:null,ping:xn,placeholder:null,playsInline:bt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:bt,referrerPolicy:null,rel:xn,required:bt,reversed:bt,rows:Ie,rowSpan:Ie,sandbox:xn,scope:null,scoped:bt,seamless:bt,selected:bt,shadowRootClonable:bt,shadowRootDelegatesFocus:bt,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:tr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:bt,useMap:null,value:tr,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xn,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:bt,declare:bt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:bt,noHref:bt,noShade:bt,noWrap:bt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:tr,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:bt,disableRemotePlayback:bt,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:A7}),Aje=Af({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Pi,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:xn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:bt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Rd,g2:Rd,glyphName:Rd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:Pi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Pi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Pi,rev:Pi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Pi,requiredFeatures:Pi,requiredFonts:Pi,requiredFormats:Pi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:Pi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Pi,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Pi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:N7}),O7=Af({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$7=Af({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:A7}),D7=Af({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Oje={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},$je=/[A-Z]/g,nM=/-[a-z]/g,Dje=/^data[-\w.:]+$/i;function Pje(e,t){const n=jk(t);let r=t,i=Ii;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dje.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(nM,zje);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!nM.test(o)){let a=o.replace($je,Mje);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=MR}return new i(r,t)}function Mje(e){return"-"+e.toLowerCase()}function zje(e){return e.charAt(1).toUpperCase()}const Lje=R7([T7,Nje,O7,$7,D7],"html"),zR=R7([T7,Aje,O7,$7,D7],"svg");function Fje(e){return e.join(" ").trim()}var sd={},A1,rM;function Uje(){if(rM)return A1;rM=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
`,f="/",m="*",h="",v="comment",y="declaration";A1=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var k=1,E=1;function j(K){var V=K.match(t);V&&(k+=V.length);var H=K.lastIndexOf(d);E=~H?K.length-H:E+K.length}function I(){var K={line:k,column:E};return function(V){return V.position=new N(K),D(),V}}function N(K){this.start=K,this.end={line:k,column:E},this.source=C.source}N.prototype.content=S;function T(K){var V=new Error(C.source+":"+k+":"+E+": "+K);if(V.reason=K,V.filename=C.source,V.line=k,V.column=E,V.source=S,!C.silent)throw V}function A(K){var V=K.exec(S);if(V){var H=V[0];return j(H),S=S.slice(H.length),V}}function D(){A(n)}function F(K){var V;for(K=K||[];V=q();)V!==!1&&K.push(V);return K}function q(){var K=I();if(!(f!=S.charAt(0)||m!=S.charAt(1))){for(var V=2;h!=S.charAt(V)&&(m!=S.charAt(V)||f!=S.charAt(V+1));)++V;if(V+=2,h===S.charAt(V-1))return T("End of comment missing");var H=S.slice(2,V-2);return E+=2,j(H),S=S.slice(V),E+=2,K({type:v,comment:H})}}function ee(){var K=I(),V=A(r);if(V){if(q(),!A(i))return T("property missing ':'");var H=A(o),z=K({type:y,property:x(V[0].replace(e,h)),value:H?x(H[0].replace(e,h)):h});return A(a),z}}function G(){var K=[];F(K);for(var V;V=ee();)V!==!1&&(K.push(V),F(K));return K}return D(),G()};function x(S){return S?S.replace(l,h):h}return A1}var iM;function Vje(){if(iM)return sd;iM=1;var e=sd&&sd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sd,"__esModule",{value:!0}),sd.default=n;const t=e(Uje());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),l=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;l?i(f,m,d):m&&(o=o||{},o[f]=m)}),o}return sd}var qp={},oM;function Bje(){if(oM)return qp;oM=1,Object.defineProperty(qp,"__esModule",{value:!0}),qp.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),o(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(i,l):f=f.replace(r,l),f.replace(t,a))};return qp.camelCase=d,qp}var Kp,aM;function Hje(){if(aM)return Kp;aM=1;var e=Kp&&Kp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Vje()),n=Bje();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(l,d){l&&d&&(a[(0,n.camelCase)(l,o)]=d)}),a}return r.default=r,Kp=r,Kp}var qje=Hje();const Kje=of(qje),P7=M7("end"),LR=M7("start");function M7(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Gje(e){const t=LR(e),n=P7(e);if(t&&n)return{start:t,end:n}}function fm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sM(e.position):"start"in e||"end"in e?sM(e):"line"in e||"column"in e?Tk(e):""}function Tk(e){return lM(e&&e.line)+":"+lM(e&&e.column)}function sM(e){return Tk(e&&e.start)+"-"+Tk(e&&e.end)}function lM(e){return e&&typeof e=="number"?e:1}class Fr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=fm(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Fr.prototype.file="";Fr.prototype.name="";Fr.prototype.reason="";Fr.prototype.message="";Fr.prototype.stack="";Fr.prototype.column=void 0;Fr.prototype.line=void 0;Fr.prototype.ancestors=void 0;Fr.prototype.cause=void 0;Fr.prototype.fatal=void 0;Fr.prototype.place=void 0;Fr.prototype.ruleId=void 0;Fr.prototype.source=void 0;const FR={}.hasOwnProperty,Zje=new Map,Yje=/[A-Z]/g,Wje=new Set(["table","tbody","thead","tfoot","tr"]),Xje=new Set(["td","th"]),z7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jje(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=aIe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oIe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?zR:Lje,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=L7(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function L7(e,t,n){if(t.type==="element")return Qje(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return eIe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nIe(e,t,n);if(t.type==="mdxjsEsm")return tIe(e,t);if(t.type==="root")return rIe(e,t,n);if(t.type==="text")return iIe(e,t)}function Qje(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=zR,e.schema=i),e.ancestors.push(t);const o=U7(e,t.tagName,!1),a=sIe(e,t);let l=VR(e,t);return Wje.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!Rje(d):!0})),F7(e,a,o,t),UR(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function eIe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Lm(e,t.position)}function tIe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lm(e,t.position)}function nIe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=zR,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:U7(e,t.name,!0),a=lIe(e,t),l=VR(e,t);return F7(e,a,o,t),UR(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function rIe(e,t,n){const r={};return UR(r,VR(e,t)),e.create(t,e.Fragment,r,n)}function iIe(e,t){return t.value}function F7(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function UR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oIe(e,t,n){return r;function r(i,o,a,l){const f=Array.isArray(a.children)?n:t;return l?f(o,a,l):f(o,a)}}function aIe(e,t){return n;function n(r,i,o,a){const l=Array.isArray(o.children),d=LR(r);return t(i,o,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function sIe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&FR.call(t.properties,i)){const o=cIe(e,i,t.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Xje.has(t.tagName)?r=l:n[a]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lIe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Lm(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Lm(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function VR(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Zje;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=i.get(d)||0;a=d+"-"+f,i.set(d,f+1)}}const l=L7(e,o,a);l!==void 0&&n.push(l)}return n}function cIe(e,t,n){const r=Pje(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cje(n):Fje(n)),r.property==="style"){let i=typeof n=="object"?n:uIe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=dIe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Oje[r.property]||r.property:r.attribute,n]}}function uIe(e,t){try{return Kje(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Fr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=z7+"#cannot-parse-style-attribute",i}}function U7(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const l=QP(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=a}else r=QP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return FR.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Lm(e)}function Lm(e,t){const n=new Fr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=z7+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dIe(e){const t={};let n;for(n in e)FR.call(e,n)&&(t[fIe(n)]=e[n]);return t}function fIe(e){let t=e.replace(Yje,pIe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pIe(e){return"-"+e.toLowerCase()}const O1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mIe={};function hIe(e,t){const n=mIe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return V7(e,r,i)}function V7(e,t,n){if(gIe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return cM(e.children,t,n)}return Array.isArray(e)?cM(e,t,n):""}function cM(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=V7(e[i],t,n);return r.join("")}function gIe(e){return!!(e&&typeof e=="object")}const uM=document.createElement("i");function BR(e){const t="&"+e+";";uM.innerHTML=t;const n=uM.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _a(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function bo(e,t){return e.length>0?(_a(e,e.length,0,t),e):t}const dM={}.hasOwnProperty;function vIe(e){const t={};let n=-1;for(;++n<e.length;)yIe(t,e[n]);return t}function yIe(e,t){let n;for(n in t){const i=(dM.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){dM.call(i,a)||(i[a]=[]);const l=o[a];bIe(i[a],Array.isArray(l)?l:l?[l]:[])}}}function bIe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_a(e,0,0,r)}function B7(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Td(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ua=Bl(/[A-Za-z]/),Ui=Bl(/[\dA-Za-z]/),xIe=Bl(/[#-'*+\--9=?A-Z^-~]/);function Nk(e){return e!==null&&(e<32||e===127)}const Ak=Bl(/\d/),wIe=Bl(/[\dA-Fa-f]/),SIe=Bl(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function Ci(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const _Ie=Bl(new RegExp("\\p{P}|\\p{S}","u")),CIe=Bl(/\s/);function Bl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Of(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ui(e.charCodeAt(n+1))&&Ui(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Sn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Kt(d)?(e.enter(n),l(d)):t(d)}function l(d){return Kt(d)&&o++<i?(e.consume(d),l):(e.exit(n),t(d))}}const kIe={tokenize:EIe};function EIe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Sn(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return lt(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),a)}}const jIe={tokenize:IIe},fM={tokenize:RIe};function IIe(e){const t=this,n=[];let r=0,i,o,a;return l;function l(j){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const I=t.events.length;let N=I,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){T=t.events[N][1].end;break}k(r);let A=I;for(;A<t.events.length;)t.events[A][1].end={...T},A++;return _a(t.events,N+1,0,t.events.slice(I)),t.events.length=A,f(j)}return l(j)}function f(j){if(r===n.length){if(!i)return v(j);if(i.currentConstruct&&i.currentConstruct.concrete)return x(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fM,m,h)(j)}function m(j){return i&&E(),k(r),v(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(j)}function v(j){return t.containerState={},e.attempt(fM,y,x)(j)}function y(j){return r++,n.push([t.currentConstruct,t.containerState]),v(j)}function x(j){if(j===null){i&&E(),k(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(j)}function S(j){if(j===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(j);return}return lt(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(j),S)}function C(j,I){const N=t.sliceStream(j);if(I&&N.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(N),t.parser.lazy[j.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<a&&(!i.events[T][1].end||i.events[T][1].end.offset>a))return;const A=t.events.length;let D=A,F,q;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(F){q=t.events[D][1].end;break}F=!0}for(k(r),T=A;T<t.events.length;)t.events[T][1].end={...q},T++;_a(t.events,D+1,0,t.events.slice(A)),t.events.length=T}}function k(j){let I=n.length;for(;I-- >j;){const N=n[I];t.containerState=N[1],N[0].exit.call(t,e)}n.length=j}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function RIe(e,t,n){return Sn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pM(e){if(e===null||Ci(e)||CIe(e))return 1;if(_Ie(e))return 2}function HR(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Ok={name:"attention",resolveAll:TIe,tokenize:NIe};function TIe(e,t){let n=-1,r,i,o,a,l,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},v={...e[n][1].start};mM(h,-d),mM(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=bo(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=bo(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=bo(f,HR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=bo(f,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=bo(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,_a(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function NIe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pM(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===o)return e.consume(d),l;const f=e.exit("attentionSequence"),m=pM(d),h=!m||m===2&&i||n.includes(d),v=!i||i===2&&m||n.includes(r);return f._open=!!(o===42?h:h&&(i||!v)),f._close=!!(o===42?v:v&&(m||!h)),t(d)}}function mM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const AIe={name:"autolink",tokenize:OIe};function OIe(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ua(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Ui(y)?(r=1,l(y)):f(y)}function l(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ui(y))&&r++<32?(e.consume(y),l):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Nk(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):xIe(y)?(e.consume(y),f):n(y)}function m(y){return Ui(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,m):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Ui(y))&&r++<63){const x=y===45?v:h;return e.consume(y),x}return n(y)}}const V0={partial:!0,tokenize:$Ie};function $Ie(e,t,n){return r;function r(o){return Kt(o)?Sn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||lt(o)?t(o):n(o)}}const H7={continuation:{tokenize:PIe},exit:MIe,name:"blockQuote",tokenize:DIe};function DIe(e,t,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Kt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function PIe(e,t,n){const r=this;return i;function i(a){return Kt(a)?Sn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(H7,t,n)(a)}}function MIe(e){e.exit("blockQuote")}const q7={name:"characterEscape",tokenize:zIe};function zIe(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return SIe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const K7={name:"characterReference",tokenize:LIe};function LIe(e,t,n){const r=this;let i=0,o,a;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=Ui,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=wIe,m):(e.enter("characterReferenceValue"),o=7,a=Ak,m(h))}function m(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Ui&&!BR(r.sliceSerialize(v))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),m):n(h)}}const hM={partial:!0,tokenize:UIe},gM={concrete:!0,name:"codeFenced",tokenize:FIe};function FIe(e,t,n){const r=this,i={partial:!0,tokenize:N};let o=0,a=0,l;return d;function d(T){return f(T)}function f(T){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(T)}function m(T){return T===l?(a++,e.consume(T),m):a<3?n(T):(e.exit("codeFencedFenceSequence"),Kt(T)?Sn(e,h,"whitespace")(T):h(T))}function h(T){return T===null||lt(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(hM,S,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(T)):Kt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Sn(e,y,"whitespace")(T)):T===96&&T===l?n(T):(e.consume(T),v)}function y(T){return T===null||lt(T)?h(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||lt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(T)):T===96&&T===l?n(T):(e.consume(T),x)}function S(T){return e.attempt(i,I,C)(T)}function C(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return o>0&&Kt(T)?Sn(e,E,"linePrefix",o+1)(T):E(T)}function E(T){return T===null||lt(T)?e.check(hM,S,I)(T):(e.enter("codeFlowValue"),j(T))}function j(T){return T===null||lt(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),j)}function I(T){return e.exit("codeFenced"),t(T)}function N(T,A,D){let F=0;return q;function q(H){return T.enter("lineEnding"),T.consume(H),T.exit("lineEnding"),ee}function ee(H){return T.enter("codeFencedFence"),Kt(H)?Sn(T,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):G(H)}function G(H){return H===l?(T.enter("codeFencedFenceSequence"),K(H)):D(H)}function K(H){return H===l?(F++,T.consume(H),K):F>=a?(T.exit("codeFencedFenceSequence"),Kt(H)?Sn(T,V,"whitespace")(H):V(H)):D(H)}function V(H){return H===null||lt(H)?(T.exit("codeFencedFence"),A(H)):D(H)}}}function UIe(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const $1={name:"codeIndented",tokenize:BIe},VIe={partial:!0,tokenize:HIe};function BIe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Sn(e,o,"linePrefix",5)(f)}function o(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):lt(f)?e.attempt(VIe,a,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||lt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function HIe(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):lt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Sn(e,o,"linePrefix",5)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):lt(a)?i(a):n(a)}}const qIe={name:"codeText",previous:GIe,resolve:KIe,tokenize:ZIe};function KIe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function GIe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZIe(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(o=e.enter("codeTextSequence"),i=0,m(h)):lt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||lt(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class YIe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Gp(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Gp(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Gp(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Gp(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Gp(this.left,n.reverse())}}}function Gp(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function G7(e){const t={};let n=-1,r,i,o,a,l,d,f;const m=new YIe(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WIe(m,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=m.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},l=m.slice(i,n),l.unshift(r),m.splice(i,n-i+1,l))}}return _a(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function WIe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,d=[],f={};let m,h,v=-1,y=n,x=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(m=r.sliceStream(y),y.next||m.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<l.length;)l[v][0]==="exit"&&l[v-1][0]==="enter"&&l[v][1].type===l[v-1][1].type&&l[v][1].start.line!==l[v][1].end.line&&(S=v+1,C.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),v=C.length;v--;){const k=l.slice(C[v],C[v+1]),E=o.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),v=-1;++v<d.length;)f[x+d[v][0]]=x+d[v][1],x+=d[v][1]-d[v][0]-1;return f}const XIe={resolve:QIe,tokenize:eRe},JIe={partial:!0,tokenize:tRe};function QIe(e){return G7(e),e}function eRe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):lt(l)?e.check(JIe,a,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function tRe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Sn(e,o,"linePrefix")}function o(a){if(a===null||lt(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Z7(e,t,n,r,i,o,a,l,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return h;function h(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),v):k===null||k===32||k===41||Nk(k)?n(k):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),S(k))}function v(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(l),v(k)):k===null||k===60||lt(k)?n(k):(e.consume(k),k===92?x:y)}function x(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function S(k){return!m&&(k===null||k===41||Ci(k))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(k)):m<f&&k===40?(e.consume(k),m++,S):k===41?(e.consume(k),m--,S):k===null||k===32||k===40||Nk(k)?n(k):(e.consume(k),k===92?C:S)}function C(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function Y7(e,t,n,r,i,o){const a=this;let l=0,d;return f;function f(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),m}function m(y){return l>999||y===null||y===91||y===93&&!d||y===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):lt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||lt(y)||l++>999?(e.exit("chunkString"),m(y)):(e.consume(y),d||(d=!Kt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),l++,h):h(y)}}function W7(e,t,n,r,i,o){let a;return l;function l(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),a=v===40?41:v,d):n(v)}function d(v){return v===a?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),f(v))}function f(v){return v===a?(e.exit(o),d(a)):v===null?n(v):lt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Sn(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===a||v===null||lt(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?h:m)}function h(v){return v===a||v===92?(e.consume(v),m):m(v)}}function pm(e,t){let n;return r;function r(i){return lt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Kt(i)?Sn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nRe={name:"definition",tokenize:iRe},rRe={partial:!0,tokenize:oRe};function iRe(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return Y7.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=Td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return Ci(y)?pm(e,f)(y):f(y)}function f(y){return Z7(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(rRe,h,h)(y)}function h(y){return Kt(y)?Sn(e,v,"whitespace")(y):v(y)}function v(y){return y===null||lt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function oRe(e,t,n){return r;function r(l){return Ci(l)?pm(e,i)(l):n(l)}function i(l){return W7(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Kt(l)?Sn(e,a,"whitespace")(l):a(l)}function a(l){return l===null||lt(l)?t(l):n(l)}}const aRe={name:"hardBreakEscape",tokenize:sRe};function sRe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return lt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const lRe={name:"headingAtx",resolve:cRe,tokenize:uRe};function cRe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_a(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function uRe(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||Ci(m)?(e.exit("atxHeadingSequence"),l(m)):n(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||lt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?Sn(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Ci(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const dRe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vM=["pre","script","style","textarea"],fRe={concrete:!0,name:"htmlFlow",resolveTo:hRe,tokenize:gRe},pRe={partial:!0,tokenize:yRe},mRe={partial:!0,tokenize:vRe};function hRe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gRe(e,t,n){const r=this;let i,o,a,l,d;return f;function f(O){return m(O)}function m(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),i=3,r.interrupt?t:$):ua(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function v(O){return O===45?(e.consume(O),i=2,y):O===91?(e.consume(O),i=5,l=0,x):ua(O)?(e.consume(O),i=4,r.interrupt?t:$):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:$):n(O)}function x(O){const X="CDATA[";return O===X.charCodeAt(l++)?(e.consume(O),l===X.length?r.interrupt?t:G:x):n(O)}function S(O){return ua(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||Ci(O)){const X=O===47,pe=a.toLowerCase();return!X&&!o&&vM.includes(pe)?(i=1,r.interrupt?t(O):G(O)):dRe.includes(a.toLowerCase())?(i=6,X?(e.consume(O),k):r.interrupt?t(O):G(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?E(O):j(O))}return O===45||Ui(O)?(e.consume(O),a+=String.fromCharCode(O),C):n(O)}function k(O){return O===62?(e.consume(O),r.interrupt?t:G):n(O)}function E(O){return Kt(O)?(e.consume(O),E):q(O)}function j(O){return O===47?(e.consume(O),q):O===58||O===95||ua(O)?(e.consume(O),I):Kt(O)?(e.consume(O),j):q(O)}function I(O){return O===45||O===46||O===58||O===95||Ui(O)?(e.consume(O),I):N(O)}function N(O){return O===61?(e.consume(O),T):Kt(O)?(e.consume(O),N):j(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,A):Kt(O)?(e.consume(O),T):D(O)}function A(O){return O===d?(e.consume(O),d=null,F):O===null||lt(O)?n(O):(e.consume(O),A)}function D(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Ci(O)?N(O):(e.consume(O),D)}function F(O){return O===47||O===62||Kt(O)?j(O):n(O)}function q(O){return O===62?(e.consume(O),ee):n(O)}function ee(O){return O===null||lt(O)?G(O):Kt(O)?(e.consume(O),ee):n(O)}function G(O){return O===45&&i===2?(e.consume(O),z):O===60&&i===1?(e.consume(O),W):O===62&&i===4?(e.consume(O),P):O===63&&i===3?(e.consume(O),$):O===93&&i===5?(e.consume(O),ne):lt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(pRe,U,K)(O)):O===null||lt(O)?(e.exit("htmlFlowData"),K(O)):(e.consume(O),G)}function K(O){return e.check(mRe,V,U)(O)}function V(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),H}function H(O){return O===null||lt(O)?K(O):(e.enter("htmlFlowData"),G(O))}function z(O){return O===45?(e.consume(O),$):G(O)}function W(O){return O===47?(e.consume(O),a="",L):G(O)}function L(O){if(O===62){const X=a.toLowerCase();return vM.includes(X)?(e.consume(O),P):G(O)}return ua(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),L):G(O)}function ne(O){return O===93?(e.consume(O),$):G(O)}function $(O){return O===62?(e.consume(O),P):O===45&&i===2?(e.consume(O),$):G(O)}function P(O){return O===null||lt(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),P)}function U(O){return e.exit("htmlFlow"),t(O)}}function vRe(e,t,n){const r=this;return i;function i(a){return lt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function yRe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(V0,t,n)}}const bRe={name:"htmlText",tokenize:xRe};function xRe(e,t,n){const r=this;let i,o,a;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),d}function d($){return $===33?(e.consume($),f):$===47?(e.consume($),N):$===63?(e.consume($),j):ua($)?(e.consume($),D):n($)}function f($){return $===45?(e.consume($),m):$===91?(e.consume($),o=0,x):ua($)?(e.consume($),E):n($)}function m($){return $===45?(e.consume($),y):n($)}function h($){return $===null?n($):$===45?(e.consume($),v):lt($)?(a=h,W($)):(e.consume($),h)}function v($){return $===45?(e.consume($),y):h($)}function y($){return $===62?z($):$===45?v($):h($)}function x($){const P="CDATA[";return $===P.charCodeAt(o++)?(e.consume($),o===P.length?S:x):n($)}function S($){return $===null?n($):$===93?(e.consume($),C):lt($)?(a=S,W($)):(e.consume($),S)}function C($){return $===93?(e.consume($),k):S($)}function k($){return $===62?z($):$===93?(e.consume($),k):S($)}function E($){return $===null||$===62?z($):lt($)?(a=E,W($)):(e.consume($),E)}function j($){return $===null?n($):$===63?(e.consume($),I):lt($)?(a=j,W($)):(e.consume($),j)}function I($){return $===62?z($):j($)}function N($){return ua($)?(e.consume($),T):n($)}function T($){return $===45||Ui($)?(e.consume($),T):A($)}function A($){return lt($)?(a=A,W($)):Kt($)?(e.consume($),A):z($)}function D($){return $===45||Ui($)?(e.consume($),D):$===47||$===62||Ci($)?F($):n($)}function F($){return $===47?(e.consume($),z):$===58||$===95||ua($)?(e.consume($),q):lt($)?(a=F,W($)):Kt($)?(e.consume($),F):z($)}function q($){return $===45||$===46||$===58||$===95||Ui($)?(e.consume($),q):ee($)}function ee($){return $===61?(e.consume($),G):lt($)?(a=ee,W($)):Kt($)?(e.consume($),ee):F($)}function G($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),i=$,K):lt($)?(a=G,W($)):Kt($)?(e.consume($),G):(e.consume($),V)}function K($){return $===i?(e.consume($),i=void 0,H):$===null?n($):lt($)?(a=K,W($)):(e.consume($),K)}function V($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Ci($)?F($):(e.consume($),V)}function H($){return $===47||$===62||Ci($)?F($):n($)}function z($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function W($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),L}function L($){return Kt($)?Sn(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):ne($)}function ne($){return e.enter("htmlTextData"),a($)}}const qR={name:"labelEnd",resolveAll:CRe,resolveTo:kRe,tokenize:ERe},wRe={tokenize:jRe},SRe={tokenize:IRe},_Re={tokenize:RRe};function CRe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&_a(e,0,e.length,n),e}function kRe(e,t){let n=e.length,r=0,i,o,a,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",d,t],["enter",f,t]],l=bo(l,e.slice(o+1,o+r+3)),l=bo(l,[["enter",m,t]]),l=bo(l,HR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),l=bo(l,[["exit",m,t],e[a-2],e[a-1],["exit",f,t]]),l=bo(l,e.slice(a+1)),l=bo(l,[["exit",d,t]]),_a(e,o,e.length,l),e}function ERe(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(Td(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(wRe,m,a?m:h)(v):v===91?e.attempt(SRe,m,a?f:h)(v):a?m(v):h(v)}function f(v){return e.attempt(_Re,m,h)(v)}function m(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function jRe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Ci(h)?pm(e,o)(h):o(h)}function o(h){return h===41?m(h):Z7(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Ci(h)?pm(e,d)(h):m(h)}function l(h){return n(h)}function d(h){return h===34||h===39||h===40?W7(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Ci(h)?pm(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function IRe(e,t,n){const r=this;return i;function i(l){return Y7.call(r,e,o,a,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function RRe(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const TRe={name:"labelStartImage",resolveAll:qR.resolveAll,tokenize:NRe};function NRe(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const ARe={name:"labelStartLink",resolveAll:qR.resolveAll,tokenize:ORe};function ORe(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const D1={name:"lineEnding",tokenize:$Re};function $Re(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Sn(e,t,"linePrefix")}}const gy={name:"thematicBreak",tokenize:DRe};function DRe(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,l(f)}function l(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||lt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Kt(f)?Sn(e,l,"whitespace")(f):l(f))}}const mi={continuation:{tokenize:LRe},exit:URe,name:"list",tokenize:zRe},PRe={partial:!0,tokenize:VRe},MRe={partial:!0,tokenize:FRe};function zRe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Ak(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(gy,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return Ak(y)&&++a<10?(e.consume(y),d):(!r.interrupt||a<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):n(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(V0,r.interrupt?n:m,e.attempt(PRe,v,h))}function m(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function h(y){return Kt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function LRe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(V0,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Sn(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Kt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(MRe,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Sn(e,e.attempt(mi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function FRe(e,t,n){const r=this;return Sn(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function URe(e){e.exit(this.containerState.type)}function VRe(e,t,n){const r=this;return Sn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Kt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const yM={name:"setextUnderline",resolveTo:BRe,tokenize:HRe};function BRe(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function HRe(e,t,n){const r=this;let i;return o;function o(f){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Kt(f)?Sn(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||lt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const qRe={tokenize:KRe};function KRe(e){const t=this,n=e.attempt(V0,r,e.attempt(this.parser.constructs.flowInitial,i,Sn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(XIe,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const GRe={resolveAll:J7()},ZRe=X7("string"),YRe=X7("text");function X7(e){return{resolveAll:J7(e==="text"?WRe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,l);return a;function a(m){return f(m)?o(m):l(m)}function l(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),o(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const h=i[m];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function J7(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function WRe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,l=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(f===-2)d=!0,l++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const XRe={42:mi,43:mi,45:mi,48:mi,49:mi,50:mi,51:mi,52:mi,53:mi,54:mi,55:mi,56:mi,57:mi,62:H7},JRe={91:nRe},QRe={[-2]:$1,[-1]:$1,32:$1},eTe={35:lRe,42:gy,45:[yM,gy],60:fRe,61:yM,95:gy,96:gM,126:gM},tTe={38:K7,92:q7},nTe={[-5]:D1,[-4]:D1,[-3]:D1,33:TRe,38:K7,42:Ok,60:[AIe,bRe],91:ARe,92:[aRe,q7],93:qR,95:Ok,96:qIe},rTe={null:[Ok,GRe]},iTe={null:[42,95]},oTe={null:[]},aTe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iTe,contentInitial:JRe,disable:oTe,document:XRe,flow:eTe,flowInitial:QRe,insideSpan:rTe,string:tTe,text:nTe},Symbol.toStringTag,{value:"Module"}));function sTe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],l=[];const d={attempt:A(N),check:A(T),consume:E,enter:j,exit:I,interrupt:A(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:x,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let m=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function h(ee){return a=bo(a,ee),C(),a[a.length-1]!==null?[]:(D(t,0),f.events=HR(o,f.events,f),f.events)}function v(ee,G){return cTe(y(ee),G)}function y(ee){return lTe(a,ee)}function x(){const{_bufferIndex:ee,_index:G,line:K,column:V,offset:H}=r;return{_bufferIndex:ee,_index:G,line:K,column:V,offset:H}}function S(ee){i[ee.line]=ee.column,q()}function C(){let ee;for(;r._index<a.length;){const G=a[r._index];if(typeof G=="string")for(ee=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ee&&r._bufferIndex<G.length;)k(G.charCodeAt(r._bufferIndex));else k(G)}}function k(ee){m=m(ee)}function E(ee){lt(ee)?(r.line++,r.column=1,r.offset+=ee===-3?2:1,q()):ee!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=ee}function j(ee,G){const K=G||{};return K.type=ee,K.start=x(),f.events.push(["enter",K,f]),l.push(K),K}function I(ee){const G=l.pop();return G.end=x(),f.events.push(["exit",G,f]),G}function N(ee,G){D(ee,G.from)}function T(ee,G){G.restore()}function A(ee,G){return K;function K(V,H,z){let W,L,ne,$;return Array.isArray(V)?U(V):"tokenize"in V?U([V]):P(V);function P(ve){return Q;function Q(le){const Se=le!==null&&ve[le],ke=le!==null&&ve.null,Pe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return U(Pe)(le)}}function U(ve){return W=ve,L=0,ve.length===0?z:O(ve[L])}function O(ve){return Q;function Q(le){return $=F(),ne=ve,ve.partial||(f.currentConstruct=ve),ve.name&&f.parser.constructs.disable.null.includes(ve.name)?pe():ve.tokenize.call(G?Object.assign(Object.create(f),G):f,d,X,pe)(le)}}function X(ve){return ee(ne,$),H}function pe(ve){return $.restore(),++L<W.length?O(W[L]):z}}}function D(ee,G){ee.resolveAll&&!o.includes(ee)&&o.push(ee),ee.resolve&&_a(f.events,G,f.events.length-G,ee.resolve(f.events.slice(G),f)),ee.resolveTo&&(f.events=ee.resolveTo(f.events,f))}function F(){const ee=x(),G=f.previous,K=f.currentConstruct,V=f.events.length,H=Array.from(l);return{from:V,restore:z};function z(){r=ee,f.previous=G,f.currentConstruct=K,f.events.length=V,l=H,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lTe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function cTe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function uTe(e){const r={constructs:vIe([aTe,...(e||{}).extensions||[]]),content:i(kIe),defined:[],document:i(jIe),flow:i(qRe),lazy:{},string:i(ZRe),text:i(YRe)};return r;function i(o){return a;function a(l){return sTe(r,o,l)}}}function dTe(e){for(;!G7(e););return e}const bM=/[\0\t\n\r]/g;function fTe(){let e=1,t="",n=!0,r;return i;function i(o,a,l){const d=[];let f,m,h,v,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(bM.lastIndex=h,f=bM.exec(o),v=f&&f.index!==void 0?f.index:o.length,y=o.charCodeAt(v),!f){t=o.slice(h);break}if(y===10&&h===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<v&&(d.push(o.slice(h,v)),e+=v-h),y){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=v+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const pTe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mTe(e){return e.replace(pTe,hTe)}function hTe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return B7(n.slice(o?2:1),o?16:10)}return BR(n)||e}const Q7={}.hasOwnProperty;function gTe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vTe(n)(dTe(uTe(n).document().write(fTe()(e,t,!0))))}function vTe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Yt),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Pt),blockQuote:o(ke),characterEscape:F,characterReference:F,codeFenced:o(Pe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Pe,a),codeText:o(Fe,a),codeTextData:F,data:F,codeFlowValue:F,definition:o(ut),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Ze),hardBreakEscape:o(dn),hardBreakTrailing:o(dn),htmlFlow:o(tn,a),htmlFlowData:F,htmlText:o(tn,a),htmlTextData:F,image:o(br),label:a,link:o(Yt),listItem:o(Y),listItemValue:v,listOrdered:o(An,h),listUnordered:o(An),paragraph:o(re),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Pt),strong:o(se),thematicBreak:o(me)},exit:{atxHeading:d(),atxHeadingSequence:N,autolink:d(),autolinkEmail:Se,autolinkProtocol:le,blockQuote:d(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ve,characterReference:Q,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:q,codeIndented:d(k),codeText:d(H),codeTextData:q,data:q,definition:d(),definitionDestinationString:I,definitionLabelString:E,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(K),htmlFlowData:q,htmlText:d(V),htmlTextData:q,image:d(W),label:ne,labelText:L,lineEnding:ee,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:X,resourceDestinationString:$,resourceTitleString:P,resource:U,setextHeading:d(D),setextHeadingLineSequence:A,setextHeadingText:T,strong:d(),thematicBreak:d()}};eK(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(B){let ce={type:"root",children:[]};const Ee={stack:[ce],tokenStack:[],config:t,enter:l,exit:f,buffer:a,resume:m,data:n},Me=[];let Ke=-1;for(;++Ke<B.length;)if(B[Ke][1].type==="listOrdered"||B[Ke][1].type==="listUnordered")if(B[Ke][0]==="enter")Me.push(Ke);else{const Wt=Me.pop();Ke=i(B,Wt,Ke)}for(Ke=-1;++Ke<B.length;){const Wt=t[B[Ke][0]];Q7.call(Wt,B[Ke][1].type)&&Wt[B[Ke][1].type].call(Object.assign({sliceSerialize:B[Ke][2].sliceSerialize},Ee),B[Ke][1])}if(Ee.tokenStack.length>0){const Wt=Ee.tokenStack[Ee.tokenStack.length-1];(Wt[1]||xM).call(Ee,void 0,Wt[0])}for(ce.position={start:Gs(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Gs(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)ce=t.transforms[Ke](ce)||ce;return ce}function i(B,ce,Ee){let Me=ce-1,Ke=-1,Wt=!1,Vt,Cn,zt,fn;for(;++Me<=Ee;){const kt=B[Me];switch(kt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{kt[0]==="enter"?Ke++:Ke--,fn=void 0;break}case"lineEndingBlank":{kt[0]==="enter"&&(Vt&&!fn&&!Ke&&!zt&&(zt=Me),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!Ke&&kt[0]==="enter"&&kt[1].type==="listItemPrefix"||Ke===-1&&kt[0]==="exit"&&(kt[1].type==="listUnordered"||kt[1].type==="listOrdered")){if(Vt){let ar=Me;for(Cn=void 0;ar--;){const In=B[ar];if(In[1].type==="lineEnding"||In[1].type==="lineEndingBlank"){if(In[0]==="exit")continue;Cn&&(B[Cn][1].type="lineEndingBlank",Wt=!0),In[1].type="lineEnding",Cn=ar}else if(!(In[1].type==="linePrefix"||In[1].type==="blockQuotePrefix"||In[1].type==="blockQuotePrefixWhitespace"||In[1].type==="blockQuoteMarker"||In[1].type==="listItemIndent"))break}zt&&(!Cn||zt<Cn)&&(Vt._spread=!0),Vt.end=Object.assign({},Cn?B[Cn][1].start:kt[1].end),B.splice(Cn||Me,0,["exit",Vt,kt[2]]),Me++,Ee++}if(kt[1].type==="listItemPrefix"){const ar={type:"listItem",_spread:!1,start:Object.assign({},kt[1].start),end:void 0};Vt=ar,B.splice(Me,0,["enter",ar,kt[2]]),Me++,Ee++,zt=void 0,fn=!0}}}return B[ce][1]._spread=Wt,Ee}function o(B,ce){return Ee;function Ee(Me){l.call(this,B(Me),Me),ce&&ce.call(this,Me)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(B,ce,Ee){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([ce,Ee||void 0]),B.position={start:Gs(ce.start),end:void 0}}function d(B){return ce;function ce(Ee){B&&B.call(this,Ee),f.call(this,Ee)}}function f(B,ce){const Ee=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==B.type&&(ce?ce.call(this,B,Me[0]):(Me[1]||xM).call(this,B,Me[0]));else throw new Error("Cannot close `"+B.type+"` ("+fm({start:B.start,end:B.end})+"): it’s not open");Ee.position.end=Gs(B.end)}function m(){return hIe(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(B){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function y(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=B}function x(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=B}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.value=B.replace(/(\r?\n|\r)$/g,"")}function E(B){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Td(this.sliceSerialize(B)).toLowerCase()}function j(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.title=B}function I(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.url=B}function N(B){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ee=this.sliceSerialize(B).length;ce.depth=Ee}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function A(B){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function F(B){const Ee=this.stack[this.stack.length-1].children;let Me=Ee[Ee.length-1];(!Me||Me.type!=="text")&&(Me=ie(),Me.position={start:Gs(B.start),end:void 0},Ee.push(Me)),this.stack.push(Me)}function q(B){const ce=this.stack.pop();ce.value+=this.sliceSerialize(B),ce.position.end=Gs(B.end)}function ee(B){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ce.children[ce.children.length-1];Ee.position.end=Gs(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(F.call(this,B),q.call(this,B))}function G(){this.data.atHardBreak=!0}function K(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.value=B}function V(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.value=B}function H(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.value=B}function z(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=ce,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function W(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=ce,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function L(B){const ce=this.sliceSerialize(B),Ee=this.stack[this.stack.length-2];Ee.label=mTe(ce),Ee.identifier=Td(ce).toLowerCase()}function ne(){const B=this.stack[this.stack.length-1],ce=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Me=B.children;Ee.children=Me}else Ee.alt=ce}function $(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.url=B}function P(){const B=this.resume(),ce=this.stack[this.stack.length-1];ce.title=B}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function X(B){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=Td(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function pe(B){this.data.characterReferenceType=B.type}function ve(B){const ce=this.sliceSerialize(B),Ee=this.data.characterReferenceType;let Me;Ee?(Me=B7(ce,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=BR(ce);const Ke=this.stack[this.stack.length-1];Ke.value+=Me}function Q(B){const ce=this.stack.pop();ce.position.end=Gs(B.end)}function le(B){q.call(this,B);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(B)}function Se(B){q.call(this,B);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(B)}function ke(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ut(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ze(){return{type:"emphasis",children:[]}}function Pt(){return{type:"heading",depth:0,children:[]}}function dn(){return{type:"break"}}function tn(){return{type:"html",value:""}}function br(){return{type:"image",title:null,url:"",alt:null}}function Yt(){return{type:"link",title:null,url:"",children:[]}}function An(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function Y(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function re(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function me(){return{type:"thematicBreak"}}}function Gs(e){return{line:e.line,column:e.column,offset:e.offset}}function eK(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eK(e,r):yTe(e,r)}}function yTe(e,t){let n;for(n in t)if(Q7.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function xM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fm({start:t.start,end:t.end})+") is still open")}function bTe(e){const t=this;t.parser=n;function n(r){return gTe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xTe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function wTe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function STe(e,t){const n=t.value?t.value+`
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function _Te(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CTe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kTe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Of(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,l+=1,e.footnoteCounts.set(r,l);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function ETe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jTe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tK(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function ITe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tK(e,t);const i={src:Of(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function RTe(e,t){const n={src:Of(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function TTe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function NTe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tK(e,t);const i={href:Of(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function ATe(e,t){const n={href:Of(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function OTe(e,t,n){const r=e.all(t),i=n?$Te(n):nK(t),o={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const m=r[l];(i||l!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
`}),m.type==="element"&&m.tagName==="p"&&!i?a.push(...m.children):a.push(m)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function $Te(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=nK(n[r])}return t}function nK(e){const t=e.spread;return t??e.children.length>1}function DTe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function PTe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MTe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zTe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LTe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=LR(t.children[1]),d=P7(t.children[t.children.length-1]);l&&d&&(a.position={start:l,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function FTe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let d=-1;const f=[];for(;++d<l;){const h=t.children[d],v={},y=a?a[d]:void 0;y&&(v.align=y);let x={type:"element",tagName:o,properties:v,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),f.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function UTe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wM=9,SM=32;function VTe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(_M(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(_M(t.slice(i),i>0,!1)),o.join("")}function _M(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===wM||o===SM;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===wM||o===SM;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function BTe(e,t){const n={type:"text",value:VTe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function HTe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qTe={blockquote:xTe,break:wTe,code:STe,delete:_Te,emphasis:CTe,footnoteReference:kTe,heading:ETe,html:jTe,imageReference:ITe,image:RTe,inlineCode:TTe,linkReference:NTe,link:ATe,listItem:OTe,list:DTe,paragraph:PTe,root:MTe,strong:zTe,table:LTe,tableCell:UTe,tableRow:FTe,text:BTe,thematicBreak:HTe,toml:Gv,yaml:Gv,definition:Gv,footnoteDefinition:Gv};function Gv(){}const rK=-1,B0=0,mm=1,xb=2,KR=3,GR=4,ZR=5,YR=6,iK=7,oK=8,CM=typeof self=="object"?self:globalThis,KTe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case B0:case rK:return n(a,i);case mm:{const l=n([],i);for(const d of a)l.push(r(d));return l}case xb:{const l=n({},i);for(const[d,f]of a)l[r(d)]=r(f);return l}case KR:return n(new Date(a),i);case GR:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case ZR:{const l=n(new Map,i);for(const[d,f]of a)l.set(r(d),r(f));return l}case YR:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case iK:{const{name:l,message:d}=a;return n(new CM[l](d),i)}case oK:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(new CM[o](a),i)};return r},kM=e=>KTe(new Map,e)(0),ld="",{toString:GTe}={},{keys:ZTe}=Object,Zp=e=>{const t=typeof e;if(t!=="object"||!e)return[B0,t];const n=GTe.call(e).slice(8,-1);switch(n){case"Array":return[mm,ld];case"Object":return[xb,ld];case"Date":return[KR,ld];case"RegExp":return[GR,ld];case"Map":return[ZR,ld];case"Set":return[YR,ld];case"DataView":return[mm,n]}return n.includes("Array")?[mm,n]:n.includes("Error")?[iK,n]:[xb,n]},Zv=([e,t])=>e===B0&&(t==="function"||t==="symbol"),YTe=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},o=a=>{if(n.has(a))return n.get(a);let[l,d]=Zp(a);switch(l){case B0:{let m=a;switch(d){case"bigint":l=oK,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return i([rK],a)}return i([l,m],a)}case mm:{if(d){let v=a;return d==="DataView"?v=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(v=new Uint8Array(a)),i([d,[...v]],a)}const m=[],h=i([l,m],a);for(const v of a)m.push(o(v));return h}case xb:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const m=[],h=i([l,m],a);for(const v of ZTe(a))(e||!Zv(Zp(a[v])))&&m.push([o(v),o(a[v])]);return h}case KR:return i([l,a.toISOString()],a);case GR:{const{source:m,flags:h}=a;return i([l,{source:m,flags:h}],a)}case ZR:{const m=[],h=i([l,m],a);for(const[v,y]of a)(e||!(Zv(Zp(v))||Zv(Zp(y))))&&m.push([o(v),o(y)]);return h}case YR:{const m=[],h=i([l,m],a);for(const v of a)(e||!Zv(Zp(v)))&&m.push(o(v));return h}}const{message:f}=a;return i([l,{name:d,message:f}],a)};return o},EM=(e,{json:t,lossy:n}={})=>{const r=[];return YTe(!(t||n),!!t,new Map,r)(e),r},wb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?kM(EM(e,t)):structuredClone(e):(e,t)=>kM(EM(e,t));function WTe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XTe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JTe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||WTe,r=e.options.footnoteBackLabel||XTe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const m=e.all(f),h=String(f.identifier).toUpperCase(),v=Of(h.toLowerCase());let y=0;const x=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++y<=S;){x.length>0&&x.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,y);typeof E=="string"&&(E={type:"text",value:E}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,y),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const E=C.children[C.children.length-1];E&&E.type==="text"?E.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...x)}else m.push(...x);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(m,!0)};e.patch(f,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...wb(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
`}]}}const aK=(function(e){if(e==null)return nNe;if(typeof e=="function")return H0(e);if(typeof e=="object")return Array.isArray(e)?QTe(e):eNe(e);if(typeof e=="string")return tNe(e);throw new Error("Expected function, string, or object as test")});function QTe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=aK(e[n]);return H0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function eNe(e){const t=e;return H0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function tNe(e){return H0(t);function t(n){return n&&n.type===e}}function H0(e){return t;function t(n,r,i){return!!(rNe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function nNe(){return!0}function rNe(e){return e!==null&&typeof e=="object"&&"type"in e}const sK=[],iNe=!0,jM=!1,oNe="skip";function aNe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=aK(i),a=r?-1:1;l(e,void 0,[])();function l(d,f,m){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(d.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=sK,x,S,C;if((!t||o(d,f,m[m.length-1]||void 0))&&(y=sNe(n(d,m)),y[0]===jM))return y;if("children"in d&&d.children){const k=d;if(k.children&&y[0]!==oNe)for(S=(r?k.children.length:-1)+a,C=m.concat(k);S>-1&&S<k.children.length;){const E=k.children[S];if(x=l(E,S,C)(),x[0]===jM)return x;S=typeof x[1]=="number"?x[1]:S+a}}return y}}}function sNe(e){return Array.isArray(e)?e:typeof e=="number"?[iNe,e]:e==null?sK:[e]}function lK(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),aNe(e,o,l,i);function l(d,f){const m=f[f.length-1],h=m?m.children.indexOf(d):void 0;return a(d,h,m)}}const $k={}.hasOwnProperty,lNe={};function cNe(e,t){const n=t||lNe,r=new Map,i=new Map,o=new Map,a={...qTe,...n.handlers},l={all:f,applyData:dNe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:uNe,wrap:pNe};return lK(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:i,v=String(m.identifier).toUpperCase();h.has(v)||h.set(v,m)}}),l;function d(m,h){const v=m.type,y=l.handlers[v];if($k.call(l.handlers,v)&&y)return y(l,m,h);if(l.options.passThrough&&l.options.passThrough.includes(v)){if("children"in m){const{children:S,...C}=m,k=wb(C);return k.children=l.all(m),k}return wb(m)}return(l.options.unknownHandler||fNe)(l,m,h)}function f(m){const h=[];if("children"in m){const v=m.children;let y=-1;for(;++y<v.length;){const x=l.one(v[y],m);if(x){if(y&&v[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=IM(x.value)),!Array.isArray(x)&&x.type==="element")){const S=x.children[0];S&&S.type==="text"&&(S.value=IM(S.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function uNe(e,t){e.position&&(t.position=Gje(e))}function dNe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,wb(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function fNe(e,t){const n=t.data||{},r="value"in t&&!($k.call(n,"hProperties")||$k.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pNe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function IM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function RM(e,t){const n=cNe(e,t),r=n.one(e,void 0),i=JTe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
`},i),o}function mNe(e,t){return e&&"run"in e?async function(n,r){const i=RM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return RM(n,{file:r,...e||t})}}function TM(e){if(e)throw e}var P1,NM;function hNe(){if(NM)return P1;NM=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!h)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},a=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},l=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return P1=function d(){var f,m,h,v,y,x,S=arguments[0],C=1,k=arguments.length,E=!1;for(typeof S=="boolean"&&(E=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<k;++C)if(f=arguments[C],f!=null)for(m in f)h=l(S,m),v=l(f,m),S!==v&&(E&&v&&(o(v)||(y=i(v)))?(y?(y=!1,x=h&&i(h)?h:[]):x=h&&o(h)?h:{},a(S,{name:m,newValue:d(E,x,v)})):typeof v<"u"&&a(S,{name:m,newValue:v}));return S},P1}var gNe=hNe();const M1=of(gNe);function Dk(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vNe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(d,...f){const m=e[++o];let h=-1;if(d){a(d);return}for(;++h<i.length;)(f[h]===null||f[h]===void 0)&&(f[h]=i[h]);i=f,m?yNe(m,l)(...f):a(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function yNe(e,t){let n;return r;function r(...a){const l=e.length>a.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(f){const m=f;if(l&&n)throw m;return i(m)}l||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const la={basename:bNe,dirname:xNe,extname:wNe,join:SNe,sep:"/"};function bNe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zh(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function xNe(e){if(Zh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function wNe(e){Zh(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function SNe(...e){let t=-1,n;for(;++t<e.length;)Zh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_Ne(n)}function _Ne(e){Zh(e);const t=e.codePointAt(0)===47;let n=CNe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CNe(e,t){let n="",r=0,i=-1,o=0,a=-1,l,d;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return n}function Zh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kNe={cwd:ENe};function ENe(){return"/"}function Pk(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jNe(e){if(typeof e=="string")e=new URL(e);else if(!Pk(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return INe(e)}function INe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const z1=["history","path","basename","stem","extname","dirname"];class cK{constructor(t){let n;t?Pk(t)?n={path:t}:typeof t=="string"||RNe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kNe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<z1.length;){const o=z1[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)z1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){F1(t,"basename"),L1(t,"basename"),this.path=la.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?la.dirname(this.path):void 0}set dirname(t){AM(this.basename,"dirname"),this.path=la.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?la.extname(this.path):void 0}set extname(t){if(L1(t,"extname"),AM(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=la.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Pk(t)&&(t=jNe(t)),F1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?la.basename(this.path,this.extname):void 0}set stem(t){F1(t,"stem"),L1(t,"stem"),this.path=la.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Fr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function L1(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function F1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function AM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function RNe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TNe=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),NNe={}.hasOwnProperty;class WR extends TNe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vNe()}copy(){const t=new WR;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(M1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(B1("data",this.frozen),this.namespace[t]=n,this):NNe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(B1("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Yv(t),r=this.parser||this.Parser;return U1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),U1("process",this.parser||this.Parser),V1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const l=Yv(t),d=r.parse(l);r.run(d,l,function(m,h,v){if(m||!h||!v)return f(m);const y=h,x=r.stringify(y,v);$Ne(x)?v.value=x:v.result=x,f(m,v)});function f(m,h){m||!h?a(m):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),U1("processSync",this.parser||this.Parser),V1("processSync",this.compiler||this.Compiler),this.process(t,i),$M("processSync","process",n),r;function i(o,a){n=!0,TM(o),r=a}}run(t,n,r){OM(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,l){const d=Yv(n);i.run(t,d,f);function f(m,h,v){const y=h||t;m?l(m):a?a(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),$M("runSync","run",r),i;function o(a,l){TM(a),i=l,r=!0}}stringify(t,n){this.freeze();const r=Yv(n),i=this.compiler||this.Compiler;return V1("stringify",i),OM(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(B1("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...h]=f;d(m,h)}else a(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function a(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(i.settings=M1(!0,i.settings,f.settings))}function l(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const h=f[m];o(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,m){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===f){v=h;break}if(v===-1)r.push([f,...m]);else if(m.length>0){let[y,...x]=m;const S=r[v][1];Dk(S)&&Dk(y)&&(y=M1(!0,S,y)),r[v]=[f,y,...x]}}}}const ANe=new WR().freeze();function U1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function V1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function B1(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function OM(e){if(!Dk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function $M(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Yv(e){return ONe(e)?e:new cK(e)}function ONe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $Ne(e){return typeof e=="string"||DNe(e)}function DNe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PNe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",DM=[],PM={allowDangerousHtml:!0},MNe=/^(https?|ircs?|mailto|xmpp)$/i,zNe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function LNe(e){const t=FNe(e),n=UNe(e);return VNe(t.runSync(t.parse(n),n),e)}function FNe(e){const t=e.rehypePlugins||DM,n=e.remarkPlugins||DM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...PM}:PM;return ANe().use(bTe).use(n).use(mNe,r).use(t)}function UNe(e){const t=e.children||"",n=new cK;return typeof t=="string"&&(n.value=t),n}function VNe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,d=t.urlTransform||BNe;for(const m of zNe)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+PNe+m.id,void 0);return lK(e,f),Jje(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(m,h,v){if(m.type==="raw"&&v&&typeof h=="number")return a?v.children.splice(h,1):v.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let y;for(y in O1)if(Object.hasOwn(O1,y)&&Object.hasOwn(m.properties,y)){const x=m.properties[y],S=O1[y];(S===null||S.includes(m.tagName))&&(m.properties[y]=d(String(x||""),y,m))}}if(m.type==="element"){let y=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!y&&r&&typeof h=="number"&&(y=!r(m,h,v)),y&&v&&typeof h=="number")return l&&m.children?v.children.splice(h,1,...m.children):v.children.splice(h,1),h}}}function BNe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||MNe.test(e.slice(0,t))?e:""}var HNe="Separator",MM="horizontal",qNe=["horizontal","vertical"],uK=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=MM,...i}=e,o=KNe(r)?r:MM,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(u6.div,{"data-orientation":o,...l,...i,ref:t})});uK.displayName=HNe;function KNe(e){return qNe.includes(e)}var GNe=uK;function q0({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return u.jsx(GNe,{"data-slot":"separator-root",decorative:n,orientation:t,className:Ue("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var K0="Tabs",[ZNe]=Qi(K0,[Ef]),dK=Ef(),[YNe,XR]=ZNe(K0),fK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:d="automatic",...f}=e,m=eu(l),[h,v]=Ko({prop:r,onChange:i,defaultProp:o??"",caller:K0});return u.jsx(YNe,{scope:n,baseId:Vi(),value:h,onValueChange:v,orientation:a,dir:m,activationMode:d,children:u.jsx(We.div,{dir:m,"data-orientation":a,...f,ref:t})})});fK.displayName=K0;var pK="TabsList",mK=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=XR(pK,n),a=dK(n);return u.jsx(pR,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(We.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});mK.displayName=pK;var hK="TabsTrigger",gK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=XR(hK,n),l=dK(n),d=bK(a.baseId,r),f=xK(a.baseId,r),m=r===a.value;return u.jsx(mR,{asChild:!0,...l,focusable:!i,active:m,children:u.jsx(We.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const h=a.activationMode!=="manual";!m&&!i&&h&&a.onValueChange(r)})})})});gK.displayName=hK;var vK="TabsContent",yK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,l=XR(vK,n),d=bK(l.baseId,r),f=xK(l.baseId,r),m=r===l.value,h=b.useRef(m);return b.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(or,{present:i||m,children:({present:v})=>u.jsx(We.div,{"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:v&&o})})});yK.displayName=vK;function bK(e,t){return`${e}-trigger-${t}`}function xK(e,t){return`${e}-content-${t}`}var WNe=fK,XNe=mK,JNe=gK,QNe=yK;function Mk({className:e,...t}){return u.jsx(WNe,{"data-slot":"tabs",className:Ue("flex flex-col gap-2",e),...t})}function zk({className:e,...t}){return u.jsx(XNe,{"data-slot":"tabs-list",className:Ue("text-muted-foreground inline-flex w-fit items-center justify-center rounded-full bg-gray-950 p-1",e),...t})}function Js({className:e,...t}){return u.jsx(JNe,{"data-slot":"tabs-trigger",className:Ue("data-[state=active]:text-white data-[state=active]:bg-gray-600 dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1 text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 border rounded-full border-transparent px-2 py-1 font-medium whitespace-nowrap transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Qs({className:e,...t}){return u.jsx(QNe,{"data-slot":"tabs-content",className:Ue("flex-1 outline-none",e),...t})}function wK(e,t,n){for(const r of e)if(r[t]===n)return r}const eAe=Pb("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function JR({className:e,variant:t,...n}){return u.jsx("div",{"data-slot":"alert",role:"alert",className:Ue(eAe({variant:t}),e),...n})}function tAe({className:e,...t}){return u.jsx("div",{"data-slot":"alert-title",className:Ue("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function QR({className:e,...t}){return u.jsx("div",{"data-slot":"alert-description",className:Ue("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function nAe(e){const{user:t}=ms(),n=ox(),{instance:r,cluster:i}=Zm({strict:!1}),o=n.instanceClient.defaults.baseURL;return b.useMemo(()=>{const a=k0(e);return[{title:"Install Harper CLI",code:"npm install -g harperdb"},{title:"Clone Template",code:`git clone https://github.com/HarperFast/application-template.git ${a}
cd ${a}`},{title:"Start Local Harper Instance",code:"npm run dev",alert:"You will be prompted to configure your instance"},{title:"Make Changes!",code:"pico schema.graphql"},{title:"Configure your .env file",code:`npm run login ${t?.username}@${o}`,note:"Your credentials are your own! Remember to exclude the .env file from source control."},{title:"Deploy Application",code:"npm run deploy"}]},[e,o,t?.username])}function rAe({defaultApplicationName:e,formState:t,watch:n}){const r=n("applicationName")||e,i=nAe(r),o=b9(...i.map(a=>a.code));return u.jsxs(u.Fragment,{children:[u.jsxs(Rl,{children:[u.jsx(Tl,{children:"Deploy with Harper CLI"}),u.jsx(Zc,{children:"Follow these steps to deploy your application using the Harper CLI"})]}),u.jsxs(hs,{className:"space-y-6",children:[i.map((a,l)=>u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:l+1}),u.jsx("h3",{children:a.title})]}),u.jsxs("div",{className:"ml-8",children:[u.jsxs("div",{className:"bg-black rounded-lg p-4 flex items-center justify-between group",children:[u.jsx("code",{className:"text-sm overflow-auto pl-8 -indent-8 wrap-anywhere",children:a.code}),u.jsx(be,{type:"button",variant:"default",size:"sm",onClick:o[l],children:u.jsx(A4,{className:"w-4 h-4"})})]}),a.note&&u.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:a.note}),a.alert&&u.jsxs(JR,{className:"mt-2",children:[u.jsx(dE,{className:"w-4 h-4"}),u.jsx(QR,{children:a.alert})]})]}),u.jsx(q0,{className:"bg-black"})]},a.title)),r&&u.jsxs("div",{className:"bg-accent rounded-lg p-4",children:[u.jsxs("p",{className:"text-sm",children:[u.jsx("strong",{children:"Application Name:"})," ",r]}),u.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:"Your application will be deployed with this name"})]}),u.jsxs(be,{className:"w-full",variant:"secondary",disabled:!t.isValid,children:[u.jsx(sE,{className:"w-4 h-4 mr-2"}),"I Have Completed These Steps"]})]})]})}function iAe({control:e,defaultApplicationName:t}){return u.jsxs(u.Fragment,{children:[u.jsxs(Rl,{children:[u.jsx(Tl,{children:"Application Name"}),u.jsx(Zc,{children:"Choose a name for your new API application"})]}),u.jsx(hs,{children:u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{control:e,name:"applicationName",render:({field:n})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"words",autoComplete:"off",autoFocus:!0,placeholder:t,...n})}),u.jsx(Ae,{})]})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Use lowercase letters, numbers, underscores, and hyphens"})]})})]})}function oAe({control:e,formState:t,isImportingApplication:n,setValue:r,watch:i}){const o=i("contents.source"),a=b.useCallback(l=>{r("contents.source",l)},[r]);return u.jsxs(u.Fragment,{children:[u.jsxs(Rl,{children:[u.jsx(Tl,{children:"Import Existing Application"}),u.jsx(Zc,{children:"Import from Git, NPM, or a tarball URL"})]}),u.jsxs(hs,{className:"space-y-6",children:[u.jsxs(Mk,{value:o,onValueChange:a,children:[u.jsxs(zk,{className:"grid w-full grid-cols-3",children:[u.jsxs(Js,{value:"git",children:[u.jsx(cE,{className:"w-4 h-4 mr-2"}),"Git"]}),u.jsxs(Js,{value:"npm",children:[u.jsx(uE,{className:"w-4 h-4 mr-2"}),"NPM"]}),u.jsxs(Js,{value:"tarball",children:[u.jsx(Lte,{className:"w-4 h-4 mr-2"}),"Tarball"]})]}),u.jsx(Qs,{value:"git",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx($e,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Git Repository URL"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})}),u.jsx(Qs,{value:"npm",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx($e,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"NPM Package Reference"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})}),u.jsx(Qs,{value:"tarball",className:"space-y-4 mt-4",children:u.jsx("div",{className:"space-y-2",children:u.jsx($e,{control:e,name:"contents.ref",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Tarball URL"}),u.jsx(Oe,{children:u.jsx(ze,{type:"url",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...l})}),u.jsx(Ae,{})]})})})})]}),u.jsx($e,{control:e,name:"contents.installCommand",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Install Command"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoCapitalize:"none",autoComplete:"off",placeholder:"npm install",...l})}),u.jsx(Ae,{})]})}),u.jsx(Ne,{children:"Authorization"}),u.jsx($e,{control:e,name:"contents.requiresAuth",render:({field:l})=>u.jsxs(Mk,{className:"w-full pt-2 pb-0 mb-0",value:String(l.value),onValueChange:d=>l.onChange(d==="true"),children:[u.jsxs(zk,{className:"grid w-full grid-cols-2",children:[u.jsx(Js,{value:"false",children:"Public Access"}),u.jsx(Js,{value:"true",children:"Requires Auth"})]}),u.jsx(Qs,{value:"false",className:"space-y-4 mt-4"}),u.jsx(Qs,{value:"true",className:"space-y-4 mt-4",children:u.jsx(JR,{children:u.jsx(QR,{children:u.jsxs("span",{children:["You can manage your certificates over in"," ",u.jsx(Ye,{to:"config",className:"underline",children:"Config"})," ",">"," ",u.jsx(Ye,{to:"config/ssh-keys",className:"underline",children:"SSH Keys"}),". This enables SSH based auth for private repos, i.e. following the pattern of"," ",u.jsx("a",{href:"https://github.com/HarperFast/Studio",target:"_blank",rel:"noreferrer",className:"underline",children:"git@github.com:HarperFast/studio.git"}),". If you have more than one key, make sure to utilize unique hostnames!"]})})})})]})}),u.jsx(q0,{className:"bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(U4,{className:"w-4 h-4 mr-2"}),"Import Application"]})]})]})}const eT=[{id:"harper",name:"Web + REST ORM",description:"Define your entities in schema.graphql, add your HTML/CSS/JS in web, and you're cooking!",tags:["Harper","ORM","REST","GraphQL"],githubUrl:"https://github.com/HarperFast/application-template/tree/fabric"},{id:"harper-ts",name:"TypeScript",description:"The same Web + REST ORM from the first template, but with TypeScript sprinkled in.",tags:["Harper","TypeScript","GraphQL"],githubUrl:"https://github.com/HarperFast/application-template/tree/fabric-typescript"}],aAe=$t({type:Cf("template"),id:tt("Please select a template.")}),sAe={type:"template",id:eT[0].id},lAe=$t({type:Cf("import"),source:Ml(["git","npm","tarball"]),ref:tt().nonempty("Please enter a URL or package reference."),installCommand:tt(),requiresAuth:Xt()}),cAe={type:"import",source:"git",ref:"",requiresAuth:!1,installCommand:""},uAe=$t({type:Cf("cli")}),dAe={type:"cli"},fAe=$t({applicationName:tt().trim().max(75,{error:"Application name cannot be longer than 75 characters."}).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),contents:II("type",[aAe,lAe,uAe])});var tT="Radio",[pAe,SK]=Qi(tT),[mAe,hAe]=pAe(tT),_K=b.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:a,value:l="on",onCheck:d,form:f,...m}=e,[h,v]=b.useState(null),y=pt(t,C=>v(C)),x=b.useRef(!1),S=h?f||!!h.closest("form"):!0;return u.jsxs(mAe,{scope:n,checked:i,disabled:a,children:[u.jsx(We.button,{type:"button",role:"radio","aria-checked":i,"data-state":jK(i),"data-disabled":a?"":void 0,disabled:a,value:l,...m,ref:y,onClick:Re(e.onClick,C=>{i||d?.(),S&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),S&&u.jsx(EK,{control:h,bubbles:!x.current,name:r,value:l,checked:i,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});_K.displayName=tT;var CK="RadioIndicator",kK=b.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=hAe(CK,n);return u.jsx(or,{present:r||o.checked,children:u.jsx(We.span,{"data-state":jK(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});kK.displayName=CK;var gAe="RadioBubbleInput",EK=b.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const a=b.useRef(null),l=pt(a,o),d=NE(n),f=AU(t);return b.useEffect(()=>{const m=a.current;if(!m)return;const h=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==n&&y){const x=new Event("click",{bubbles:r});y.call(m,n),m.dispatchEvent(x)}},[d,n,r]),u.jsx(We.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});EK.displayName=gAe;function jK(e){return e?"checked":"unchecked"}var vAe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G0="RadioGroup",[yAe]=Qi(G0,[Ef,SK]),IK=Ef(),RK=SK(),[bAe,xAe]=yAe(G0),TK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:a=!1,disabled:l=!1,orientation:d,dir:f,loop:m=!0,onValueChange:h,...v}=e,y=IK(n),x=eu(f),[S,C]=Ko({prop:o,defaultProp:i??null,onChange:h,caller:G0});return u.jsx(bAe,{scope:n,name:r,required:a,disabled:l,value:S,onValueChange:C,children:u.jsx(pR,{asChild:!0,...y,orientation:d,dir:x,loop:m,children:u.jsx(We.div,{role:"radiogroup","aria-required":a,"aria-orientation":d,"data-disabled":l?"":void 0,dir:x,...v,ref:t})})})});TK.displayName=G0;var NK="RadioGroupItem",AK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=xAe(NK,n),a=o.disabled||r,l=IK(n),d=RK(n),f=b.useRef(null),m=pt(t,f),h=o.value===i.value,v=b.useRef(!1);return b.useEffect(()=>{const y=S=>{vAe.includes(S.key)&&(v.current=!0)},x=()=>v.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",x)}},[]),u.jsx(mR,{asChild:!0,...l,focusable:!a,active:h,children:u.jsx(_K,{disabled:a,required:o.required,checked:h,...d,...i,name:o.name,ref:m,onCheck:()=>o.onValueChange(i.value),onKeyDown:Re(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:Re(i.onFocus,()=>{v.current&&f.current?.click()})})})});AK.displayName=NK;var wAe="RadioGroupIndicator",OK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=RK(n);return u.jsx(kK,{...i,...r,ref:t})});OK.displayName=wAe;var SAe=TK,_Ae=AK,CAe=OK;function kAe({className:e,...t}){return u.jsx(SAe,{"data-slot":"radio-group",className:Ue("grid gap-3",e),...t})}function EAe({className:e,...t}){return u.jsx(_Ae,{"data-slot":"radio-group-item",className:Ue("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(CAe,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:u.jsx(T4,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function $K(e){e.stopPropagation()}function jAe({control:e,formState:t,isCreatingFromTemplate:n}){return u.jsxs(u.Fragment,{children:[u.jsxs(Rl,{children:[u.jsx(Tl,{children:"Choose a Template"}),u.jsx(Zc,{children:"Start with a pre-configured template for common use cases"})]}),u.jsxs(hs,{children:[u.jsx($e,{control:e,name:"contents.id",render:({field:r})=>u.jsx(kAe,{value:r.value,onValueChange:r.onChange,children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:eT.map(i=>u.jsxs("div",{className:"relative",children:[u.jsx(EAe,{value:i.id,id:i.id,className:"peer sr-only"}),u.jsxs(ch,{htmlFor:i.id,className:"flex flex-col gap-3 p-4 border-2 rounded-lg cursor-pointer hover:bg-accent peer-data-[state=checked]:border-green peer-data-[state=checked]:bg-primary/5",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[u.jsx("span",{children:i.name}),u.jsx("a",{href:i.githubUrl,target:"_blank",rel:"noopener noreferrer",onClick:$K,className:"text-muted-foreground hover:text-white transition-colors -m-4 p-4",children:u.jsx(cE,{className:"w-4 h-4"})})]}),u.jsx("p",{className:"text-muted-foreground text-sm",children:i.description})]}),u.jsx("div",{className:"flex flex-wrap gap-2",children:i.tags.map(o=>u.jsx(Yo,{variant:"outline",children:o},o))})]})]},i.id))})})}),u.jsx(q0,{className:"my-6 bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(U4,{className:"w-4 h-4 mr-2"}),"Create from Template"]})]})]})}function IAe(e){const t=ox(),{reloadRootEntries:n,setFocusedItem:r,setExpandedItems:i,setSelectedItems:o}=Lr(),a=b.useCallback(({project:l})=>{const d=we.loading("Looking for application...",{description:"This may take a bit.",duration:3e5});e(!0),n().then(f=>{const m=f?.entries||[];for(const h of m)if(h.name.toLowerCase()===l.toLowerCase()){r(h.name),o([h.name]),i([h.name]),e(!1),we.success("Imported successfully",{description:`${l} is now available in your ${t.entityType}!`,id:d,duration:5e3});return}we.warning("Deployment Not Detected",{description:`I searched for ${l} but did not find it in the ${t.entityType} yet. Do you see it on the left? Did you use a different name, perhaps?`,id:d,duration:1e4}),e(!1)})},[t,e,n,r,i,o]);return b.useMemo(()=>({checkCLI:a}),[a])}async function RAe({instanceClient:e,project:t,template:n,entityType:r}){const{data:i}=await e.post("/",{operation:"add_component",project:t,template:n,replicated:r==="cluster"});return i}function TAe(){return ct({mutationFn:RAe})}function NAe(e){const{mutate:t,isPending:n}=TAe(),r=ox(),{reloadRootEntries:i,setFocusedItem:o,setExpandedItems:a,setSelectedItems:l}=Lr(),d=b.useCallback(({contents:f,project:m})=>{const h=we.loading("Creating from template...",{description:"This may take a bit.",duration:3e5}),v=wK(eT,"id",f.id);if(!v)return we.error("Template Not Found",{description:"Please select a template",duration:1e4,id:h});t({project:m,template:v.githubUrl,...r},{onSuccess:()=>{we.success("Created successfully!",{description:`${m} will be available once you restart your ${r.entityType}!`,id:h,duration:5e3}),e(!0),i(),o(m),l([m]),a([m])}})},[t,r,e,i,o,a,l]);return b.useMemo(()=>({isCreatingFromTemplate:n,createFromTemplate:d}),[n,d])}async function AAe({applicationName:e,applicationUrl:t,installCommand:n,entityType:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"deploy_component",package:t,project:e,replicated:r==="cluster",install_command:n||void 0,restart:"rolling"},{timeout:3e5});return o}function DK(){return ct({mutationFn:AAe})}function OAe(e){const{mutate:t,isPending:n}=DK(),r=ir(),i=Zt(),{reloadRootEntries:o,setFocusedItem:a,setExpandedItems:l,setSelectedItems:d}=Lr(),f=b.useCallback(({contents:m,project:h})=>{const v=we.loading("Importing application...",{description:"This may take a bit.",duration:3e5});t({applicationName:h,applicationUrl:m.ref,installCommand:m.installCommand,...i},{onSuccess:()=>{we.success("Imported successfully",{description:`${h} will be available once you restart your ${i.entityType}!`,id:v,duration:5e3}),e(!0),r.invalidateQueries({queryKey:[i.entityId]}),o(),a(h),d([h]),l([h])},onError:()=>{we.dismiss(v)}})},[t,r,i,e,o,a,l,d]);return b.useMemo(()=>({isImportingApplication:n,importApplication:f}),[n,f])}function $Ae(){const{rootEntries:e}=Lr(),{organization:t,instance:n,cluster:r}=Zm({strict:!1}),i=b.useMemo(()=>{const A=k0(r?.name||n?.name||t?.name||"");if(A==="")return A;let D=A,F=1;for(;wK(e,"name",D);)F+=1,D=`${A}-${F}`;return D},[e,r,n,t]),o=b.useCallback((A,D)=>{!A.applicationName&&!i?D.addIssue({code:"custom",path:["applicationName"],message:"Please name your application!"}):e.find(F=>F.name===A.applicationName)&&D.addIssue({code:"custom",path:["applicationName"],message:"That application name is already in use!"})},[i,e]),a=cn({resolver:vn(fAe.superRefine(o)),defaultValues:{applicationName:"",contents:{...cAe,...dAe,...sAe}}}),{watch:l,handleSubmit:d,control:f,setValue:m,formState:h,trigger:v}=a,[y,x]=b.useState(!1),{isCreatingFromTemplate:S,createFromTemplate:C}=NAe(x),{isImportingApplication:k,importApplication:E}=OAe(x),{checkCLI:j}=IAe(x),I=b.useCallback(A=>{const D=A.applicationName||i;switch(A.contents.type){case"template":{C({contents:A.contents,project:D});break}case"import":{E({contents:A.contents,project:D});break}case"cli":{j({contents:A.contents,project:D});break}}},[j,C,i,E]),N=l("contents.type"),T=b.useCallback(A=>{const D=h.isValid;m("contents.type",A),D||v()},[m,h,v]);return u.jsxs("div",{className:"mx-auto max-w-4xl mt-6",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"text-4xl pt-4 pb-2",children:"Bootstrap New API Application"}),u.jsx("p",{className:"text-muted-foreground",children:"Create a new application from templates, import existing code, or deploy with Harper CLI"})]}),u.jsx(un,{...a,children:u.jsx("form",{onSubmit:d(I),className:"flex flex-col gap-4 p-4",children:u.jsxs("fieldset",{disabled:k||S||y,children:[u.jsx(Dc,{className:"bg-black-dark",children:u.jsx(iAe,{control:f,defaultApplicationName:i})}),u.jsx(Dc,{className:"bg-black-dark mt-4 pt-0",children:u.jsxs(Mk,{defaultValue:N,onValueChange:T,children:[u.jsxs(zk,{className:"w-full grid grid-cols-3 mt-0",children:[u.jsxs(Js,{value:"template",children:[u.jsx(Hee,{}),u.jsx("span",{className:"hidden sm:inline-block",children:"Templates"})]}),u.jsxs(Js,{value:"import",children:[u.jsx(Tte,{}),"Import"]}),u.jsxs(Js,{value:"cli",children:[u.jsx(dE,{}),u.jsx("span",{className:"hidden md:inline-block",children:"Harper"})," CLI"]})]}),u.jsx("div",{className:"mx-6 mt-1",children:u.jsx(q0,{className:"bg-black"})}),u.jsx(Qs,{value:"template",className:"space-y-4",children:u.jsx(jAe,{control:f,formState:h,isCreatingFromTemplate:S})}),u.jsx(Qs,{value:"import",className:"space-y-4",children:u.jsx(oAe,{control:f,formState:h,isImportingApplication:k,setValue:m,watch:l})}),u.jsx(Qs,{value:"cli",className:"space-y-4",children:u.jsx(rAe,{defaultApplicationName:i,formState:h,watch:l})})]})})]})})})]})}const DAe={js:"javascript",cjs:"javascript",jsx:"javascript",yaml:"yaml",ts:"typescript",tsx:"typescript",json:"json",md:"markdown",html:"html",css:"css",graphql:"graphql",mjs:"javascript"};function PAe(){const e=Zt(),{openedEntryContents:t,openedEntry:n,restrictPackageModification:r,isSavingFile:i,saveFile:o}=Lr(),{content:a,setContent:l}=Kh(!!n&&!n.package&&n.path),d=b.useCallback(C=>{l(C!==t?C:void 0)},[t,l]),f=yf(),[m,h]=b.useState(null),v=L0(n?.path),y=DAe[v]||"plaintext",x=b.useCallback((C,k)=>{h([C,k])},[]);if(b.useEffect(()=>{if(m&&f&&!n?.package&&!r)return _ke(m)},[m,f,n,r]),ub("SaveFile",()=>{n&&!i&&a!==void 0&&o({...e,file:n.path.split("/").slice(1).join("/"),payload:a,project:n.project},n.path)},[n,e,a]),ub("RevertChanges",()=>{if(t!==void 0&&m){const[C]=m;d(void 0),C.setValue(t)}},[t,m]),!n)return null;const S=i||!!n.package||!f;return u.jsx(Bh,{className:"w-full min-h-full h-80",language:y,theme:"vs-dark",value:a??t,onMount:x,onChange:S?void 0:d,options:{automaticLayout:!0,minimap:{enabled:!1},readOnly:S,padding:{top:48}}})}function MAe(){const{openedEntry:e,openedEntryContents:t}=Lr(),n=_je(e?.project);return e?.path===Eo?u.jsx($Ae,{}):Er(e)?u.jsx("div",{className:"directoryReadMe max-w-3xl",children:u.jsx(LNe,{urlTransform:n,children:t})}):Kq(e?.name)?u.jsx("div",{className:"mt-9 absolute top-0 right-0 bottom-0 left-0",children:u.jsx("img",{className:"w-full h-full object-contain p-20",alt:e?.name,src:`data:image/${L0(e?.name)};base64,${t}`})}):u.jsx(PAe,{})}function zAe(e){let t=e?.fqdn;return t?(t.match(/^https?:\/\//i)||(t=`https://${t}`),new URL(t).toString()):null}function LAe(){const{clusterId:e,instanceId:t}=rt({strict:!1}),n=rh(),{data:r}=Mt(Dl(e));return!!e&&jt.checkForFabricConnect(e)||!!t&&jt.checkForFabricConnect(t)?zAe(r):n.defaults.baseURL?n.defaults.baseURL.replace(/:9925\/?/,""):null}function FAe(e,t,n){const r=t,i=t.replace(/:9925\/?/,"");return r&&(e=e.replaceAll(/https?:\/\/localhost:9926/g,i)),n.project&&(e=e.replaceAll("Your New Harper Fabric App",n.project)),e}function UAe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_components"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_components"});return n},retry:!1}}function PK(e,t,n,r=[]){const i=[];for(const o of e){const a=n(o,r);i.push(a);const l=o,d=l[t];d&&(a[t]=PK(d,t,n,[...r,l]))}return i}function VAe({children:e}){const t=jn(),[n,r]=b.useState(void 0),[i,o]=b.useState(void 0),{setContent:a}=Kh(n?.path),l=Zt(),d=LAe(),f=ir(),{open:m}=Rr({strict:!1}),{data:h}=Ji(UAe(l)),v=b.useMemo(()=>{const L=new Set;return{rootEntries:PK(h.entries||[],"entries",($,P)=>{const U=Er($)&&$.entries.find(X=>X.name.toLowerCase()==="readme.md"),O=[...P.map(X=>X.name),$.name].join("/");return L.add(O),{name:$.name,path:O,project:(P[0]||$)?.name,package:(P[0]||$)?.package,overviewEntry:U&&!Er(U)&&{name:U.name,path:[...P.map(X=>X.name),$.name,U.name].join("/"),project:(P[0]||$)?.name,package:(P[0]||$)?.package}||void 0}}),pathsRegistry:L}},[h]),y=b.useCallback(async()=>f.fetchQuery({queryKey:[l.entityId,"get_components"],networkMode:"online"}),[f,l]),x=b.useCallback(L=>v.pathsRegistry.has(L),[v.pathsRegistry]),S=v.rootEntries.filter(L=>!L.package&&L.path!==Eo).map(L=>L.name);let C=S[0],k=S.slice(0,1);C||(C=Eo,k=[Eo]);const[E,j]=Id(`FileFocused/${l.entityId}`,C),[I,N]=Id(`FolderOpened/${l.entityId}`,S),[T,A]=Id(`FileSelected/${l.entityId}`,k);b.useEffect(()=>{if(m?.length){const L=m.split("?"),ne=L[0],$=L[1],P=ne.split("/");if($){const U=$.split("=");ni(U[0],U[1]==="true"?!0:U[1]==="false"?!1:U[1])}N(U=>{const O=new Set(U);for(let X=1;X<P.length;X++)O.add(P.slice(0,X).join("/"));return[...O]}),A([ne]),j(ne),t({search:void 0})}},[t,m,N,j,A]);const D=n&&(Er(n)?n.overviewEntry?.path:n.path)||"",F=n&&(Er(n)?n.overviewEntry?.project:n.project)||"",q=n&&(Er(n)?!!n.overviewEntry?.path:!1)||!1,ee=Zq({file:D?.split("/").slice(1).join("/"),project:F,...l}),{data:G}=Mt(pke({file:D?.split("/").slice(1).join("/"),project:F,...l}));b.useEffect(function(){const ne=G?.project+"/"+G?.file;let $=G?.message;ne===D&&$!==void 0?(q&&d&&G&&($=FAe($,d,G)),o($)):o(void 0)},[G,D,q,l]);const{mutate:K,isPending:V}=Yq(),H=b.useCallback((L,ne)=>{K(L,{onSuccess:()=>{n?.path===ne&&L.payload!==void 0&&(a(void 0),o(L.payload||void 0),f.setQueryData(ee,{...G,message:L.payload}))},onError:$=>{console.error("Error saving file:",$)}})},[ee,G,n?.path,f,K,a]),z=b.useMemo(()=>n?n.package?.includes("github.com/HarperDB/status-check-fabric")||n.package?.includes("github.com/HarperFast/status-check-fabric")||n.path===Xs||n.path===Eo:!1,[n]),W=b.useMemo(()=>({rootEntries:v.rootEntries,reloadRootEntries:y,entryExists:x,focusedItem:E,setFocusedItem:j,expandedItems:I,setExpandedItems:N,selectedItems:T,setSelectedItems:A,restrictPackageModification:z,openedEntry:n,setOpenedEntry:r,openedEntryContents:i,setOpenedEntryContents:o,saveFile:H,isSavingFile:V}),[v.rootEntries,y,x,E,j,I,N,T,A,z,n,r,i,o,H,V]);return u.jsx(Hq.Provider,{value:W,children:e})}function Hl(e){const t=e;if(t?.focus)zM(t);else{const n=e;n?.target?.focus&&zM(n.target)}}function zM(e){qc(1).then(()=>{e.focus?.()})}function BAe(){const{value:e,trigger:t}=Vl("ShowAddDirectoryOrFileModalType",!1),n=b.useCallback(()=>{ni("ShowAddDirectoryOrFileModalType",!1),Hl(t)},[t]),{openedEntry:r,entryExists:i,reloadRootEntries:o,setFocusedItem:a,setSelectedItems:l,setExpandedItems:d}=Lr(),f=Zt(),{mutate:m,isPending:h}=Yq(),v=Cl.object({name:Cl.string().nonempty({error:"Please enter a valid name."}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:"Names can only contain letters, numbers, underscores, hyphens, periods, and spaces."}).max(50,{error:"Names cannot be longer than 50 characters."}).trim()}),y=cn({resolver:vn(v),defaultValues:{name:""}}),x=b.useCallback(C=>{if(!r||!e)return;const k=r.path.split("/"),E=(Er(r)?k.slice(1):k.slice(1,-1)).join("/"),j=E?`${E}/${C.name}`:C.name;if(i(r.project+"/"+j)){we.error(`${wo(e)} already exists!`,{description:j});return}m({file:j,project:r.project,payload:e==="directory"?void 0:"",...f},{onSuccess:()=>{o(),n(),y.reset();const I=[r.project,E,C.name].filter(Jo).join("/");a(I),l([I]),e==="directory"&&d(N=>[...N,I])}})},[m,y,n,f,r,i,o,d,a,l,e]),S=b.useCallback(()=>{n(),y.reset()},[n,y]);return u.jsx(Un,{onOpenChange:n,open:!!e,children:u.jsx(Vn,{"aria-describedby":void 0,className:"text-white",children:u.jsx(un,{...y,children:u.jsxs("form",{onSubmit:y.handleSubmit(x),children:[u.jsxs(yr,{children:[u.jsxs(Pn,{children:["Add ",e]}),u.jsxs(Ir,{children:["Enter the name of the ",e," you want to add:"]})]}),u.jsx($e,{control:y.control,name:"name",render:({field:C})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:h,type:"text",autoComplete:"off",autoCapitalize:"off",...C})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:S,children:"Cancel"}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:h,children:[u.jsx(Jr,{})," Add ",e]})]})})]})})})})}function HAe(){const{value:e,trigger:t}=Vl("ShowDeleteDirectoryOrFileModal",!1),n=Zt(),{openedEntry:r,reloadRootEntries:i,setFocusedItem:o,setSelectedItems:a,selectedItems:l}=Lr(),d=l.length>1,f=Er(r),m=f&&r.path===r.project,h=!!r?.package,v=h?"Remove":"Delete",y=h?"Imported Application":m?"Application":f?"Directory":"File",x=b.useCallback(()=>{ni("ShowDeleteDirectoryOrFileModal",!1),Hl(t)},[t]),S=b.useCallback(async()=>{x();let k=[],E=0,j=!1;const I={label:"Cancel",onClick:()=>{j=!0}},N={label:"OK",onClick:()=>{}},T="deleting-files";for(const A of l.reverse()){k=A.split("/");const D=k[0],F=k.length>1?k.slice(1).join("/"):void 0;if(we.loading(`${v} in progress...`,{id:T,description:`${E} of ${Yr(l.length,"item","items")}`,action:I}),await qq({file:F,project:D,...n}),j)break;E+=1}if(j?we.warning(`${v} canceled!`,{id:T,description:"",action:N}):we.success(`${v} completed!`,{id:T,description:"",action:N}),k.length){const A=k.slice(0,-1).join("/");o(A||void 0),a(A?[A]:[]),i()}},[v,x,n,i,l,o,a]),C=b.useCallback(k=>{k.preventDefault(),S()},[S]);return u.jsx(Un,{onOpenChange:x,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsxs(Pn,{children:[v," ",y]}),u.jsxs(Ir,{children:["Are you sure you want to ",v.toLowerCase()," ",d?`these ${l.length} items`:`this ${y.toLowerCase()}`,"?"]}),!h&&u.jsx(Ir,{className:"whitespace-pre",children:d?l.join(`
`):r?.path})]}),u.jsxs("div",{className:"flex w-full gap-4",children:[u.jsx(be,{variant:"ghostOutline",className:"w-full rounded-full",onClick:x,children:"Cancel"}),u.jsxs(be,{variant:"destructiveOutline",type:"button",className:"w-full rounded-full",autoFocus:!0,onClick:C,children:[u.jsx(Ca,{})," ",v," ",d?"items":y]})]})]})})}async function qAe({packageName:e,project:t,skipNodeModules:n,skipSymlinks:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"package_component",package:e,project:t,skip_node_modules:n,skip_symlinks:r},{timeout:3e5});return o}function KAe(){return ct({mutationFn:qAe})}function GAe(){const{value:e,trigger:t}=Vl("ShowDownloadApplicationModal",!1),n=Zt(),{openedEntry:r}=Lr(),{mutate:i,isPending:o,isSuccess:a}=KAe(),l=a?"Downloaded":o?"Downloading":"Download",[d,f]=b.useState(!1),m=b.useCallback(y=>{f(y.target.checked)},[]),h=b.useCallback(()=>{ni("ShowDownloadApplicationModal",!1),Hl(t)},[t]),v=b.useCallback(y=>{if(y.preventDefault(),!r)return;h();const x=we.loading("Packaging...");i({packageName:r.package,project:r.project,skipNodeModules:!d,...n},{onSuccess:S=>{we.success("Download ready!",{id:x});const C=document.createElement("a");C.setAttribute("class","invisible absolute top-0");const k=Uint8Array.from(atob(S.payload),j=>j.charCodeAt(0)),E=new Blob([k],{type:"application/gzip"});C.href=URL.createObjectURL(E),C.download=`${r.project}.gz`,document.body.appendChild(C),C.click(),document.body.removeChild(C)}})},[r,i,d,n,h]);return u.jsx(Un,{onOpenChange:h,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"Download Application"}),u.jsxs(Ir,{children:["This will package up the contents of ",u.jsx("strong",{children:r?.project})," into a gzipped file."]})]}),u.jsxs(ch,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",disabled:o,checked:d,onChange:m}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Include Node Modules"})]}),u.jsxs("div",{className:"flex w-full gap-4",children:[u.jsx(be,{variant:"ghostOutline",className:"w-full rounded-full",onClick:h,children:"Cancel"}),u.jsxs(be,{variant:"positive",type:"button",className:"w-full rounded-full",disabled:o,autoFocus:!0,onClick:v,children:[u.jsx($4,{})," ",l,o?"...":""]})]})]})})}function ha({className:e,...t}){const{formDescriptionId:n}=wx();return u.jsx("p",{"data-slot":"form-description",id:n,className:Ue("text-muted-foreground text-sm",e),...t})}function Fm(e=!1){const[t,n]=b.useState(e),r=b.useCallback(a=>{a?.preventDefault?.(),n(l=>!l)},[]),i=b.useCallback(a=>{a?.preventDefault?.(),n(!0)},[]),o=b.useCallback(a=>{a?.preventDefault?.(),n(!1)},[]);return b.useMemo(()=>({toggled:t,setToggled:n,toggle:r,toggleOn:i,toggleOff:o}),[r,n,o,i,t])}function ZAe({field:e}){const{toggled:t,toggle:n}=Fm(!1);return u.jsxs(Te,{className:"my-4",children:[u.jsxs(Ne,{onClick:n,className:ki("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Mb,{}):u.jsx(bi,{})," Optional Database Name"]}),u.jsx(ha,{className:t?"":"hidden",children:'"data" is the default recommended name'}),u.jsx(Oe,{className:t?"":"hidden",children:u.jsx(ze,{type:"text",className:"my-1",...e})}),u.jsx(Ae,{})]})}var Sb=(e=>(e.Any="Any",e.BigInt="BigInt",e.Blob="Blob",e.Boolean="Boolean",e.Bytes="Bytes",e.Date="Date",e.Float="Float",e.ID="ID",e.Int="Int",e.Long="Long",e.String="String",e))(Sb||{});const Z0=/^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/,MK=tt().regex(Z0,{error:"Database name cannot include backticks or forward slashes."}).max(75,{error:"Database name cannot be longer than 75 characters."}),YAe=tt().nonempty({error:"Field name is required."}).regex(Z0,{error:"Field name cannot include backticks or forward slashes."}).max(250,{error:"Field name cannot be longer than 250 characters."}),zK=tt().nonempty({error:"Table name is required."}).regex(Z0,{error:"Table name cannot include backticks or forward slashes."}).max(250,{error:"Table name cannot be longer than 250 characters."}),WAe=$t({tableName:zK,databaseName:MK,expiration:gI().or(Cf("")),enableRest:Xt(),sealed:Xt(),tableFields:ds($t({fieldName:YAe,fieldType:Ml(Sb),primaryKey:Xt(),nullable:Xt(),indexed:Xt(),array:Xt()})).min(1,{error:"Please add at least one field."})});function XAe({field:e}){const{toggled:t,toggle:n}=Fm(!1),r=b.useCallback(i=>e.onChange(i.target.value?parseInt(i.target.value,10):i.target.value),[]);return u.jsxs(Te,{className:"my-4",children:[u.jsxs(Ne,{onClick:n,className:ki("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Mb,{}):u.jsx(bi,{})," Optional Expiration"]}),u.jsx(ha,{className:t?"":"hidden",children:"After how many seconds should records be automatically evicted? Leave blank or set to 0 to skip this feature. (It can be useful for cache records.)"}),u.jsx(Oe,{className:t?"":"hidden",children:u.jsx(ze,{...e,type:"number",min:0,step:1,className:"my-1",onChange:r})}),u.jsx(Ae,{})]})}function JAe(){const e=Xa("ShowNewTableModal",!1),{openedEntry:t,openedEntryContents:n}=Lr(),{setContent:r}=Kh(!!t&&!t.package&&t.path),i=cn({resolver:vn(WAe),defaultValues:{tableName:"",databaseName:"data",expiration:"",enableRest:!0,sealed:!0,tableFields:[{fieldName:"id",fieldType:Sb.ID,primaryKey:!0,nullable:!0,indexed:!1,array:!1}]}}),{control:o,handleSubmit:a,formState:l}=i,{fields:d,append:f,remove:m}=cj({name:"tableFields",control:o}),h=b.useCallback(()=>{f({fieldName:"",fieldType:Sb.String,primaryKey:!1,nullable:!1,indexed:!1,array:!1})},[f]),v=b.useCallback(async y=>{r(x=>{const S=x||n||"",C=[!!y.databaseName&&y.databaseName!=="data"&&`database: "${y.databaseName}"`,!!y.expiration&&y.expiration>0&&`expiration: ${y.expiration}`].filter(Jo),k=C.length?`(${C.join(", ")})`:"",E=y.enableRest?" @export":"",j=y.sealed?" @sealed":"",I=y.tableFields.map(N=>{const T=N.array?`[${N.fieldType}]`:N.fieldType,A=N.nullable?"":"!",D=N.primaryKey?" @primaryKey":"",F=N.indexed?" @indexed":"";return`
	${N.fieldName}: ${T}${A}${D}${F}`}).join("");return`${S}
type ${y.tableName} @table${k}${E}${j} {${I}
}
`}),e()},[r,e,n]);return u.jsx(un,{...i,children:u.jsxs("form",{onSubmit:a(v),children:[u.jsx($e,{control:o,name:"tableName",render:({field:y})=>u.jsxs(Te,{className:"my-4",children:[u.jsx(Ne,{children:"Table Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",className:"my-1",...y})}),u.jsx(Ae,{})]})}),u.jsx("h3",{className:"text-lg",children:"Table Fields"}),d.map((y,x)=>u.jsxs("div",{className:"p-4 my-2 border rounded-lg",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx($e,{control:o,name:`tableFields.${x}.fieldName`,render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Field Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",...S})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.fieldType`,render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Type"}),u.jsx(Oe,{children:u.jsxs(Gi,{...S,onValueChange:S.onChange,defaultValue:S.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{})}),u.jsxs(Wi,{children:[u.jsx(Ot,{value:"Any",children:"Any"}),u.jsx(Ot,{value:"BigInt",children:"BigInt"}),u.jsx(Ot,{value:"Blob",children:"Blob"}),u.jsx(Ot,{value:"Boolean",children:"Boolean"}),u.jsx(Ot,{value:"Bytes",children:"Bytes"}),u.jsx(Ot,{value:"Date",children:"Date"}),u.jsx(Ot,{value:"Float",children:"Float"}),u.jsx(Ot,{value:"ID",children:"ID"}),u.jsx(Ot,{value:"Int",children:"Int"}),u.jsx(Ot,{value:"Long",children:"Long"}),u.jsx(Ot,{value:"String",children:"String"})]})]})}),u.jsx(Ae,{})]})})]}),u.jsxs("div",{className:"flex flex-wrap items-center mt-2 gap-x-2 md:gap-x-4",children:[u.jsx($e,{control:o,name:`tableFields.${x}.indexed`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Indexed"}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.primaryKey`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Primary Key"}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.nullable`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Nullable"}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.array`,render:({field:S})=>u.jsxs(Te,{className:"inline-flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Ne,{className:"flex-1 py-2.5",children:"Array"}),u.jsx(Ae,{})]})}),u.jsx("div",{className:"grow"}),u.jsxs(be,{type:"button",variant:"destructiveGhost",className:"rounded-full",onClick:()=>m(x),children:[u.jsx(Ca,{})," Remove Field"]})]})]},y.id)),u.jsxs(be,{variant:"ghost",type:"button",className:"w-full",onClick:h,children:[u.jsx(Jr,{})," Add Another Field"]}),u.jsx("hr",{className:"my-6 border-gray-600"}),u.jsx($e,{control:o,name:"databaseName",render:({field:y})=>u.jsx(ZAe,{field:y})}),u.jsx($e,{control:o,name:"expiration",render:({field:y})=>u.jsx(XAe,{field:y})}),u.jsx($e,{control:o,name:"enableRest",render:({field:y})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Ne,{className:"flex-1 py-2.5",children:["Make available as a REST endpoint (add"," ",u.jsx("code",{className:"text-muted-foreground italic ml-1",children:"@export"}),")"]}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o,name:"sealed",render:({field:y})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Ne,{className:"flex-1 py-2.5",children:["Sealed (add",u.jsx("code",{className:"text-muted-foreground italic ml-1",children:"@sealed"})," to ignore unspecified properties)"]}),u.jsx(Ae,{})]})}),u.jsxs("div",{className:"text-muted-foreground italic text-sm pb-2",children:["There are even more directives available to you when editing your schema.graphql by hand! You can read more about them"," ",u.jsx("a",{className:"underline",target:"_blank",rel:"noreferrer",href:"https://docs.harperdb.io/docs/developers/applications/defining-schemas",children:"in our documentation"}),"."]}),u.jsxs("div",{className:"flex w-full gap-4 sticky -bottom-6 pb-6 pt-4 bg-black",children:[u.jsxs(be,{variant:"ghost",className:"w-full rounded-full",onClick:e,children:[u.jsx(Uee,{})," Cancel"]}),u.jsxs(be,{variant:"positive",type:"submit",className:"w-full rounded-full",disabled:!l.isValid,children:[u.jsx(Jr,{})," New Table"]})]})]})})}function QAe(){const{value:e,trigger:t}=Vl("ShowNewTableModal",!1),n=b.useCallback(()=>{ni("ShowNewTableModal",!1),Hl(t)},[t]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"New Table"}),u.jsx(Ir,{children:"Creating a table is the basis of a data-driven application and can immediately be used as RESTful endpoints. This can also be configured as a caching table and extended and customized for specific endpoint behavior."})]}),u.jsx(JAe,{})]})})}function eOe(){const{value:e,trigger:t}=Vl("ShowRedeployApplicationModal",!1),n=ir(),r=Zt(),{openedEntry:i}=Lr(),o=i?.package,{mutate:a,isPending:l}=DK(),d=cn({defaultValues:{applicationUrl:o,installCommand:""}}),{control:f,handleSubmit:m,reset:h}=d;b.useEffect(()=>{h({applicationUrl:o})},[h,o]);const v=b.useCallback(()=>{ni("ShowRedeployApplicationModal",!1),Hl(t),h({applicationUrl:o})},[h,o,t]),y=b.useCallback((S,C)=>{if(!i)return;v();const k=we.loading("Redeploying...");a({applicationName:i.project,applicationUrl:S,installCommand:C,...r},{onSuccess:()=>{we.success(`Application ${i.project} redeployed successfully`,{id:k}),n.invalidateQueries({queryKey:[r.entityId,"get_components"],refetchType:"active"})},onError:()=>{we.dismiss(k)}})},[a,i,r,n,v]),x=({applicationUrl:S,installCommand:C})=>{S&&y(S,C)};return u.jsx(Un,{onOpenChange:v,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"Redeploy Package"}),u.jsx(Ir,{children:"Redeploy this package?"})]}),u.jsx("div",{children:u.jsx(un,{...d,children:u.jsxs("form",{className:"flex flex-col w-full gap-4",onSubmit:m(x),children:[u.jsx($e,{control:f,name:"applicationUrl",render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Package Reference"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoFocus:!0,...S})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:f,name:"installCommand",render:({field:S})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Install Command"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",placeholder:"npm install",...S})}),u.jsx(Ae,{})]})}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"w-full rounded-full",disabled:l,children:[u.jsx(xa,{})," Redeploy Application"]}),u.jsx(be,{type:"button",variant:"ghostOutline",className:"w-full rounded-full",onClick:v,disabled:l,children:"Cancel"})]})})})]})})}function tOe(e){return $R(e.split("/").slice(0,-1))}function nOe(e,t){return $R(tOe(e),t)}function rOe(){const{value:e,trigger:t}=Vl("ShowRenameFileModal",!1),n=b.useCallback(()=>{ni("ShowRenameFileModal",!1),Hl(t)},[t]),{openedEntry:r,entryExists:i}=Lr(),o=Cl.object({name:Cl.string().nonempty({error:"Please enter a valid name."}).regex(/^[a-zA-Z0-9_\- .]*$/,{error:"Names can only contain letters, numbers, underscores, hyphens, periods, and spaces."}).max(50,{error:"Names cannot be longer than 50 characters."}).trim().refine(v=>v!==r?.name,{error:"Please enter a new name."})}),[a,l]=b.useState(!1),d=Wq(),f=cn({resolver:vn(o)});b.useEffect(()=>{r?.name&&f.reset({name:r?.name})},[f,r?.name]);const m=b.useCallback(async v=>{if(!r)return;const y=nOe(r.path,v.name);if(i(y)){we.error(`${Er(r)?"Directory":"File"} already exists!`,{description:y});return}l(!0),await d([{from:r.path,to:y}]),n(),f.reset(),l(!1)},[n,i,f,r,d,l]),h=b.useCallback(()=>{n(),f.reset()},[n,f]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,className:"text-white",children:u.jsx(un,{...f,children:u.jsxs("form",{onSubmit:f.handleSubmit(m),children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"Rename File"}),u.jsx(Ir,{children:r?.path})]}),u.jsx($e,{control:f.control,name:"name",render:({field:v})=>u.jsxs(Te,{className:"my-2",children:[u.jsx(Ne,{children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{disabled:a,type:"text",autoComplete:"off",autoCapitalize:"off",...v})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"ghostOutline",className:"rounded-full",onClick:h,children:"Cancel"}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"rounded-full",disabled:a||!f.formState.isDirty||!f.formState.isValid,children:[u.jsx(L4,{})," Rename"]})]})})]})})})})}function iOe(){const{toggle:e,toggled:t}=fke("ApplicationsSidebarOpened",!0);return u.jsxs(VAe,{children:[u.jsx("aside",{id:"file-explorer-sidebar",className:ki("pt-[calc(--spacing(32))] w-56 fixed top-0 left-0 bottom-0 z-30","bg-black-dark shadow shadow-black","transition-transform -translate-x-full",t?"translate-x-0":"md:translate-x-0"),"aria-label":"Sidebar",children:u.jsx(vje,{})}),u.jsxs("div",{className:ki("applications-content","overflow-y-auto overflow-x-hidden","fixed top-32 right-0 bottom-0 left-0","transition-[left]","md:left-56",t&&"sm:left-56"),children:[u.jsx(MAe,{}),u.jsx(Sje,{toggledSidebar:t,toggleSidebar:e})]}),u.jsx(BAe,{}),u.jsx(QAe,{}),u.jsx(HAe,{}),u.jsx(GAe,{}),u.jsx(eOe,{}),u.jsx(rOe,{})]})}function oOe(e){return[nt({getParentRoute:()=>e,path:"/",component:iOe})]}const rl="flex items-center p-2 rounded-lg group",il={className:"text-white hover:bg-gray-700"},ol={className:"text-black bg-white pointer-events-none cursor-default"};function aOe(){return u.jsxs("div",{className:"md:grid gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:[u.jsxs("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3 md:border-r-1 border-b md:border-b-0 md:pr-4 border-gray-700",children:[u.jsx(sOe,{}),u.jsx(lOe,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 md:pt-4",children:u.jsx(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:u.jsx(jl,{})})})]})}function sOe(){const e=rt({strict:!1}),t=LE();return u.jsxs("div",{className:"hidden md:block pl-4 pt-4",children:[u.jsxs(Ye,{to:ur(e,"config"),className:rl,activeOptions:{exact:!0},inactiveProps:il,activeProps:ol,children:[u.jsx(I4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]}),t&&u.jsxs("ul",{className:"border-t border-gray-700 pt-4 mt-4 space-y-2",children:[u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/users"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(V4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/roles"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(D4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/ssh-keys"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(P4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}function lOe(){const e=rt({strict:!1}),t=LE();return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2 px-4",children:[u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config"),className:rl,activeOptions:{exact:!0},inactiveProps:il,activeProps:ol,children:[u.jsx(I4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]})}),t&&u.jsxs(u.Fragment,{children:[u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/users"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(V4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/roles"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(D4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ye,{to:ur(e,"config/ssh-keys"),className:rl,inactiveProps:il,activeProps:ol,children:[u.jsx(P4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}async function cOe({clusterId:e,instanceId:t}){return null}function uOe(e){return{queryKey:[e.clusterId,e.instanceId],queryFn:()=>cOe(e),retry:!1}}const dOe=({loadingRegistration:e,registrationInfo:t})=>u.jsxs(u.Fragment,{children:[u.jsx("dt",{className:"font-bold text-sm/6",children:"Harper Version"}),u.jsx("dd",{className:"text-sm/6 sm:mt-2",children:e?u.jsx(Pr,{className:"w-10"}):t?.version||"Unknown"})]});function fOe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_configuration"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_configuration"});return n}}}function nT({entityId:e,instanceClient:t}){return{queryKey:[e,"registration_info"],staleTime:6e4,queryFn:async()=>{const{data:n}=await t.post("/",{operation:"registration_info"});return n}}}function pOe({entityId:e,instanceClient:t},n){return{queryKey:[e,"get_usage_licenses"],enabled:n,queryFn:async()=>{try{const{data:r}=await t.post("/",{operation:"get_usage_licenses"});return r}catch(r){return console.error(r),null}}}}function LM(e,t){const n=FM(e),r=FM(t);return!n||!r?!1:hOe(r,n)>=0}function FM(e){if(typeof e!="string")return null;const[t]=e.split("+",1).concat(""),n=t.indexOf("-"),r=n===-1?t:t.slice(0,n),i=n===-1?"":t.slice(n+1),o=r.split(".");if(o.length===0)return null;const a=H1(o[0]),l=H1(o[1]??"0"),d=H1(o[2]??"0");if(a==null||l==null||d==null)return null;const f=i?i.split(".").map(m=>mOe(m)?Number(m):m):[];return{major:a,minor:l,patch:d,pre:f}}function H1(e){return e==null||e===""||!/^\d+$/.test(e)?null:Number(e)}function mOe(e){return/^\d+$/.test(e)}function hOe(e,t){if(e.major!==t.major)return e.major<t.major?-1:1;if(e.minor!==t.minor)return e.minor<t.minor?-1:1;if(e.patch!==t.patch)return e.patch<t.patch?-1:1;const n=e.pre.length>0,r=t.pre.length>0;if(!n&&!r)return 0;if(!n&&r)return 1;if(n&&!r)return-1;const i=Math.min(e.pre.length,t.pre.length);for(let o=0;o<i;o++){const a=e.pre[o],l=t.pre[o],d=typeof a=="number",f=typeof l=="number";if(d&&f){if(a!==l)return a<l?-1:1;continue}if(d&&!f)return-1;if(!d&&f)return 1;if(a!==l)return String(a)<String(l)?-1:1}return e.pre.length!==t.pre.length?e.pre.length<t.pre.length?-1:1:0}const gOe=({children:e})=>u.jsx(u.Fragment,{children:e});function vOe(){const{clusterId:e,instanceId:t}=rt({strict:!1}),{instance:n}=Zm({strict:!1}),r="Instance",i=Zt(),{version:o}=Gm({strict:!1}),a=!xd,{data:l,isLoading:d}=Mt(uOe({clusterId:e,instanceId:t})),{data:f}=Mt(pOe(i,a));l?.cluster,l?.instance;const{data:m,isLoading:h}=Mt(nT(i)),{data:v,isLoading:y}=Mt(fOe(i));return b.useMemo(()=>{if(e&&!t)return[];if(f&&n?.licenses){const x=If(f,"id");return n.licenses.filter(S=>!x[S.id])}return[]},[e,t,f,n]),u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(gOe,{children:u.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-3",children:[u.jsx("div",{className:"px-4 pb-4 sm:col-span-2 sm:px-0",children:u.jsx(dOe,{loadingRegistration:h,registrationInfo:m})}),u.jsx("div",{className:"px-4 pb-4 text-right sm:col-span-1 sm:px-0",children:u.jsx(I7,{targetNoun:r,instanceClient:i.instanceClient,operation:"restart"})})]})}),u.jsx("h3",{className:"flex-none font-bold text-sm/6",children:"Instance Config (read only)"}),!t&&u.jsx("p",{className:"text-muted-foreground italic text-sm mb-2",children:"You are viewing the config for one instance in your cluster, based on what the load balancer selected for you."}),u.jsx("div",{className:"grow",children:y?u.jsxs(u.Fragment,{children:[u.jsx(Pr,{className:"w-full"}),u.jsx(Pr,{className:"w-full"}),u.jsx(Pr,{className:"w-1/2"})]}):u.jsx(M0,{className:"w-full min-h-full h-96",language:"json",theme:"vs-dark",options:{readOnly:!0,scrollBeyondLastLine:!1},value:JSON.stringify(v,null,4)})})]})}const Wv=R0(),yOe=[{header:"Role",accessorKey:"role",enableSorting:!1},Wv.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Tc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),Wv.display({header:"Updated",id:"__updatedtime__",enableSorting:!1,cell:e=>Tc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}),Wv.display({header:"Super  User",id:"super_user",enableSorting:!1,cell:e=>e.row.original.permission.super_user?"Yes":"No"}),Wv.display({header:"Structure  User",id:"structure_user",enableSorting:!1,cell:e=>e.row.original.permission.structure_user?"Yes":"No"})];async function bOe(e){const{role:t,super_user:n,structure_user:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"add_role",role:t,permission:{super_user:n,structure_user:r}});return o}function xOe(){return ct({mutationFn:bOe})}const wOe=$t({role:tt().nonempty({error:"Please enter a role."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role cannot be longer than 30 characters."}),super_user:Xt(),structure_user:Xt()});function SOe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=cn({resolver:vn(wOe),defaultValues:{role:"",super_user:!1,structure_user:!1}}),i=Zt(),{mutate:o,isPending:a}=xOe(),l=b.useCallback(async f=>{f&&o({role:f.role,super_user:f.super_user,structure_user:f.structure_user,...i},{onSuccess:()=>{r.reset(),t(f.role),we.success("Role added successfully!"),n(!1)}})},[o,r,i,t,n]),d=b.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(un,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(l),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(yr,{className:"md:col-span-2",children:[u.jsx(Pn,{children:"Add New Role"}),u.jsx(Ir,{children:"After adding the role, you will be able to edit the per-table permissions."})]}),u.jsx($e,{control:r.control,name:"role",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"super_user",render:({field:f})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Ne,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Super User"}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"structure_user",render:({field:f})=>u.jsxs(Te,{className:"flex",children:[u.jsx(Oe,{children:u.jsx(ze,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Ne,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Structure User"}),u.jsx(Ae,{})]})}),u.jsx(Yn,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:a,children:[u.jsx(To,{})," Add Role"]})]})})]})})})})}function rT({entityId:e,instanceClient:t}){return{queryKey:[e,"list_roles"],queryFn:()=>_Oe({instanceClient:t}),refetchInterval:1e4}}async function _Oe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_roles"});return t}function COe({instanceDatabaseMap:e,currentRolePermissions:t,version:n,showAttributes:r}){const i={...t};if(t.super_user||t.structure_user||t.cluster_user)return t;const[o,a,l]=n.split(".").map(f=>parseInt(f,10)),d=n!=="2.0.000"&&o<=2&&a<=1&&l<=2;for(const f in e){i[f]={tables:{}};for(const m in e[f]){const v=e[f][m].attributes.map(y=>y.attribute).sort();if(d){const y=t&&t[f]&&t[f].tables[m];i[f].tables[m]=kOe(y,v,r)}else{const y=t&&t[f]&&t[f].tables[m];i[f].tables[m]=EOe(y,v,r)}}}return i}function kOe(e,t,n){const r=e&&If(e.attribute_restrictions,"attribute_name");return{read:e?e.read:!0,insert:e?e.insert:!0,update:e?e.update:!0,delete:e?e.delete:!0,attribute_restrictions:t.filter(()=>n).map(i=>{const o=r?.[i];return{attribute_name:i,read:o?o.read:e?e.read:!0,insert:o?o.insert:e?e.insert:!0,update:o?o.update:e?e.update:!0,delete:o?o.delete:e?e.delete:!0}})}}function EOe(e,t,n){const r=e&&If(e.attribute_permissions||[],"attribute_name");return{read:e?e.read:!1,insert:e?e.insert:!1,update:e?e.update:!1,delete:e?e.delete:!1,attribute_permissions:n?t.map(i=>{const o=r?.[i];return{attribute_name:i,read:o?o.read:e?.attribute_permissions?.length?!1:e?.read||!1,insert:o?o.insert:e?.attribute_permissions?.length?!1:e?.insert||!1,update:o?o.update:e?.attribute_permissions?.length?!1:e?.update||!1}}):null}}async function jOe({id:e,permission:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"alter_role",id:e,permission:t});return r}function IOe(){return ct({mutationFn:jOe})}async function ROe({id:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_role",id:e});return n}function TOe(){return ct({mutationFn:ROe})}function LK({entityId:e,instanceClient:t}){return{queryKey:[e,"describe_all"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"describe_all"});return n},staleTime:6e4,gcTime:5e3,retry:!1}}function NOe({data:e,instanceId:t,clusterId:n,isModalOpen:r,closeModal:i,onSelectRole:o,onChangesSaved:a}){const{role:l,permission:d}=e,[f,m]=b.useState(JSON.stringify(d,null,2)),h=Zt(),[v,y]=b.useState(!0),{data:x}=Mt(LK(h)),{data:S}=Mt(nT(h)),k=ms().user?.role?.role===e.role,[E,j]=Dq(f?.includes("attribute_name")),{mutate:I,isPending:N}=IOe(),{mutate:T}=TOe(),A=b.useCallback(K=>{y(K.length===0)},[y]),D=b.useMemo(()=>JSON.stringify(x&&S&&COe({instanceDatabaseMap:x,currentRolePermissions:f&&Fh(f)||d,version:S.version,showAttributes:E}),null,2),[d,x,S,E,f]);b.useEffect(()=>{m(D)},[D]);const F=b.useCallback(K=>{if(K){const V=JSON.parse(K);if(V.super_user||V.structure_user||V.cluster_user)for(const H in V)(H!=="super_user"&&H!=="structure_user"&&H!=="cluster_user"||V[H]===!1)&&delete V[H];I({id:e.id,permission:V,...h},{onSuccess:()=>{we.success("Role updated successfully!"),o(void 0),a()}})}},[I,e.id,h,a,o]),q=b.useCallback(()=>{T({id:e.id,...h},{onSuccess:()=>{we.success("Role deleted successfully!"),o(void 0),a()}})},[e.id,T,h,a,o]),ee=b.useCallback(()=>{f&&v&&F(f)},[f,F,v]),G=b.useCallback(()=>{q()},[q]);return u.jsx(Un,{onOpenChange:i,open:r,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsxs(Pn,{children:[k?"View":"Edit",' Role "',l,'"']}),u.jsx(Ir,{children:k?"You can view your own role, but you cannot edit it. Please assign yourself a different role to edit this role.":"Edit the role's permissions in JSON format or remove the role entirely."}),D?u.jsx(Bh,{theme:"vs-dark",height:"400px",defaultLanguage:"json",value:f,options:k?{readOnly:!0}:void 0,onValidate:A,onChange:m,defaultValue:D}):u.jsx(Pr,{}),u.jsx(Yn,{children:!k&&u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:G,disabled:N,children:"Delete Role"}),u.jsx("div",{className:"grow"}),u.jsxs(ch,{className:"flex",children:[u.jsx(ze,{type:"checkbox",className:"w-6",checked:E,onChange:j}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:"Pick Attributes"})]}),u.jsx(be,{variant:"submit",className:"rounded-full",onClick:ee,disabled:N||!v,children:"Save Changes"})]})})]})})}function UM(){const e=jn(),{clusterId:t,instanceId:n,roleId:r}=rt({strict:!1}),i=Zt(),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(rT(i)),f=b.useMemo(()=>o?.find(j=>j.id===r),[o,r]),m=b.useCallback(j=>{const I=[r?"..":"",j].filter(Boolean);e({to:I.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=b.useState(!1),x=b.useCallback(()=>{y(!0)},[y]),S=b.useCallback(j=>{a(),y(!1),m(j)},[m,a]),C=b.useCallback(j=>{m(j.original.role)},[m]),k=b.useCallback(()=>{m(void 0)},[m]),E=Ul(a);return u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(Tf,{columns:yOe,data:o,isFetching:l,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:E,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:x,accessKey:"a",disabled:v,children:[u.jsx(Jr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(SOe,{isModalOpen:v,onChangesSaved:S,setIsModalOpen:y}),h&&u.jsx(NOe,{instanceId:n,clusterId:t,isModalOpen:h,closeModal:k,data:f,onSelectRole:m,onChangesSaved:()=>a()})]})}async function AOe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_ssh_keys"});return t}function OOe(e){return{queryKey:[e.entityId,"list_ssh_keys"],queryFn:()=>AOe(e)}}const $Oe=[{header:"SSH Key Name",accessorKey:"name",enableSorting:!1}];function _b({className:e,...t}){return u.jsx("textarea",{"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
        selection:text-primary-foreground
        dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
        dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
        aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
        flex w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
        file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
        focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple  disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
        aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...t})}async function DOe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"get_ssh_known_hosts"});return t}function POe(e){return{queryKey:[e.entityId,"get_ssh_known_hosts"],queryFn:()=>DOe(e)}}const MOe=$t({known_hosts:tt().trim()});async function zOe(e){const{instanceClient:t,entityType:n,...r}=e,{data:i}=await t.post("/",{operation:"set_ssh_known_hosts",replicated:n==="cluster",...r});return i}function LOe(){return ct({mutationFn:zOe})}function FOe(){const e=Zt(),{data:t}=Ji(POe(e)),n=cn({resolver:vn(MOe),defaultValues:{known_hosts:t?.known_hosts||""}}),{mutate:r,isPending:i}=LOe(),o=b.useCallback(async a=>{const{known_hosts:l}=a;l&&r({known_hosts:l.trim()+`
`,...e},{onSuccess:()=>{n.reset(a),we.success("Known hosts saved!")}})},[r,n,e]);return u.jsx(un,{...n,children:u.jsx("form",{onSubmit:n.handleSubmit(o),className:"grid my-4 md:grid-cols-2 overflow-x-auto rounded-md",children:u.jsx($e,{control:n.control,name:"known_hosts",render:({field:a})=>u.jsxs(Te,{className:"md:col-span-2 gap-0",children:[u.jsx(Ne,{className:"bg-black-dark py-3 px-2 m-0 text-left font-medium whitespace-nowrap",children:"Known Hosts"}),u.jsxs("div",{className:"border border-grey-700 p-2 pb-3",children:[u.jsx(ha,{children:`Manage your known hosts here. When you add a SSH Key with a hostname of "github.com", we'll automatically attempt to resolve GitHub's known hosts for you.`}),u.jsx(Oe,{children:u.jsx(_b,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:10,...a})}),u.jsx(Ae,{}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full mt-2",disabled:i||!n.formState.isDirty||!n.formState.isValid,children:[u.jsx(To,{})," ",i?"Saving":"Save"," Known Hosts",i?"...":""]})]})]})})})})}const UOe=$t({name:tt().trim().min(1).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),key:tt().min(1).trim(),host:tt().min(1).trim(),hostname:tt().min(1).trim(),known_hosts:tt().trim().optional()});async function VOe(e){const{instanceClient:t,entityType:n,entityId:r,...i}=e,{data:o}=await t.post("/",{operation:"add_ssh_key",replicated:n==="cluster",...i});return o}function BOe(){return ct({mutationFn:VOe})}function HOe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=cn({resolver:vn(UOe),defaultValues:{name:"",key:"",host:"",hostname:"",known_hosts:""}}),i=Zt(),{mutate:o,isPending:a}=BOe(),l=b.useCallback(async f=>{if(f){const{name:m,key:h,host:v,hostname:y,known_hosts:x}=f;o({name:m,key:h.trim()+`
`,host:v,hostname:y,known_hosts:x||void 0,...i},{onSuccess:()=>{r.reset(),t(),we.success("SSH Key added successfully!"),n(!1)}})}},[o,r,i,t,n]),d=b.useCallback(()=>{r.reset(),n(!1)},[r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(un,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(l),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(yr,{className:"md:col-span-2",children:[u.jsx(Pn,{children:"Add New SSH Key"}),u.jsx(Ir,{children:"Enter the details of your SSH Key below."})]}),u.jsx($e,{control:r.control,name:"name",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",autoFocus:!0,...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"key",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Key"}),u.jsx(ha,{children:`Your private key. Don't have one? Try out "ssh-keygen"! You'll want to add your public key to your registry, i.e. GitHub.`}),u.jsx(Oe,{children:u.jsx(_b,{autoComplete:"off",autoCapitalize:"off",rows:3,...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"host",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Host"}),u.jsx(ha,{children:'A unique identifying name for the combination of this key and your hostname, i.e. "your-repo.github.com". You will use this instead of the direct hostname to pick your key when importing applications.'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"hostname",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Hostname"}),u.jsx(ha,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:r.control,name:"known_hosts",render:({field:f})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Known Hosts"}),u.jsx(ha,{children:"Optionally, append known hosts, one per line. GitHub known hosts should resolve automatically."}),u.jsx(Oe,{children:u.jsx(_b,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:3,...f})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{className:"md:col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{variant:"destructiveOutline",type:"button",className:"rounded-full",onClick:d,disabled:a,children:"Cancel"}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:a||!r.formState.isDirty||!r.formState.isValid,children:[u.jsx(To,{})," Add SSH Key"]})]})})]})})})})}async function qOe(e){const{instanceClient:t,entityType:n,name:r}=e,{data:i}=await t.post("/",{operation:"delete_ssh_key",replicated:n==="cluster",name:r});return i}function KOe(){return ct({mutationFn:qOe})}async function GOe({name:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"get_ssh_key",name:e});return n}function ZOe(e){return{queryKey:[e.entityId,"get_ssh_key"],queryFn:()=>GOe(e),refetchInterval:1e4}}const YOe=$t({name:tt().trim(),key:tt().min(1).trim()});async function WOe(e){const{instanceClient:t,entityType:n,name:r,key:i}=e,{data:o}=await t.post("/",{operation:"update_ssh_key",replicated:n==="cluster",name:r,key:i});return o}function XOe(){return ct({mutationFn:WOe})}function JOe({data:e,isModalOpen:t,closeModal:n,onSelectSSHKey:r,onChangesSaved:i}){const{name:o}=e,a=cn({resolver:vn(YOe),defaultValues:{name:o,key:""}}),l=Zt(),{data:d}=Mt(ZOe({...l,name:o})),{mutate:f,isPending:m}=XOe(),{mutate:h}=KOe(),v=b.useCallback(async({key:x})=>{x&&f({name:o,key:x.trim()+`
`,...l},{onSuccess:()=>{we.success("SSH Key updated successfully!"),r(void 0),i()}})},[f,o,l,r,i]),y=b.useCallback(()=>{h({name:o,...l},{onSuccess:()=>{we.success("SSH Key deleted successfully!"),r(void 0),i()}})},[o,h,l,i,r]);return u.jsx(Un,{onOpenChange:n,open:t,children:u.jsx(Vn,{className:"sm:max-w-[750px]","aria-describedby":void 0,children:u.jsx(un,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(v),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsx(Pn,{children:"Edit SSH Key"}),u.jsx($e,{control:a.control,name:"name",render:({field:x})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Name"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",readOnly:!0,disabled:!0,...x})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a.control,name:"key",render:({field:x})=>u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Key"}),u.jsx(ha,{children:`Replace your existing private key. Lost it? Try out "ssh-keygen"! You'll want to add your public key to your registry, i.e. GitHub.`}),u.jsx(Oe,{children:u.jsx(_b,{autoComplete:"off",autoCapitalize:"off",autoFocus:!0,rows:3,...x})}),u.jsx(Ae,{})]})}),u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Host"}),u.jsx(ha,{children:'A unique identifying name for the combination of this key and your hostname, i.e. "your-repo.github.com". You will use this instead of the direct hostname to pick your key when importing applications.'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.host||"",disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]}),u.jsxs(Te,{className:"md:col-span-2",children:[u.jsx(Ne,{className:"pb-1",children:"Hostname"}),u.jsx(ha,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.hostname||"",disabled:!0,readOnly:!0})}),u.jsx(Ae,{})]}),u.jsxs(Yn,{children:[u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:y,disabled:m,children:"Delete SSH Key"}),u.jsx("div",{className:"grow"}),u.jsx(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:m||!a.formState.isValid,children:"Update SSH Key"})]})]})})})})}function VM(){const e=jn(),{keyName:t}=rt({strict:!1}),n=Zt(),{data:r,refetch:i,isFetching:o,isRefetching:a}=Mt(OOe(n)),l=b.useMemo(()=>r?.find(x=>x.name===t),[r,t]),d=b.useCallback(x=>{const S=x?.original?.name,C=[t?"..":"",S].filter(Boolean);e({to:C.join("/")})},[t,e]),f=!!t&&!!l,[m,h]=b.useState(!1),v=b.useCallback(()=>{h(!0)},[h]),y=Ul(i);return u.jsxs(u.Fragment,{children:[u.jsxs(Tf,{columns:$Oe,data:r||[],isFetching:o,onRowClick:d,children:[u.jsx(Ye,{className:"inline-block underline text-sm text-gray-400 hover:text-white",to:"https://docs.harperdb.io/docs/developers/security/certificate-management",target:"_blank",children:"Certificate Management Docs"}),u.jsxs(be,{variant:"defaultOutline",onClick:y,accessKey:"r",disabled:o||a,children:[u.jsx(xa,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:v,accessKey:"a",disabled:m,children:[u.jsx(Jr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),m&&u.jsx(HOe,{isModalOpen:m,onChangesSaved:i,setIsModalOpen:h}),f&&u.jsx(JOe,{isModalOpen:f,closeModal:d,data:l,onSelectSSHKey:d,onChangesSaved:i}),u.jsx(b.Suspense,{fallback:u.jsx(no,{text:"Loading..."}),children:u.jsx(FOe,{})})]})}const BM=R0(),QOe=[{header:"Username",accessorKey:"username",enableSorting:!1},BM.display({header:"Role",enableSorting:!1,id:"role",cell:e=>e.row.original.role.role}),{header:"Active",accessorKey:"active",enableSorting:!1},BM.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Tc((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),{header:"Updated",accessorKey:"__updatedtime__",enableSorting:!1,cell:e=>Tc((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}];function e$e({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Zt(),{data:i}=Ji(rT(r)),o=cn({resolver:vn(bd),defaultValues:{username:"",role:"",password:"",confirmPassword:""}}),{mutate:a,isPending:l}=JCe(),d=b.useCallback(async f=>{f&&a({active:!0,password:f.password,role:f.role,username:f.username,...r},{onSuccess:()=>{const m=f.role;o.reset(),o.setValue("role",m),t(),we.success("User added successfully!"),n(!1)}})},[a,o,r,t,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsx(Vn,{"aria-describedby":void 0,children:u.jsx(un,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Pn,{children:"Add New User"})}),u.jsx($e,{control:o.control,name:"username",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o.control,name:"password",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o.control,name:"confirmPassword",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:o.control,name:"role",render:({field:f})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Pr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...f,onValueChange:m=>f.onChange(m),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(ER,{children:"Role"}),i?.map(m=>u.jsx(Ot,{value:m.id,children:m.role},m.id))]})})]})})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:l,children:[u.jsx(To,{})," Add User"]})})})]})})})})}const t$e=$t({username:bd.shape.username,role:bd.shape.role,newPassword:bd.shape.password.or(Im()).optional(),confirmPassword:bd.shape.confirmPassword}).refine(e=>!e.newPassword||e.newPassword.length>=8,{error:"Password must be at least 8 characters long.",path:["password"]}).refine(e=>!e.newPassword||e.newPassword===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function n$e({data:e,onUserUpdated:t}){const n=Zt(),{data:r}=Ji(rT(n)),{mutate:i,isPending:o}=QCe(),a=cn({resolver:vn(t$e),defaultValues:{username:e.username,role:e.role.role,newPassword:"",confirmPassword:""}}),l=b.useCallback(d=>{const f={username:e.username,role:d.role,...n};d.newPassword&&(f.password=d.newPassword),i(f,{onSuccess:()=>{a.reset(),we.success("User edited successfully!"),t()}})},[a,i,e.username,n,t]);return u.jsx(un,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(l),className:"grid gap-4 my-4",children:[u.jsx(yr,{children:u.jsx(Pn,{children:"Edit User"})}),u.jsx($e,{control:a.control,name:"username",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",disabled:!0,readOnly:!0,...d})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a.control,name:"newPassword",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Change Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a.control,name:"confirmPassword",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Password"}),u.jsx(Oe,{children:u.jsx(ze,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:a.control,name:"role",render:({field:d})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Pr,{}),children:u.jsx(Oe,{children:u.jsxs(Gi,{...d,onValueChange:f=>d.onChange(f),children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Choose Role"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(ER,{children:"Role"}),r?.map(f=>u.jsx(Ot,{value:f.id,children:f.role},f.id))]})})]})})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"submit",className:"rounded-full",disabled:o,children:[u.jsx(To,{})," Save Changes"]})})})]})})}const r$e=$t({username:oR,confirmUsernameForDeletion:tt().nonempty({error:"Please type the username again to confirm deletion."}).toLowerCase()}).refine(e=>e.username===e.confirmUsernameForDeletion,{error:"Username does not match.",path:["confirmUsernameForDeletion"]});function i$e({data:e,onUserDeleted:t}){const{mutate:n,isPending:r}=eke(),i=cn({resolver:vn(r$e),defaultValues:{username:e.username,confirmUsernameForDeletion:""}}),o=ox(),a=b.useCallback(()=>{n({username:e.username,...o},{onSuccess:()=>{i.reset(),we.success("User deleted successfully!"),t()}})},[e.username,i,n,o,t]);return u.jsx(un,{...i,children:u.jsxs("form",{onSubmit:i.handleSubmit(a),className:"grid gap-4 my-4",children:[u.jsx($e,{control:i.control,name:"confirmUsernameForDeletion",render:({field:l})=>u.jsxs(Te,{children:[u.jsx(Ne,{className:"pb-1",children:"Confirm Username"}),u.jsx(Oe,{children:u.jsx(ze,{type:"text",enterKeyHint:"next",autoComplete:"username",...l})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"destructive",className:"rounded-full",disabled:r||!i.formState.isValid,children:[u.jsx(Ca,{})," Delete User"]})})})]})})}function o$e({closeModal:e,clusterId:t,instanceId:n,data:r,isModalOpen:i,onUserDeleted:o,onUserUpdated:a}){const f=!(ms().user?.username===r.username);return u.jsx(Un,{onOpenChange:e,open:i,children:u.jsxs(Vn,{className:"sm:max-w-[750px]",children:[u.jsx(n$e,{data:r,onUserUpdated:a}),f&&u.jsx(i$e,{data:r,onUserDeleted:o})]})})}function a$e({entityId:e,instanceClient:t}){return{queryKey:[e,"list_users"],queryFn:()=>s$e({instanceClient:t}),refetchInterval:1e4}}async function s$e({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_users"});return t}function HM(){const e=jn(),{instanceId:t,clusterId:n,username:r}=rt({strict:!1}),i=Zt(),{data:o,refetch:a,isFetching:l,isRefetching:d}=Ji(a$e(i)),f=b.useMemo(()=>o?.find(A=>A.username===r),[o,r]),m=b.useCallback(A=>{const D=[r?"..":"",A].filter(Boolean);e({to:D.join("/")})},[r,e]),h=!!r&&!!f,[v,y]=b.useState(!1),[x]=b.useState({attribute:"username",descending:!1}),S=b.useMemo(()=>[{desc:x.descending,id:x.attribute}],[x]),C=b.useCallback(()=>{y(!0)},[y]),k=b.useCallback(()=>{a(),y(!1)},[a,y]),E=b.useCallback(A=>{m(A.original.username)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),I=b.useCallback(()=>{a(),m(void 0)},[m,a]),N=b.useCallback(()=>{a(),m(void 0)},[m,a]),T=Ul(a);return u.jsxs(b.Suspense,{fallback:u.jsx(no,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(Tf,{data:o,isFetching:l||d,columns:QOe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:T,accessKey:"r",disabled:l||d,children:[u.jsx(xa,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Jr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(e$e,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(o$e,{instanceId:t,clusterId:n,closeModal:j,data:f,isModalOpen:h,onUserDeleted:N,onUserUpdated:I})]})}function vy({context:e,params:t}){const n=hU(t);return e.queryClient.ensureQueryData(nT(n))}function l$e(e){const t=nt({getParentRoute:()=>e,path:"config",component:aOe}),n=nt({getParentRoute:()=>t,path:"/",component:vOe,loader:vy}),r=nt({getParentRoute:()=>t,path:"roles",component:UM}),i=nt({getParentRoute:()=>t,path:"roles/$roleId",component:UM}),o=nt({getParentRoute:()=>t,path:"users",component:HM}),a=nt({getParentRoute:()=>t,path:"users/$username",component:HM}),l=nt({getParentRoute:()=>t,path:"ssh-keys",component:VM}),d=nt({getParentRoute:()=>t,path:"ssh-keys/$keyName",component:VM});return t.addChildren([n,r,i,o,a,l,d])}function Lk({clusterId:e,databaseName:t,instanceId:n,organizationId:r,tableName:i}){const o=["databases",t,i].filter(Jo).join("/");return ur({organizationId:r,instanceId:n,clusterId:e},o)}function c$e(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var iT="ScrollArea",[FK]=Qi(iT),[u$e,$o]=FK(iT),UK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[l,d]=b.useState(null),[f,m]=b.useState(null),[h,v]=b.useState(null),[y,x]=b.useState(null),[S,C]=b.useState(null),[k,E]=b.useState(0),[j,I]=b.useState(0),[N,T]=b.useState(!1),[A,D]=b.useState(!1),F=pt(t,ee=>d(ee)),q=eu(i);return u.jsx(u$e,{scope:n,type:r,dir:q,scrollHideDelay:o,scrollArea:l,viewport:f,onViewportChange:m,content:h,onContentChange:v,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:T,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:E,onCornerHeightChange:I,children:u.jsx(We.div,{dir:q,...a,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});UK.displayName=iT;var VK="ScrollAreaViewport",BK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=$o(VK,n),l=b.useRef(null),d=pt(t,l,a.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),u.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});BK.displayName=VK;var Ia="ScrollAreaScrollbar",HK=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ia,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,l=e.orientation==="horizontal";return b.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),i.type==="hover"?u.jsx(d$e,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx(f$e,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(qK,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(oT,{...r,ref:t}):null});HK.displayName=Ia;var d$e=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ia,e.__scopeScrollArea),[o,a]=b.useState(!1);return b.useEffect(()=>{const l=i.scrollArea;let d=0;if(l){const f=()=>{window.clearTimeout(d),a(!0)},m=()=>{d=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(or,{present:n||o,children:u.jsx(qK,{"data-state":o?"visible":"hidden",...r,ref:t})})}),f$e=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$o(Ia,e.__scopeScrollArea),o=e.orientation==="horizontal",a=W0(()=>d("SCROLL_END"),100),[l,d]=c$e("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,d]),b.useEffect(()=>{const f=i.viewport,m=o?"scrollLeft":"scrollTop";if(f){let h=f[m];const v=()=>{const y=f[m];h!==y&&(d("SCROLL"),a()),h=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[i.viewport,o,d,a]),u.jsx(or,{present:n||l!=="hidden",children:u.jsx(oT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),qK=b.forwardRef((e,t)=>{const n=$o(Ia,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=b.useState(!1),l=e.orientation==="horizontal",d=W0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?f:m)}},10);return rf(n.viewport,d),rf(n.content,d),u.jsx(or,{present:r||o,children:u.jsx(oT,{"data-state":o?"visible":"hidden",...i,ref:t})})}),oT=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=$o(Ia,e.__scopeScrollArea),o=b.useRef(null),a=b.useRef(0),[l,d]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=WK(l.viewport,l.content),m={...r,sizes:l,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:v=>a.current=v};function h(v,y){return y$e(v,a.current,l,y)}return n==="horizontal"?u.jsx(p$e,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,y=qM(v,l,i.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=h(v,i.dir))}}):n==="vertical"?u.jsx(m$e,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,y=qM(v,l);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=h(v))}}):null}),p$e=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=$o(Ia,e.__scopeScrollArea),[a,l]=b.useState(),d=b.useRef(null),f=pt(t,d,o.onScrollbarXChange);return b.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),u.jsx(GK,{"data-orientation":"horizontal",...i,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Y0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(o.viewport){const v=o.viewport.scrollLeft+m.deltaX;e.onWheelScroll(v),JK(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:kb(a.paddingLeft),paddingEnd:kb(a.paddingRight)}})}})}),m$e=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=$o(Ia,e.__scopeScrollArea),[a,l]=b.useState(),d=b.useRef(null),f=pt(t,d,o.onScrollbarYChange);return b.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),u.jsx(GK,{"data-orientation":"vertical",...i,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Y0(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(o.viewport){const v=o.viewport.scrollTop+m.deltaY;e.onWheelScroll(v),JK(v,h)&&m.preventDefault()}},onResize:()=>{d.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:kb(a.paddingTop),paddingEnd:kb(a.paddingBottom)}})}})}),[h$e,KK]=FK(Ia),GK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:h,...v}=e,y=$o(Ia,n),[x,S]=b.useState(null),C=pt(t,F=>S(F)),k=b.useRef(null),E=b.useRef(""),j=y.viewport,I=r.content-r.viewport,N=Tn(m),T=Tn(d),A=W0(h,10);function D(F){if(k.current){const q=F.clientX-k.current.left,ee=F.clientY-k.current.top;f({x:q,y:ee})}}return b.useEffect(()=>{const F=q=>{const ee=q.target;x?.contains(ee)&&N(q,I)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[j,x,I,N]),b.useEffect(T,[r,T]),rf(x,A),rf(y.content,A),u.jsx(h$e,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:Tn(o),onThumbPointerUp:Tn(a),onThumbPositionChange:T,onThumbPointerDown:Tn(l),children:u.jsx(We.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:Re(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),k.current=x.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),D(F))}),onPointerMove:Re(e.onPointerMove,D),onPointerUp:Re(e.onPointerUp,F=>{const q=F.target;q.hasPointerCapture(F.pointerId)&&q.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=E.current,y.viewport&&(y.viewport.style.scrollBehavior=""),k.current=null})})})}),Cb="ScrollAreaThumb",ZK=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=KK(Cb,e.__scopeScrollArea);return u.jsx(or,{present:n||i.hasThumb,children:u.jsx(g$e,{ref:t,...r})})}),g$e=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=$o(Cb,n),a=KK(Cb,n),{onThumbPositionChange:l}=a,d=pt(t,h=>a.onThumbChange(h)),f=b.useRef(void 0),m=W0(()=>{f.current&&(f.current(),f.current=void 0)},100);return b.useEffect(()=>{const h=o.viewport;if(h){const v=()=>{if(m(),!f.current){const y=b$e(h,l);f.current=y,l()}};return l(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[o.viewport,m,l]),u.jsx(We.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,h=>{const y=h.target.getBoundingClientRect(),x=h.clientX-y.left,S=h.clientY-y.top;a.onThumbPointerDown({x,y:S})}),onPointerUp:Re(e.onPointerUp,a.onThumbPointerUp)})});ZK.displayName=Cb;var aT="ScrollAreaCorner",YK=b.forwardRef((e,t)=>{const n=$o(aT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(v$e,{...e,ref:t}):null});YK.displayName=aT;var v$e=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=$o(aT,n),[o,a]=b.useState(0),[l,d]=b.useState(0),f=!!(o&&l);return rf(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),d(m)}),rf(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),a(m)}),f?u.jsx(We.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function kb(e){return e?parseInt(e,10):0}function WK(e,t){const n=e/t;return isNaN(n)?0:n}function Y0(e){const t=WK(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function y$e(e,t,n,r="ltr"){const i=Y0(n),o=i/2,a=t||o,l=i-a,d=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return XK([d,f],h)(e)}function qM(e,t,n="ltr"){const r=Y0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,l=o-r,d=n==="ltr"?[0,a]:[a*-1,0],f=ak(e,d);return XK([0,a],[0,l])(f)}function XK(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function JK(e,t){return e>0&&e<t}var b$e=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,l=n.top!==o.top;(a||l)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function W0(e,t){const n=Tn(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function rf(e,t){const n=Tn(t);rr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var x$e=UK,w$e=BK,S$e=YK;function _$e({className:e,children:t,...n}){return u.jsxs(x$e,{"data-slot":"scroll-area",className:Ue("relative",e),...n,children:[u.jsx(w$e,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),u.jsx(C$e,{}),u.jsx(S$e,{})]})}function C$e({className:e,orientation:t="vertical",...n}){return u.jsx(HK,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ue("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:u.jsx(ZK,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}async function k$e({databaseName:e,tableName:t,primaryKey:n,replicated:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"create_table",database:e,table:t,primary_key:n,replicated:r});return o}function E$e(){return ct({mutationFn:k$e})}const Xv=$t({databaseName:MK,tableName:zK,primaryKey:tt().regex(Z0,{error:"Primary key cannot include backticks or forward slashes."}).max(250,{error:"Primary key cannot be longer than 250 characters."})});function j$e({databaseName:e,onSelectTable:t}){const n=ir(),r=Zt(),i=_n(),[o,a]=b.useState(!1),l=cn({resolver:vn(Xv),defaultValues:{databaseName:e||"",tableName:"",primaryKey:""}}),{mutate:d}=E$e(),f=async m=>{const h=m.databaseName||"data",v=m.tableName;d({databaseName:h,tableName:v,primaryKey:m.primaryKey||"id",...r,replicated:r.entityType==="cluster"},{onSuccess:async()=>{await n.invalidateQueries({queryKey:[r.entityId,"describe_all"],refetchType:"all"}),we.success(`Table ${v} created successfully`),a(!1),l.reset(),t(h,v),await i.invalidate()}})};return u.jsxs(Un,{open:o,onOpenChange:a,children:[u.jsx(N8,{asChild:!0,children:u.jsx("div",{className:"sticky bottom-0 py-4 bg-black/70 backdrop-blur-xs",children:u.jsxs(be,{variant:"positiveOutline",className:"w-full rounded-full",size:"lg",accessKey:"t",children:[u.jsx(Jr,{}),u.jsxs("span",{children:["Create a ",u.jsx("u",{children:"T"}),"able"]})]})})}),u.jsxs(Vn,{className:"sm:max-w-[425px]",children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"Create a New Table"}),u.jsx(Ir,{children:"What would you like to create?"})]}),u.jsx(un,{...l,children:u.jsxs("form",{onSubmit:l.handleSubmit(f),className:"grid gap-6 text-white",children:[u.jsx($e,{control:l.control,name:"tableName",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Table Name"}),u.jsx(Oe,{children:u.jsx(ze,{...m,type:"text",maxLength:Xv.shape.tableName.maxLength,autoFocus:!0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:l.control,name:"primaryKey",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Primary Key"}),u.jsx(Oe,{children:u.jsx(ze,{...m,placeholder:"id",type:"text",maxLength:Xv.shape.primaryKey.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:l.control,name:"databaseName",render:({field:m})=>u.jsxs(Te,{className:"",children:[u.jsx(Ne,{className:"pb-1",children:"Database Name"}),u.jsx(Oe,{children:u.jsx(ze,{...m,type:"text",placeholder:"data",maxLength:Xv.shape.databaseName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Ae,{})]})}),u.jsx(Yn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",children:[u.jsx(yne,{}),"Create New Table"]})})]})})]})]})}function I$e({instanceDatabaseMap:e}){const t=_n(),n=!e,r=rt({strict:!1}),i=jn(),o=yf(),{databaseNames:a,tableNames:l}=b.useMemo(()=>{const m=Object.keys(e||{}).sort(),h=r.databaseName?Object.keys(e?.[r.databaseName]||[]).sort():[];return{databaseNames:m,tableNames:h}},[e,r.databaseName]),d=b.useCallback(m=>{const h=m?Object.keys(e?.[m]||[]).sort():[];r.databaseName?i({to:Lk({...r,databaseName:m,tableName:h[0]})}):t.invalidate()},[e,r,t,i]),f=b.useCallback((m,h)=>{i({to:Lk({...r,databaseName:m,tableName:h})})},[i,r]);return u.jsxs("div",{className:"pl-3",children:[u.jsx("h1",{className:"pt-3 pb-3 text-3xl",children:"Databases"}),n?u.jsx(Pr,{className:"w-full h-9 m-0 rounded-md bg-gray-700"}):u.jsx("div",{className:"flex space-x-2",children:u.jsxs(Gi,{name:"databaseSelect",value:r.databaseName||"",disabled:a.length===0,onValueChange:d,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select a Database"})}),u.jsx(Wi,{children:u.jsx(Wo,{children:a.map(m=>u.jsx(Ot,{value:m,children:m},m))})})]})}),n?u.jsx(Pr,{className:"w-full min-h-80 rounded-md bg-gray-700 mb-0"}):u.jsxs(_$e,{className:"border rounded-md min-h-80 border-grey-700 mt-4",children:[l.length===0&&r.databaseName?.length?u.jsxs("div",{className:"w-full h-full text-center",children:[u.jsx("p",{className:"py-6",children:"No tables found in this database."}),o&&u.jsx("p",{children:'Tap "Create a Table" below!'})]}):l.length===0&&!r.databaseName?.length?u.jsxs("p",{className:"pt-2 text-sm text-center",children:["Please ",a.length===0?"create":"select"," a table."]}):"",u.jsx("ul",{children:l.map(m=>u.jsx("li",{className:"flex items-center p-2 border-b hover:bg-grey-700/80 border-grey-700",children:u.jsxs(be,{onClick:()=>f(r.databaseName,m),size:"lg",className:"items-center justify-between w-full bg-transparent border-none shadow-none hover:bg-transparent",children:[m,u.jsx("span",{children:r.tableName===m&&u.jsx(bi,{})})]})},m))})]}),o&&u.jsx(j$e,{databaseName:r.databaseName,onSelectTable:f})]})}function R$e(e){if(!e)return{dataTableColumns:[],hashAttribute:""};const{hash_attribute:t,attributes:n}=e,r=[],i=[],o=[],a=[];for(let l=n.length-1;l>=0;l--){const{attribute:d,type:f,is_primary_key:m,indexed:h}=n[l],v={header:d,accessorKey:d,enableSorting:!!(m||h),enableColumnFilter:!!(m||h),size:T$e(f)};m?r.push(v):d==="__createdtime__"||d==="__updatedtime__"?a.push(v):v.enableSorting?i.push(v):o.push(v)}return{dataTableColumns:[...r,...i,...o,...a],hashAttribute:t}}function T$e(e){switch(e){case"Id":case"ID":return 1;case"Boolean":return 1;case"Int":case"Long":case"Float":case"BigInt":return 1;default:return Math.round(window.innerWidth*.1)}}async function N$e({databaseName:e,tableName:t,records:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"insert",database:e,table:t,records:n});return i}function A$e(){return ct({mutationFn:N$e})}function O$e({isModalOpen:e,instanceTable:t,setIsModalOpen:n,refreshTable:r}){const{mutate:i,isPending:o}=A$e(),a=Zt(),[l,d]=b.useState(!0),[f,m]=b.useState(),[h,v]=b.useState(!1),[y,x]=b.useState([]),S=b.useMemo(()=>{const E={};for(const j of t.attributes)j.is_primary_key||j.attribute==="__createdtime__"||j.attribute==="__updatedtime__"||(E[j.attribute]=$$e(j.type));return JSON.stringify(E,null,4)},[t]),C=b.useCallback(E=>{v(!0),d(E.length===0)},[d]),k=b.useCallback(()=>{if(f&&l){const E=JSON.parse(f),j=Array.isArray(E)?E:[E],I=we.loading(`Adding ${j.length} records...`);i({...a,databaseName:t.schema,tableName:t.name,records:j},{onSuccess:N=>{r(),N.skipped_hashes?.length||n(!1),x(N.skipped_hashes),(N.skipped_hashes?.length>0?we.warning:we.success)(N.skipped_hashes?.length>0?"Warning!":"Success!",{id:I,description:u.jsxs(u.Fragment,{children:[N.inserted_hashes.length>0&&u.jsxs("p",{children:["Added ",Yr(N.inserted_hashes.length,"record","records")]}),N.skipped_hashes.length>0&&u.jsxs("p",{children:["Skipped ",Yr(N.skipped_hashes.length,"record","records")]})]})})}})}},[f,i,a,t.name,t.schema,l,r,n]);return u.jsx(Un,{onOpenChange:n,open:e,children:u.jsxs(Vn,{"aria-describedby":void 0,onEscapeKeyDown:E=>{h&&E.preventDefault()},children:[u.jsx(yr,{children:u.jsxs(Pn,{children:["Add New ",t.name]})}),t?.hash_attribute&&u.jsxs("div",{className:"text-sm text-gray-500",children:["The primary key for this table is"," ",u.jsxs("strong",{children:["“",t.hash_attribute,"”"]}),", and will auto-generate. You may manually add it if you want to specify its value."]}),u.jsx(M0,{className:"w-full h-96",language:"json",theme:"vs-dark",value:S,onValidate:C,onChange:m,options:{minimap:{enabled:!1}}}),u.jsxs("div",{className:"text-sm text-gray-500",children:[u.jsx("strong",{children:"Provide an [array]"})," if you want to add more than one record at a time."]}),y.length>0&&u.jsxs(JR,{className:"mt-2",children:[u.jsx(dE,{className:"w-4 h-4"}),u.jsxs(tAe,{children:["Skipped ",y.length===1?"Hash":"Hashes"," Detected"]}),u.jsx(QR,{className:"max-h-36 overflow-auto",children:u.jsx("ol",{children:y.map(E=>u.jsx("li",{children:E},E))})})]}),u.jsx(Yn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"submit",className:"rounded-full",onClick:k,accessKey:"s",disabled:!f||!l||o,children:[u.jsx(To,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})})})]})})}function $$e(e){switch(e){case"Date":return new Date().toISOString();case"Id":case"ID":case"String":return"";case"Boolean":return!1;case"Int":case"Long":case"Float":case"BigInt":return 0;default:return null}}async function D$e({databaseName:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"drop_database",database:e,replicated:t});return r}function P$e(){return ct({mutationFn:D$e})}function M$e({databaseName:e,onDeleted:t}){const{value:n,trigger:r}=Vl("ShowDeleteDatabase",!1),i=b.useCallback(()=>{ni("ShowDeleteDatabase",!1),Hl(r)},[r]),o=yf(),a=ir(),l=Zt(),d=_n(),{mutate:f,isPending:m}=P$e(),h=b.useCallback(()=>{f({databaseName:e,...l,replicated:l.entityType==="cluster"},{onSuccess:async()=>{i(),await a.invalidateQueries({queryKey:[l.entityId,"describe_all"],refetchType:"all"}),await d.invalidate(),we.success(`Database ${e} dropped successfully`),t("database")}})},[i,e,f,l,t,a,d]);return!o||!e?u.jsx(u.Fragment,{}):u.jsx(w0,{typeOfThingBeingDeleted:"database",nameOfThingBeingDeleted:e,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:n,setIsModalOpen:i,deletionConfirmed:h,deletionPending:m})}async function z$e({databaseName:e,tableName:t,replicated:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"drop_table",database:e,table:t,replicated:n});return i}function L$e(){return ct({mutationFn:z$e})}function F$e({databaseName:e,tableName:t,onDeleted:n}){const{value:r,trigger:i}=Vl("ShowDeleteTable",!1),o=b.useCallback(()=>{ni("ShowDeleteTable",!1),Hl(i)},[i]),a=yf(),l=ir(),d=Zt(),f=_n(),{mutate:m,isPending:h}=L$e(),v=b.useCallback(()=>{m({databaseName:e,tableName:t,...d,replicated:d.entityType==="cluster"},{onSuccess:async()=>{o(),await l.invalidateQueries({queryKey:[d.entityId,"describe_all"],refetchType:"all"}),await f.invalidate(),we.success(`Table ${t} dropped successfully`),n("table")}})},[o,e,m,d,n,l,f,t]);return!a||!e?u.jsx(u.Fragment,{}):u.jsx(w0,{typeOfThingBeingDeleted:"table",nameOfThingBeingDeleted:`${e} > ${t}`,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:r,setIsModalOpen:o,deletionConfirmed:v,deletionPending:h})}function U$e({canEditRecords:e,canDeleteRecords:t,setIsModalOpen:n,isModalOpen:r,hashAttribute:i,data:o,onSaveChanges:a,onDeleteRecord:l,isUpdateTableRecordsPending:d,isDeleteTableRecordsPending:f}){const[m,h]=b.useState(!0),[v,y]=b.useState(!1),[x,S]=b.useState(),C=b.useMemo(()=>{const E=o?.map(({__createdtime__:j,__updatedtime__:I,...N})=>N);return JSON.stringify(E,null,4)},[o]),k=b.useCallback(E=>{y(!0),h(E.length===0)},[h]);return u.jsx(Un,{onOpenChange:n,open:r,children:u.jsxs(Vn,{"aria-describedby":void 0,onEscapeKeyDown:e?E=>{v&&E.preventDefault()}:void 0,children:[u.jsx(yr,{children:u.jsxs(Pn,{children:[e?"Edit":"View"," Row"]})}),o?u.jsx(M0,{className:"w-full h-96",language:"json",theme:"vs-dark",options:e?void 0:{readOnly:!0},value:C,onValidate:k,onChange:E=>{S(E)}}):u.jsx(no,{}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[t&&u.jsxs(be,{variant:"destructive",className:"rounded-full",onClick:()=>{const E=o[0]?.[i];E&&l([E])},disabled:f,children:[u.jsx(Ca,{})," Delete Row"]}),e&&u.jsxs(be,{variant:"submit",className:"rounded-full",accessKey:"s",onClick:()=>{x&&m&&a(JSON.parse(x))},disabled:!x||!m||d,children:[u.jsx(To,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})]})})]})})}async function V$e(e){const{database:t,table:n,fileData:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"csv_data_load",database:t,action:"insert",table:n,data:r});return o}function B$e(){return ct({mutationFn:V$e})}const H$e=$t({fileData:tt(),database:tt(),table:tt()});function q$e({setIsModalOpen:e,isModalOpen:t,onSaveChanges:n,database:r,table:i}){const[o,a]=b.useState(null),l=Zt(),{mutate:d,isPending:f}=B$e(),m=y=>{if(!y.target.files)return;const x=y.target.files[0];if(x){const S=new FileReader;S.onload=C=>{const k=C.target?.result;typeof k=="string"&&(a(x),h.setValue("fileData",k))},S.readAsText(x)}},h=cn({resolver:vn(H$e),defaultValues:{database:r,table:i,fileData:""}}),v=y=>{d({fileData:y.fileData,database:r,table:i,...l},{onSuccess:({message:x})=>{h.reset(),a(null),n(x)}})};return u.jsx(Un,{onOpenChange:()=>{e(!1),h.reset()},open:t,children:u.jsxs(Vn,{children:[u.jsxs(yr,{children:[u.jsx(Pn,{children:"Import CSV"}),u.jsx(Ir,{children:"Upload a CSV file to import data into the table."})]}),u.jsx(un,{...h,children:u.jsxs("form",{onSubmit:h.handleSubmit(v),children:[u.jsx("div",{className:"w-full",children:u.jsx($e,{control:h.control,name:"fileData",render:({field:y})=>u.jsxs(Te,{className:"relative",children:[u.jsx(Ne,{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-grey border-dashed rounded-lg cursor-pointer bg-grey-700 hover:bg-grey-700/80",children:u.jsx(Oe,{children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[u.jsx(N4,{className:"text-white",size:48}),u.jsx("p",{className:"mb-2 text-sm text-white",children:o?o.name:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop a CSV File"]})})]}),u.jsx(ze,{id:"dropzone-file",type:"file",className:"opacity-0 w-full h-full absolute left-0 top-0 cursor-pointer",accept:".csv",name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:y.disabled,onChange:m})]})})}),u.jsx(Ae,{})]})})}),u.jsx(Yn,{className:"mt-4",children:u.jsxs(be,{variant:"submit",className:"rounded-full",accessKey:"u",disabled:!o||f,children:[u.jsx(To,{}),u.jsxs("span",{children:[u.jsx("u",{children:"U"}),"pload CSV"]})]})})]})})]})})}async function K$e({databaseName:e,tableName:t,hashValues:n,instanceClient:r}){const{data:i}=await r.post("/",{operation:"delete",database:e,table:t,hash_values:n});return i}function G$e(){return ct({mutationFn:K$e})}function Z$e({databaseName:e,tableName:t,entityId:n,instanceClient:r}){return{queryKey:[n,e,t,"describe_table"],queryFn:async()=>{const{data:i}=await r.post("/",{operation:"describe_table",database:e,table:t});return i},staleTime:6e4,gcTime:5e3,enabled:!!e&&!!t,retry:!1}}const Y$e=["1","bet","k","ok","si","tru","true","yes","yup"];function W$e(e){const t=e.toLowerCase().trim();return Y$e.includes(t)}function KM(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function X$e(e){if(e.startsWith("0.")&&KM(e))return!0;const t=e.toUpperCase().includes("E");return!(e!=="0"&&e.startsWith("0"))&&!t&&KM(e)}const GM={true:!0,TRUE:!0,false:!1,FALSE:!1,undefined:null,null:null,NULL:null,NaN:NaN},J$e=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/;function Q$e(e){return e==null||e===""||typeof e!="string"?e:GM[e]!==void 0?GM[e]:X$e(e)?Number(e):J$e.test(e)?new Date(e):e}function eDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,conditions:o,sort:a,pageIndex:l,pageSize:d,onlyIfCached:f}=e;return{enabled:t&&!!o,queryKey:[n,r,i,"search_by_conditions",o,a.attribute||"default",a.descending||!1,l||0,d||0,f],staleTime:6e4,gcTime:5e3,retry:!1,queryFn:()=>QK(e)}}function QK({instanceClient:e,databaseName:t,tableName:n,conditions:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:l,headers:d}){return e.post("/",{operation:"search_by_conditions",get_attributes:["*"],database:t,table:n,conditions:r,sort:i.attribute.length?i:void 0,offset:o*a,limit:a,onlyIfCached:l,noCacheStore:l},{timeout:0,headers:d})}function tDe(e,t,n){return t.split(/ & /).map(i=>nDe(e,i,n))}function nDe(e,t,n){t.startsWith(e)&&(t=t.substring(e.length));const{comparator:r,value:i}=iDe(t);switch(n?.type){case"ID":case"String":return{search_attribute:e,search_type:r,search_value:i};case"Int":case"BigInt":case"Long":case"Float":{const o=n.type.includes("Int")?parseInt(i,10):parseFloat(i);if(isNaN(o))throw new Error(`${i} does not appear to be a valid number.`);return{search_attribute:e,search_type:r,search_value:o}}case"Date":{const o=new Date(i).toISOString();return{search_attribute:e,search_type:r,search_value:o}}case"Boolean":return{search_attribute:e,search_type:r,search_value:W$e(i)};case"Blob":case"Bytes":return{search_attribute:e,search_type:r,search_value:i};default:return{search_attribute:e,search_type:r,search_value:Q$e(i)}}}const ZM={"=== ":"equals","== ":"eq","equals ":"equals","equal ":"equals","eq ":"eq","!== ":"not_equal","!= ":"ne","notequals ":"not_equal","notequal ":"not_equal","ne ":"ne"},rDe={">":"greater_than",g:"greater_than",gt:"greater_than","=gt":"greater_than",greater:"greater_than",greaterthan:"greater_than",">=":"greater_than_equal",ge:"greater_than_equal","=ge":"greater_than_equal",gte:"greater_than_equal",greaterorequal:"greater_than_equal",greaterthanequal:"greater_than_equal",greaterthanorequal:"greater_than_equal","<":"less_than",l:"less_than",lt:"less_than","=lt":"less_than",less:"less_than",lessthan:"less_than","<=":"less_than_equal",lte:"less_than_equal",le:"less_than_equal","=le":"less_than_equal",lessorequal:"less_than_equal",lessthanequal:"less_than_equal",lessthanorequal:"less_than_equal"};function iDe(e){const t=e.toLowerCase(),n=t.match(/^([>=<a-z_ ]+)([\d._TZ-]+)$/);if(n){const r=n[1].replace(/[_ ]+/g,"").replace(/^([a-z]+)=$/g,"$1"),i=n[2],o=rDe[r];if(o)return{comparator:o,value:i}}for(const r in ZM)if(t.startsWith(r))return{comparator:ZM[r],value:e.slice(r.length)};return t.endsWith("*")?{comparator:"starts_with",value:e.slice(0,-1)}:{comparator:"equals",value:e}}function oDe({enabled:e,entityId:t,instanceClient:n,databaseName:r,tableName:i,ids:o}){return{queryKey:[t,"search_by_id",r,i,o],queryFn:()=>n.post("/",{get_attributes:["*"],ids:o,noCacheStore:!0,onlyIfCached:!0,operation:"search_by_id",database:r,table:i}),enabled:e&&!!o?.length,retry:!1}}function aDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,searchAttribute:o,sort:a,pageIndex:l,pageSize:d,onlyIfCached:f}=e;return{enabled:t,queryKey:[n,r,i,"search_by_value",o,a.attribute||"default",a.descending||!1,l||0,d||0,f],retry:!1,staleTime:6e4,gcTime:5e3,queryFn:()=>eG(e)}}function eG({instanceClient:e,databaseName:t,tableName:n,searchAttribute:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:l,headers:d}){const f=i.attribute.length&&!(i.attribute===r&&!i.descending);return e.post("/",{operation:"search_by_value",get_attributes:["*"],database:t,table:n,search_attribute:r,search_value:"*",sort:f?i:void 0,offset:o*a,limit:a,onlyIfCached:l,noCacheStore:l},{timeout:0,headers:d})}async function sDe(e){const{databaseName:t,tableName:n,records:r,instanceClient:i}=e,{data:o}=await i.post("/",{operation:"update",database:t,table:n,records:r});return o}function lDe(){return ct({mutationFn:sDe})}const cDe=d0(tt(),tt());function uDe({applyFilters:e,columnFiltersForm:t,headerGroups:n}){const r=b.useCallback(i=>{if(i.key==="Enter")return i.preventDefault(),e(),!1},[e]);return u.jsx(Uh,{children:u.jsx(un,{...t,children:n.map(i=>u.jsx(Hi,{className:"border-none",children:i.headers.map(o=>u.jsx(fs,{style:{width:`${o.column.getSize()}px`},children:o.column.columnDef.enableColumnFilter&&u.jsx($e,{control:t.control,name:o.id,render:({field:a})=>u.jsxs(Te,{className:"border-r-1 border-r-black",children:[u.jsx(Oe,{children:u.jsx(ze,{...a,type:"text",autoCapitalize:"none",autoComplete:"off",className:"rounded-none",onKeyDown:r,value:a.value??""})}),u.jsx(Ae,{})]})})},o.id))},i.id))})})}function dDe({columns:e,columnVisibility:t,setColumnVisibility:n}){const r=b.useMemo(()=>e.map(i=>i.header).filter(Jo),[e]);return u.jsxs(Mh,{children:[u.jsx(zh,{asChild:!0,children:u.jsxs(be,{variant:"ghost",children:[u.jsx(cte,{className:"inline-block "}),"Columns"]})}),u.jsx(Lh,{children:r.map(i=>u.jsx(fDe,{columnHeader:i,columnVisibility:t,setColumnVisibility:n},i))})]})}function fDe({columnHeader:e,columnVisibility:t,setColumnVisibility:n}){const{toggled:r,toggle:i}=Fm(t[e]??!0);return b.useEffect(()=>{t[e]!==r&&n({...t,[e]:r})},[e,t,r,n]),u.jsx(J0e,{checked:r,onClick:i,children:e},e)}function pDe({className:e}){return u.jsx(M4,{className:ki("animate-spin",e)})}function mDe({applyFilters:e,columns:t,columnVisibility:n,columnFiltersForm:r,data:i,isFetching:o,onColumnClick:a,onRowClick:l,pageIndex:d,pageSize:f,setPageIndex:m,setPageSize:h,filtersToggled:v,totalPages:y,totalRecords:x}){const S=A0({data:i||[],columns:t,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onEnd",pageCount:y,defaultColumn:{minSize:1},state:{columnVisibility:n},rowCount:x,getCoreRowModel:N0(),getPaginationRowModel:W_e()}),C=b.useCallback(()=>{m(d-1)},[d,m]),k=b.useCallback(()=>{m(d+1)},[d,m]);return u.jsxs(u.Fragment,{children:[u.jsxs(O0,{containerClassName:"rounded-md bg-black-dark grow max-h-[calc(100vh-128px-16px-112px-80px)]",children:[u.jsx(Uh,{children:S.getHeaderGroups().map(E=>u.jsx(Hi,{className:"border-none",children:E.headers.map(j=>u.jsx(_q,{header:j,onColumnClick:a},j.id))},E.id))}),v&&u.jsx(uDe,{applyFilters:e,columnFiltersForm:r,headerGroups:S.getHeaderGroups()}),u.jsx($0,{className:"bg-black border border-grey-700",children:S.getRowModel().rows?.length?S.getRowModel().rows.map(E=>u.jsx(Hi,{"data-state":E.getIsSelected()&&"selected",onClick:()=>l?.(E),className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted",l&&"cursor-pointer"),children:E.getVisibleCells().map(j=>u.jsx(fs,{style:{width:`${j.column.getSize()}px`},className:"px-2 py-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:j.getValue()=="[object Object]"?JSON.stringify(j.getValue()):Hc(j.column.columnDef.cell,j.getContext())},j.id))},E.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:t.length,className:"h-24 text-center",children:o||i===void 0?u.jsx(pDe,{className:"opacity-50 inline-block"}):u.jsx("span",{children:"No results."})})})})]}),u.jsxs("div",{className:"flex items-center justify-end py-4 space-x-2 pr-4",children:[u.jsxs(be,{variant:"defaultOutline",size:"sm",onClick:C,className:"select-none",disabled:d===0,children:[u.jsx(Pc,{}),"Previous"]}),u.jsx("div",{className:"grow"}),u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Records"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:x===void 0?u.jsx(Pr,{}):hy(x)})]}),x!==void 0&&x>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:u.jsxs(Gi,{defaultValue:f.toString(),onValueChange:E=>{h(Number(E))},children:[u.jsx(Yi,{className:"h-10 w-20",children:u.jsx(Zi,{})}),u.jsx(Wi,{side:"top",children:[20,50,100,250].map(E=>u.jsx(Ot,{value:`${E}`,children:E},E))})]})}),y!==void 0&&y>1&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Pages"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:hy(y)})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("dt",{className:"font-medium text-gray-500 text-sm/6 dark:text-gray-400",children:"Page"}),u.jsx("dd",{className:"font-semibold tracking-tight",children:hy(d+1)})]})]})]}),u.jsx("div",{className:"grow"}),u.jsxs(be,{variant:"defaultOutline",size:"sm",onClick:k,className:"select-none",disabled:y===void 0||d===y-1,children:["Next",u.jsx(bi,{})]})]})]})}function hDe({instanceDatabaseMap:e,databaseName:t,tableName:n}){const r=rt({strict:!1}),i=jn(),o=Zt(),{clusterId:a,instanceId:l}=r,{toggled:d,toggle:f}=Fm(!0),m=K_(l??a,t,n,"insert"),h=K_(l??a,t,n,"update"),v=K_(l??a,t,n,"delete"),y=yf(),{data:x}=Mt(Z$e({...o,databaseName:t,tableName:n})),S=b.useMemo(()=>If(x?.attributes??[],"attribute"),[x]),[C,k]=tm(null,r),[E,j]=b.useState(!1),I=b.useMemo(()=>(t?Object.keys(e?.[t]||[]).sort():[]).length===1,[e,t]),{toggled:N,toggleOn:T,toggleOff:A}=Fm(!1),D=cn({resolver:vn(cDe)}),{reset:F}=D,q=D.watch(),[ee,G]=tm(null,[r.clusterId,r.instanceId,t,n]),K=b.useCallback(()=>{const Bt=[];for(const Xe in q)if(q[Xe]?.length)try{Bt.push(...tDe(Xe,q[Xe],S[Xe]))}catch(nn){we.error(String(nn))}G(Bt.length?Bt:null),F({...q})},[S,F,q]),V=b.useCallback(()=>{F({},{keepValues:!1,keepDirtyValues:!1,keepDefaultValues:!1}),F(),G(null),A()},[A,F]);b.useEffect(function(){return V()},[r,V]);const{dataTableColumns:H,hashAttribute:z}=R$e(x),[W,L]=b.useState(!1),[ne,$]=b.useState(!1),[P,U]=tm({attribute:z,descending:!1},r),[O,X]=tm(0,[t,n]),[pe,ve]=b.useState(20),Q=x?.record_count,le=x?.record_count?Math.ceil(x.record_count/pe):0,Se=N&&!!ee,ke={...o,enabled:!Se&&!!z,databaseName:t,tableName:n,searchAttribute:z,sort:P,pageSize:pe,pageIndex:O,onlyIfCached:d},Pe=aDe(ke),{data:Fe,isFetching:ut}=Mt(Pe),Ze={...o,enabled:Se&&!!z,databaseName:t,tableName:n,conditions:ee,sort:P,pageSize:pe,pageIndex:O,onlyIfCached:d},Pt=eDe(Ze),{data:dn,isFetching:tn}=Mt(Pt),br=Se?dn:Fe,Yt=ut||tn,{data:An}=Mt(oDe({...o,enabled:E,databaseName:t,tableName:n,ids:C})),{mutate:Y,isPending:re}=lDe(),{mutate:se,isPending:ie}=G$e(),me=ir(),B=b.useCallback(()=>me.invalidateQueries({queryKey:[o.entityId,t,n]}),[me,o.entityId,t,n]),[ce,Ee]=b.useState(!1),Me=b.useCallback(async()=>{if(!z)return;const Bt=we.loading("Loading CSV...");Ee(!0);const Xe={pageIndex:0,pageSize:1e6,headers:{Accept:"text/csv"}},nn=await(Se?QK({...Ze,...Xe}):eG({...ke,...Xe}));we.loading("Preparing CSV...",{id:Bt});const Wn=nn.data,fr=new Blob([Wn],{type:"text/csv"}),ea=URL.createObjectURL(fr),pn=document.createElement("a");pn.href=ea,pn.setAttribute("download",`${t}.${n}.${new Date().toISOString()}.csv`),pn.click(),we.success("CSV Exported!",{id:Bt}),Ee(!1)},[t,n,Pe,Pt]),Ke=b.useCallback(Bt=>{Y({...o,databaseName:t,tableName:n,records:Bt},{onSuccess:()=>{B(),j(!1),we.success("Record updated successfully")}})},[Y,o,t,n,B]),Wt=b.useCallback(Bt=>{se({...o,databaseName:t,tableName:n,hashValues:Bt},{onSuccess:()=>{B(),j(!1),we.success("Record deleted successfully")}})},[se,o,t,n,B]),Vt=b.useCallback(Bt=>{B(),$(!1),we.success(`${Bt}. Please wait a few moments then refresh the table.`)},[B]),Cn=Bt=>{k([Bt.original[z]]),j(!E)},zt=(Bt,Xe)=>{U({attribute:Bt,descending:!Xe})},fn=Ul(B),kt=b.useCallback(()=>{L(!0)},[L]),ar=b.useCallback(()=>{$(!0)},[$]),In=b.useCallback(Bt=>{i({to:Bt==="table"?"../":"../../"})},[i]),[dr,ys]=Id(`ColumnDisplayed/${t}}/${n}`,{}),bs=Xa("ShowDeleteTable",!0),Ra=Xa("ShowDeleteDatabase",!0);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between space-y-3 md:space-y-0 md:space-x-3 pt-15 pb-4 pr-4",children:[u.jsxs("div",{className:"flex space-x-2",children:[m&&u.jsxs(be,{variant:"positiveOutline",onClick:kt,disabled:W,accessKey:"n",children:[u.jsx(Jr,{}),u.jsxs("span",{children:["Add ",u.jsx("u",{children:"N"}),"ew Record(s)"]})]}),m&&u.jsxs(be,{variant:"positiveOutline",onClick:ar,disabled:ne,accessKey:"c",children:[u.jsx(N4,{}),u.jsxs("span",{children:["Import ",u.jsx("u",{children:"C"}),"SV"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:Me,disabled:ce,accessKey:"e",children:[u.jsx(ate,{}),u.jsxs("span",{children:[u.jsx("u",{children:"E"}),"xport CSV"]})]})]}),u.jsxs("div",{className:"flex space-x-2",children:[N&&ee&&u.jsxs(be,{variant:"ghost",onClick:V,accessKey:"f",children:[u.jsx(oD,{className:"inline-block "}),u.jsxs("span",{children:["Clear ",u.jsx("u",{children:"F"}),"ilters"]})]}),N&&D.formState.isDirty&&u.jsxs(be,{variant:"default",onClick:K,children:[u.jsx(_te,{className:"inline-block "}),"Apply Filters"]}),N&&!ee&&u.jsxs(be,{variant:"ghost",onClick:A,accessKey:"f",children:[u.jsx(oD,{className:"inline-block "}),u.jsxs("span",{children:["Hide ",u.jsx("u",{children:"F"}),"ilters"]})]}),!N&&u.jsxs(be,{variant:"ghost",onClick:T,accessKey:"f",children:[u.jsx(Ete,{className:"inline-block "}),u.jsxs("span",{children:["Show ",u.jsx("u",{children:"F"}),"ilters"]})]}),u.jsx(be,{variant:"defaultOutline",onClick:fn,disabled:Yt,children:u.jsx(xa,{})}),u.jsx(dDe,{columns:H,columnVisibility:dr,setColumnVisibility:ys}),u.jsxs(Mh,{children:[u.jsx(zh,{disabled:!e,children:u.jsx(lE,{"aria-label":"Table options",color:e?"white":"gray"})}),u.jsxs(Lh,{side:"bottom",align:"end",children:[u.jsxs(kr,{className:"focus:bg-primary/70 focus:text-white",onClick:f,children:[d?u.jsx(Qee,{className:"text-green"}):u.jsx(T4,{}),"Only If Cached",u.jsx(Ye,{to:"https://docs.harperdb.io/docs/developers/applications/caching#cache-control-header",target:"_blank",rel:"noopener noreferrer",onClick:$K,children:u.jsx(vte,{})})]}),y&&!I&&u.jsxs(kr,{className:"focus:bg-red/70 focus:text-white",onClick:bs,children:[u.jsx(Ca,{className:"inline-block "}),"Drop Table"]}),y&&u.jsxs(kr,{className:"focus:bg-red/70 focus:text-white",onClick:Ra,children:[u.jsx(wne,{}),"Drop Database"]})]})]})]})]}),u.jsx(mDe,{data:br?.data,isFetching:Yt,filtersToggled:N,columns:H,columnVisibility:dr,onRowClick:Cn,onColumnClick:zt,totalPages:le,totalRecords:Q,pageIndex:O,pageSize:pe,columnFiltersForm:D,applyFilters:K,setPageIndex:X,setPageSize:ve}),m&&x&&W&&u.jsx(O$e,{instanceTable:x,isModalOpen:W,refreshTable:B,setIsModalOpen:L}),u.jsx(U$e,{canEditRecords:h,canDeleteRecords:v,setIsModalOpen:j,isModalOpen:E,hashAttribute:z,data:An?.data,onSaveChanges:Ke,onDeleteRecord:Wt,isUpdateTableRecordsPending:re,isDeleteTableRecordsPending:ie}),u.jsx(M$e,{databaseName:t,onDeleted:In}),u.jsx(F$e,{databaseName:t,tableName:n,onDeleted:In}),u.jsx(q$e,{isModalOpen:ne,setIsModalOpen:$,onSaveChanges:Vt,database:t,table:n})]})}function gDe(){const e=rt({strict:!1}),t=Zt(),{data:n}=Mt(LK(t));let r,i;if(n){e.databaseName||(r=Object.keys(n).sort()[0]);const o=e.databaseName??r;!e.tableName&&o&&n[o]&&(i=Object.keys(n[o]).sort()[0])}return r||i?u.jsx(jc,{to:Lk({...e,databaseName:r??e.databaseName,tableName:i}),replace:!0}):u.jsxs("main",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 min-h-[calc(100vh-(--spacing(36)))]",children:[u.jsx("section",{className:"col-span-1 text-white md:col-span-4 lg:col-span-3",children:u.jsx(I$e,{instanceDatabaseMap:n})}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9 flex flex-col",children:e.databaseName&&e.tableName&&u.jsx(hDe,{instanceDatabaseMap:n,databaseName:e.databaseName,tableName:e.tableName})})]})}function vDe(e){return nt({getParentRoute:()=>e,path:"/databases/{-$databaseName}/{-$tableName}",component:gDe})}function yDe({entityId:e,instanceClient:t},n){return{queryKey:[e,"get_status"],staleTime:9e3,refetchInterval:1e4,retryDelay:1e4,throwOnError:!1,enabled:n,queryFn:async()=>{const{data:r}=await t.post("/",{operation:"get_status"});return r}}}const tG={className:"text-white"};function bDe(){const e=LE(),t=rt({strict:!1}),{version:n}=Gm({strict:!1}),r=LM("4.6.0",n),i=LM("4.7.0-beta.7",n),o=Zt(),{data:a}=Mt(yDe(o,r)),l=a?.restartRequired??!1,d=b.useMemo(()=>[{to:ur(t),activeOptions:{exact:!0},name:"Applications",shortName:"Apps",icon:u.jsx(uE,{className:"inline-block"})},{to:ur(t,"databases"),icon:u.jsx(pte,{className:"inline-block"}),name:"Databases"},e&&i&&{to:ur(t,"apis"),name:"APIs",icon:u.jsx(mne,{className:"inline-block"})},e&&r&&{to:ur(t,"status"),icon:u.jsx(Ite,{className:"inline-block"}),name:"Status"},e&&{to:ur(t,"logs"),icon:u.jsx(Xte,{className:"inline-block"}),name:"Logs"},e&&{to:ur(t,"config"),icon:u.jsx(gne,{className:"inline-block"}),name:"Config"}].filter(Jo),[e,t,i,r]);return u.jsxs(u.Fragment,{children:[u.jsx(xDe,{links:d,restartRequired:l}),u.jsx(wDe,{links:d,restartRequired:l})]})}function xDe({links:e,restartRequired:t}){return u.jsxs("div",{className:"hidden md:flex items-center justify-between h-full text-sm text-white",children:[u.jsx(vx,{restartRequired:t}),u.jsx("div",{className:"flex space-x-2",children:e.map(({shortName:n,...r})=>u.jsxs(Ye,{className:"p-2 text-center text-gray-400 hover:text-white",activeProps:tG,...r,children:[r.icon,u.jsx("span",{className:"hidden xl:inline-block ml-1",children:r.name}),n&&u.jsx("span",{className:"visible xl:hidden ml-1",children:n})]},r.to))})]})}function wDe({links:e,restartRequired:t}){return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex md:hidden items-center justify-between h-full px-2 text-white",children:[u.jsx(vx,{restartRequired:t}),u.jsxs(Mh,{children:[u.jsx(zh,{asChild:!0,children:u.jsx(be,{variant:"ghost",className:"p-0",children:u.jsx(z4,{className:"h-8 w-8"})})}),u.jsxs(Lh,{children:[u.jsx(tb,{children:"Instance Menu"}),u.jsx(nb,{}),e.map(n=>u.jsx(kr,{asChild:!0,children:u.jsx(Ye,{to:n.to,activeProps:tG,children:n.name})},n.to))]})]})]})})}function q1(){return u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full z-39 h-12 md:px-12 bg-grey-700",children:u.jsx(bDe,{})}),u.jsx("div",{className:"mt-32 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(jl,{})})]})}function SDe(e){switch(e){case"local":return nt({getParentRoute:()=>z0,id:"_instanceLayout",component:q1,loader:vy});case"cluster":return nt({getParentRoute:()=>ps,id:"_instanceLayout",component:q1,beforeLoad:YM,loader:vy});case"instance":return nt({getParentRoute:()=>ps,path:"instance/$instanceId",component:q1,beforeLoad:YM,loader:vy})}}async function YM({context:e,params:t}){const n=e.authentication[t.instanceId||t.clusterId];if(n?.isLoading||n?.user)return;const r=e.authentication[$n];if(r?.isLoading)return;const{update:i}=t.instanceId?vU(r.user,t.organizationId,t.clusterId):gU(r.user,t.organizationId,t.clusterId);if(i){const a=t.instanceId||t.clusterId,l=es({id:a,forceFabricConnect:!0});try{const d=await sl({instanceClient:l});jt.setUserForIdAndKey(a,l.defaults.baseURL,d),jt.flagForFabricConnect(a,!0);return}catch(d){console.error("Fabric Connect not established",d)}}const o=`/${t.organizationId}/${t.clusterId}/`+(t.instanceId?`instance/${t.instanceId}`:"")+"/sign-in";throw Kc({to:o,search:zq()})}const _De=Pb(`inline-flex 
  items-center 
  justify-center 
  gap-2 
  whitespace-nowrap 
  rounded-lg 
  text-sm  
  transition-[color,box-shadow] 
  disabled:pointer-events-none 
  disabled:opacity-50 
  [&_svg]:pointer-events-none 
  [&_svg:not([class*='size-'])]:size-4 
  [&_svg]:shrink-0 
  ring-ring/10 
  dark:ring-ring/20 
  dark:outline-ring/40 
  outline-ring/50 
  focus-visible:ring-1 
  focus-visible:outline-1 
  focus-visible:ring-purple-200 
  aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var nG="Toggle",rG=b.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,l]=Ko({prop:n,onChange:i,defaultProp:r??!1,caller:nG});return u.jsx(We.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:Re(e.onClick,()=>{e.disabled||l(!a)})})});rG.displayName=nG;var CDe=rG;function kDe({className:e,variant:t,size:n,...r}){return u.jsx(CDe,{"data-slot":"toggle",className:Ue(_De({variant:t,size:n,className:e})),...r})}function iG(e){switch(e){case"warn":return"warning";case"notify":return"success";case"info":case"debug":case"trace":case void 0:case"stdout":return"secondary";case"stderr":case"error":return"destructive";default:return e}}const WM=["secondary","default","warning","outline","success","destructive"];let XM=0;const K1=new Map,oG=e=>{if(K1.has(e))return K1.get(e);XM++;const t=XM%WM.length,n=WM[t];return K1.set(e,n),n};function EDe({columns:e,data:t,onRowClick:n}){const r=A0({data:t,columns:e,getCoreRowModel:N0()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(O0,{className:"text-xs",children:[u.jsx(Uh,{children:r.getHeaderGroups().map(i=>u.jsx(Hi,{className:"border-none",children:i.headers.map(o=>u.jsx(NR,{className:"p-4 max-w-96",children:o.isPlaceholder?null:Hc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx($0,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Hi,{"data-state":i.getIsSelected()&&"selected",className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted max-w-full",n&&"cursor-pointer"),onClick:()=>n?.(i),children:i.getVisibleCells().map(o=>u.jsx(fs,{className:"p-1",children:Hc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Hi,{children:u.jsx(fs,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function jDe(e){try{JSON.parse(e)}catch{return!1}return!0}function IDe({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?oG(n.node):"default";return u.jsx(Un,{onOpenChange:e,open:t,children:u.jsxs(Vn,{"aria-describedby":void 0,children:[u.jsx(yr,{children:u.jsx(Pn,{children:"Edit Row"})}),n?u.jsxs("div",{className:"flex flex-col gap-3 text-white",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"inline-block pr-2",children:"Level:"}),u.jsx(Yo,{variant:iG(n.level),children:wo(n.level)})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Timestamp:"}),u.jsx("p",{className:"text-sm",children:n.timestamp})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Thread:"}),u.jsx("p",{className:"text-sm",children:n.thread})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Node:"}),u.jsx(Yo,{variant:r,children:n.node})]}),u.jsxs("div",{children:[u.jsx("h3",{children:"Tags:"}),u.jsx("p",{className:"text-sm",children:n.tags&&n.tags.length>0?u.jsx("span",{children:n.tags}):"N/A"})]}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold",children:"Message"}),u.jsx(M0,{className:"w-full h-72",language:jDe(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(no,{}),u.jsx(Yn,{children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsxs(be,{type:"button",variant:"destructive",className:"rounded-full",children:[u.jsx(Ca,{})," Delete Row"]}),u.jsxs(be,{variant:"submit",className:"rounded-full",children:[u.jsx(To,{})," Save Changes"]})]})})]})})}function RDe({entityId:e,instanceClient:t,logFilters:n,replicated:r,isAutoRefreshEnabled:i}){return{queryKey:[e,"read_log",n.limit,n.level,n.from,n.until,r],queryFn:async()=>{const{data:o}=await t.post("/",{operation:"read_log",start:0,replicated:r,limit:n.limit?parseInt(n.limit,10):void 0,level:n.level!=="undefined"?n.level:void 0,from:n.from?new Date(n.from).toISOString():void 0,until:n.until?new Date(n.until).toISOString():void 0,order:"desc"});return o},retry:!1,refetchInterval:i?5e3:!1}}const TDe=$t({limit:tt().optional(),level:Ml(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:tt().or(Im()).optional(),until:tt().or(Im()).optional()});function NDe({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(un,{...e,children:u.jsxs("form",{onSubmit:e.handleSubmit(n),className:"flex-col space-y-5",children:[u.jsx($e,{control:e.control,name:"limit",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Log Limit:"}),u.jsxs(Gi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select log limit"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(Ot,{value:"1000",children:"1000"}),u.jsx(Ot,{value:"500",children:"500"}),u.jsx(Ot,{value:"250",children:"250"}),u.jsx(Ot,{value:"100",children:"100"}),u.jsx(Ot,{value:"10",children:"10"})]})})]}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Log Level:"}),u.jsxs(Gi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Yi,{className:"w-full",children:u.jsx(Zi,{placeholder:"Select log level"})}),u.jsx(Wi,{children:u.jsxs(Wo,{children:[u.jsx(Ot,{value:"undefined",children:"All"}),u.jsx(Ot,{value:"notify",children:"Notify"}),u.jsx(Ot,{value:"error",children:"Error"}),u.jsx(Ot,{value:"warn",children:"Warn"}),u.jsx(Ot,{value:"info",children:"Info"}),u.jsx(Ot,{value:"debug",children:"Debug"}),u.jsx(Ot,{value:"trace",children:"Trace"})]})})]}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"Start Date:"}),u.jsx(Oe,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Ae,{})]})}),u.jsx($e,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Te,{children:[u.jsx(Ne,{children:"End Date:"}),u.jsx(Oe,{children:u.jsx(ze,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Ae,{})]})}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsx(be,{type:"submit",variant:"positiveOutline",className:"grow",children:"Apply Filters"}),u.jsx(be,{type:"reset",variant:"destructiveOutline",onClick:()=>t(),children:"Clear Filters"})]})]})})})}const G1={limit:"100",level:"undefined",from:"",until:""},ADe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Yo,{variant:iG(t),children:wo(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=oG(t);return u.jsx(u.Fragment,{children:t?u.jsxs(mx,{children:[u.jsx(hx,{asChild:!0,children:u.jsxs(Yo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(gx,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),u.jsx("pre",{children:u.jsx("code",{children:t})})}}],ODe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function $De(){const[e,t]=b.useState(G1),[n,r]=b.useState(!1),[i,o]=b.useState(),[a,l]=b.useState(!1),d=Zt(),{data:f,isLoading:m,refetch:h,isFetching:v}=Mt(RDe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=cn({resolver:vn(TDe),defaultValues:G1,mode:"onChange"}),x=E=>{o(E.original),r(!0)},S=async E=>{if(!ODe(E.from,E.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(E)},C=async()=>{y.reset(),t(G1)},k=Ul(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(NDe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,disabled:v||m||a,className:"grow",children:[u.jsx(xa,{}),"Refresh"]}),u.jsxs(kDe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:l,children:[u.jsx(xa,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:m?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(EDe,{columns:ADe,data:f||[],onRowClick:x})})}),u.jsx(IDe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function DDe(e){return nt({getParentRoute:()=>e,path:"logs",component:$De})}function PDe(e){return nt({getParentRoute:()=>e,path:"status",component:s4(async()=>th(()=>import("./index-BlhOerSW.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function MDe(e){const t=SDe(e),n=[DDe(t),...oOe(t),uke(t),PDe(t),l$e(t),vDe(t)];return t.addChildren(n)}nt({getParentRoute:()=>z0,path:"profile",component:s4(async()=>th(()=>import("./index-DUFpWvra.js"),[]),"ProfileIndex")});const zDe=ix.addChildren([...fbe,z0.addChildren([MDe("local")])]);function LDe({routeTree:e=zDe,authentication:t}){const n=VX();return _Q({routeTree:e,history:n,defaultNotFoundComponent:Rne,defaultErrorComponent:Ry,defaultPreload:Tne()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Ty,authentication:t||{}}})}function FDe(){const e=IQ(),t=LDe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(EQ,{router:t,context:{authentication:e}}),!1]})}const UDe=({...e})=>u.jsx(rre,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});let JM=!1;function VDe(){b.useEffect(()=>{JM||(JM=!0)},[])}var BDe=function(){return null};function HDe(){return Ffe(),Nde(),VDe(),u.jsxs(u.Fragment,{children:[u.jsxs(CX,{client:Ty,children:[u.jsx(FDe,{}),u.jsx(BDe,{buttonPosition:"bottom-right"})]}),u.jsx(UDe,{richColors:!0})]})}var Z1={exports:{}},Yp={},Y1={exports:{}},W1={};var QM;function qDe(){return QM||(QM=1,(function(e){function t(z,W){var L=z.length;z.push(W);e:for(;0<L;){var ne=L-1>>>1,$=z[ne];if(0<i($,W))z[ne]=W,z[L]=$,L=ne;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var W=z[0],L=z.pop();if(L!==W){z[0]=L;e:for(var ne=0,$=z.length,P=$>>>1;ne<P;){var U=2*(ne+1)-1,O=z[U],X=U+1,pe=z[X];if(0>i(O,L))X<$&&0>i(pe,O)?(z[ne]=pe,z[X]=L,ne=X):(z[ne]=O,z[U]=L,ne=U);else if(X<$&&0>i(pe,L))z[ne]=pe,z[X]=L,ne=X;else break e}}return W}function i(z,W){var L=z.sortIndex-W.sortIndex;return L!==0?L:z.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var d=[],f=[],m=1,h=null,v=3,y=!1,x=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(z){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=z)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function N(z){if(S=!1,I(z),!x)if(n(d)!==null)x=!0,T||(T=!0,G());else{var W=n(f);W!==null&&H(N,W.startTime-z)}}var T=!1,A=-1,D=5,F=-1;function q(){return C?!0:!(e.unstable_now()-F<D)}function ee(){if(C=!1,T){var z=e.unstable_now();F=z;var W=!0;try{e:{x=!1,S&&(S=!1,E(A),A=-1),y=!0;var L=v;try{t:{for(I(z),h=n(d);h!==null&&!(h.expirationTime>z&&q());){var ne=h.callback;if(typeof ne=="function"){h.callback=null,v=h.priorityLevel;var $=ne(h.expirationTime<=z);if(z=e.unstable_now(),typeof $=="function"){h.callback=$,I(z),W=!0;break t}h===n(d)&&r(d),I(z)}else r(d);h=n(d)}if(h!==null)W=!0;else{var P=n(f);P!==null&&H(N,P.startTime-z),W=!1}}break e}finally{h=null,v=L,y=!1}W=void 0}}finally{W?G():T=!1}}}var G;if(typeof j=="function")G=function(){j(ee)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,V=K.port2;K.port1.onmessage=ee,G=function(){V.postMessage(null)}}else G=function(){k(ee,0)};function H(z,W){A=k(function(){z(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var W=3;break;default:W=v}var L=v;v=W;try{return z()}finally{v=L}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var L=v;v=z;try{return W()}finally{v=L}},e.unstable_scheduleCallback=function(z,W,L){var ne=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?ne+L:ne):L=ne,z){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,z={id:m++,callback:W,priorityLevel:z,startTime:L,expirationTime:$,sortIndex:-1},L>ne?(z.sortIndex=L,t(f,z),n(d)===null&&z===n(f)&&(S?(E(A),A=-1):S=!0,H(N,L-ne))):(z.sortIndex=$,t(d,z),x||y||(x=!0,T||(T=!0,G()))),z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(z){var W=v;return function(){var L=v;v=W;try{return z.apply(this,arguments)}finally{v=L}}}})(W1)),W1}var ez;function KDe(){return ez||(ez=1,Y1.exports=qDe()),Y1.exports}var tz;function GDe(){if(tz)return Yp;tz=1;var e=KDe(),t=qm(),n=a4();function r(s){var c="https://react.dev/errors/"+s;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var c=s,p=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(p=c.return),s=c.return;while(s)}return c.tag===3?p:null}function a(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function l(s){if(s.tag===31){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var c=s.alternate;if(!c){if(c=o(s),c===null)throw Error(r(188));return c!==s?null:s}for(var p=s,g=c;;){var w=p.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){p=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===p)return d(w),s;if(_===g)return d(w),c;_=_.sibling}throw Error(r(188))}if(p.return!==g.return)p=w,g=_;else{for(var R=!1,M=w.child;M;){if(M===p){R=!0,p=w,g=_;break}if(M===g){R=!0,g=w,p=_;break}M=M.sibling}if(!R){for(M=_.child;M;){if(M===p){R=!0,p=_,g=w;break}if(M===g){R=!0,g=_,p=w;break}M=M.sibling}if(!R)throw Error(r(189))}}if(p.alternate!==g)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?s:c}function m(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s;for(s=s.child;s!==null;){if(c=m(s),c!==null)return c;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var K=Symbol.for("react.client.reference");function V(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===K?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case T:return"SuspenseList";case F:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case j:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case I:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return c=s.displayName||null,c!==null?c:V(s.type)||"Memo";case D:c=s._payload,s=s._init;try{return V(s(c))}catch{}}return null}var H=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},ne=[],$=-1;function P(s){return{current:s}}function U(s){0>$||(s.current=ne[$],ne[$]=null,$--)}function O(s,c){$++,ne[$]=s.current,s.current=c}var X=P(null),pe=P(null),ve=P(null),Q=P(null);function le(s,c){switch(O(ve,c),O(pe,s),O(X,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?wO(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=wO(c),s=SO(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(X),O(X,s)}function Se(){U(X),U(pe),U(ve)}function ke(s){s.memoizedState!==null&&O(Q,s);var c=X.current,p=SO(c,s.type);c!==p&&(O(pe,s),O(X,p))}function Pe(s){pe.current===s&&(U(X),U(pe)),Q.current===s&&(U(Q),bp._currentValue=L)}var Fe,ut;function Ze(s){if(Fe===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);Fe=c&&c[1]||"",ut=-1<p.stack.indexOf(`
    at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Fe+s+ut}var Pt=!1;function dn(s,c){if(!s||Pt)return"";Pt=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ge){var fe=ge}Reflect.construct(s,[],_e)}else{try{_e.call()}catch(ge){fe=ge}s.call(_e.prototype)}}else{try{throw Error()}catch(ge){fe=ge}(_e=s())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ge){if(ge&&fe&&typeof ge.stack=="string")return[ge.stack,fe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=g.DetermineComponentFrameRoot(),R=_[0],M=_[1];if(R&&M){var Z=R.split(`
`),de=M.split(`
`);for(w=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;w<de.length&&!de[w].includes("DetermineComponentFrameRoot");)w++;if(g===Z.length||w===de.length)for(g=Z.length-1,w=de.length-1;1<=g&&0<=w&&Z[g]!==de[w];)w--;for(;1<=g&&0<=w;g--,w--)if(Z[g]!==de[w]){if(g!==1||w!==1)do if(g--,w--,0>w||Z[g]!==de[w]){var ye=`
`+Z[g].replace(" at new "," at ");return s.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",s.displayName)),ye}while(1<=g&&0<=w);break}}}finally{Pt=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?Ze(p):""}function tn(s,c){switch(s.tag){case 26:case 27:case 5:return Ze(s.type);case 16:return Ze("Lazy");case 13:return s.child!==c&&c!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return dn(s.type,!1);case 11:return dn(s.type.render,!1);case 1:return dn(s.type,!0);case 31:return Ze("Activity");default:return""}}function br(s){try{var c="",p=null;do c+=tn(s,p),p=s,s=s.return;while(s);return c}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var Yt=Object.prototype.hasOwnProperty,An=e.unstable_scheduleCallback,Y=e.unstable_cancelCallback,re=e.unstable_shouldYield,se=e.unstable_requestPaint,ie=e.unstable_now,me=e.unstable_getCurrentPriorityLevel,B=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Me=e.unstable_LowPriority,Ke=e.unstable_IdlePriority,Wt=e.log,Vt=e.unstable_setDisableYieldValue,Cn=null,zt=null;function fn(s){if(typeof Wt=="function"&&Vt(s),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(Cn,s)}catch{}}var kt=Math.clz32?Math.clz32:dr,ar=Math.log,In=Math.LN2;function dr(s){return s>>>=0,s===0?32:31-(ar(s)/In|0)|0}var ys=256,bs=262144,Ra=4194304;function Bt(s){var c=s&42;if(c!==0)return c;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Xe(s,c,p){var g=s.pendingLanes;if(g===0)return 0;var w=0,_=s.suspendedLanes,R=s.pingedLanes;s=s.warmLanes;var M=g&134217727;return M!==0?(g=M&~_,g!==0?w=Bt(g):(R&=M,R!==0?w=Bt(R):p||(p=M&~s,p!==0&&(w=Bt(p))))):(M=g&~_,M!==0?w=Bt(M):R!==0?w=Bt(R):p||(p=g&~s,p!==0&&(w=Bt(p)))),w===0?0:c!==0&&c!==w&&(c&_)===0&&(_=w&-w,p=c&-c,_>=p||_===32&&(p&4194048)!==0)?c:w}function nn(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function Wn(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fr(){var s=Ra;return Ra<<=1,(Ra&62914560)===0&&(Ra=4194304),s}function ea(s){for(var c=[],p=0;31>p;p++)c.push(s);return c}function pn(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ii(s,c,p,g,w,_){var R=s.pendingLanes;s.pendingLanes=p,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=p,s.entangledLanes&=p,s.errorRecoveryDisabledLanes&=p,s.shellSuspendCounter=0;var M=s.entanglements,Z=s.expirationTimes,de=s.hiddenUpdates;for(p=R&~p;0<p;){var ye=31-kt(p),_e=1<<ye;M[ye]=0,Z[ye]=-1;var fe=de[ye];if(fe!==null)for(de[ye]=null,ye=0;ye<fe.length;ye++){var ge=fe[ye];ge!==null&&(ge.lane&=-536870913)}p&=~_e}g!==0&&ql(s,g,0),_!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=_&~(R&~c))}function ql(s,c,p){s.pendingLanes|=c,s.suspendedLanes&=~c;var g=31-kt(c);s.entangledLanes|=c,s.entanglements[g]=s.entanglements[g]|1073741824|p&261930}function oi(s,c){var p=s.entangledLanes|=c;for(s=s.entanglements;p;){var g=31-kt(p),w=1<<g;w&c|s[g]&c&&(s[g]|=c),p&=~w}}function ai(s,c){var p=c&-c;return p=(p&42)!==0?1:du(p),(p&(s.suspendedLanes|c))!==0?0:p}function du(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Do(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function X0(){var s=W.p;return s!==0?s:(s=window.event,s===void 0?32:qO(s.type))}function sT(s,c){var p=W.p;try{return W.p=s,c()}finally{W.p=p}}var xs=Math.random().toString(36).slice(2),xr="__reactFiber$"+xs,si="__reactProps$"+xs,fu="__reactContainer$"+xs,J0="__reactEvents$"+xs,aG="__reactListeners$"+xs,sG="__reactHandles$"+xs,lT="__reactResources$"+xs,$f="__reactMarker$"+xs;function Q0(s){delete s[xr],delete s[si],delete s[J0],delete s[aG],delete s[sG]}function pu(s){var c=s[xr];if(c)return c;for(var p=s.parentNode;p;){if(c=p[fu]||p[xr]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(s=RO(s);s!==null;){if(p=s[xr])return p;s=RO(s)}return c}s=p,p=s.parentNode}return null}function mu(s){if(s=s[xr]||s[fu]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Df(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function hu(s){var c=s[lT];return c||(c=s[lT]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function pr(s){s[$f]=!0}var cT=new Set,uT={};function Kl(s,c){gu(s,c),gu(s+"Capture",c)}function gu(s,c){for(uT[s]=c,s=0;s<c.length;s++)cT.add(c[s])}var lG=RegExp("^[: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]*$"),dT={},fT={};function cG(s){return Yt.call(fT,s)?!0:Yt.call(dT,s)?!1:lG.test(s)?fT[s]=!0:(dT[s]=!0,!1)}function Yh(s,c,p){if(cG(c))if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+p)}}function Wh(s,c,p){if(p===null)s.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttribute(c,""+p)}}function Ta(s,c,p,g){if(g===null)s.removeAttribute(p);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(p);return}s.setAttributeNS(c,p,""+g)}}function ro(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function pT(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function uG(s,c,p){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var w=g.get,_=g.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return w.call(this)},set:function(R){p=""+R,_.call(this,R)}}),Object.defineProperty(s,c,{enumerable:g.enumerable}),{getValue:function(){return p},setValue:function(R){p=""+R},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function ew(s){if(!s._valueTracker){var c=pT(s)?"checked":"value";s._valueTracker=uG(s,c,""+s[c])}}function mT(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var p=c.getValue(),g="";return s&&(g=pT(s)?s.checked?"true":"false":s.value),s=g,s!==p?(c.setValue(s),!0):!1}function Xh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var dG=/[\n"\\]/g;function io(s){return s.replace(dG,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function tw(s,c,p,g,w,_,R,M){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),c!=null?R==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+ro(c)):s.value!==""+ro(c)&&(s.value=""+ro(c)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),c!=null?nw(s,R,ro(c)):p!=null?nw(s,R,ro(p)):g!=null&&s.removeAttribute("value"),w==null&&_!=null&&(s.defaultChecked=!!_),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+ro(M):s.removeAttribute("name")}function hT(s,c,p,g,w,_,R,M){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),c!=null||p!=null){if(!(_!=="submit"&&_!=="reset"||c!=null)){ew(s);return}p=p!=null?""+ro(p):"",c=c!=null?""+ro(c):p,M||c===s.value||(s.value=c),s.defaultValue=c}g=g??w,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=M?s.checked:!!g,s.defaultChecked=!!g,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R),ew(s)}function nw(s,c,p){c==="number"&&Xh(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function vu(s,c,p,g){if(s=s.options,c){c={};for(var w=0;w<p.length;w++)c["$"+p[w]]=!0;for(p=0;p<s.length;p++)w=c.hasOwnProperty("$"+s[p].value),s[p].selected!==w&&(s[p].selected=w),w&&g&&(s[p].defaultSelected=!0)}else{for(p=""+ro(p),c=null,w=0;w<s.length;w++){if(s[w].value===p){s[w].selected=!0,g&&(s[w].defaultSelected=!0);return}c!==null||s[w].disabled||(c=s[w])}c!==null&&(c.selected=!0)}}function gT(s,c,p){if(c!=null&&(c=""+ro(c),c!==s.value&&(s.value=c),p==null)){s.defaultValue!==c&&(s.defaultValue=c);return}s.defaultValue=p!=null?""+ro(p):""}function vT(s,c,p,g){if(c==null){if(g!=null){if(p!=null)throw Error(r(92));if(H(g)){if(1<g.length)throw Error(r(93));g=g[0]}p=g}p==null&&(p=""),c=p}p=ro(c),s.defaultValue=p,g=s.textContent,g===p&&g!==""&&g!==null&&(s.value=g),ew(s)}function yu(s,c){if(c){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=c;return}}s.textContent=c}var fG=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yT(s,c,p){var g=c.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?g?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":g?s.setProperty(c,p):typeof p!="number"||p===0||fG.has(c)?c==="float"?s.cssFloat=p:s[c]=(""+p).trim():s[c]=p+"px"}function bT(s,c,p){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,p!=null){for(var g in p)!p.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var w in c)g=c[w],c.hasOwnProperty(w)&&p[w]!==g&&yT(s,w,g)}else for(var _ in c)c.hasOwnProperty(_)&&yT(s,_,c[_])}function rw(s){if(s.indexOf("-")===-1)return!1;switch(s){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 pG=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mG=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jh(s){return mG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Na(){}var iw=null;function ow(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var bu=null,xu=null;function xT(s){var c=mu(s);if(c&&(s=c.stateNode)){var p=s[si]||null;e:switch(s=c.stateNode,c.type){case"input":if(tw(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),c=p.name,p.type==="radio"&&c!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+io(""+c)+'"][type="radio"]'),c=0;c<p.length;c++){var g=p[c];if(g!==s&&g.form===s.form){var w=g[si]||null;if(!w)throw Error(r(90));tw(g,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<p.length;c++)g=p[c],g.form===s.form&&mT(g)}break e;case"textarea":gT(s,p.value,p.defaultValue);break e;case"select":c=p.value,c!=null&&vu(s,!!p.multiple,c,!1)}}}var aw=!1;function wT(s,c,p){if(aw)return s(c,p);aw=!0;try{var g=s(c);return g}finally{if(aw=!1,(bu!==null||xu!==null)&&(Lg(),bu&&(c=bu,s=xu,xu=bu=null,xT(c),s)))for(c=0;c<s.length;c++)xT(s[c])}}function Pf(s,c){var p=s.stateNode;if(p===null)return null;var g=p[si]||null;if(g===null)return null;p=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(p&&typeof p!="function")throw Error(r(231,c,typeof p));return p}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sw=!1;if(Aa)try{var Mf={};Object.defineProperty(Mf,"passive",{get:function(){sw=!0}}),window.addEventListener("test",Mf,Mf),window.removeEventListener("test",Mf,Mf)}catch{sw=!1}var ws=null,lw=null,Qh=null;function ST(){if(Qh)return Qh;var s,c=lw,p=c.length,g,w="value"in ws?ws.value:ws.textContent,_=w.length;for(s=0;s<p&&c[s]===w[s];s++);var R=p-s;for(g=1;g<=R&&c[p-g]===w[_-g];g++);return Qh=w.slice(s,1<g?1-g:void 0)}function eg(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function tg(){return!0}function _T(){return!1}function li(s){function c(p,g,w,_,R){this._reactName=p,this._targetInst=w,this.type=g,this.nativeEvent=_,this.target=R,this.currentTarget=null;for(var M in s)s.hasOwnProperty(M)&&(p=s[M],this[M]=p?p(_):_[M]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?tg:_T,this.isPropagationStopped=_T,this}return h(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=tg)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=tg)},persist:function(){},isPersistent:tg}),c}var Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ng=li(Gl),zf=h({},Gl,{view:0,detail:0}),hG=li(zf),cw,uw,Lf,rg=h({},zf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fw,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Lf&&(Lf&&s.type==="mousemove"?(cw=s.screenX-Lf.screenX,uw=s.screenY-Lf.screenY):uw=cw=0,Lf=s),cw)},movementY:function(s){return"movementY"in s?s.movementY:uw}}),CT=li(rg),gG=h({},rg,{dataTransfer:0}),vG=li(gG),yG=h({},zf,{relatedTarget:0}),dw=li(yG),bG=h({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),xG=li(bG),wG=h({},Gl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),SG=li(wG),_G=h({},Gl,{data:0}),kT=li(_G),CG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kG={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},EG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jG(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=EG[s])?!!c[s]:!1}function fw(){return jG}var IG=h({},zf,{key:function(s){if(s.key){var c=CG[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=eg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?kG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fw,charCode:function(s){return s.type==="keypress"?eg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?eg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),RG=li(IG),TG=h({},rg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ET=li(TG),NG=h({},zf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fw}),AG=li(NG),OG=h({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),$G=li(OG),DG=h({},rg,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),PG=li(DG),MG=h({},Gl,{newState:0,oldState:0}),zG=li(MG),LG=[9,13,27,32],pw=Aa&&"CompositionEvent"in window,Ff=null;Aa&&"documentMode"in document&&(Ff=document.documentMode);var FG=Aa&&"TextEvent"in window&&!Ff,jT=Aa&&(!pw||Ff&&8<Ff&&11>=Ff),IT=" ",RT=!1;function TT(s,c){switch(s){case"keyup":return LG.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var wu=!1;function UG(s,c){switch(s){case"compositionend":return NT(c);case"keypress":return c.which!==32?null:(RT=!0,IT);case"textInput":return s=c.data,s===IT&&RT?null:s;default:return null}}function VG(s,c){if(wu)return s==="compositionend"||!pw&&TT(s,c)?(s=ST(),Qh=lw=ws=null,wu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return jT&&c.locale!=="ko"?null:c.data;default:return null}}var BG={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function AT(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!BG[s.type]:c==="textarea"}function OT(s,c,p,g){bu?xu?xu.push(g):xu=[g]:bu=g,c=Kg(c,"onChange"),0<c.length&&(p=new ng("onChange","change",null,p,g),s.push({event:p,listeners:c}))}var Uf=null,Vf=null;function HG(s){hO(s,0)}function ig(s){var c=Df(s);if(mT(c))return s}function $T(s,c){if(s==="change")return c}var DT=!1;if(Aa){var mw;if(Aa){var hw="oninput"in document;if(!hw){var PT=document.createElement("div");PT.setAttribute("oninput","return;"),hw=typeof PT.oninput=="function"}mw=hw}else mw=!1;DT=mw&&(!document.documentMode||9<document.documentMode)}function MT(){Uf&&(Uf.detachEvent("onpropertychange",zT),Vf=Uf=null)}function zT(s){if(s.propertyName==="value"&&ig(Vf)){var c=[];OT(c,Vf,s,ow(s)),wT(HG,c)}}function qG(s,c,p){s==="focusin"?(MT(),Uf=c,Vf=p,Uf.attachEvent("onpropertychange",zT)):s==="focusout"&&MT()}function KG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return ig(Vf)}function GG(s,c){if(s==="click")return ig(c)}function ZG(s,c){if(s==="input"||s==="change")return ig(c)}function YG(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var Ri=typeof Object.is=="function"?Object.is:YG;function Bf(s,c){if(Ri(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var p=Object.keys(s),g=Object.keys(c);if(p.length!==g.length)return!1;for(g=0;g<p.length;g++){var w=p[g];if(!Yt.call(c,w)||!Ri(s[w],c[w]))return!1}return!0}function LT(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function FT(s,c){var p=LT(s);s=0;for(var g;p;){if(p.nodeType===3){if(g=s+p.textContent.length,s<=c&&g>=c)return{node:p,offset:c-s};s=g}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=LT(p)}}function UT(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?UT(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function VT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=Xh(s.document);c instanceof s.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)s=c.contentWindow;else break;c=Xh(s.document)}return c}function gw(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var WG=Aa&&"documentMode"in document&&11>=document.documentMode,Su=null,vw=null,Hf=null,yw=!1;function BT(s,c,p){var g=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;yw||Su==null||Su!==Xh(g)||(g=Su,"selectionStart"in g&&gw(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Hf&&Bf(Hf,g)||(Hf=g,g=Kg(vw,"onSelect"),0<g.length&&(c=new ng("onSelect","select",null,c,p),s.push({event:c,listeners:g}),c.target=Su)))}function Zl(s,c){var p={};return p[s.toLowerCase()]=c.toLowerCase(),p["Webkit"+s]="webkit"+c,p["Moz"+s]="moz"+c,p}var _u={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},bw={},HT={};Aa&&(HT=document.createElement("div").style,"AnimationEvent"in window||(delete _u.animationend.animation,delete _u.animationiteration.animation,delete _u.animationstart.animation),"TransitionEvent"in window||delete _u.transitionend.transition);function Yl(s){if(bw[s])return bw[s];if(!_u[s])return s;var c=_u[s],p;for(p in c)if(c.hasOwnProperty(p)&&p in HT)return bw[s]=c[p];return s}var qT=Yl("animationend"),KT=Yl("animationiteration"),GT=Yl("animationstart"),XG=Yl("transitionrun"),JG=Yl("transitionstart"),QG=Yl("transitioncancel"),ZT=Yl("transitionend"),YT=new Map,xw="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");xw.push("scrollEnd");function Po(s,c){YT.set(s,c),Kl(c,[s])}var og=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},oo=[],Cu=0,ww=0;function ag(){for(var s=Cu,c=ww=Cu=0;c<s;){var p=oo[c];oo[c++]=null;var g=oo[c];oo[c++]=null;var w=oo[c];oo[c++]=null;var _=oo[c];if(oo[c++]=null,g!==null&&w!==null){var R=g.pending;R===null?w.next=w:(w.next=R.next,R.next=w),g.pending=w}_!==0&&WT(p,w,_)}}function sg(s,c,p,g){oo[Cu++]=s,oo[Cu++]=c,oo[Cu++]=p,oo[Cu++]=g,ww|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function Sw(s,c,p,g){return sg(s,c,p,g),lg(s)}function Wl(s,c){return sg(s,null,null,c),lg(s)}function WT(s,c,p){s.lanes|=p;var g=s.alternate;g!==null&&(g.lanes|=p);for(var w=!1,_=s.return;_!==null;)_.childLanes|=p,g=_.alternate,g!==null&&(g.childLanes|=p),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(w=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,w&&c!==null&&(w=31-kt(p),s=_.hiddenUpdates,g=s[w],g===null?s[w]=[c]:g.push(c),c.lane=p|536870912),_):null}function lg(s){if(50<fp)throw fp=0,NS=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var ku={};function eZ(s,c,p,g){this.tag=s,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ti(s,c,p,g){return new eZ(s,c,p,g)}function _w(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Oa(s,c){var p=s.alternate;return p===null?(p=Ti(s.tag,c,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=c,p.type=s.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=s.flags&65011712,p.childLanes=s.childLanes,p.lanes=s.lanes,p.child=s.child,p.memoizedProps=s.memoizedProps,p.memoizedState=s.memoizedState,p.updateQueue=s.updateQueue,c=s.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function XT(s,c){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=c,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=p.childLanes,s.lanes=p.lanes,s.child=p.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=p.memoizedProps,s.memoizedState=p.memoizedState,s.updateQueue=p.updateQueue,s.type=p.type,c=p.dependencies,s.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),s}function cg(s,c,p,g,w,_){var R=0;if(g=s,typeof s=="function")_w(s)&&(R=1);else if(typeof s=="string")R=oY(s,p,X.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case F:return s=Ti(31,p,c,w),s.elementType=F,s.lanes=_,s;case S:return Xl(p.children,w,_,c);case C:R=8,w|=24;break;case k:return s=Ti(12,p,c,w|2),s.elementType=k,s.lanes=_,s;case N:return s=Ti(13,p,c,w),s.elementType=N,s.lanes=_,s;case T:return s=Ti(19,p,c,w),s.elementType=T,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:R=10;break e;case E:R=9;break e;case I:R=11;break e;case A:R=14;break e;case D:R=16,g=null;break e}R=29,p=Error(r(130,s===null?"null":typeof s,"")),g=null}return c=Ti(R,p,c,w),c.elementType=s,c.type=g,c.lanes=_,c}function Xl(s,c,p,g){return s=Ti(7,s,g,c),s.lanes=p,s}function Cw(s,c,p){return s=Ti(6,s,null,c),s.lanes=p,s}function JT(s){var c=Ti(18,null,null,0);return c.stateNode=s,c}function kw(s,c,p){return c=Ti(4,s.children!==null?s.children:[],s.key,c),c.lanes=p,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var QT=new WeakMap;function ao(s,c){if(typeof s=="object"&&s!==null){var p=QT.get(s);return p!==void 0?p:(c={value:s,source:c,stack:br(c)},QT.set(s,c),c)}return{value:s,source:c,stack:br(c)}}var Eu=[],ju=0,ug=null,qf=0,so=[],lo=0,Ss=null,ta=1,na="";function $a(s,c){Eu[ju++]=qf,Eu[ju++]=ug,ug=s,qf=c}function eN(s,c,p){so[lo++]=ta,so[lo++]=na,so[lo++]=Ss,Ss=s;var g=ta;s=na;var w=32-kt(g)-1;g&=~(1<<w),p+=1;var _=32-kt(c)+w;if(30<_){var R=w-w%5;_=(g&(1<<R)-1).toString(32),g>>=R,w-=R,ta=1<<32-kt(c)+w|p<<w|g,na=_+s}else ta=1<<_|p<<w|g,na=s}function Ew(s){s.return!==null&&($a(s,1),eN(s,1,0))}function jw(s){for(;s===ug;)ug=Eu[--ju],Eu[ju]=null,qf=Eu[--ju],Eu[ju]=null;for(;s===Ss;)Ss=so[--lo],so[lo]=null,na=so[--lo],so[lo]=null,ta=so[--lo],so[lo]=null}function tN(s,c){so[lo++]=ta,so[lo++]=na,so[lo++]=Ss,ta=c.id,na=c.overflow,Ss=s}var wr=null,kn=null,At=!1,_s=null,co=!1,Iw=Error(r(519));function Cs(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kf(ao(c,s)),Iw}function nN(s){var c=s.stateNode,p=s.type,g=s.memoizedProps;switch(c[xr]=s,c[si]=g,p){case"dialog":Rt("cancel",c),Rt("close",c);break;case"iframe":case"object":case"embed":Rt("load",c);break;case"video":case"audio":for(p=0;p<mp.length;p++)Rt(mp[p],c);break;case"source":Rt("error",c);break;case"img":case"image":case"link":Rt("error",c),Rt("load",c);break;case"details":Rt("toggle",c);break;case"input":Rt("invalid",c),hT(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Rt("invalid",c);break;case"textarea":Rt("invalid",c),vT(c,g.value,g.defaultValue,g.children)}p=g.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||c.textContent===""+p||g.suppressHydrationWarning===!0||bO(c.textContent,p)?(g.popover!=null&&(Rt("beforetoggle",c),Rt("toggle",c)),g.onScroll!=null&&Rt("scroll",c),g.onScrollEnd!=null&&Rt("scrollend",c),g.onClick!=null&&(c.onclick=Na),c=!0):c=!1,c||Cs(s,!0)}function rN(s){for(wr=s.return;wr;)switch(wr.tag){case 5:case 31:case 13:co=!1;return;case 27:case 3:co=!0;return;default:wr=wr.return}}function Iu(s){if(s!==wr)return!1;if(!At)return rN(s),At=!0,!1;var c=s.tag,p;if((p=c!==3&&c!==27)&&((p=c===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||KS(s.type,s.memoizedProps)),p=!p),p&&kn&&Cs(s),rN(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));kn=IO(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));kn=IO(s)}else c===27?(c=kn,zs(s.type)?(s=XS,XS=null,kn=s):kn=c):kn=wr?fo(s.stateNode.nextSibling):null;return!0}function Jl(){kn=wr=null,At=!1}function Rw(){var s=_s;return s!==null&&(fi===null?fi=s:fi.push.apply(fi,s),_s=null),s}function Kf(s){_s===null?_s=[s]:_s.push(s)}var Tw=P(null),Ql=null,Da=null;function ks(s,c,p){O(Tw,c._currentValue),c._currentValue=p}function Pa(s){s._currentValue=Tw.current,U(Tw)}function Nw(s,c,p){for(;s!==null;){var g=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),s===p)break;s=s.return}}function Aw(s,c,p,g){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var _=w.dependencies;if(_!==null){var R=w.child;_=_.firstContext;e:for(;_!==null;){var M=_;_=w;for(var Z=0;Z<c.length;Z++)if(M.context===c[Z]){_.lanes|=p,M=_.alternate,M!==null&&(M.lanes|=p),Nw(_.return,p,s),g||(R=null);break e}_=M.next}}else if(w.tag===18){if(R=w.return,R===null)throw Error(r(341));R.lanes|=p,_=R.alternate,_!==null&&(_.lanes|=p),Nw(R,p,s),R=null}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===s){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}}function Ru(s,c,p,g){s=null;for(var w=c,_=!1;w!==null;){if(!_){if((w.flags&524288)!==0)_=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var R=w.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var M=w.type;Ri(w.pendingProps.value,R.value)||(s!==null?s.push(M):s=[M])}}else if(w===Q.current){if(R=w.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(bp):s=[bp])}w=w.return}s!==null&&Aw(c,s,p,g),c.flags|=262144}function dg(s){for(s=s.firstContext;s!==null;){if(!Ri(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function ec(s){Ql=s,Da=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Sr(s){return iN(Ql,s)}function fg(s,c){return Ql===null&&ec(s),iN(s,c)}function iN(s,c){var p=c._currentValue;if(c={context:c,memoizedValue:p,next:null},Da===null){if(s===null)throw Error(r(308));Da=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else Da=Da.next=c;return p}var tZ=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(p,g){s.push(g)}};this.abort=function(){c.aborted=!0,s.forEach(function(p){return p()})}},nZ=e.unstable_scheduleCallback,rZ=e.unstable_NormalPriority,Xn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ow(){return{controller:new tZ,data:new Map,refCount:0}}function Gf(s){s.refCount--,s.refCount===0&&nZ(rZ,function(){s.controller.abort()})}var Zf=null,$w=0,Tu=0,Nu=null;function iZ(s,c){if(Zf===null){var p=Zf=[];$w=0,Tu=MS(),Nu={status:"pending",value:void 0,then:function(g){p.push(g)}}}return $w++,c.then(oN,oN),c}function oN(){if(--$w===0&&Zf!==null){Nu!==null&&(Nu.status="fulfilled");var s=Zf;Zf=null,Tu=0,Nu=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function oZ(s,c){var p=[],g={status:"pending",value:null,reason:null,then:function(w){p.push(w)}};return s.then(function(){g.status="fulfilled",g.value=c;for(var w=0;w<p.length;w++)(0,p[w])(c)},function(w){for(g.status="rejected",g.reason=w,w=0;w<p.length;w++)(0,p[w])(void 0)}),g}var aN=z.S;z.S=function(s,c){BA=ie(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&iZ(s,c),aN!==null&&aN(s,c)};var tc=P(null);function Dw(){var s=tc.current;return s!==null?s:mn.pooledCache}function pg(s,c){c===null?O(tc,tc.current):O(tc,c.pool)}function sN(){var s=Dw();return s===null?null:{parent:Xn._currentValue,pool:s}}var Au=Error(r(460)),Pw=Error(r(474)),mg=Error(r(542)),hg={then:function(){}};function lN(s){return s=s.status,s==="fulfilled"||s==="rejected"}function cN(s,c,p){switch(p=s[p],p===void 0?s.push(c):p!==c&&(c.then(Na,Na),c=p),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,dN(s),s;default:if(typeof c.status=="string")c.then(Na,Na);else{if(s=mn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(g){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=g}},function(g){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,dN(s),s}throw rc=c,Au}}function nc(s){try{var c=s._init;return c(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(rc=p,Au):p}}var rc=null;function uN(){if(rc===null)throw Error(r(459));var s=rc;return rc=null,s}function dN(s){if(s===Au||s===mg)throw Error(r(483))}var Ou=null,Yf=0;function gg(s){var c=Yf;return Yf+=1,Ou===null&&(Ou=[]),cN(Ou,s,c)}function Wf(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function vg(s,c){throw c.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function fN(s){function c(oe,te){if(s){var ue=oe.deletions;ue===null?(oe.deletions=[te],oe.flags|=16):ue.push(te)}}function p(oe,te){if(!s)return null;for(;te!==null;)c(oe,te),te=te.sibling;return null}function g(oe){for(var te=new Map;oe!==null;)oe.key!==null?te.set(oe.key,oe):te.set(oe.index,oe),oe=oe.sibling;return te}function w(oe,te){return oe=Oa(oe,te),oe.index=0,oe.sibling=null,oe}function _(oe,te,ue){return oe.index=ue,s?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<te?(oe.flags|=67108866,te):ue):(oe.flags|=67108866,te)):(oe.flags|=1048576,te)}function R(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function M(oe,te,ue,xe){return te===null||te.tag!==6?(te=Cw(ue,oe.mode,xe),te.return=oe,te):(te=w(te,ue),te.return=oe,te)}function Z(oe,te,ue,xe){var Je=ue.type;return Je===S?ye(oe,te,ue.props.children,xe,ue.key):te!==null&&(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===D&&nc(Je)===te.type)?(te=w(te,ue.props),Wf(te,ue),te.return=oe,te):(te=cg(ue.type,ue.key,ue.props,null,oe.mode,xe),Wf(te,ue),te.return=oe,te)}function de(oe,te,ue,xe){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=kw(ue,oe.mode,xe),te.return=oe,te):(te=w(te,ue.children||[]),te.return=oe,te)}function ye(oe,te,ue,xe,Je){return te===null||te.tag!==7?(te=Xl(ue,oe.mode,xe,Je),te.return=oe,te):(te=w(te,ue),te.return=oe,te)}function _e(oe,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Cw(""+te,oe.mode,ue),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return ue=cg(te.type,te.key,te.props,null,oe.mode,ue),Wf(ue,te),ue.return=oe,ue;case x:return te=kw(te,oe.mode,ue),te.return=oe,te;case D:return te=nc(te),_e(oe,te,ue)}if(H(te)||G(te))return te=Xl(te,oe.mode,ue,null),te.return=oe,te;if(typeof te.then=="function")return _e(oe,gg(te),ue);if(te.$$typeof===j)return _e(oe,fg(oe,te),ue);vg(oe,te)}return null}function fe(oe,te,ue,xe){var Je=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Je!==null?null:M(oe,te,""+ue,xe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===Je?Z(oe,te,ue,xe):null;case x:return ue.key===Je?de(oe,te,ue,xe):null;case D:return ue=nc(ue),fe(oe,te,ue,xe)}if(H(ue)||G(ue))return Je!==null?null:ye(oe,te,ue,xe,null);if(typeof ue.then=="function")return fe(oe,te,gg(ue),xe);if(ue.$$typeof===j)return fe(oe,te,fg(oe,ue),xe);vg(oe,ue)}return null}function ge(oe,te,ue,xe,Je){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return oe=oe.get(ue)||null,M(te,oe,""+xe,Je);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case y:return oe=oe.get(xe.key===null?ue:xe.key)||null,Z(te,oe,xe,Je);case x:return oe=oe.get(xe.key===null?ue:xe.key)||null,de(te,oe,xe,Je);case D:return xe=nc(xe),ge(oe,te,ue,xe,Je)}if(H(xe)||G(xe))return oe=oe.get(ue)||null,ye(te,oe,xe,Je,null);if(typeof xe.then=="function")return ge(oe,te,ue,gg(xe),Je);if(xe.$$typeof===j)return ge(oe,te,ue,fg(te,xe),Je);vg(te,xe)}return null}function Be(oe,te,ue,xe){for(var Je=null,Lt=null,Ge=te,yt=te=0,Nt=null;Ge!==null&&yt<ue.length;yt++){Ge.index>yt?(Nt=Ge,Ge=null):Nt=Ge.sibling;var Ft=fe(oe,Ge,ue[yt],xe);if(Ft===null){Ge===null&&(Ge=Nt);break}s&&Ge&&Ft.alternate===null&&c(oe,Ge),te=_(Ft,te,yt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft,Ge=Nt}if(yt===ue.length)return p(oe,Ge),At&&$a(oe,yt),Je;if(Ge===null){for(;yt<ue.length;yt++)Ge=_e(oe,ue[yt],xe),Ge!==null&&(te=_(Ge,te,yt),Lt===null?Je=Ge:Lt.sibling=Ge,Lt=Ge);return At&&$a(oe,yt),Je}for(Ge=g(Ge);yt<ue.length;yt++)Nt=ge(Ge,oe,yt,ue[yt],xe),Nt!==null&&(s&&Nt.alternate!==null&&Ge.delete(Nt.key===null?yt:Nt.key),te=_(Nt,te,yt),Lt===null?Je=Nt:Lt.sibling=Nt,Lt=Nt);return s&&Ge.forEach(function(Bs){return c(oe,Bs)}),At&&$a(oe,yt),Je}function et(oe,te,ue,xe){if(ue==null)throw Error(r(151));for(var Je=null,Lt=null,Ge=te,yt=te=0,Nt=null,Ft=ue.next();Ge!==null&&!Ft.done;yt++,Ft=ue.next()){Ge.index>yt?(Nt=Ge,Ge=null):Nt=Ge.sibling;var Bs=fe(oe,Ge,Ft.value,xe);if(Bs===null){Ge===null&&(Ge=Nt);break}s&&Ge&&Bs.alternate===null&&c(oe,Ge),te=_(Bs,te,yt),Lt===null?Je=Bs:Lt.sibling=Bs,Lt=Bs,Ge=Nt}if(Ft.done)return p(oe,Ge),At&&$a(oe,yt),Je;if(Ge===null){for(;!Ft.done;yt++,Ft=ue.next())Ft=_e(oe,Ft.value,xe),Ft!==null&&(te=_(Ft,te,yt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft);return At&&$a(oe,yt),Je}for(Ge=g(Ge);!Ft.done;yt++,Ft=ue.next())Ft=ge(Ge,oe,yt,Ft.value,xe),Ft!==null&&(s&&Ft.alternate!==null&&Ge.delete(Ft.key===null?yt:Ft.key),te=_(Ft,te,yt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft);return s&&Ge.forEach(function(gY){return c(oe,gY)}),At&&$a(oe,yt),Je}function an(oe,te,ue,xe){if(typeof ue=="object"&&ue!==null&&ue.type===S&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var Je=ue.key;te!==null;){if(te.key===Je){if(Je=ue.type,Je===S){if(te.tag===7){p(oe,te.sibling),xe=w(te,ue.props.children),xe.return=oe,oe=xe;break e}}else if(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===D&&nc(Je)===te.type){p(oe,te.sibling),xe=w(te,ue.props),Wf(xe,ue),xe.return=oe,oe=xe;break e}p(oe,te);break}else c(oe,te);te=te.sibling}ue.type===S?(xe=Xl(ue.props.children,oe.mode,xe,ue.key),xe.return=oe,oe=xe):(xe=cg(ue.type,ue.key,ue.props,null,oe.mode,xe),Wf(xe,ue),xe.return=oe,oe=xe)}return R(oe);case x:e:{for(Je=ue.key;te!==null;){if(te.key===Je)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){p(oe,te.sibling),xe=w(te,ue.children||[]),xe.return=oe,oe=xe;break e}else{p(oe,te);break}else c(oe,te);te=te.sibling}xe=kw(ue,oe.mode,xe),xe.return=oe,oe=xe}return R(oe);case D:return ue=nc(ue),an(oe,te,ue,xe)}if(H(ue))return Be(oe,te,ue,xe);if(G(ue)){if(Je=G(ue),typeof Je!="function")throw Error(r(150));return ue=Je.call(ue),et(oe,te,ue,xe)}if(typeof ue.then=="function")return an(oe,te,gg(ue),xe);if(ue.$$typeof===j)return an(oe,te,fg(oe,ue),xe);vg(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(p(oe,te.sibling),xe=w(te,ue),xe.return=oe,oe=xe):(p(oe,te),xe=Cw(ue,oe.mode,xe),xe.return=oe,oe=xe),R(oe)):p(oe,te)}return function(oe,te,ue,xe){try{Yf=0;var Je=an(oe,te,ue,xe);return Ou=null,Je}catch(Ge){if(Ge===Au||Ge===mg)throw Ge;var Lt=Ti(29,Ge,null,oe.mode);return Lt.lanes=xe,Lt.return=oe,Lt}}}var ic=fN(!0),pN=fN(!1),Es=!1;function Mw(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zw(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Is(s,c,p){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Ht&2)!==0){var w=g.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),g.pending=c,c=lg(s),WT(s,null,p),c}return sg(s,g,c,p),lg(s)}function Xf(s,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194048)!==0)){var g=c.lanes;g&=s.pendingLanes,p|=g,c.lanes=p,oi(s,p)}}function Lw(s,c){var p=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,p===g)){var w=null,_=null;if(p=p.firstBaseUpdate,p!==null){do{var R={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};_===null?w=_=R:_=_.next=R,p=p.next}while(p!==null);_===null?w=_=c:_=_.next=c}else w=_=c;p={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:_,shared:g.shared,callbacks:g.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=c}var Fw=!1;function Jf(){if(Fw){var s=Nu;if(s!==null)throw s}}function Qf(s,c,p,g){Fw=!1;var w=s.updateQueue;Es=!1;var _=w.firstBaseUpdate,R=w.lastBaseUpdate,M=w.shared.pending;if(M!==null){w.shared.pending=null;var Z=M,de=Z.next;Z.next=null,R===null?_=de:R.next=de,R=Z;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,M=ye.lastBaseUpdate,M!==R&&(M===null?ye.firstBaseUpdate=de:M.next=de,ye.lastBaseUpdate=Z))}if(_!==null){var _e=w.baseState;R=0,ye=de=Z=null,M=_;do{var fe=M.lane&-536870913,ge=fe!==M.lane;if(ge?(Tt&fe)===fe:(g&fe)===fe){fe!==0&&fe===Tu&&(Fw=!0),ye!==null&&(ye=ye.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Be=s,et=M;fe=c;var an=p;switch(et.tag){case 1:if(Be=et.payload,typeof Be=="function"){_e=Be.call(an,_e,fe);break e}_e=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=et.payload,fe=typeof Be=="function"?Be.call(an,_e,fe):Be,fe==null)break e;_e=h({},_e,fe);break e;case 2:Es=!0}}fe=M.callback,fe!==null&&(s.flags|=64,ge&&(s.flags|=8192),ge=w.callbacks,ge===null?w.callbacks=[fe]:ge.push(fe))}else ge={lane:fe,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ye===null?(de=ye=ge,Z=_e):ye=ye.next=ge,R|=fe;if(M=M.next,M===null){if(M=w.shared.pending,M===null)break;ge=M,M=ge.next,ge.next=null,w.lastBaseUpdate=ge,w.shared.pending=null}}while(!0);ye===null&&(Z=_e),w.baseState=Z,w.firstBaseUpdate=de,w.lastBaseUpdate=ye,_===null&&(w.shared.lanes=0),Os|=R,s.lanes=R,s.memoizedState=_e}}function mN(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function hN(s,c){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)mN(p[s],c)}var $u=P(null),yg=P(0);function gN(s,c){s=qa,O(yg,s),O($u,c),qa=s|c.baseLanes}function Uw(){O(yg,qa),O($u,$u.current)}function Vw(){qa=yg.current,U($u),U(yg)}var Ni=P(null),uo=null;function Rs(s){var c=s.alternate;O(Bn,Bn.current&1),O(Ni,s),uo===null&&(c===null||$u.current!==null||c.memoizedState!==null)&&(uo=s)}function Bw(s){O(Bn,Bn.current),O(Ni,s),uo===null&&(uo=s)}function vN(s){s.tag===22?(O(Bn,Bn.current),O(Ni,s),uo===null&&(uo=s)):Ts()}function Ts(){O(Bn,Bn.current),O(Ni,Ni.current)}function Ai(s){U(Ni),uo===s&&(uo=null),U(Bn)}var Bn=P(0);function bg(s){for(var c=s;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||YS(p)||WS(p)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Ma=0,mt=null,rn=null,Jn=null,xg=!1,Du=!1,oc=!1,wg=0,ep=0,Pu=null,aZ=0;function Mn(){throw Error(r(321))}function Hw(s,c){if(c===null)return!1;for(var p=0;p<c.length&&p<s.length;p++)if(!Ri(s[p],c[p]))return!1;return!0}function qw(s,c,p,g,w,_){return Ma=_,mt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,z.H=s===null||s.memoizedState===null?eA:aS,oc=!1,_=p(g,w),oc=!1,Du&&(_=bN(c,p,g,w)),yN(s),_}function yN(s){z.H=rp;var c=rn!==null&&rn.next!==null;if(Ma=0,Jn=rn=mt=null,xg=!1,ep=0,Pu=null,c)throw Error(r(300));s===null||Qn||(s=s.dependencies,s!==null&&dg(s)&&(Qn=!0))}function bN(s,c,p,g){mt=s;var w=0;do{if(Du&&(Pu=null),ep=0,Du=!1,25<=w)throw Error(r(301));if(w+=1,Jn=rn=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}z.H=tA,_=c(p,g)}while(Du);return _}function sZ(){var s=z.H,c=s.useState()[0];return c=typeof c.then=="function"?tp(c):c,s=s.useState()[0],(rn!==null?rn.memoizedState:null)!==s&&(mt.flags|=1024),c}function Kw(){var s=wg!==0;return wg=0,s}function Gw(s,c,p){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~p}function Zw(s){if(xg){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}xg=!1}Ma=0,Jn=rn=mt=null,Du=!1,ep=wg=0,Pu=null}function Ur(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jn===null?mt.memoizedState=Jn=s:Jn=Jn.next=s,Jn}function Hn(){if(rn===null){var s=mt.alternate;s=s!==null?s.memoizedState:null}else s=rn.next;var c=Jn===null?mt.memoizedState:Jn.next;if(c!==null)Jn=c,rn=s;else{if(s===null)throw mt.alternate===null?Error(r(467)):Error(r(310));rn=s,s={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},Jn===null?mt.memoizedState=Jn=s:Jn=Jn.next=s}return Jn}function Sg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tp(s){var c=ep;return ep+=1,Pu===null&&(Pu=[]),s=cN(Pu,s,c),c=mt,(Jn===null?c.memoizedState:Jn.next)===null&&(c=c.alternate,z.H=c===null||c.memoizedState===null?eA:aS),s}function _g(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return tp(s);if(s.$$typeof===j)return Sr(s)}throw Error(r(438,String(s)))}function Yw(s){var c=null,p=mt.updateQueue;if(p!==null&&(c=p.memoCache),c==null){var g=mt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),p===null&&(p=Sg(),mt.updateQueue=p),p.memoCache=c,p=c.data[c.index],p===void 0)for(p=c.data[c.index]=Array(s),g=0;g<s;g++)p[g]=q;return c.index++,p}function za(s,c){return typeof c=="function"?c(s):c}function Cg(s){var c=Hn();return Ww(c,rn,s)}function Ww(s,c,p){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=p;var w=s.baseQueue,_=g.pending;if(_!==null){if(w!==null){var R=w.next;w.next=_.next,_.next=R}c.baseQueue=w=_,g.pending=null}if(_=s.baseState,w===null)s.memoizedState=_;else{c=w.next;var M=R=null,Z=null,de=c,ye=!1;do{var _e=de.lane&-536870913;if(_e!==de.lane?(Tt&_e)===_e:(Ma&_e)===_e){var fe=de.revertLane;if(fe===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),_e===Tu&&(ye=!0);else if((Ma&fe)===fe){de=de.next,fe===Tu&&(ye=!0);continue}else _e={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Z===null?(M=Z=_e,R=_):Z=Z.next=_e,mt.lanes|=fe,Os|=fe;_e=de.action,oc&&p(_,_e),_=de.hasEagerState?de.eagerState:p(_,_e)}else fe={lane:_e,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Z===null?(M=Z=fe,R=_):Z=Z.next=fe,mt.lanes|=_e,Os|=_e;de=de.next}while(de!==null&&de!==c);if(Z===null?R=_:Z.next=M,!Ri(_,s.memoizedState)&&(Qn=!0,ye&&(p=Nu,p!==null)))throw p;s.memoizedState=_,s.baseState=R,s.baseQueue=Z,g.lastRenderedState=_}return w===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Xw(s){var c=Hn(),p=c.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var g=p.dispatch,w=p.pending,_=c.memoizedState;if(w!==null){p.pending=null;var R=w=w.next;do _=s(_,R.action),R=R.next;while(R!==w);Ri(_,c.memoizedState)||(Qn=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),p.lastRenderedState=_}return[_,g]}function xN(s,c,p){var g=mt,w=Hn(),_=At;if(_){if(p===void 0)throw Error(r(407));p=p()}else p=c();var R=!Ri((rn||w).memoizedState,p);if(R&&(w.memoizedState=p,Qn=!0),w=w.queue,eS(_N.bind(null,g,w,s),[s]),w.getSnapshot!==c||R||Jn!==null&&Jn.memoizedState.tag&1){if(g.flags|=2048,Mu(9,{destroy:void 0},SN.bind(null,g,w,p,c),null),mn===null)throw Error(r(349));_||(Ma&127)!==0||wN(g,c,p)}return p}function wN(s,c,p){s.flags|=16384,s={getSnapshot:c,value:p},c=mt.updateQueue,c===null?(c=Sg(),mt.updateQueue=c,c.stores=[s]):(p=c.stores,p===null?c.stores=[s]:p.push(s))}function SN(s,c,p,g){c.value=p,c.getSnapshot=g,CN(c)&&kN(s)}function _N(s,c,p){return p(function(){CN(c)&&kN(s)})}function CN(s){var c=s.getSnapshot;s=s.value;try{var p=c();return!Ri(s,p)}catch{return!0}}function kN(s){var c=Wl(s,2);c!==null&&pi(c,s,2)}function Jw(s){var c=Ur();if(typeof s=="function"){var p=s;if(s=p(),oc){fn(!0);try{p()}finally{fn(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:s},c}function EN(s,c,p,g){return s.baseState=p,Ww(s,rn,typeof g=="function"?g:za)}function lZ(s,c,p,g,w){if(jg(s))throw Error(r(485));if(s=c.action,s!==null){var _={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){_.listeners.push(R)}};z.T!==null?p(!0):_.isTransition=!1,g(_),p=c.pending,p===null?(_.next=c.pending=_,jN(c,_)):(_.next=p.next,c.pending=p.next=_)}}function jN(s,c){var p=c.action,g=c.payload,w=s.state;if(c.isTransition){var _=z.T,R={};z.T=R;try{var M=p(w,g),Z=z.S;Z!==null&&Z(R,M),IN(s,c,M)}catch(de){Qw(s,c,de)}finally{_!==null&&R.types!==null&&(_.types=R.types),z.T=_}}else try{_=p(w,g),IN(s,c,_)}catch(de){Qw(s,c,de)}}function IN(s,c,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(g){RN(s,c,g)},function(g){return Qw(s,c,g)}):RN(s,c,p)}function RN(s,c,p){c.status="fulfilled",c.value=p,TN(c),s.state=p,c=s.pending,c!==null&&(p=c.next,p===c?s.pending=null:(p=p.next,c.next=p,jN(s,p)))}function Qw(s,c,p){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=p,TN(c),c=c.next;while(c!==g)}s.action=null}function TN(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function NN(s,c){return c}function AN(s,c){if(At){var p=mn.formState;if(p!==null){e:{var g=mt;if(At){if(kn){t:{for(var w=kn,_=co;w.nodeType!==8;){if(!_){w=null;break t}if(w=fo(w.nextSibling),w===null){w=null;break t}}_=w.data,w=_==="F!"||_==="F"?w:null}if(w){kn=fo(w.nextSibling),g=w.data==="F!";break e}}Cs(g)}g=!1}g&&(c=p[0])}}return p=Ur(),p.memoizedState=p.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:NN,lastRenderedState:c},p.queue=g,p=XN.bind(null,mt,g),g.dispatch=p,g=Jw(!1),_=oS.bind(null,mt,!1,g.queue),g=Ur(),w={state:c,dispatch:null,action:s,pending:null},g.queue=w,p=lZ.bind(null,mt,w,_,p),w.dispatch=p,g.memoizedState=s,[c,p,!1]}function ON(s){var c=Hn();return $N(c,rn,s)}function $N(s,c,p){if(c=Ww(s,c,NN)[0],s=Cg(za)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=tp(c)}catch(R){throw R===Au?mg:R}else g=c;c=Hn();var w=c.queue,_=w.dispatch;return p!==c.memoizedState&&(mt.flags|=2048,Mu(9,{destroy:void 0},cZ.bind(null,w,p),null)),[g,_,s]}function cZ(s,c){s.action=c}function DN(s){var c=Hn(),p=rn;if(p!==null)return $N(c,p,s);Hn(),c=c.memoizedState,p=Hn();var g=p.queue.dispatch;return p.memoizedState=s,[c,g,!1]}function Mu(s,c,p,g){return s={tag:s,create:p,deps:g,inst:c,next:null},c=mt.updateQueue,c===null&&(c=Sg(),mt.updateQueue=c),p=c.lastEffect,p===null?c.lastEffect=s.next=s:(g=p.next,p.next=s,s.next=g,c.lastEffect=s),s}function PN(){return Hn().memoizedState}function kg(s,c,p,g){var w=Ur();mt.flags|=s,w.memoizedState=Mu(1|c,{destroy:void 0},p,g===void 0?null:g)}function Eg(s,c,p,g){var w=Hn();g=g===void 0?null:g;var _=w.memoizedState.inst;rn!==null&&g!==null&&Hw(g,rn.memoizedState.deps)?w.memoizedState=Mu(c,_,p,g):(mt.flags|=s,w.memoizedState=Mu(1|c,_,p,g))}function MN(s,c){kg(8390656,8,s,c)}function eS(s,c){Eg(2048,8,s,c)}function uZ(s){mt.flags|=4;var c=mt.updateQueue;if(c===null)c=Sg(),mt.updateQueue=c,c.events=[s];else{var p=c.events;p===null?c.events=[s]:p.push(s)}}function zN(s){var c=Hn().memoizedState;return uZ({ref:c,nextImpl:s}),function(){if((Ht&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function LN(s,c){return Eg(4,2,s,c)}function FN(s,c){return Eg(4,4,s,c)}function UN(s,c){if(typeof c=="function"){s=s();var p=c(s);return function(){typeof p=="function"?p():c(null)}}if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function VN(s,c,p){p=p!=null?p.concat([s]):null,Eg(4,4,UN.bind(null,c,s),p)}function tS(){}function BN(s,c){var p=Hn();c=c===void 0?null:c;var g=p.memoizedState;return c!==null&&Hw(c,g[1])?g[0]:(p.memoizedState=[s,c],s)}function HN(s,c){var p=Hn();c=c===void 0?null:c;var g=p.memoizedState;if(c!==null&&Hw(c,g[1]))return g[0];if(g=s(),oc){fn(!0);try{s()}finally{fn(!1)}}return p.memoizedState=[g,c],g}function nS(s,c,p){return p===void 0||(Ma&1073741824)!==0&&(Tt&261930)===0?s.memoizedState=c:(s.memoizedState=p,s=qA(),mt.lanes|=s,Os|=s,p)}function qN(s,c,p,g){return Ri(p,c)?p:$u.current!==null?(s=nS(s,p,g),Ri(s,c)||(Qn=!0),s):(Ma&42)===0||(Ma&1073741824)!==0&&(Tt&261930)===0?(Qn=!0,s.memoizedState=p):(s=qA(),mt.lanes|=s,Os|=s,c)}function KN(s,c,p,g,w){var _=W.p;W.p=_!==0&&8>_?_:8;var R=z.T,M={};z.T=M,oS(s,!1,c,p);try{var Z=w(),de=z.S;if(de!==null&&de(M,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ye=oZ(Z,g);np(s,c,ye,Di(s))}else np(s,c,g,Di(s))}catch(_e){np(s,c,{then:function(){},status:"rejected",reason:_e},Di())}finally{W.p=_,R!==null&&M.types!==null&&(R.types=M.types),z.T=R}}function dZ(){}function rS(s,c,p,g){if(s.tag!==5)throw Error(r(476));var w=GN(s).queue;KN(s,w,c,L,p===null?dZ:function(){return ZN(s),p(g)})}function GN(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:L},next:null};var p={};return c.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:p},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function ZN(s){var c=GN(s);c.next===null&&(c=s.alternate.memoizedState),np(s,c.next.queue,{},Di())}function iS(){return Sr(bp)}function YN(){return Hn().memoizedState}function WN(){return Hn().memoizedState}function fZ(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var p=Di();s=js(p);var g=Is(c,s,p);g!==null&&(pi(g,c,p),Xf(g,c,p)),c={cache:Ow()},s.payload=c;return}c=c.return}}function pZ(s,c,p){var g=Di();p={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},jg(s)?JN(c,p):(p=Sw(s,c,p,g),p!==null&&(pi(p,s,g),QN(p,c,g)))}function XN(s,c,p){var g=Di();np(s,c,p,g)}function np(s,c,p,g){var w={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(jg(s))JN(c,w);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var R=c.lastRenderedState,M=_(R,p);if(w.hasEagerState=!0,w.eagerState=M,Ri(M,R))return sg(s,c,w,0),mn===null&&ag(),!1}catch{}if(p=Sw(s,c,w,g),p!==null)return pi(p,s,g),QN(p,c,g),!0}return!1}function oS(s,c,p,g){if(g={lane:2,revertLane:MS(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},jg(s)){if(c)throw Error(r(479))}else c=Sw(s,p,g,2),c!==null&&pi(c,s,2)}function jg(s){var c=s.alternate;return s===mt||c!==null&&c===mt}function JN(s,c){Du=xg=!0;var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}function QN(s,c,p){if((p&4194048)!==0){var g=c.lanes;g&=s.pendingLanes,p|=g,c.lanes=p,oi(s,p)}}var rp={readContext:Sr,use:_g,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useLayoutEffect:Mn,useInsertionEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useSyncExternalStore:Mn,useId:Mn,useHostTransitionStatus:Mn,useFormState:Mn,useActionState:Mn,useOptimistic:Mn,useMemoCache:Mn,useCacheRefresh:Mn};rp.useEffectEvent=Mn;var eA={readContext:Sr,use:_g,useCallback:function(s,c){return Ur().memoizedState=[s,c===void 0?null:c],s},useContext:Sr,useEffect:MN,useImperativeHandle:function(s,c,p){p=p!=null?p.concat([s]):null,kg(4194308,4,UN.bind(null,c,s),p)},useLayoutEffect:function(s,c){return kg(4194308,4,s,c)},useInsertionEffect:function(s,c){kg(4,2,s,c)},useMemo:function(s,c){var p=Ur();c=c===void 0?null:c;var g=s();if(oc){fn(!0);try{s()}finally{fn(!1)}}return p.memoizedState=[g,c],g},useReducer:function(s,c,p){var g=Ur();if(p!==void 0){var w=p(c);if(oc){fn(!0);try{p(c)}finally{fn(!1)}}}else w=c;return g.memoizedState=g.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},g.queue=s,s=s.dispatch=pZ.bind(null,mt,s),[g.memoizedState,s]},useRef:function(s){var c=Ur();return s={current:s},c.memoizedState=s},useState:function(s){s=Jw(s);var c=s.queue,p=XN.bind(null,mt,c);return c.dispatch=p,[s.memoizedState,p]},useDebugValue:tS,useDeferredValue:function(s,c){var p=Ur();return nS(p,s,c)},useTransition:function(){var s=Jw(!1);return s=KN.bind(null,mt,s.queue,!0,!1),Ur().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,p){var g=mt,w=Ur();if(At){if(p===void 0)throw Error(r(407));p=p()}else{if(p=c(),mn===null)throw Error(r(349));(Tt&127)!==0||wN(g,c,p)}w.memoizedState=p;var _={value:p,getSnapshot:c};return w.queue=_,MN(_N.bind(null,g,_,s),[s]),g.flags|=2048,Mu(9,{destroy:void 0},SN.bind(null,g,_,p,c),null),p},useId:function(){var s=Ur(),c=mn.identifierPrefix;if(At){var p=na,g=ta;p=(g&~(1<<32-kt(g)-1)).toString(32)+p,c="_"+c+"R_"+p,p=wg++,0<p&&(c+="H"+p.toString(32)),c+="_"}else p=aZ++,c="_"+c+"r_"+p.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:iS,useFormState:AN,useActionState:AN,useOptimistic:function(s){var c=Ur();c.memoizedState=c.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=p,c=oS.bind(null,mt,!0,p),p.dispatch=c,[s,c]},useMemoCache:Yw,useCacheRefresh:function(){return Ur().memoizedState=fZ.bind(null,mt)},useEffectEvent:function(s){var c=Ur(),p={impl:s};return c.memoizedState=p,function(){if((Ht&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},aS={readContext:Sr,use:_g,useCallback:BN,useContext:Sr,useEffect:eS,useImperativeHandle:VN,useInsertionEffect:LN,useLayoutEffect:FN,useMemo:HN,useReducer:Cg,useRef:PN,useState:function(){return Cg(za)},useDebugValue:tS,useDeferredValue:function(s,c){var p=Hn();return qN(p,rn.memoizedState,s,c)},useTransition:function(){var s=Cg(za)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:tp(s),c]},useSyncExternalStore:xN,useId:YN,useHostTransitionStatus:iS,useFormState:ON,useActionState:ON,useOptimistic:function(s,c){var p=Hn();return EN(p,rn,s,c)},useMemoCache:Yw,useCacheRefresh:WN};aS.useEffectEvent=zN;var tA={readContext:Sr,use:_g,useCallback:BN,useContext:Sr,useEffect:eS,useImperativeHandle:VN,useInsertionEffect:LN,useLayoutEffect:FN,useMemo:HN,useReducer:Xw,useRef:PN,useState:function(){return Xw(za)},useDebugValue:tS,useDeferredValue:function(s,c){var p=Hn();return rn===null?nS(p,s,c):qN(p,rn.memoizedState,s,c)},useTransition:function(){var s=Xw(za)[0],c=Hn().memoizedState;return[typeof s=="boolean"?s:tp(s),c]},useSyncExternalStore:xN,useId:YN,useHostTransitionStatus:iS,useFormState:DN,useActionState:DN,useOptimistic:function(s,c){var p=Hn();return rn!==null?EN(p,rn,s,c):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:Yw,useCacheRefresh:WN};tA.useEffectEvent=zN;function sS(s,c,p,g){c=s.memoizedState,p=p(g,c),p=p==null?c:h({},c,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var lS={enqueueSetState:function(s,c,p){s=s._reactInternals;var g=Di(),w=js(g);w.payload=c,p!=null&&(w.callback=p),c=Is(s,w,g),c!==null&&(pi(c,s,g),Xf(c,s,g))},enqueueReplaceState:function(s,c,p){s=s._reactInternals;var g=Di(),w=js(g);w.tag=1,w.payload=c,p!=null&&(w.callback=p),c=Is(s,w,g),c!==null&&(pi(c,s,g),Xf(c,s,g))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var p=Di(),g=js(p);g.tag=2,c!=null&&(g.callback=c),c=Is(s,g,p),c!==null&&(pi(c,s,p),Xf(c,s,p))}};function nA(s,c,p,g,w,_,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,_,R):c.prototype&&c.prototype.isPureReactComponent?!Bf(p,g)||!Bf(w,_):!0}function rA(s,c,p,g){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,g),c.state!==s&&lS.enqueueReplaceState(c,c.state,null)}function ac(s,c){var p=c;if("ref"in c){p={};for(var g in c)g!=="ref"&&(p[g]=c[g])}if(s=s.defaultProps){p===c&&(p=h({},p));for(var w in s)p[w]===void 0&&(p[w]=s[w])}return p}function iA(s){og(s)}function oA(s){console.error(s)}function aA(s){og(s)}function Ig(s,c){try{var p=s.onUncaughtError;p(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function sA(s,c,p){try{var g=s.onCaughtError;g(p.value,{componentStack:p.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function cS(s,c,p){return p=js(p),p.tag=3,p.payload={element:null},p.callback=function(){Ig(s,c)},p}function lA(s){return s=js(s),s.tag=3,s}function cA(s,c,p,g){var w=p.type.getDerivedStateFromError;if(typeof w=="function"){var _=g.value;s.payload=function(){return w(_)},s.callback=function(){sA(c,p,g)}}var R=p.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(s.callback=function(){sA(c,p,g),typeof w!="function"&&($s===null?$s=new Set([this]):$s.add(this));var M=g.stack;this.componentDidCatch(g.value,{componentStack:M!==null?M:""})})}function mZ(s,c,p,g,w){if(p.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=p.alternate,c!==null&&Ru(c,p,w,!0),p=Ni.current,p!==null){switch(p.tag){case 31:case 13:return uo===null?Fg():p.alternate===null&&zn===0&&(zn=3),p.flags&=-257,p.flags|=65536,p.lanes=w,g===hg?p.flags|=16384:(c=p.updateQueue,c===null?p.updateQueue=new Set([g]):c.add(g),$S(s,g,w)),!1;case 22:return p.flags|=65536,g===hg?p.flags|=16384:(c=p.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},p.updateQueue=c):(p=c.retryQueue,p===null?c.retryQueue=new Set([g]):p.add(g)),$S(s,g,w)),!1}throw Error(r(435,p.tag))}return $S(s,g,w),Fg(),!1}if(At)return c=Ni.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,g!==Iw&&(s=Error(r(422),{cause:g}),Kf(ao(s,p)))):(g!==Iw&&(c=Error(r(423),{cause:g}),Kf(ao(c,p))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,g=ao(g,p),w=cS(s.stateNode,g,w),Lw(s,w),zn!==4&&(zn=2)),!1;var _=Error(r(520),{cause:g});if(_=ao(_,p),dp===null?dp=[_]:dp.push(_),zn!==4&&(zn=2),c===null)return!0;g=ao(g,p),p=c;do{switch(p.tag){case 3:return p.flags|=65536,s=w&-w,p.lanes|=s,s=cS(p.stateNode,g,s),Lw(p,s),!1;case 1:if(c=p.type,_=p.stateNode,(p.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&($s===null||!$s.has(_))))return p.flags|=65536,w&=-w,p.lanes|=w,w=lA(w),cA(w,s,p,g),Lw(p,w),!1}p=p.return}while(p!==null);return!1}var uS=Error(r(461)),Qn=!1;function _r(s,c,p,g){c.child=s===null?pN(c,null,p,g):ic(c,s.child,p,g)}function uA(s,c,p,g,w){p=p.render;var _=c.ref;if("ref"in g){var R={};for(var M in g)M!=="ref"&&(R[M]=g[M])}else R=g;return ec(c),g=qw(s,c,p,R,_,w),M=Kw(),s!==null&&!Qn?(Gw(s,c,w),La(s,c,w)):(At&&M&&Ew(c),c.flags|=1,_r(s,c,g,w),c.child)}function dA(s,c,p,g,w){if(s===null){var _=p.type;return typeof _=="function"&&!_w(_)&&_.defaultProps===void 0&&p.compare===null?(c.tag=15,c.type=_,fA(s,c,_,g,w)):(s=cg(p.type,null,g,c,c.mode,w),s.ref=c.ref,s.return=c,c.child=s)}if(_=s.child,!yS(s,w)){var R=_.memoizedProps;if(p=p.compare,p=p!==null?p:Bf,p(R,g)&&s.ref===c.ref)return La(s,c,w)}return c.flags|=1,s=Oa(_,g),s.ref=c.ref,s.return=c,c.child=s}function fA(s,c,p,g,w){if(s!==null){var _=s.memoizedProps;if(Bf(_,g)&&s.ref===c.ref)if(Qn=!1,c.pendingProps=g=_,yS(s,w))(s.flags&131072)!==0&&(Qn=!0);else return c.lanes=s.lanes,La(s,c,w)}return dS(s,c,p,g,w)}function pA(s,c,p,g){var w=g.children,_=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(_=_!==null?_.baseLanes|p:p,s!==null){for(g=c.child=s.child,w=0;g!==null;)w=w|g.lanes|g.childLanes,g=g.sibling;g=w&~_}else g=0,c.child=null;return mA(s,c,_,p,g)}if((p&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&pg(c,_!==null?_.cachePool:null),_!==null?gN(c,_):Uw(),vN(c);else return g=c.lanes=536870912,mA(s,c,_!==null?_.baseLanes|p:p,p,g)}else _!==null?(pg(c,_.cachePool),gN(c,_),Ts(),c.memoizedState=null):(s!==null&&pg(c,null),Uw(),Ts());return _r(s,c,w,p),c.child}function ip(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function mA(s,c,p,g,w){var _=Dw();return _=_===null?null:{parent:Xn._currentValue,pool:_},c.memoizedState={baseLanes:p,cachePool:_},s!==null&&pg(c,null),Uw(),vN(c),s!==null&&Ru(s,c,g,!0),c.childLanes=w,null}function Rg(s,c){return c=Ng({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function hA(s,c,p){return ic(c,s.child,null,p),s=Rg(c,c.pendingProps),s.flags|=2,Ai(c),c.memoizedState=null,s}function hZ(s,c,p){var g=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(At){if(g.mode==="hidden")return s=Rg(c,g),c.lanes=536870912,ip(null,s);if(Bw(c),(s=kn)?(s=jO(s,co),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ss!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},p=JT(s),p.return=c,c.child=p,wr=c,kn=null)):s=null,s===null)throw Cs(c);return c.lanes=536870912,null}return Rg(c,g)}var _=s.memoizedState;if(_!==null){var R=_.dehydrated;if(Bw(c),w)if(c.flags&256)c.flags&=-257,c=hA(s,c,p);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(Qn||Ru(s,c,p,!1),w=(p&s.childLanes)!==0,Qn||w){if(g=mn,g!==null&&(R=ai(g,p),R!==0&&R!==_.retryLane))throw _.retryLane=R,Wl(s,R),pi(g,s,R),uS;Fg(),c=hA(s,c,p)}else s=_.treeContext,kn=fo(R.nextSibling),wr=c,At=!0,_s=null,co=!1,s!==null&&tN(c,s),c=Rg(c,g),c.flags|=4096;return c}return s=Oa(s.child,{mode:g.mode,children:g.children}),s.ref=c.ref,c.child=s,s.return=c,s}function Tg(s,c){var p=c.ref;if(p===null)s!==null&&s.ref!==null&&(c.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(c.flags|=4194816)}}function dS(s,c,p,g,w){return ec(c),p=qw(s,c,p,g,void 0,w),g=Kw(),s!==null&&!Qn?(Gw(s,c,w),La(s,c,w)):(At&&g&&Ew(c),c.flags|=1,_r(s,c,p,w),c.child)}function gA(s,c,p,g,w,_){return ec(c),c.updateQueue=null,p=bN(c,g,p,w),yN(s),g=Kw(),s!==null&&!Qn?(Gw(s,c,_),La(s,c,_)):(At&&g&&Ew(c),c.flags|=1,_r(s,c,p,_),c.child)}function vA(s,c,p,g,w){if(ec(c),c.stateNode===null){var _=ku,R=p.contextType;typeof R=="object"&&R!==null&&(_=Sr(R)),_=new p(g,_),c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=lS,c.stateNode=_,_._reactInternals=c,_=c.stateNode,_.props=g,_.state=c.memoizedState,_.refs={},Mw(c),R=p.contextType,_.context=typeof R=="object"&&R!==null?Sr(R):ku,_.state=c.memoizedState,R=p.getDerivedStateFromProps,typeof R=="function"&&(sS(c,p,R,g),_.state=c.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(R=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),R!==_.state&&lS.enqueueReplaceState(_,_.state,null),Qf(c,g,_,w),Jf(),_.state=c.memoizedState),typeof _.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(s===null){_=c.stateNode;var M=c.memoizedProps,Z=ac(p,M);_.props=Z;var de=_.context,ye=p.contextType;R=ku,typeof ye=="object"&&ye!==null&&(R=Sr(ye));var _e=p.getDerivedStateFromProps;ye=typeof _e=="function"||typeof _.getSnapshotBeforeUpdate=="function",M=c.pendingProps!==M,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(M||de!==R)&&rA(c,_,g,R),Es=!1;var fe=c.memoizedState;_.state=fe,Qf(c,g,_,w),Jf(),de=c.memoizedState,M||fe!==de||Es?(typeof _e=="function"&&(sS(c,p,_e,g),de=c.memoizedState),(Z=Es||nA(c,p,Z,g,fe,de,R))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=de),_.props=g,_.state=de,_.context=R,g=Z):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{_=c.stateNode,zw(s,c),R=c.memoizedProps,ye=ac(p,R),_.props=ye,_e=c.pendingProps,fe=_.context,de=p.contextType,Z=ku,typeof de=="object"&&de!==null&&(Z=Sr(de)),M=p.getDerivedStateFromProps,(de=typeof M=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(R!==_e||fe!==Z)&&rA(c,_,g,Z),Es=!1,fe=c.memoizedState,_.state=fe,Qf(c,g,_,w),Jf();var ge=c.memoizedState;R!==_e||fe!==ge||Es||s!==null&&s.dependencies!==null&&dg(s.dependencies)?(typeof M=="function"&&(sS(c,p,M,g),ge=c.memoizedState),(ye=Es||nA(c,p,ye,g,fe,ge,Z)||s!==null&&s.dependencies!==null&&dg(s.dependencies))?(de||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(g,ge,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(g,ge,Z)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=ge),_.props=g,_.state=ge,_.context=Z,g=ye):(typeof _.componentDidUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||R===s.memoizedProps&&fe===s.memoizedState||(c.flags|=1024),g=!1)}return _=g,Tg(s,c),g=(c.flags&128)!==0,_||g?(_=c.stateNode,p=g&&typeof p.getDerivedStateFromError!="function"?null:_.render(),c.flags|=1,s!==null&&g?(c.child=ic(c,s.child,null,w),c.child=ic(c,null,p,w)):_r(s,c,p,w),c.memoizedState=_.state,s=c.child):s=La(s,c,w),s}function yA(s,c,p,g){return Jl(),c.flags|=256,_r(s,c,p,g),c.child}var fS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pS(s){return{baseLanes:s,cachePool:sN()}}function mS(s,c,p){return s=s!==null?s.childLanes&~p:0,c&&(s|=$i),s}function bA(s,c,p){var g=c.pendingProps,w=!1,_=(c.flags&128)!==0,R;if((R=_)||(R=s!==null&&s.memoizedState===null?!1:(Bn.current&2)!==0),R&&(w=!0,c.flags&=-129),R=(c.flags&32)!==0,c.flags&=-33,s===null){if(At){if(w?Rs(c):Ts(),(s=kn)?(s=jO(s,co),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Ss!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},p=JT(s),p.return=c,c.child=p,wr=c,kn=null)):s=null,s===null)throw Cs(c);return WS(s)?c.lanes=32:c.lanes=536870912,null}var M=g.children;return g=g.fallback,w?(Ts(),w=c.mode,M=Ng({mode:"hidden",children:M},w),g=Xl(g,w,p,null),M.return=c,g.return=c,M.sibling=g,c.child=M,g=c.child,g.memoizedState=pS(p),g.childLanes=mS(s,R,p),c.memoizedState=fS,ip(null,g)):(Rs(c),hS(c,M))}var Z=s.memoizedState;if(Z!==null&&(M=Z.dehydrated,M!==null)){if(_)c.flags&256?(Rs(c),c.flags&=-257,c=gS(s,c,p)):c.memoizedState!==null?(Ts(),c.child=s.child,c.flags|=128,c=null):(Ts(),M=g.fallback,w=c.mode,g=Ng({mode:"visible",children:g.children},w),M=Xl(M,w,p,null),M.flags|=2,g.return=c,M.return=c,g.sibling=M,c.child=g,ic(c,s.child,null,p),g=c.child,g.memoizedState=pS(p),g.childLanes=mS(s,R,p),c.memoizedState=fS,c=ip(null,g));else if(Rs(c),WS(M)){if(R=M.nextSibling&&M.nextSibling.dataset,R)var de=R.dgst;R=de,g=Error(r(419)),g.stack="",g.digest=R,Kf({value:g,source:null,stack:null}),c=gS(s,c,p)}else if(Qn||Ru(s,c,p,!1),R=(p&s.childLanes)!==0,Qn||R){if(R=mn,R!==null&&(g=ai(R,p),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,Wl(s,g),pi(R,s,g),uS;YS(M)||Fg(),c=gS(s,c,p)}else YS(M)?(c.flags|=192,c.child=s.child,c=null):(s=Z.treeContext,kn=fo(M.nextSibling),wr=c,At=!0,_s=null,co=!1,s!==null&&tN(c,s),c=hS(c,g.children),c.flags|=4096);return c}return w?(Ts(),M=g.fallback,w=c.mode,Z=s.child,de=Z.sibling,g=Oa(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,de!==null?M=Oa(de,M):(M=Xl(M,w,p,null),M.flags|=2),M.return=c,g.return=c,g.sibling=M,c.child=g,ip(null,g),g=c.child,M=s.child.memoizedState,M===null?M=pS(p):(w=M.cachePool,w!==null?(Z=Xn._currentValue,w=w.parent!==Z?{parent:Z,pool:Z}:w):w=sN(),M={baseLanes:M.baseLanes|p,cachePool:w}),g.memoizedState=M,g.childLanes=mS(s,R,p),c.memoizedState=fS,ip(s.child,g)):(Rs(c),p=s.child,s=p.sibling,p=Oa(p,{mode:"visible",children:g.children}),p.return=c,p.sibling=null,s!==null&&(R=c.deletions,R===null?(c.deletions=[s],c.flags|=16):R.push(s)),c.child=p,c.memoizedState=null,p)}function hS(s,c){return c=Ng({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Ng(s,c){return s=Ti(22,s,null,c),s.lanes=0,s}function gS(s,c,p){return ic(c,s.child,null,p),s=hS(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function xA(s,c,p){s.lanes|=c;var g=s.alternate;g!==null&&(g.lanes|=c),Nw(s.return,c,p)}function vS(s,c,p,g,w,_){var R=s.memoizedState;R===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:p,tailMode:w,treeForkCount:_}:(R.isBackwards=c,R.rendering=null,R.renderingStartTime=0,R.last=g,R.tail=p,R.tailMode=w,R.treeForkCount=_)}function wA(s,c,p){var g=c.pendingProps,w=g.revealOrder,_=g.tail;g=g.children;var R=Bn.current,M=(R&2)!==0;if(M?(R=R&1|2,c.flags|=128):R&=1,O(Bn,R),_r(s,c,g,p),g=At?qf:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&xA(s,p,c);else if(s.tag===19)xA(s,p,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(p=c.child,w=null;p!==null;)s=p.alternate,s!==null&&bg(s)===null&&(w=p),p=p.sibling;p=w,p===null?(w=c.child,c.child=null):(w=p.sibling,p.sibling=null),vS(c,!1,w,p,_,g);break;case"backwards":case"unstable_legacy-backwards":for(p=null,w=c.child,c.child=null;w!==null;){if(s=w.alternate,s!==null&&bg(s)===null){c.child=w;break}s=w.sibling,w.sibling=p,p=w,w=s}vS(c,!0,p,null,_,g);break;case"together":vS(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function La(s,c,p){if(s!==null&&(c.dependencies=s.dependencies),Os|=c.lanes,(p&c.childLanes)===0)if(s!==null){if(Ru(s,c,p,!1),(p&c.childLanes)===0)return null}else return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,p=Oa(s,s.pendingProps),c.child=p,p.return=c;s.sibling!==null;)s=s.sibling,p=p.sibling=Oa(s,s.pendingProps),p.return=c;p.sibling=null}return c.child}function yS(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&dg(s)))}function gZ(s,c,p){switch(c.tag){case 3:le(c,c.stateNode.containerInfo),ks(c,Xn,s.memoizedState.cache),Jl();break;case 27:case 5:ke(c);break;case 4:le(c,c.stateNode.containerInfo);break;case 10:ks(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Bw(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Rs(c),c.flags|=128,null):(p&c.child.childLanes)!==0?bA(s,c,p):(Rs(c),s=La(s,c,p),s!==null?s.sibling:null);Rs(c);break;case 19:var w=(s.flags&128)!==0;if(g=(p&c.childLanes)!==0,g||(Ru(s,c,p,!1),g=(p&c.childLanes)!==0),w){if(g)return wA(s,c,p);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),O(Bn,Bn.current),g)break;return null;case 22:return c.lanes=0,pA(s,c,p,c.pendingProps);case 24:ks(c,Xn,s.memoizedState.cache)}return La(s,c,p)}function SA(s,c,p){if(s!==null)if(s.memoizedProps!==c.pendingProps)Qn=!0;else{if(!yS(s,p)&&(c.flags&128)===0)return Qn=!1,gZ(s,c,p);Qn=(s.flags&131072)!==0}else Qn=!1,At&&(c.flags&1048576)!==0&&eN(c,qf,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(s=nc(c.elementType),c.type=s,typeof s=="function")_w(s)?(g=ac(s,g),c.tag=1,c=vA(null,c,s,g,p)):(c.tag=0,c=dS(null,c,s,g,p));else{if(s!=null){var w=s.$$typeof;if(w===I){c.tag=11,c=uA(null,c,s,g,p);break e}else if(w===A){c.tag=14,c=dA(null,c,s,g,p);break e}}throw c=V(s)||s,Error(r(306,c,""))}}return c;case 0:return dS(s,c,c.type,c.pendingProps,p);case 1:return g=c.type,w=ac(g,c.pendingProps),vA(s,c,g,w,p);case 3:e:{if(le(c,c.stateNode.containerInfo),s===null)throw Error(r(387));g=c.pendingProps;var _=c.memoizedState;w=_.element,zw(s,c),Qf(c,g,null,p);var R=c.memoizedState;if(g=R.cache,ks(c,Xn,g),g!==_.cache&&Aw(c,[Xn],p,!0),Jf(),g=R.element,_.isDehydrated)if(_={element:g,isDehydrated:!1,cache:R.cache},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){c=yA(s,c,g,p);break e}else if(g!==w){w=ao(Error(r(424)),c),Kf(w),c=yA(s,c,g,p);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,kn=fo(s.firstChild),wr=c,At=!0,_s=null,co=!0,p=pN(c,null,g,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Jl(),g===w){c=La(s,c,p);break e}_r(s,c,g,p)}c=c.child}return c;case 26:return Tg(s,c),s===null?(p=OO(c.type,null,c.pendingProps,null))?c.memoizedState=p:At||(p=c.type,s=c.pendingProps,g=Gg(ve.current).createElement(p),g[xr]=c,g[si]=s,Cr(g,p,s),pr(g),c.stateNode=g):c.memoizedState=OO(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return ke(c),s===null&&At&&(g=c.stateNode=TO(c.type,c.pendingProps,ve.current),wr=c,co=!0,w=kn,zs(c.type)?(XS=w,kn=fo(g.firstChild)):kn=w),_r(s,c,c.pendingProps.children,p),Tg(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&At&&((w=g=kn)&&(g=KZ(g,c.type,c.pendingProps,co),g!==null?(c.stateNode=g,wr=c,kn=fo(g.firstChild),co=!1,w=!0):w=!1),w||Cs(c)),ke(c),w=c.type,_=c.pendingProps,R=s!==null?s.memoizedProps:null,g=_.children,KS(w,_)?g=null:R!==null&&KS(w,R)&&(c.flags|=32),c.memoizedState!==null&&(w=qw(s,c,sZ,null,null,p),bp._currentValue=w),Tg(s,c),_r(s,c,g,p),c.child;case 6:return s===null&&At&&((s=p=kn)&&(p=GZ(p,c.pendingProps,co),p!==null?(c.stateNode=p,wr=c,kn=null,s=!0):s=!1),s||Cs(c)),null;case 13:return bA(s,c,p);case 4:return le(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=ic(c,null,g,p):_r(s,c,g,p),c.child;case 11:return uA(s,c,c.type,c.pendingProps,p);case 7:return _r(s,c,c.pendingProps,p),c.child;case 8:return _r(s,c,c.pendingProps.children,p),c.child;case 12:return _r(s,c,c.pendingProps.children,p),c.child;case 10:return g=c.pendingProps,ks(c,c.type,g.value),_r(s,c,g.children,p),c.child;case 9:return w=c.type._context,g=c.pendingProps.children,ec(c),w=Sr(w),g=g(w),c.flags|=1,_r(s,c,g,p),c.child;case 14:return dA(s,c,c.type,c.pendingProps,p);case 15:return fA(s,c,c.type,c.pendingProps,p);case 19:return wA(s,c,p);case 31:return hZ(s,c,p);case 22:return pA(s,c,p,c.pendingProps);case 24:return ec(c),g=Sr(Xn),s===null?(w=Dw(),w===null&&(w=mn,_=Ow(),w.pooledCache=_,_.refCount++,_!==null&&(w.pooledCacheLanes|=p),w=_),c.memoizedState={parent:g,cache:w},Mw(c),ks(c,Xn,w)):((s.lanes&p)!==0&&(zw(s,c),Qf(c,null,null,p),Jf()),w=s.memoizedState,_=c.memoizedState,w.parent!==g?(w={parent:g,cache:g},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),ks(c,Xn,g)):(g=_.cache,ks(c,Xn,g),g!==w.cache&&Aw(c,[Xn],p,!0))),_r(s,c,c.pendingProps.children,p),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function Fa(s){s.flags|=4}function bS(s,c,p,g,w){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(YA())s.flags|=8192;else throw rc=hg,Pw}else s.flags&=-16777217}function _A(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!zO(c))if(YA())s.flags|=8192;else throw rc=hg,Pw}function Ag(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?fr():536870912,s.lanes|=c,Uu|=c)}function op(s,c){if(!At)switch(s.tailMode){case"hidden":c=s.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s.tail=null:p.sibling=null;break;case"collapsed":p=s.tail;for(var g=null;p!==null;)p.alternate!==null&&(g=p),p=p.sibling;g===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function En(s){var c=s.alternate!==null&&s.alternate.child===s.child,p=0,g=0;if(c)for(var w=s.child;w!==null;)p|=w.lanes|w.childLanes,g|=w.subtreeFlags&65011712,g|=w.flags&65011712,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)p|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=g,s.childLanes=p,c}function vZ(s,c,p){var g=c.pendingProps;switch(jw(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(c),null;case 1:return En(c),null;case 3:return p=c.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),Pa(Xn),Se(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Iu(c)?Fa(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Rw())),En(c),null;case 26:var w=c.type,_=c.memoizedState;return s===null?(Fa(c),_!==null?(En(c),_A(c,_)):(En(c),bS(c,w,null,g,p))):_?_!==s.memoizedState?(Fa(c),En(c),_A(c,_)):(En(c),c.flags&=-16777217):(s=s.memoizedProps,s!==g&&Fa(c),En(c),bS(c,w,s,g,p)),null;case 27:if(Pe(c),p=ve.current,w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return En(c),null}s=X.current,Iu(c)?nN(c):(s=TO(w,g,p),c.stateNode=s,Fa(c))}return En(c),null;case 5:if(Pe(c),w=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return En(c),null}if(_=X.current,Iu(c))nN(c);else{var R=Gg(ve.current);switch(_){case 1:_=R.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:_=R.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":_=R.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":_=R.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":_=R.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof g.is=="string"?R.createElement("select",{is:g.is}):R.createElement("select"),g.multiple?_.multiple=!0:g.size&&(_.size=g.size);break;default:_=typeof g.is=="string"?R.createElement(w,{is:g.is}):R.createElement(w)}}_[xr]=c,_[si]=g;e:for(R=c.child;R!==null;){if(R.tag===5||R.tag===6)_.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===c)break e;for(;R.sibling===null;){if(R.return===null||R.return===c)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}c.stateNode=_;e:switch(Cr(_,w,g),w){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Fa(c)}}return En(c),bS(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,p),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==g&&Fa(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(s=ve.current,Iu(c)){if(s=c.stateNode,p=c.memoizedProps,g=null,w=wr,w!==null)switch(w.tag){case 27:case 5:g=w.memoizedProps}s[xr]=c,s=!!(s.nodeValue===p||g!==null&&g.suppressHydrationWarning===!0||bO(s.nodeValue,p)),s||Cs(c,!0)}else s=Gg(s).createTextNode(g),s[xr]=c,c.stateNode=s}return En(c),null;case 31:if(p=c.memoizedState,s===null||s.memoizedState!==null){if(g=Iu(c),p!==null){if(s===null){if(!g)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[xr]=c}else Jl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),s=!1}else p=Rw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return c.flags&256?(Ai(c),c):(Ai(c),null);if((c.flags&128)!==0)throw Error(r(558))}return En(c),null;case 13:if(g=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=Iu(c),g!==null&&g.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[xr]=c}else Jl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),w=!1}else w=Rw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(Ai(c),c):(Ai(c),null)}return Ai(c),(c.flags&128)!==0?(c.lanes=p,c):(p=g!==null,s=s!==null&&s.memoizedState!==null,p&&(g=c.child,w=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(w=g.alternate.memoizedState.cachePool.pool),_=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(_=g.memoizedState.cachePool.pool),_!==w&&(g.flags|=2048)),p!==s&&p&&(c.child.flags|=8192),Ag(c,c.updateQueue),En(c),null);case 4:return Se(),s===null&&US(c.stateNode.containerInfo),En(c),null;case 10:return Pa(c.type),En(c),null;case 19:if(U(Bn),g=c.memoizedState,g===null)return En(c),null;if(w=(c.flags&128)!==0,_=g.rendering,_===null)if(w)op(g,!1);else{if(zn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(_=bg(s),_!==null){for(c.flags|=128,op(g,!1),s=_.updateQueue,c.updateQueue=s,Ag(c,s),c.subtreeFlags=0,s=p,p=c.child;p!==null;)XT(p,s),p=p.sibling;return O(Bn,Bn.current&1|2),At&&$a(c,g.treeForkCount),c.child}s=s.sibling}g.tail!==null&&ie()>Mg&&(c.flags|=128,w=!0,op(g,!1),c.lanes=4194304)}else{if(!w)if(s=bg(_),s!==null){if(c.flags|=128,w=!0,s=s.updateQueue,c.updateQueue=s,Ag(c,s),op(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!At)return En(c),null}else 2*ie()-g.renderingStartTime>Mg&&p!==536870912&&(c.flags|=128,w=!0,op(g,!1),c.lanes=4194304);g.isBackwards?(_.sibling=c.child,c.child=_):(s=g.last,s!==null?s.sibling=_:c.child=_,g.last=_)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=ie(),s.sibling=null,p=Bn.current,O(Bn,w?p&1|2:p&1),At&&$a(c,g.treeForkCount),s):(En(c),null);case 22:case 23:return Ai(c),Vw(),g=c.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(p&536870912)!==0&&(c.flags&128)===0&&(En(c),c.subtreeFlags&6&&(c.flags|=8192)):En(c),p=c.updateQueue,p!==null&&Ag(c,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048),s!==null&&U(tc),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),Pa(Xn),En(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function yZ(s,c){switch(jw(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Pa(Xn),Se(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return Pe(c),null;case 31:if(c.memoizedState!==null){if(Ai(c),c.alternate===null)throw Error(r(340));Jl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Ai(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Jl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return U(Bn),null;case 4:return Se(),null;case 10:return Pa(c.type),null;case 22:case 23:return Ai(c),Vw(),s!==null&&U(tc),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Pa(Xn),null;case 25:return null;default:return null}}function CA(s,c){switch(jw(c),c.tag){case 3:Pa(Xn),Se();break;case 26:case 27:case 5:Pe(c);break;case 4:Se();break;case 31:c.memoizedState!==null&&Ai(c);break;case 13:Ai(c);break;case 19:U(Bn);break;case 10:Pa(c.type);break;case 22:case 23:Ai(c),Vw(),s!==null&&U(tc);break;case 24:Pa(Xn)}}function ap(s,c){try{var p=c.updateQueue,g=p!==null?p.lastEffect:null;if(g!==null){var w=g.next;p=w;do{if((p.tag&s)===s){g=void 0;var _=p.create,R=p.inst;g=_(),R.destroy=g}p=p.next}while(p!==w)}}catch(M){Qt(c,c.return,M)}}function Ns(s,c,p){try{var g=c.updateQueue,w=g!==null?g.lastEffect:null;if(w!==null){var _=w.next;g=_;do{if((g.tag&s)===s){var R=g.inst,M=R.destroy;if(M!==void 0){R.destroy=void 0,w=c;var Z=p,de=M;try{de()}catch(ye){Qt(w,Z,ye)}}}g=g.next}while(g!==_)}}catch(ye){Qt(c,c.return,ye)}}function kA(s){var c=s.updateQueue;if(c!==null){var p=s.stateNode;try{hN(c,p)}catch(g){Qt(s,s.return,g)}}}function EA(s,c,p){p.props=ac(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(g){Qt(s,c,g)}}function sp(s,c){try{var p=s.ref;if(p!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof p=="function"?s.refCleanup=p(g):p.current=g}}catch(w){Qt(s,c,w)}}function ra(s,c){var p=s.ref,g=s.refCleanup;if(p!==null)if(typeof g=="function")try{g()}catch(w){Qt(s,c,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(w){Qt(s,c,w)}else p.current=null}function jA(s){var c=s.type,p=s.memoizedProps,g=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&g.focus();break e;case"img":p.src?g.src=p.src:p.srcSet&&(g.srcset=p.srcSet)}}catch(w){Qt(s,s.return,w)}}function xS(s,c,p){try{var g=s.stateNode;FZ(g,s.type,p,c),g[si]=c}catch(w){Qt(s,s.return,w)}}function IA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&zs(s.type)||s.tag===4}function wS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||IA(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&zs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function SS(s,c,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,c):(c=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,c.appendChild(s),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Na));else if(g!==4&&(g===27&&zs(s.type)&&(p=s.stateNode,c=null),s=s.child,s!==null))for(SS(s,c,p),s=s.sibling;s!==null;)SS(s,c,p),s=s.sibling}function Og(s,c,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?p.insertBefore(s,c):p.appendChild(s);else if(g!==4&&(g===27&&zs(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(Og(s,c,p),s=s.sibling;s!==null;)Og(s,c,p),s=s.sibling}function RA(s){var c=s.stateNode,p=s.memoizedProps;try{for(var g=s.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);Cr(c,g,p),c[xr]=s,c[si]=p}catch(_){Qt(s,s.return,_)}}var Ua=!1,er=!1,_S=!1,TA=typeof WeakSet=="function"?WeakSet:Set,mr=null;function bZ(s,c){if(s=s.containerInfo,HS=ev,s=VT(s),gw(s)){if("selectionStart"in s)var p={start:s.selectionStart,end:s.selectionEnd};else e:{p=(p=s.ownerDocument)&&p.defaultView||window;var g=p.getSelection&&p.getSelection();if(g&&g.rangeCount!==0){p=g.anchorNode;var w=g.anchorOffset,_=g.focusNode;g=g.focusOffset;try{p.nodeType,_.nodeType}catch{p=null;break e}var R=0,M=-1,Z=-1,de=0,ye=0,_e=s,fe=null;t:for(;;){for(var ge;_e!==p||w!==0&&_e.nodeType!==3||(M=R+w),_e!==_||g!==0&&_e.nodeType!==3||(Z=R+g),_e.nodeType===3&&(R+=_e.nodeValue.length),(ge=_e.firstChild)!==null;)fe=_e,_e=ge;for(;;){if(_e===s)break t;if(fe===p&&++de===w&&(M=R),fe===_&&++ye===g&&(Z=R),(ge=_e.nextSibling)!==null)break;_e=fe,fe=_e.parentNode}_e=ge}p=M===-1||Z===-1?null:{start:M,end:Z}}else p=null}p=p||{start:0,end:0}}else p=null;for(qS={focusedElem:s,selectionRange:p},ev=!1,mr=c;mr!==null;)if(c=mr,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,mr=s;else for(;mr!==null;){switch(c=mr,_=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(p=0;p<s.length;p++)w=s[p],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,p=c,w=_.memoizedProps,_=_.memoizedState,g=p.stateNode;try{var Be=ac(p.type,w);s=g.getSnapshotBeforeUpdate(Be,_),g.__reactInternalSnapshotBeforeUpdate=s}catch(et){Qt(p,p.return,et)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,p=s.nodeType,p===9)ZS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ZS(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=c.sibling,s!==null){s.return=c.return,mr=s;break}mr=c.return}}function NA(s,c,p){var g=p.flags;switch(p.tag){case 0:case 11:case 15:Ba(s,p),g&4&&ap(5,p);break;case 1:if(Ba(s,p),g&4)if(s=p.stateNode,c===null)try{s.componentDidMount()}catch(R){Qt(p,p.return,R)}else{var w=ac(p.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(w,c,s.__reactInternalSnapshotBeforeUpdate)}catch(R){Qt(p,p.return,R)}}g&64&&kA(p),g&512&&sp(p,p.return);break;case 3:if(Ba(s,p),g&64&&(s=p.updateQueue,s!==null)){if(c=null,p.child!==null)switch(p.child.tag){case 27:case 5:c=p.child.stateNode;break;case 1:c=p.child.stateNode}try{hN(s,c)}catch(R){Qt(p,p.return,R)}}break;case 27:c===null&&g&4&&RA(p);case 26:case 5:Ba(s,p),c===null&&g&4&&jA(p),g&512&&sp(p,p.return);break;case 12:Ba(s,p);break;case 31:Ba(s,p),g&4&&$A(s,p);break;case 13:Ba(s,p),g&4&&DA(s,p),g&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=IZ.bind(null,p),ZZ(s,p))));break;case 22:if(g=p.memoizedState!==null||Ua,!g){c=c!==null&&c.memoizedState!==null||er,w=Ua;var _=er;Ua=g,(er=c)&&!_?Ha(s,p,(p.subtreeFlags&8772)!==0):Ba(s,p),Ua=w,er=_}break;case 30:break;default:Ba(s,p)}}function AA(s){var c=s.alternate;c!==null&&(s.alternate=null,AA(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Q0(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Rn=null,ci=!1;function Va(s,c,p){for(p=p.child;p!==null;)OA(s,c,p),p=p.sibling}function OA(s,c,p){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Cn,p)}catch{}switch(p.tag){case 26:er||ra(p,c),Va(s,c,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:er||ra(p,c);var g=Rn,w=ci;zs(p.type)&&(Rn=p.stateNode,ci=!1),Va(s,c,p),gp(p.stateNode),Rn=g,ci=w;break;case 5:er||ra(p,c);case 6:if(g=Rn,w=ci,Rn=null,Va(s,c,p),Rn=g,ci=w,Rn!==null)if(ci)try{(Rn.nodeType===9?Rn.body:Rn.nodeName==="HTML"?Rn.ownerDocument.body:Rn).removeChild(p.stateNode)}catch(_){Qt(p,c,_)}else try{Rn.removeChild(p.stateNode)}catch(_){Qt(p,c,_)}break;case 18:Rn!==null&&(ci?(s=Rn,kO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),Yu(s)):kO(Rn,p.stateNode));break;case 4:g=Rn,w=ci,Rn=p.stateNode.containerInfo,ci=!0,Va(s,c,p),Rn=g,ci=w;break;case 0:case 11:case 14:case 15:Ns(2,p,c),er||Ns(4,p,c),Va(s,c,p);break;case 1:er||(ra(p,c),g=p.stateNode,typeof g.componentWillUnmount=="function"&&EA(p,c,g)),Va(s,c,p);break;case 21:Va(s,c,p);break;case 22:er=(g=er)||p.memoizedState!==null,Va(s,c,p),er=g;break;default:Va(s,c,p)}}function $A(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Yu(s)}catch(p){Qt(c,c.return,p)}}}function DA(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Yu(s)}catch(p){Qt(c,c.return,p)}}function xZ(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new TA),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new TA),c;default:throw Error(r(435,s.tag))}}function $g(s,c){var p=xZ(s);c.forEach(function(g){if(!p.has(g)){p.add(g);var w=RZ.bind(null,s,g);g.then(w,w)}})}function ui(s,c){var p=c.deletions;if(p!==null)for(var g=0;g<p.length;g++){var w=p[g],_=s,R=c,M=R;e:for(;M!==null;){switch(M.tag){case 27:if(zs(M.type)){Rn=M.stateNode,ci=!1;break e}break;case 5:Rn=M.stateNode,ci=!1;break e;case 3:case 4:Rn=M.stateNode.containerInfo,ci=!0;break e}M=M.return}if(Rn===null)throw Error(r(160));OA(_,R,w),Rn=null,ci=!1,_=w.alternate,_!==null&&(_.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)PA(c,s),c=c.sibling}var Mo=null;function PA(s,c){var p=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ui(c,s),di(s),g&4&&(Ns(3,s,s.return),ap(3,s),Ns(5,s,s.return));break;case 1:ui(c,s),di(s),g&512&&(er||p===null||ra(p,p.return)),g&64&&Ua&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(p=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=p===null?g:p.concat(g))));break;case 26:var w=Mo;if(ui(c,s),di(s),g&512&&(er||p===null||ra(p,p.return)),g&4){var _=p!==null?p.memoizedState:null;if(g=s.memoizedState,p===null)if(g===null)if(s.stateNode===null){e:{g=s.type,p=s.memoizedProps,w=w.ownerDocument||w;t:switch(g){case"title":_=w.getElementsByTagName("title")[0],(!_||_[$f]||_[xr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=w.createElement(g),w.head.insertBefore(_,w.querySelector("head > title"))),Cr(_,g,p),_[xr]=s,pr(_),g=_;break e;case"link":var R=PO("link","href",w).get(g+(p.href||""));if(R){for(var M=0;M<R.length;M++)if(_=R[M],_.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&_.getAttribute("rel")===(p.rel==null?null:p.rel)&&_.getAttribute("title")===(p.title==null?null:p.title)&&_.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){R.splice(M,1);break t}}_=w.createElement(g),Cr(_,g,p),w.head.appendChild(_);break;case"meta":if(R=PO("meta","content",w).get(g+(p.content||""))){for(M=0;M<R.length;M++)if(_=R[M],_.getAttribute("content")===(p.content==null?null:""+p.content)&&_.getAttribute("name")===(p.name==null?null:p.name)&&_.getAttribute("property")===(p.property==null?null:p.property)&&_.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&_.getAttribute("charset")===(p.charSet==null?null:p.charSet)){R.splice(M,1);break t}}_=w.createElement(g),Cr(_,g,p),w.head.appendChild(_);break;default:throw Error(r(468,g))}_[xr]=s,pr(_),g=_}s.stateNode=g}else MO(w,s.type,s.stateNode);else s.stateNode=DO(w,g,s.memoizedProps);else _!==g?(_===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):_.count--,g===null?MO(w,s.type,s.stateNode):DO(w,g,s.memoizedProps)):g===null&&s.stateNode!==null&&xS(s,s.memoizedProps,p.memoizedProps)}break;case 27:ui(c,s),di(s),g&512&&(er||p===null||ra(p,p.return)),p!==null&&g&4&&xS(s,s.memoizedProps,p.memoizedProps);break;case 5:if(ui(c,s),di(s),g&512&&(er||p===null||ra(p,p.return)),s.flags&32){w=s.stateNode;try{yu(w,"")}catch(Be){Qt(s,s.return,Be)}}g&4&&s.stateNode!=null&&(w=s.memoizedProps,xS(s,w,p!==null?p.memoizedProps:w)),g&1024&&(_S=!0);break;case 6:if(ui(c,s),di(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,p=s.stateNode;try{p.nodeValue=g}catch(Be){Qt(s,s.return,Be)}}break;case 3:if(Wg=null,w=Mo,Mo=Zg(c.containerInfo),ui(c,s),Mo=w,di(s),g&4&&p!==null&&p.memoizedState.isDehydrated)try{Yu(c.containerInfo)}catch(Be){Qt(s,s.return,Be)}_S&&(_S=!1,MA(s));break;case 4:g=Mo,Mo=Zg(s.stateNode.containerInfo),ui(c,s),di(s),Mo=g;break;case 12:ui(c,s),di(s);break;case 31:ui(c,s),di(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,$g(s,g)));break;case 13:ui(c,s),di(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(Pg=ie()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,$g(s,g)));break;case 22:w=s.memoizedState!==null;var Z=p!==null&&p.memoizedState!==null,de=Ua,ye=er;if(Ua=de||w,er=ye||Z,ui(c,s),er=ye,Ua=de,di(s),g&8192)e:for(c=s.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(p===null||Z||Ua||er||sc(s)),p=null,c=s;;){if(c.tag===5||c.tag===26){if(p===null){Z=p=c;try{if(_=Z.stateNode,w)R=_.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{M=Z.stateNode;var _e=Z.memoizedProps.style,fe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;M.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Be){Qt(Z,Z.return,Be)}}}else if(c.tag===6){if(p===null){Z=c;try{Z.stateNode.nodeValue=w?"":Z.memoizedProps}catch(Be){Qt(Z,Z.return,Be)}}}else if(c.tag===18){if(p===null){Z=c;try{var ge=Z.stateNode;w?EO(ge,!0):EO(Z.stateNode,!1)}catch(Be){Qt(Z,Z.return,Be)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;p===c&&(p=null),c=c.return}p===c&&(p=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=s.updateQueue,g!==null&&(p=g.retryQueue,p!==null&&(g.retryQueue=null,$g(s,p))));break;case 19:ui(c,s),di(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,$g(s,g)));break;case 30:break;case 21:break;default:ui(c,s),di(s)}}function di(s){var c=s.flags;if(c&2){try{for(var p,g=s.return;g!==null;){if(IA(g)){p=g;break}g=g.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var w=p.stateNode,_=wS(s);Og(s,_,w);break;case 5:var R=p.stateNode;p.flags&32&&(yu(R,""),p.flags&=-33);var M=wS(s);Og(s,M,R);break;case 3:case 4:var Z=p.stateNode.containerInfo,de=wS(s);SS(s,de,Z);break;default:throw Error(r(161))}}catch(ye){Qt(s,s.return,ye)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function MA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;MA(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function Ba(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)NA(s,c.alternate,c),c=c.sibling}function sc(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:Ns(4,c,c.return),sc(c);break;case 1:ra(c,c.return);var p=c.stateNode;typeof p.componentWillUnmount=="function"&&EA(c,c.return,p),sc(c);break;case 27:gp(c.stateNode);case 26:case 5:ra(c,c.return),sc(c);break;case 22:c.memoizedState===null&&sc(c);break;case 30:sc(c);break;default:sc(c)}s=s.sibling}}function Ha(s,c,p){for(p=p&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,w=s,_=c,R=_.flags;switch(_.tag){case 0:case 11:case 15:Ha(w,_,p),ap(4,_);break;case 1:if(Ha(w,_,p),g=_,w=g.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(de){Qt(g,g.return,de)}if(g=_,w=g.updateQueue,w!==null){var M=g.stateNode;try{var Z=w.shared.hiddenCallbacks;if(Z!==null)for(w.shared.hiddenCallbacks=null,w=0;w<Z.length;w++)mN(Z[w],M)}catch(de){Qt(g,g.return,de)}}p&&R&64&&kA(_),sp(_,_.return);break;case 27:RA(_);case 26:case 5:Ha(w,_,p),p&&g===null&&R&4&&jA(_),sp(_,_.return);break;case 12:Ha(w,_,p);break;case 31:Ha(w,_,p),p&&R&4&&$A(w,_);break;case 13:Ha(w,_,p),p&&R&4&&DA(w,_);break;case 22:_.memoizedState===null&&Ha(w,_,p),sp(_,_.return);break;case 30:break;default:Ha(w,_,p)}c=c.sibling}}function CS(s,c){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&Gf(p))}function kS(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Gf(s))}function zo(s,c,p,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)zA(s,c,p,g),c=c.sibling}function zA(s,c,p,g){var w=c.flags;switch(c.tag){case 0:case 11:case 15:zo(s,c,p,g),w&2048&&ap(9,c);break;case 1:zo(s,c,p,g);break;case 3:zo(s,c,p,g),w&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Gf(s)));break;case 12:if(w&2048){zo(s,c,p,g),s=c.stateNode;try{var _=c.memoizedProps,R=_.id,M=_.onPostCommit;typeof M=="function"&&M(R,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){Qt(c,c.return,Z)}}else zo(s,c,p,g);break;case 31:zo(s,c,p,g);break;case 13:zo(s,c,p,g);break;case 23:break;case 22:_=c.stateNode,R=c.alternate,c.memoizedState!==null?_._visibility&2?zo(s,c,p,g):lp(s,c):_._visibility&2?zo(s,c,p,g):(_._visibility|=2,zu(s,c,p,g,(c.subtreeFlags&10256)!==0||!1)),w&2048&&CS(R,c);break;case 24:zo(s,c,p,g),w&2048&&kS(c.alternate,c);break;default:zo(s,c,p,g)}}function zu(s,c,p,g,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var _=s,R=c,M=p,Z=g,de=R.flags;switch(R.tag){case 0:case 11:case 15:zu(_,R,M,Z,w),ap(8,R);break;case 23:break;case 22:var ye=R.stateNode;R.memoizedState!==null?ye._visibility&2?zu(_,R,M,Z,w):lp(_,R):(ye._visibility|=2,zu(_,R,M,Z,w)),w&&de&2048&&CS(R.alternate,R);break;case 24:zu(_,R,M,Z,w),w&&de&2048&&kS(R.alternate,R);break;default:zu(_,R,M,Z,w)}c=c.sibling}}function lp(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var p=s,g=c,w=g.flags;switch(g.tag){case 22:lp(p,g),w&2048&&CS(g.alternate,g);break;case 24:lp(p,g),w&2048&&kS(g.alternate,g);break;default:lp(p,g)}c=c.sibling}}var cp=8192;function Lu(s,c,p){if(s.subtreeFlags&cp)for(s=s.child;s!==null;)LA(s,c,p),s=s.sibling}function LA(s,c,p){switch(s.tag){case 26:Lu(s,c,p),s.flags&cp&&s.memoizedState!==null&&aY(p,Mo,s.memoizedState,s.memoizedProps);break;case 5:Lu(s,c,p);break;case 3:case 4:var g=Mo;Mo=Zg(s.stateNode.containerInfo),Lu(s,c,p),Mo=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=cp,cp=16777216,Lu(s,c,p),cp=g):Lu(s,c,p));break;default:Lu(s,c,p)}}function FA(s){var c=s.alternate;if(c!==null&&(s=c.child,s!==null)){c.child=null;do c=s.sibling,s.sibling=null,s=c;while(s!==null)}}function up(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var g=c[p];mr=g,VA(g,s)}FA(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)UA(s),s=s.sibling}function UA(s){switch(s.tag){case 0:case 11:case 15:up(s),s.flags&2048&&Ns(9,s,s.return);break;case 3:up(s);break;case 12:up(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,Dg(s)):up(s);break;default:up(s)}}function Dg(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var p=0;p<c.length;p++){var g=c[p];mr=g,VA(g,s)}FA(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:Ns(8,c,c.return),Dg(c);break;case 22:p=c.stateNode,p._visibility&2&&(p._visibility&=-3,Dg(c));break;default:Dg(c)}s=s.sibling}}function VA(s,c){for(;mr!==null;){var p=mr;switch(p.tag){case 0:case 11:case 15:Ns(8,p,c);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var g=p.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Gf(p.memoizedState.cache)}if(g=p.child,g!==null)g.return=p,mr=g;else e:for(p=s;mr!==null;){g=mr;var w=g.sibling,_=g.return;if(AA(g),g===p){mr=null;break e}if(w!==null){w.return=_,mr=w;break e}mr=_}}}var wZ={getCacheForType:function(s){var c=Sr(Xn),p=c.data.get(s);return p===void 0&&(p=s(),c.data.set(s,p)),p},cacheSignal:function(){return Sr(Xn).controller.signal}},SZ=typeof WeakMap=="function"?WeakMap:Map,Ht=0,mn=null,It=null,Tt=0,Jt=0,Oi=null,As=!1,Fu=!1,ES=!1,qa=0,zn=0,Os=0,lc=0,jS=0,$i=0,Uu=0,dp=null,fi=null,IS=!1,Pg=0,BA=0,Mg=1/0,zg=null,$s=null,sr=0,Ds=null,Vu=null,Ka=0,RS=0,TS=null,HA=null,fp=0,NS=null;function Di(){return(Ht&2)!==0&&Tt!==0?Tt&-Tt:z.T!==null?MS():X0()}function qA(){if($i===0)if((Tt&536870912)===0||At){var s=bs;bs<<=1,(bs&3932160)===0&&(bs=262144),$i=s}else $i=536870912;return s=Ni.current,s!==null&&(s.flags|=32),$i}function pi(s,c,p){(s===mn&&(Jt===2||Jt===9)||s.cancelPendingCommit!==null)&&(Bu(s,0),Ps(s,Tt,$i,!1)),pn(s,p),((Ht&2)===0||s!==mn)&&(s===mn&&((Ht&2)===0&&(lc|=p),zn===4&&Ps(s,Tt,$i,!1)),ia(s))}function KA(s,c,p){if((Ht&6)!==0)throw Error(r(327));var g=!p&&(c&127)===0&&(c&s.expiredLanes)===0||nn(s,c),w=g?kZ(s,c):OS(s,c,!0),_=g;do{if(w===0){Fu&&!g&&Ps(s,c,0,!1);break}else{if(p=s.current.alternate,_&&!_Z(p)){w=OS(s,c,!1),_=!1;continue}if(w===2){if(_=c,s.errorRecoveryDisabledLanes&_)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){c=R;e:{var M=s;w=dp;var Z=M.current.memoizedState.isDehydrated;if(Z&&(Bu(M,R).flags|=256),R=OS(M,R,!1),R!==2){if(ES&&!Z){M.errorRecoveryDisabledLanes|=_,lc|=_,w=4;break e}_=fi,fi=w,_!==null&&(fi===null?fi=_:fi.push.apply(fi,_))}w=R}if(_=!1,w!==2)continue}}if(w===1){Bu(s,0),Ps(s,c,0,!0);break}e:{switch(g=s,_=w,_){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:Ps(g,c,$i,!As);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(w=Pg+300-ie(),10<w)){if(Ps(g,c,$i,!As),Xe(g,0,!0)!==0)break e;Ka=c,g.timeoutHandle=_O(GA.bind(null,g,p,fi,zg,IS,c,$i,lc,Uu,As,_,"Throttled",-0,0),w);break e}GA(g,p,fi,zg,IS,c,$i,lc,Uu,As,_,null,-0,0)}}break}while(!0);ia(s)}function GA(s,c,p,g,w,_,R,M,Z,de,ye,_e,fe,ge){if(s.timeoutHandle=-1,_e=c.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Na},LA(c,_,_e);var Be=(_&62914560)===_?Pg-ie():(_&4194048)===_?BA-ie():0;if(Be=sY(_e,Be),Be!==null){Ka=_,s.cancelPendingCommit=Be(tO.bind(null,s,c,_,p,g,w,R,M,Z,ye,_e,null,fe,ge)),Ps(s,_,R,!de);return}}tO(s,c,_,p,g,w,R,M,Z)}function _Z(s){for(var c=s;;){var p=c.tag;if((p===0||p===11||p===15)&&c.flags&16384&&(p=c.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var g=0;g<p.length;g++){var w=p[g],_=w.getSnapshot;w=w.value;try{if(!Ri(_(),w))return!1}catch{return!1}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ps(s,c,p,g){c&=~jS,c&=~lc,s.suspendedLanes|=c,s.pingedLanes&=~c,g&&(s.warmLanes|=c),g=s.expirationTimes;for(var w=c;0<w;){var _=31-kt(w),R=1<<_;g[_]=-1,w&=~R}p!==0&&ql(s,p,c)}function Lg(){return(Ht&6)===0?(pp(0),!1):!0}function AS(){if(It!==null){if(Jt===0)var s=It.return;else s=It,Da=Ql=null,Zw(s),Ou=null,Yf=0,s=It;for(;s!==null;)CA(s.alternate,s),s=s.return;It=null}}function Bu(s,c){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,BZ(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),Ka=0,AS(),mn=s,It=p=Oa(s.current,null),Tt=c,Jt=0,Oi=null,As=!1,Fu=nn(s,c),ES=!1,Uu=$i=jS=lc=Os=zn=0,fi=dp=null,IS=!1,(c&8)!==0&&(c|=c&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=c;0<g;){var w=31-kt(g),_=1<<w;c|=s[w],g&=~_}return qa=c,ag(),p}function ZA(s,c){mt=null,z.H=rp,c===Au||c===mg?(c=uN(),Jt=3):c===Pw?(c=uN(),Jt=4):Jt=c===uS?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Oi=c,It===null&&(zn=1,Ig(s,ao(c,s.current)))}function YA(){var s=Ni.current;return s===null?!0:(Tt&4194048)===Tt?uo===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?s===uo:!1}function WA(){var s=z.H;return z.H=rp,s===null?rp:s}function XA(){var s=z.A;return z.A=wZ,s}function Fg(){zn=4,As||(Tt&4194048)!==Tt&&Ni.current!==null||(Fu=!0),(Os&134217727)===0&&(lc&134217727)===0||mn===null||Ps(mn,Tt,$i,!1)}function OS(s,c,p){var g=Ht;Ht|=2;var w=WA(),_=XA();(mn!==s||Tt!==c)&&(zg=null,Bu(s,c)),c=!1;var R=zn;e:do try{if(Jt!==0&&It!==null){var M=It,Z=Oi;switch(Jt){case 8:AS(),R=6;break e;case 3:case 2:case 9:case 6:Ni.current===null&&(c=!0);var de=Jt;if(Jt=0,Oi=null,Hu(s,M,Z,de),p&&Fu){R=0;break e}break;default:de=Jt,Jt=0,Oi=null,Hu(s,M,Z,de)}}CZ(),R=zn;break}catch(ye){ZA(s,ye)}while(!0);return c&&s.shellSuspendCounter++,Da=Ql=null,Ht=g,z.H=w,z.A=_,It===null&&(mn=null,Tt=0,ag()),R}function CZ(){for(;It!==null;)JA(It)}function kZ(s,c){var p=Ht;Ht|=2;var g=WA(),w=XA();mn!==s||Tt!==c?(zg=null,Mg=ie()+500,Bu(s,c)):Fu=nn(s,c);e:do try{if(Jt!==0&&It!==null){c=It;var _=Oi;t:switch(Jt){case 1:Jt=0,Oi=null,Hu(s,c,_,1);break;case 2:case 9:if(lN(_)){Jt=0,Oi=null,QA(c);break}c=function(){Jt!==2&&Jt!==9||mn!==s||(Jt=7),ia(s)},_.then(c,c);break e;case 3:Jt=7;break e;case 4:Jt=5;break e;case 7:lN(_)?(Jt=0,Oi=null,QA(c)):(Jt=0,Oi=null,Hu(s,c,_,7));break;case 5:var R=null;switch(It.tag){case 26:R=It.memoizedState;case 5:case 27:var M=It;if(R?zO(R):M.stateNode.complete){Jt=0,Oi=null;var Z=M.sibling;if(Z!==null)It=Z;else{var de=M.return;de!==null?(It=de,Ug(de)):It=null}break t}}Jt=0,Oi=null,Hu(s,c,_,5);break;case 6:Jt=0,Oi=null,Hu(s,c,_,6);break;case 8:AS(),zn=6;break e;default:throw Error(r(462))}}EZ();break}catch(ye){ZA(s,ye)}while(!0);return Da=Ql=null,z.H=g,z.A=w,Ht=p,It!==null?0:(mn=null,Tt=0,ag(),zn)}function EZ(){for(;It!==null&&!re();)JA(It)}function JA(s){var c=SA(s.alternate,s,qa);s.memoizedProps=s.pendingProps,c===null?Ug(s):It=c}function QA(s){var c=s,p=c.alternate;switch(c.tag){case 15:case 0:c=gA(p,c,c.pendingProps,c.type,void 0,Tt);break;case 11:c=gA(p,c,c.pendingProps,c.type.render,c.ref,Tt);break;case 5:Zw(c);default:CA(p,c),c=It=XT(c,qa),c=SA(p,c,qa)}s.memoizedProps=s.pendingProps,c===null?Ug(s):It=c}function Hu(s,c,p,g){Da=Ql=null,Zw(c),Ou=null,Yf=0;var w=c.return;try{if(mZ(s,w,c,p,Tt)){zn=1,Ig(s,ao(p,s.current)),It=null;return}}catch(_){if(w!==null)throw It=w,_;zn=1,Ig(s,ao(p,s.current)),It=null;return}c.flags&32768?(At||g===1?s=!0:Fu||(Tt&536870912)!==0?s=!1:(As=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ni.current,g!==null&&g.tag===13&&(g.flags|=16384))),eO(c,s)):Ug(c)}function Ug(s){var c=s;do{if((c.flags&32768)!==0){eO(c,As);return}s=c.return;var p=vZ(c.alternate,c,qa);if(p!==null){It=p;return}if(c=c.sibling,c!==null){It=c;return}It=c=s}while(c!==null);zn===0&&(zn=5)}function eO(s,c){do{var p=yZ(s.alternate,s);if(p!==null){p.flags&=32767,It=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!c&&(s=s.sibling,s!==null)){It=s;return}It=s=p}while(s!==null);zn=6,It=null}function tO(s,c,p,g,w,_,R,M,Z){s.cancelPendingCommit=null;do Vg();while(sr!==0);if((Ht&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(_=c.lanes|c.childLanes,_|=ww,ii(s,p,_,R,M,Z),s===mn&&(It=mn=null,Tt=0),Vu=c,Ds=s,Ka=p,RS=_,TS=w,HA=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,TZ(Ee,function(){return aO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,w=W.p,W.p=2,R=Ht,Ht|=4;try{bZ(s,c,p)}finally{Ht=R,W.p=w,z.T=g}}sr=1,nO(),rO(),iO()}}function nO(){if(sr===1){sr=0;var s=Ds,c=Vu,p=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Ht;Ht|=4;try{PA(c,s);var _=qS,R=VT(s.containerInfo),M=_.focusedElem,Z=_.selectionRange;if(R!==M&&M&&M.ownerDocument&&UT(M.ownerDocument.documentElement,M)){if(Z!==null&&gw(M)){var de=Z.start,ye=Z.end;if(ye===void 0&&(ye=de),"selectionStart"in M)M.selectionStart=de,M.selectionEnd=Math.min(ye,M.value.length);else{var _e=M.ownerDocument||document,fe=_e&&_e.defaultView||window;if(fe.getSelection){var ge=fe.getSelection(),Be=M.textContent.length,et=Math.min(Z.start,Be),an=Z.end===void 0?et:Math.min(Z.end,Be);!ge.extend&&et>an&&(R=an,an=et,et=R);var oe=FT(M,et),te=FT(M,an);if(oe&&te&&(ge.rangeCount!==1||ge.anchorNode!==oe.node||ge.anchorOffset!==oe.offset||ge.focusNode!==te.node||ge.focusOffset!==te.offset)){var ue=_e.createRange();ue.setStart(oe.node,oe.offset),ge.removeAllRanges(),et>an?(ge.addRange(ue),ge.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),ge.addRange(ue))}}}}for(_e=[],ge=M;ge=ge.parentNode;)ge.nodeType===1&&_e.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<_e.length;M++){var xe=_e[M];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}ev=!!HS,qS=HS=null}finally{Ht=w,W.p=g,z.T=p}}s.current=c,sr=2}}function rO(){if(sr===2){sr=0;var s=Ds,c=Vu,p=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Ht;Ht|=4;try{NA(s,c.alternate,c)}finally{Ht=w,W.p=g,z.T=p}}sr=3}}function iO(){if(sr===4||sr===3){sr=0,se();var s=Ds,c=Vu,p=Ka,g=HA;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?sr=5:(sr=0,Vu=Ds=null,oO(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&($s=null),Do(p),c=c.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Cn,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=z.T,w=W.p,W.p=2,z.T=null;try{for(var _=s.onRecoverableError,R=0;R<g.length;R++){var M=g[R];_(M.value,{componentStack:M.stack})}}finally{z.T=c,W.p=w}}(Ka&3)!==0&&Vg(),ia(s),w=s.pendingLanes,(p&261930)!==0&&(w&42)!==0?s===NS?fp++:(fp=0,NS=s):fp=0,pp(0)}}function oO(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Gf(c)))}function Vg(){return nO(),rO(),iO(),aO()}function aO(){if(sr!==5)return!1;var s=Ds,c=RS;RS=0;var p=Do(Ka),g=z.T,w=W.p;try{W.p=32>p?32:p,z.T=null,p=TS,TS=null;var _=Ds,R=Ka;if(sr=0,Vu=Ds=null,Ka=0,(Ht&6)!==0)throw Error(r(331));var M=Ht;if(Ht|=4,UA(_.current),zA(_,_.current,R,p),Ht=M,pp(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Cn,_)}catch{}return!0}finally{W.p=w,z.T=g,oO(s,c)}}function sO(s,c,p){c=ao(p,c),c=cS(s.stateNode,c,2),s=Is(s,c,2),s!==null&&(pn(s,2),ia(s))}function Qt(s,c,p){if(s.tag===3)sO(s,s,p);else for(;c!==null;){if(c.tag===3){sO(c,s,p);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&($s===null||!$s.has(g))){s=ao(p,s),p=lA(2),g=Is(c,p,2),g!==null&&(cA(p,g,c,s),pn(g,2),ia(g));break}}c=c.return}}function $S(s,c,p){var g=s.pingCache;if(g===null){g=s.pingCache=new SZ;var w=new Set;g.set(c,w)}else w=g.get(c),w===void 0&&(w=new Set,g.set(c,w));w.has(p)||(ES=!0,w.add(p),s=jZ.bind(null,s,c,p),c.then(s,s))}function jZ(s,c,p){var g=s.pingCache;g!==null&&g.delete(c),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,mn===s&&(Tt&p)===p&&(zn===4||zn===3&&(Tt&62914560)===Tt&&300>ie()-Pg?(Ht&2)===0&&Bu(s,0):jS|=p,Uu===Tt&&(Uu=0)),ia(s)}function lO(s,c){c===0&&(c=fr()),s=Wl(s,c),s!==null&&(pn(s,c),ia(s))}function IZ(s){var c=s.memoizedState,p=0;c!==null&&(p=c.retryLane),lO(s,p)}function RZ(s,c){var p=0;switch(s.tag){case 31:case 13:var g=s.stateNode,w=s.memoizedState;w!==null&&(p=w.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),lO(s,p)}function TZ(s,c){return An(s,c)}var Bg=null,qu=null,DS=!1,Hg=!1,PS=!1,Ms=0;function ia(s){s!==qu&&s.next===null&&(qu===null?Bg=qu=s:qu=qu.next=s),Hg=!0,DS||(DS=!0,AZ())}function pp(s,c){if(!PS&&Hg){PS=!0;do for(var p=!1,g=Bg;g!==null;){if(s!==0){var w=g.pendingLanes;if(w===0)var _=0;else{var R=g.suspendedLanes,M=g.pingedLanes;_=(1<<31-kt(42|s)+1)-1,_&=w&~(R&~M),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(p=!0,fO(g,_))}else _=Tt,_=Xe(g,g===mn?_:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(_&3)===0||nn(g,_)||(p=!0,fO(g,_));g=g.next}while(p);PS=!1}}function NZ(){cO()}function cO(){Hg=DS=!1;var s=0;Ms!==0&&VZ()&&(s=Ms);for(var c=ie(),p=null,g=Bg;g!==null;){var w=g.next,_=uO(g,c);_===0?(g.next=null,p===null?Bg=w:p.next=w,w===null&&(qu=p)):(p=g,(s!==0||(_&3)!==0)&&(Hg=!0)),g=w}sr!==0&&sr!==5||pp(s),Ms!==0&&(Ms=0)}function uO(s,c){for(var p=s.suspendedLanes,g=s.pingedLanes,w=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var R=31-kt(_),M=1<<R,Z=w[R];Z===-1?((M&p)===0||(M&g)!==0)&&(w[R]=Wn(M,c)):Z<=c&&(s.expiredLanes|=M),_&=~M}if(c=mn,p=Tt,p=Xe(s,s===c?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,p===0||s===c&&(Jt===2||Jt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Y(g),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||nn(s,p)){if(c=p&-p,c===s.callbackPriority)return c;switch(g!==null&&Y(g),Do(p)){case 2:case 8:p=ce;break;case 32:p=Ee;break;case 268435456:p=Ke;break;default:p=Ee}return g=dO.bind(null,s),p=An(p,g),s.callbackPriority=c,s.callbackNode=p,c}return g!==null&&g!==null&&Y(g),s.callbackPriority=2,s.callbackNode=null,2}function dO(s,c){if(sr!==0&&sr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Vg()&&s.callbackNode!==p)return null;var g=Tt;return g=Xe(s,s===mn?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(KA(s,g,c),uO(s,ie()),s.callbackNode!=null&&s.callbackNode===p?dO.bind(null,s):null)}function fO(s,c){if(Vg())return null;KA(s,c,!0)}function AZ(){HZ(function(){(Ht&6)!==0?An(B,NZ):cO()})}function MS(){if(Ms===0){var s=Tu;s===0&&(s=ys,ys<<=1,(ys&261888)===0&&(ys=256)),Ms=s}return Ms}function pO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Jh(""+s)}function mO(s,c){var p=c.ownerDocument.createElement("input");return p.name=c.name,p.value=c.value,s.id&&p.setAttribute("form",s.id),c.parentNode.insertBefore(p,c),s=new FormData(s),p.parentNode.removeChild(p),s}function OZ(s,c,p,g,w){if(c==="submit"&&p&&p.stateNode===w){var _=pO((w[si]||null).action),R=g.submitter;R&&(c=(c=R[si]||null)?pO(c.formAction):R.getAttribute("formAction"),c!==null&&(_=c,R=null));var M=new ng("action","action",null,g,w);s.push({event:M,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ms!==0){var Z=R?mO(w,R):new FormData(w);rS(p,{pending:!0,data:Z,method:w.method,action:_},null,Z)}}else typeof _=="function"&&(M.preventDefault(),Z=R?mO(w,R):new FormData(w),rS(p,{pending:!0,data:Z,method:w.method,action:_},_,Z))},currentTarget:w}]})}}for(var zS=0;zS<xw.length;zS++){var LS=xw[zS],$Z=LS.toLowerCase(),DZ=LS[0].toUpperCase()+LS.slice(1);Po($Z,"on"+DZ)}Po(qT,"onAnimationEnd"),Po(KT,"onAnimationIteration"),Po(GT,"onAnimationStart"),Po("dblclick","onDoubleClick"),Po("focusin","onFocus"),Po("focusout","onBlur"),Po(XG,"onTransitionRun"),Po(JG,"onTransitionStart"),Po(QG,"onTransitionCancel"),Po(ZT,"onTransitionEnd"),gu("onMouseEnter",["mouseout","mouseover"]),gu("onMouseLeave",["mouseout","mouseover"]),gu("onPointerEnter",["pointerout","pointerover"]),gu("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),PZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mp));function hO(s,c){c=(c&4)!==0;for(var p=0;p<s.length;p++){var g=s[p],w=g.event;g=g.listeners;e:{var _=void 0;if(c)for(var R=g.length-1;0<=R;R--){var M=g[R],Z=M.instance,de=M.currentTarget;if(M=M.listener,Z!==_&&w.isPropagationStopped())break e;_=M,w.currentTarget=de;try{_(w)}catch(ye){og(ye)}w.currentTarget=null,_=Z}else for(R=0;R<g.length;R++){if(M=g[R],Z=M.instance,de=M.currentTarget,M=M.listener,Z!==_&&w.isPropagationStopped())break e;_=M,w.currentTarget=de;try{_(w)}catch(ye){og(ye)}w.currentTarget=null,_=Z}}}}function Rt(s,c){var p=c[J0];p===void 0&&(p=c[J0]=new Set);var g=s+"__bubble";p.has(g)||(gO(c,s,2,!1),p.add(g))}function FS(s,c,p){var g=0;c&&(g|=4),gO(p,s,g,c)}var qg="_reactListening"+Math.random().toString(36).slice(2);function US(s){if(!s[qg]){s[qg]=!0,cT.forEach(function(p){p!=="selectionchange"&&(PZ.has(p)||FS(p,!1,s),FS(p,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[qg]||(c[qg]=!0,FS("selectionchange",!1,c))}}function gO(s,c,p,g){switch(qO(c)){case 2:var w=uY;break;case 8:w=dY;break;default:w=n_}p=w.bind(null,c,p,s),w=void 0,!sw||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),g?w!==void 0?s.addEventListener(c,p,{capture:!0,passive:w}):s.addEventListener(c,p,!0):w!==void 0?s.addEventListener(c,p,{passive:w}):s.addEventListener(c,p,!1)}function VS(s,c,p,g,w){var _=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var R=g.tag;if(R===3||R===4){var M=g.stateNode.containerInfo;if(M===w)break;if(R===4)for(R=g.return;R!==null;){var Z=R.tag;if((Z===3||Z===4)&&R.stateNode.containerInfo===w)return;R=R.return}for(;M!==null;){if(R=pu(M),R===null)return;if(Z=R.tag,Z===5||Z===6||Z===26||Z===27){g=_=R;continue e}M=M.parentNode}}g=g.return}wT(function(){var de=_,ye=ow(p),_e=[];e:{var fe=YT.get(s);if(fe!==void 0){var ge=ng,Be=s;switch(s){case"keypress":if(eg(p)===0)break e;case"keydown":case"keyup":ge=RG;break;case"focusin":Be="focus",ge=dw;break;case"focusout":Be="blur",ge=dw;break;case"beforeblur":case"afterblur":ge=dw;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=CT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=vG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=AG;break;case qT:case KT:case GT:ge=xG;break;case ZT:ge=$G;break;case"scroll":case"scrollend":ge=hG;break;case"wheel":ge=PG;break;case"copy":case"cut":case"paste":ge=SG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=ET;break;case"toggle":case"beforetoggle":ge=zG}var et=(c&4)!==0,an=!et&&(s==="scroll"||s==="scrollend"),oe=et?fe!==null?fe+"Capture":null:fe;et=[];for(var te=de,ue;te!==null;){var xe=te;if(ue=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ue===null||oe===null||(xe=Pf(te,oe),xe!=null&&et.push(hp(te,xe,ue))),an)break;te=te.return}0<et.length&&(fe=new ge(fe,Be,null,p,ye),_e.push({event:fe,listeners:et}))}}if((c&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",ge=s==="mouseout"||s==="pointerout",fe&&p!==iw&&(Be=p.relatedTarget||p.fromElement)&&(pu(Be)||Be[fu]))break e;if((ge||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,ge?(Be=p.relatedTarget||p.toElement,ge=de,Be=Be?pu(Be):null,Be!==null&&(an=o(Be),et=Be.tag,Be!==an||et!==5&&et!==27&&et!==6)&&(Be=null)):(ge=null,Be=de),ge!==Be)){if(et=CT,xe="onMouseLeave",oe="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(et=ET,xe="onPointerLeave",oe="onPointerEnter",te="pointer"),an=ge==null?fe:Df(ge),ue=Be==null?fe:Df(Be),fe=new et(xe,te+"leave",ge,p,ye),fe.target=an,fe.relatedTarget=ue,xe=null,pu(ye)===de&&(et=new et(oe,te+"enter",Be,p,ye),et.target=ue,et.relatedTarget=an,xe=et),an=xe,ge&&Be)t:{for(et=MZ,oe=ge,te=Be,ue=0,xe=oe;xe;xe=et(xe))ue++;xe=0;for(var Je=te;Je;Je=et(Je))xe++;for(;0<ue-xe;)oe=et(oe),ue--;for(;0<xe-ue;)te=et(te),xe--;for(;ue--;){if(oe===te||te!==null&&oe===te.alternate){et=oe;break t}oe=et(oe),te=et(te)}et=null}else et=null;ge!==null&&vO(_e,fe,ge,et,!1),Be!==null&&an!==null&&vO(_e,an,Be,et,!0)}}e:{if(fe=de?Df(de):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var Lt=$T;else if(AT(fe))if(DT)Lt=ZG;else{Lt=KG;var Ge=qG}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&rw(de.elementType)&&(Lt=$T):Lt=GG;if(Lt&&(Lt=Lt(s,de))){OT(_e,Lt,p,ye);break e}Ge&&Ge(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&nw(fe,"number",fe.value)}switch(Ge=de?Df(de):window,s){case"focusin":(AT(Ge)||Ge.contentEditable==="true")&&(Su=Ge,vw=de,Hf=null);break;case"focusout":Hf=vw=Su=null;break;case"mousedown":yw=!0;break;case"contextmenu":case"mouseup":case"dragend":yw=!1,BT(_e,p,ye);break;case"selectionchange":if(WG)break;case"keydown":case"keyup":BT(_e,p,ye)}var yt;if(pw)e:{switch(s){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else wu?TT(s,p)&&(Nt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(Nt="onCompositionStart");Nt&&(jT&&p.locale!=="ko"&&(wu||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&wu&&(yt=ST()):(ws=ye,lw="value"in ws?ws.value:ws.textContent,wu=!0)),Ge=Kg(de,Nt),0<Ge.length&&(Nt=new kT(Nt,s,null,p,ye),_e.push({event:Nt,listeners:Ge}),yt?Nt.data=yt:(yt=NT(p),yt!==null&&(Nt.data=yt)))),(yt=FG?UG(s,p):VG(s,p))&&(Nt=Kg(de,"onBeforeInput"),0<Nt.length&&(Ge=new kT("onBeforeInput","beforeinput",null,p,ye),_e.push({event:Ge,listeners:Nt}),Ge.data=yt)),OZ(_e,s,de,p,ye)}hO(_e,c)})}function hp(s,c,p){return{instance:s,listener:c,currentTarget:p}}function Kg(s,c){for(var p=c+"Capture",g=[];s!==null;){var w=s,_=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||_===null||(w=Pf(s,p),w!=null&&g.unshift(hp(s,w,_)),w=Pf(s,c),w!=null&&g.push(hp(s,w,_))),s.tag===3)return g;s=s.return}return[]}function MZ(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function vO(s,c,p,g,w){for(var _=c._reactName,R=[];p!==null&&p!==g;){var M=p,Z=M.alternate,de=M.stateNode;if(M=M.tag,Z!==null&&Z===g)break;M!==5&&M!==26&&M!==27||de===null||(Z=de,w?(de=Pf(p,_),de!=null&&R.unshift(hp(p,de,Z))):w||(de=Pf(p,_),de!=null&&R.push(hp(p,de,Z)))),p=p.return}R.length!==0&&s.push({event:c,listeners:R})}var zZ=/\r\n?/g,LZ=/\u0000|\uFFFD/g;function yO(s){return(typeof s=="string"?s:""+s).replace(zZ,`
`).replace(LZ,"")}function bO(s,c){return c=yO(c),yO(s)===c}function on(s,c,p,g,w,_){switch(p){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||yu(s,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&yu(s,""+g);break;case"className":Wh(s,"class",g);break;case"tabIndex":Wh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Wh(s,p,g);break;case"style":bT(s,g,_);break;case"data":if(c!=="object"){Wh(s,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||p!=="href")){s.removeAttribute(p);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Jh(""+g),s.setAttribute(p,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(p,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(p==="formAction"?(c!=="input"&&on(s,c,"name",w.name,w,null),on(s,c,"formEncType",w.formEncType,w,null),on(s,c,"formMethod",w.formMethod,w,null),on(s,c,"formTarget",w.formTarget,w,null)):(on(s,c,"encType",w.encType,w,null),on(s,c,"method",w.method,w,null),on(s,c,"target",w.target,w,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Jh(""+g),s.setAttribute(p,g);break;case"onClick":g!=null&&(s.onclick=Na);break;case"onScroll":g!=null&&Rt("scroll",s);break;case"onScrollEnd":g!=null&&Rt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(p=g.__html,p!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}p=Jh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(p,""+g):s.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(p,""):s.removeAttribute(p);break;case"capture":case"download":g===!0?s.setAttribute(p,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(p,g):s.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(p,g):s.removeAttribute(p);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(p):s.setAttribute(p,g);break;case"popover":Rt("beforetoggle",s),Rt("toggle",s),Yh(s,"popover",g);break;case"xlinkActuate":Ta(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ta(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ta(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ta(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ta(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ta(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ta(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Yh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=pG.get(p)||p,Yh(s,p,g))}}function BS(s,c,p,g,w,_){switch(p){case"style":bT(s,g,_);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(p=g.__html,p!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=p}}break;case"children":typeof g=="string"?yu(s,g):(typeof g=="number"||typeof g=="bigint")&&yu(s,""+g);break;case"onScroll":g!=null&&Rt("scroll",s);break;case"onScrollEnd":g!=null&&Rt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uT.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(w=p.endsWith("Capture"),c=p.slice(2,w?p.length-7:void 0),_=s[si]||null,_=_!=null?_[p]:null,typeof _=="function"&&s.removeEventListener(c,_,w),typeof g=="function")){typeof _!="function"&&_!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(c,g,w);break e}p in s?s[p]=g:g===!0?s.setAttribute(p,""):Yh(s,p,g)}}}function Cr(s,c,p){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",s),Rt("load",s);var g=!1,w=!1,_;for(_ in p)if(p.hasOwnProperty(_)){var R=p[_];if(R!=null)switch(_){case"src":g=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:on(s,c,_,R,p,null)}}w&&on(s,c,"srcSet",p.srcSet,p,null),g&&on(s,c,"src",p.src,p,null);return;case"input":Rt("invalid",s);var M=_=R=w=null,Z=null,de=null;for(g in p)if(p.hasOwnProperty(g)){var ye=p[g];if(ye!=null)switch(g){case"name":w=ye;break;case"type":R=ye;break;case"checked":Z=ye;break;case"defaultChecked":de=ye;break;case"value":_=ye;break;case"defaultValue":M=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,c));break;default:on(s,c,g,ye,p,null)}}hT(s,_,M,Z,de,R,w,!1);return;case"select":Rt("invalid",s),g=R=_=null;for(w in p)if(p.hasOwnProperty(w)&&(M=p[w],M!=null))switch(w){case"value":_=M;break;case"defaultValue":R=M;break;case"multiple":g=M;default:on(s,c,w,M,p,null)}c=_,p=R,s.multiple=!!g,c!=null?vu(s,!!g,c,!1):p!=null&&vu(s,!!g,p,!0);return;case"textarea":Rt("invalid",s),_=w=g=null;for(R in p)if(p.hasOwnProperty(R)&&(M=p[R],M!=null))switch(R){case"value":g=M;break;case"defaultValue":w=M;break;case"children":_=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:on(s,c,R,M,p,null)}vT(s,g,w,_);return;case"option":for(Z in p)p.hasOwnProperty(Z)&&(g=p[Z],g!=null)&&(Z==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":on(s,c,Z,g,p,null));return;case"dialog":Rt("beforetoggle",s),Rt("toggle",s),Rt("cancel",s),Rt("close",s);break;case"iframe":case"object":Rt("load",s);break;case"video":case"audio":for(g=0;g<mp.length;g++)Rt(mp[g],s);break;case"image":Rt("error",s),Rt("load",s);break;case"details":Rt("toggle",s);break;case"embed":case"source":case"link":Rt("error",s),Rt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in p)if(p.hasOwnProperty(de)&&(g=p[de],g!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:on(s,c,de,g,p,null)}return;default:if(rw(c)){for(ye in p)p.hasOwnProperty(ye)&&(g=p[ye],g!==void 0&&BS(s,c,ye,g,p,void 0));return}}for(M in p)p.hasOwnProperty(M)&&(g=p[M],g!=null&&on(s,c,M,g,p,null))}function FZ(s,c,p,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,_=null,R=null,M=null,Z=null,de=null,ye=null;for(ge in p){var _e=p[ge];if(p.hasOwnProperty(ge)&&_e!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":Z=_e;default:g.hasOwnProperty(ge)||on(s,c,ge,null,g,_e)}}for(var fe in g){var ge=g[fe];if(_e=p[fe],g.hasOwnProperty(fe)&&(ge!=null||_e!=null))switch(fe){case"type":_=ge;break;case"name":w=ge;break;case"checked":de=ge;break;case"defaultChecked":ye=ge;break;case"value":R=ge;break;case"defaultValue":M=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,c));break;default:ge!==_e&&on(s,c,fe,ge,g,_e)}}tw(s,R,M,Z,de,ye,_,w);return;case"select":ge=R=M=fe=null;for(_ in p)if(Z=p[_],p.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":ge=Z;default:g.hasOwnProperty(_)||on(s,c,_,null,g,Z)}for(w in g)if(_=g[w],Z=p[w],g.hasOwnProperty(w)&&(_!=null||Z!=null))switch(w){case"value":fe=_;break;case"defaultValue":M=_;break;case"multiple":R=_;default:_!==Z&&on(s,c,w,_,g,Z)}c=M,p=R,g=ge,fe!=null?vu(s,!!p,fe,!1):!!g!=!!p&&(c!=null?vu(s,!!p,c,!0):vu(s,!!p,p?[]:"",!1));return;case"textarea":ge=fe=null;for(M in p)if(w=p[M],p.hasOwnProperty(M)&&w!=null&&!g.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:on(s,c,M,null,g,w)}for(R in g)if(w=g[R],_=p[R],g.hasOwnProperty(R)&&(w!=null||_!=null))switch(R){case"value":fe=w;break;case"defaultValue":ge=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==_&&on(s,c,R,w,g,_)}gT(s,fe,ge);return;case"option":for(var Be in p)fe=p[Be],p.hasOwnProperty(Be)&&fe!=null&&!g.hasOwnProperty(Be)&&(Be==="selected"?s.selected=!1:on(s,c,Be,null,g,fe));for(Z in g)fe=g[Z],ge=p[Z],g.hasOwnProperty(Z)&&fe!==ge&&(fe!=null||ge!=null)&&(Z==="selected"?s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol":on(s,c,Z,fe,g,ge));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var et in p)fe=p[et],p.hasOwnProperty(et)&&fe!=null&&!g.hasOwnProperty(et)&&on(s,c,et,null,g,fe);for(de in g)if(fe=g[de],ge=p[de],g.hasOwnProperty(de)&&fe!==ge&&(fe!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,c));break;default:on(s,c,de,fe,g,ge)}return;default:if(rw(c)){for(var an in p)fe=p[an],p.hasOwnProperty(an)&&fe!==void 0&&!g.hasOwnProperty(an)&&BS(s,c,an,void 0,g,fe);for(ye in g)fe=g[ye],ge=p[ye],!g.hasOwnProperty(ye)||fe===ge||fe===void 0&&ge===void 0||BS(s,c,ye,fe,g,ge);return}}for(var oe in p)fe=p[oe],p.hasOwnProperty(oe)&&fe!=null&&!g.hasOwnProperty(oe)&&on(s,c,oe,null,g,fe);for(_e in g)fe=g[_e],ge=p[_e],!g.hasOwnProperty(_e)||fe===ge||fe==null&&ge==null||on(s,c,_e,fe,g,ge)}function xO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UZ(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,p=performance.getEntriesByType("resource"),g=0;g<p.length;g++){var w=p[g],_=w.transferSize,R=w.initiatorType,M=w.duration;if(_&&M&&xO(R)){for(R=0,M=w.responseEnd,g+=1;g<p.length;g++){var Z=p[g],de=Z.startTime;if(de>M)break;var ye=Z.transferSize,_e=Z.initiatorType;ye&&xO(_e)&&(Z=Z.responseEnd,R+=ye*(Z<M?1:(M-de)/(Z-de)))}if(--g,c+=8*(_+R)/(w.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var HS=null,qS=null;function Gg(s){return s.nodeType===9?s:s.ownerDocument}function wO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function SO(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function KS(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var GS=null;function VZ(){var s=window.event;return s&&s.type==="popstate"?s===GS?!1:(GS=s,!0):(GS=null,!1)}var _O=typeof setTimeout=="function"?setTimeout:void 0,BZ=typeof clearTimeout=="function"?clearTimeout:void 0,CO=typeof Promise=="function"?Promise:void 0,HZ=typeof queueMicrotask=="function"?queueMicrotask:typeof CO<"u"?function(s){return CO.resolve(null).then(s).catch(qZ)}:_O;function qZ(s){setTimeout(function(){throw s})}function zs(s){return s==="head"}function kO(s,c){var p=c,g=0;do{var w=p.nextSibling;if(s.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"||p==="/&"){if(g===0){s.removeChild(w),Yu(c);return}g--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")g++;else if(p==="html")gp(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,gp(p);for(var _=p.firstChild;_;){var R=_.nextSibling,M=_.nodeName;_[$f]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&_.rel.toLowerCase()==="stylesheet"||p.removeChild(_),_=R}}else p==="body"&&gp(s.ownerDocument.body);p=w}while(p);Yu(c)}function EO(s,c){var p=s;s=0;do{var g=p.nextSibling;if(p.nodeType===1?c?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(c?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),g&&g.nodeType===8)if(p=g.data,p==="/$"){if(s===0)break;s--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||s++;p=g}while(p)}function ZS(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var p=c;switch(c=c.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":ZS(p),Q0(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function KZ(s,c,p,g){for(;s.nodeType===1;){var w=p;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[$f])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==w.rel||s.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||s.getAttribute("title")!==(w.title==null?null:w.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(w.src==null?null:w.src)||s.getAttribute("type")!==(w.type==null?null:w.type)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var _=w.name==null?null:""+w.name;if(w.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=fo(s.nextSibling),s===null)break}return null}function GZ(s,c,p){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=fo(s.nextSibling),s===null))return null;return s}function jO(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=fo(s.nextSibling),s===null))return null;return s}function YS(s){return s.data==="$?"||s.data==="$~"}function WS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function ZZ(s,c){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||p.readyState!=="loading")c();else{var g=function(){c(),p.removeEventListener("DOMContentLoaded",g)};p.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function fo(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var XS=null;function IO(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(c===0)return fo(s.nextSibling);c--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||c++}s=s.nextSibling}return null}function RO(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(c===0)return s;c--}else p!=="/$"&&p!=="/&"||c++}s=s.previousSibling}return null}function TO(s,c,p){switch(c=Gg(p),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function gp(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Q0(s)}var po=new Map,NO=new Set;function Zg(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ga=W.d;W.d={f:YZ,r:WZ,D:XZ,C:JZ,L:QZ,m:eY,X:nY,S:tY,M:rY};function YZ(){var s=Ga.f(),c=Lg();return s||c}function WZ(s){var c=mu(s);c!==null&&c.tag===5&&c.type==="form"?ZN(c):Ga.r(s)}var Ku=typeof document>"u"?null:document;function AO(s,c,p){var g=Ku;if(g&&typeof c=="string"&&c){var w=io(c);w='link[rel="'+s+'"][href="'+w+'"]',typeof p=="string"&&(w+='[crossorigin="'+p+'"]'),NO.has(w)||(NO.add(w),s={rel:s,crossOrigin:p,href:c},g.querySelector(w)===null&&(c=g.createElement("link"),Cr(c,"link",s),pr(c),g.head.appendChild(c)))}}function XZ(s){Ga.D(s),AO("dns-prefetch",s,null)}function JZ(s,c){Ga.C(s,c),AO("preconnect",s,c)}function QZ(s,c,p){Ga.L(s,c,p);var g=Ku;if(g&&s&&c){var w='link[rel="preload"][as="'+io(c)+'"]';c==="image"&&p&&p.imageSrcSet?(w+='[imagesrcset="'+io(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(w+='[imagesizes="'+io(p.imageSizes)+'"]')):w+='[href="'+io(s)+'"]';var _=w;switch(c){case"style":_=Gu(s);break;case"script":_=Zu(s)}po.has(_)||(s=h({rel:"preload",href:c==="image"&&p&&p.imageSrcSet?void 0:s,as:c},p),po.set(_,s),g.querySelector(w)!==null||c==="style"&&g.querySelector(vp(_))||c==="script"&&g.querySelector(yp(_))||(c=g.createElement("link"),Cr(c,"link",s),pr(c),g.head.appendChild(c)))}}function eY(s,c){Ga.m(s,c);var p=Ku;if(p&&s){var g=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+io(g)+'"][href="'+io(s)+'"]',_=w;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Zu(s)}if(!po.has(_)&&(s=h({rel:"modulepreload",href:s},c),po.set(_,s),p.querySelector(w)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(yp(_)))return}g=p.createElement("link"),Cr(g,"link",s),pr(g),p.head.appendChild(g)}}}function tY(s,c,p){Ga.S(s,c,p);var g=Ku;if(g&&s){var w=hu(g).hoistableStyles,_=Gu(s);c=c||"default";var R=w.get(_);if(!R){var M={loading:0,preload:null};if(R=g.querySelector(vp(_)))M.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":c},p),(p=po.get(_))&&JS(s,p);var Z=R=g.createElement("link");pr(Z),Cr(Z,"link",s),Z._p=new Promise(function(de,ye){Z.onload=de,Z.onerror=ye}),Z.addEventListener("load",function(){M.loading|=1}),Z.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Yg(R,c,g)}R={type:"stylesheet",instance:R,count:1,state:M},w.set(_,R)}}}function nY(s,c){Ga.X(s,c);var p=Ku;if(p&&s){var g=hu(p).hoistableScripts,w=Zu(s),_=g.get(w);_||(_=p.querySelector(yp(w)),_||(s=h({src:s,async:!0},c),(c=po.get(w))&&QS(s,c),_=p.createElement("script"),pr(_),Cr(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function rY(s,c){Ga.M(s,c);var p=Ku;if(p&&s){var g=hu(p).hoistableScripts,w=Zu(s),_=g.get(w);_||(_=p.querySelector(yp(w)),_||(s=h({src:s,async:!0,type:"module"},c),(c=po.get(w))&&QS(s,c),_=p.createElement("script"),pr(_),Cr(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function OO(s,c,p,g){var w=(w=ve.current)?Zg(w):null;if(!w)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(c=Gu(p.href),p=hu(w).hoistableStyles,g=p.get(c),g||(g={type:"style",instance:null,count:0,state:null},p.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){s=Gu(p.href);var _=hu(w).hoistableStyles,R=_.get(s);if(R||(w=w.ownerDocument||w,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,R),(_=w.querySelector(vp(s)))&&!_._p&&(R.instance=_,R.state.loading=5),po.has(s)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},po.set(s,p),_||iY(w,s,p,R.state))),c&&g===null)throw Error(r(528,""));return R}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=p.async,p=p.src,typeof p=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Zu(p),p=hu(w).hoistableScripts,g=p.get(c),g||(g={type:"script",instance:null,count:0,state:null},p.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Gu(s){return'href="'+io(s)+'"'}function vp(s){return'link[rel="stylesheet"]['+s+"]"}function $O(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function iY(s,c,p,g){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=s.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),Cr(c,"link",p),pr(c),s.head.appendChild(c))}function Zu(s){return'[src="'+io(s)+'"]'}function yp(s){return"script[async]"+s}function DO(s,c,p){if(c.count++,c.instance===null)switch(c.type){case"style":var g=s.querySelector('style[data-href~="'+io(p.href)+'"]');if(g)return c.instance=g,pr(g),g;var w=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),pr(g),Cr(g,"style",w),Yg(g,p.precedence,s),c.instance=g;case"stylesheet":w=Gu(p.href);var _=s.querySelector(vp(w));if(_)return c.state.loading|=4,c.instance=_,pr(_),_;g=$O(p),(w=po.get(w))&&JS(g,w),_=(s.ownerDocument||s).createElement("link"),pr(_);var R=_;return R._p=new Promise(function(M,Z){R.onload=M,R.onerror=Z}),Cr(_,"link",g),c.state.loading|=4,Yg(_,p.precedence,s),c.instance=_;case"script":return _=Zu(p.src),(w=s.querySelector(yp(_)))?(c.instance=w,pr(w),w):(g=p,(w=po.get(_))&&(g=h({},p),QS(g,w)),s=s.ownerDocument||s,w=s.createElement("script"),pr(w),Cr(w,"link",g),s.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,Yg(g,p.precedence,s));return c.instance}function Yg(s,c,p){for(var g=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=g.length?g[g.length-1]:null,_=w,R=0;R<g.length;R++){var M=g[R];if(M.dataset.precedence===c)_=M;else if(_!==w)break}_?_.parentNode.insertBefore(s,_.nextSibling):(c=p.nodeType===9?p.head:p,c.insertBefore(s,c.firstChild))}function JS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function QS(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var Wg=null;function PO(s,c,p){if(Wg===null){var g=new Map,w=Wg=new Map;w.set(p,g)}else w=Wg,g=w.get(p),g||(g=new Map,w.set(p,g));if(g.has(s))return g;for(g.set(s,null),p=p.getElementsByTagName(s),w=0;w<p.length;w++){var _=p[w];if(!(_[$f]||_[xr]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var R=_.getAttribute(c)||"";R=s+R;var M=g.get(R);M?M.push(_):g.set(R,[_])}}return g}function MO(s,c,p){s=s.ownerDocument||s,s.head.insertBefore(p,c==="title"?s.querySelector("head > title"):null)}function oY(s,c,p){if(p===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(s=c.disabled,typeof c.precedence=="string"&&s==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function zO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function aY(s,c,p,g){if(p.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var w=Gu(g.href),_=c.querySelector(vp(w));if(_){c=_._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Xg.bind(s),c.then(s,s)),p.state.loading|=4,p.instance=_,pr(_);return}_=c.ownerDocument||c,g=$O(g),(w=po.get(w))&&JS(g,w),_=_.createElement("link"),pr(_);var R=_;R._p=new Promise(function(M,Z){R.onload=M,R.onerror=Z}),Cr(_,"link",g),p.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,c),(c=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Xg.bind(s),c.addEventListener("load",p),c.addEventListener("error",p))}}var e_=0;function sY(s,c){return s.stylesheets&&s.count===0&&Qg(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var g=setTimeout(function(){if(s.stylesheets&&Qg(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+c);0<s.imgBytes&&e_===0&&(e_=62500*UZ());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Qg(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>e_?50:800)+c);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(w)}}:null}function Xg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qg(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Jg=null;function Qg(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Jg=new Map,c.forEach(lY,s),Jg=null,Xg.call(s))}function lY(s,c){if(!(c.state.loading&4)){var p=Jg.get(s);if(p)var g=p.get(null);else{p=new Map,Jg.set(s,p);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<w.length;_++){var R=w[_];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(p.set(R.dataset.precedence,R),g=R)}g&&p.set(null,g)}w=c.instance,R=w.getAttribute("data-precedence"),_=p.get(R)||g,_===g&&p.set(null,w),p.set(R,w),this.count++,g=Xg.bind(this),w.addEventListener("load",g),w.addEventListener("error",g),_?_.parentNode.insertBefore(w,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(w,s.firstChild)),c.state.loading|=4}}var bp={$$typeof:j,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function cY(s,c,p,g,w,_,R,M,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.hiddenUpdates=ea(null),this.identifierPrefix=g,this.onUncaughtError=w,this.onCaughtError=_,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function LO(s,c,p,g,w,_,R,M,Z,de,ye,_e){return s=new cY(s,c,p,R,Z,de,ye,_e,M),c=1,_===!0&&(c|=24),_=Ti(3,null,null,c),s.current=_,_.stateNode=s,c=Ow(),c.refCount++,s.pooledCache=c,c.refCount++,_.memoizedState={element:g,isDehydrated:p,cache:c},Mw(_),s}function FO(s){return s?(s=ku,s):ku}function UO(s,c,p,g,w,_){w=FO(w),g.context===null?g.context=w:g.pendingContext=w,g=js(c),g.payload={element:p},_=_===void 0?null:_,_!==null&&(g.callback=_),p=Is(s,g,c),p!==null&&(pi(p,s,c),Xf(p,s,c))}function VO(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<c?p:c}}function t_(s,c){VO(s,c),(s=s.alternate)&&VO(s,c)}function BO(s){if(s.tag===13||s.tag===31){var c=Wl(s,67108864);c!==null&&pi(c,s,67108864),t_(s,67108864)}}function HO(s){if(s.tag===13||s.tag===31){var c=Di();c=du(c);var p=Wl(s,c);p!==null&&pi(p,s,c),t_(s,c)}}var ev=!0;function uY(s,c,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=2,n_(s,c,p,g)}finally{W.p=_,z.T=w}}function dY(s,c,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=8,n_(s,c,p,g)}finally{W.p=_,z.T=w}}function n_(s,c,p,g){if(ev){var w=r_(g);if(w===null)VS(s,c,g,tv,p),KO(s,g);else if(pY(w,s,c,p,g))g.stopPropagation();else if(KO(s,g),c&4&&-1<fY.indexOf(s)){for(;w!==null;){var _=mu(w);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var R=Bt(_.pendingLanes);if(R!==0){var M=_;for(M.pendingLanes|=2,M.entangledLanes|=2;R;){var Z=1<<31-kt(R);M.entanglements[1]|=Z,R&=~Z}ia(_),(Ht&6)===0&&(Mg=ie()+500,pp(0))}}break;case 31:case 13:M=Wl(_,2),M!==null&&pi(M,_,2),Lg(),t_(_,2)}if(_=r_(g),_===null&&VS(s,c,g,tv,p),_===w)break;w=_}w!==null&&g.stopPropagation()}else VS(s,c,g,null,p)}}function r_(s){return s=ow(s),i_(s)}var tv=null;function i_(s){if(tv=null,s=pu(s),s!==null){var c=o(s);if(c===null)s=null;else{var p=c.tag;if(p===13){if(s=a(c),s!==null)return s;s=null}else if(p===31){if(s=l(c),s!==null)return s;s=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return tv=s,null}function qO(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(me()){case B:return 2;case ce:return 8;case Ee:case Me:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var o_=!1,Ls=null,Fs=null,Us=null,xp=new Map,wp=new Map,Vs=[],fY="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function KO(s,c){switch(s){case"focusin":case"focusout":Ls=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Us=null;break;case"pointerover":case"pointerout":xp.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":wp.delete(c.pointerId)}}function Sp(s,c,p,g,w,_){return s===null||s.nativeEvent!==_?(s={blockedOn:c,domEventName:p,eventSystemFlags:g,nativeEvent:_,targetContainers:[w]},c!==null&&(c=mu(c),c!==null&&BO(c)),s):(s.eventSystemFlags|=g,c=s.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),s)}function pY(s,c,p,g,w){switch(c){case"focusin":return Ls=Sp(Ls,s,c,p,g,w),!0;case"dragenter":return Fs=Sp(Fs,s,c,p,g,w),!0;case"mouseover":return Us=Sp(Us,s,c,p,g,w),!0;case"pointerover":var _=w.pointerId;return xp.set(_,Sp(xp.get(_)||null,s,c,p,g,w)),!0;case"gotpointercapture":return _=w.pointerId,wp.set(_,Sp(wp.get(_)||null,s,c,p,g,w)),!0}return!1}function GO(s){var c=pu(s.target);if(c!==null){var p=o(c);if(p!==null){if(c=p.tag,c===13){if(c=a(p),c!==null){s.blockedOn=c,sT(s.priority,function(){HO(p)});return}}else if(c===31){if(c=l(p),c!==null){s.blockedOn=c,sT(s.priority,function(){HO(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function nv(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var p=r_(s.nativeEvent);if(p===null){p=s.nativeEvent;var g=new p.constructor(p.type,p);iw=g,p.target.dispatchEvent(g),iw=null}else return c=mu(p),c!==null&&BO(c),s.blockedOn=p,!1;c.shift()}return!0}function ZO(s,c,p){nv(s)&&p.delete(c)}function mY(){o_=!1,Ls!==null&&nv(Ls)&&(Ls=null),Fs!==null&&nv(Fs)&&(Fs=null),Us!==null&&nv(Us)&&(Us=null),xp.forEach(ZO),wp.forEach(ZO)}function rv(s,c){s.blockedOn===c&&(s.blockedOn=null,o_||(o_=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mY)))}var iv=null;function YO(s){iv!==s&&(iv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){iv===s&&(iv=null);for(var c=0;c<s.length;c+=3){var p=s[c],g=s[c+1],w=s[c+2];if(typeof g!="function"){if(i_(g||p)===null)continue;break}var _=mu(p);_!==null&&(s.splice(c,3),c-=3,rS(_,{pending:!0,data:w,method:p.method,action:g},g,w))}}))}function Yu(s){function c(Z){return rv(Z,s)}Ls!==null&&rv(Ls,s),Fs!==null&&rv(Fs,s),Us!==null&&rv(Us,s),xp.forEach(c),wp.forEach(c);for(var p=0;p<Vs.length;p++){var g=Vs[p];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Vs.length&&(p=Vs[0],p.blockedOn===null);)GO(p),p.blockedOn===null&&Vs.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(g=0;g<p.length;g+=3){var w=p[g],_=p[g+1],R=w[si]||null;if(typeof _=="function")R||YO(p);else if(R){var M=null;if(_&&_.hasAttribute("formAction")){if(w=_,R=_[si]||null)M=R.formAction;else if(i_(w)!==null)continue}else M=R.action;typeof M=="function"?p[g+1]=M:(p.splice(g,3),g-=3),YO(p)}}}function WO(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(R){return w=R})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),g||setTimeout(p,20)}function p(){if(!g&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,w=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(p,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function a_(s){this._internalRoot=s}ov.prototype.render=a_.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var p=c.current,g=Di();UO(p,g,s,c,null,null)},ov.prototype.unmount=a_.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;UO(s.current,2,null,s,null,null),Lg(),c[fu]=null}};function ov(s){this._internalRoot=s}ov.prototype.unstable_scheduleHydration=function(s){if(s){var c=X0();s={blockedOn:null,target:s,priority:c};for(var p=0;p<Vs.length&&c!==0&&c<Vs[p].priority;p++);Vs.splice(p,0,s),p===0&&GO(s)}};var XO=t.version;if(XO!=="19.2.3")throw Error(r(527,XO,"19.2.3"));W.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(c),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var hY={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var av=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!av.isDisabled&&av.supportsFiber)try{Cn=av.inject(hY),zt=av}catch{}}return Yp.createRoot=function(s,c){if(!i(s))throw Error(r(299));var p=!1,g="",w=iA,_=oA,R=aA;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(_=c.onCaughtError),c.onRecoverableError!==void 0&&(R=c.onRecoverableError)),c=LO(s,1,!1,null,null,p,g,null,w,_,R,WO),s[fu]=c.current,US(s),new a_(c)},Yp.hydrateRoot=function(s,c,p){if(!i(s))throw Error(r(299));var g=!1,w="",_=iA,R=oA,M=aA,Z=null;return p!=null&&(p.unstable_strictMode===!0&&(g=!0),p.identifierPrefix!==void 0&&(w=p.identifierPrefix),p.onUncaughtError!==void 0&&(_=p.onUncaughtError),p.onCaughtError!==void 0&&(R=p.onCaughtError),p.onRecoverableError!==void 0&&(M=p.onRecoverableError),p.formState!==void 0&&(Z=p.formState)),c=LO(s,1,!0,c,p??null,g,w,Z,_,R,M,WO),c.context=FO(null),p=c.current,g=Di(),g=du(g),w=js(g),w.callback=null,Is(p,w,g),p=g,c.current.lanes=p,pn(c,p),ia(c),s[fu]=c.current,US(s),new ov(c)},Yp.version="19.2.3",Yp}var nz;function ZDe(){if(nz)return Z1.exports;nz=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Z1.exports=GDe(),Z1.exports}var YDe=ZDe();YDe.createRoot(document.getElementById("root"),{onUncaughtError:(e,t)=>{cy(),console.error("Uncaught error:",e,t)},onCaughtError:(e,t)=>{cy(),console.error("Caught error:",e,t)},onRecoverableError:(e,t)=>{cy(),console.warn("Recoverable error:",e,t)}}).render(u.jsx(b.StrictMode,{children:u.jsx(HDe,{})}));export{tt as $,kE as A,b2e as B,F_ as C,sae as D,yse as E,St as F,Wse as G,IL as H,I2e as I,E2e as J,j2e as K,R2e as L,boe as M,Et as N,xo as O,S2e as P,Dr as Q,wt as R,zr as S,Xb as T,Jm as U,ML as V,Ud as W,Qm as X,ct as Y,Gt as Z,$t as _,mle as a,XJ as a$,_n as a0,jn as a1,Il as a2,cn as a3,vn as a4,b as a5,jt as a6,$n as a7,we as a8,Afe as a9,j7 as aA,qc as aB,Yr as aC,Jo as aD,g2e as aE,of as aF,WDe as aG,qm as aH,J as aI,N2e as aJ,ca as aK,Qe as aL,iE as aM,rt as aN,Mt as aO,fOe as aP,nT as aQ,LAe as aR,no as aS,LM as aT,Ry as aU,Jr as aV,v2e as aW,Tc as aX,Fo as aY,Ue as aZ,d4 as a_,u as aa,un as ab,$e as ac,Te as ad,Ne as ae,Oe as af,ze as ag,Ae as ah,be as ai,To as aj,Fd as ak,gE as al,jL as am,dre as an,hl as ao,No as ap,gt as aq,vr as ar,X4 as as,Zt as at,ir as au,Dm as av,dj as aw,es as ax,Jk as ay,sl as az,Hb as b,cf as b0,Wk as b1,qSe as b2,HSe as b3,ch as b4,Gi as b5,Yi as b6,Zi as b7,Wi as b8,Wo as b9,Ot as ba,Ji as bb,Pr as bc,_2e as c,$se as d,ple as e,xF as f,C2e as g,x2e as h,y2e as i,Yse as j,w2e as k,Zn as l,IE as m,Mce as n,k2e as o,mF as p,Bb as q,fle as r,wF as s,jr as t,vl as u,nx as v,Dn as w,zce as x,en as y,va as z};