harperdb 4.7.12 → 4.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/bin/harperdb.js +34 -34
  3. package/bin/lite.js +28 -28
  4. package/launchServiceScripts/launchNatsIngestService.js +29 -29
  5. package/launchServiceScripts/launchNatsReplyService.js +29 -29
  6. package/launchServiceScripts/launchUpdateNodes4-0-0.js +29 -29
  7. package/npm-shrinkwrap.json +292 -256
  8. package/package.json +3 -3
  9. package/resources/RequestTarget.d.ts +1 -1
  10. package/resources/Resource.d.ts +13 -13
  11. package/resources/Table.d.ts +12 -10
  12. package/resources/transactionBroadcast.d.ts +4 -3
  13. package/server/jobs/jobProcess.js +29 -29
  14. package/server/replication/knownNodes.d.ts +1 -1
  15. package/server/threads/threadServer.js +29 -29
  16. package/studio/web/HDBDogOnly.svg +78 -1
  17. package/studio/web/assets/index-BwlW0AMB.css +1 -0
  18. package/studio/web/assets/{index-YHth6Ryl.css → index-CVjGhoEG.css} +1 -1
  19. package/studio/web/assets/{index-B_cFV1Ze.js → index-DCIk8mGR.js} +1 -1
  20. package/studio/web/assets/index-DHFTW4ZU.js +36 -0
  21. package/studio/web/assets/index-KVLE5Pus.js +217 -0
  22. package/studio/web/assets/{index.lazy-CFrFVE2k.js → index.lazy-CwPUt0Bc.js} +53 -53
  23. package/studio/web/assets/{profiler-_PkvXANS.js → profiler-Cnhc6FqT.js} +1 -1
  24. package/studio/web/assets/{react-redux-Cuw5Q5nk.js → react-redux-Dy0makvb.js} +2 -2
  25. package/studio/web/assets/startRecording-IOmSWGHg.js +2 -0
  26. package/studio/web/github-icon.svg +14 -2
  27. package/studio/web/index.html +14 -16
  28. package/studio/web/running.html +137 -92
  29. package/studio/web/running.js +1 -1
  30. package/utility/scripts/restartHdb.js +29 -29
  31. package/studio/web/assets/index-B-eMLFIg.css +0 -1
  32. package/studio/web/assets/index-BedIpyD2.js +0 -37
  33. package/studio/web/assets/index-CYB7LsMb.js +0 -203
  34. package/studio/web/assets/startRecording-BAY7HJ6r.js +0 -2
@@ -0,0 +1,217 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-CwPUt0Bc.js","assets/react-redux-Dy0makvb.js","assets/index-CVjGhoEG.css","assets/index-DHFTW4ZU.js"])))=>i.map(i=>d[i]);
2
+ function dY(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 B$e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ef(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o_={exports:{}},xp={};var HA;function fY(){if(HA)return xp;HA=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 c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return xp.Fragment=t,xp.jsx=n,xp.jsxs=n,xp}var qA;function pY(){return qA||(qA=1,o_.exports=fY()),o_.exports}var u=pY();const hd=!0,mY="/",Ed=9925,Y1="HDB_ADMIN",ya="/",zk="../",hY=1024*1024*1024,gY=100*1024*1024;function GM(e,t){return function(){return e.apply(t,arguments)}}const{toString:vY}=Object.prototype,{getPrototypeOf:Lk}=Object,{iterator:_b,toStringTag:ZM}=Symbol,Cb=(e=>t=>{const n=vY.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Wo=e=>(e=e.toLowerCase(),t=>Cb(t)===e),kb=e=>t=>typeof t===e,{isArray:tf}=Array,jd=kb("undefined");function zm(e){return e!==null&&!jd(e)&&e.constructor!==null&&!jd(e.constructor)&&xi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const YM=Wo("ArrayBuffer");function yY(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&YM(e.buffer),t}const bY=kb("string"),xi=kb("function"),WM=kb("number"),Lm=e=>e!==null&&typeof e=="object",xY=e=>e===!0||e===!1,Yv=e=>{if(Cb(e)!=="object")return!1;const t=Lk(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ZM in e)&&!(_b in e)},wY=e=>{if(!Lm(e)||zm(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},SY=Wo("Date"),_Y=Wo("File"),CY=Wo("Blob"),kY=Wo("FileList"),EY=e=>Lm(e)&&xi(e.pipe),jY=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xi(e.append)&&((t=Cb(e))==="formdata"||t==="object"&&xi(e.toString)&&e.toString()==="[object FormData]"))},RY=Wo("URLSearchParams"),[IY,NY,TY,OY]=["ReadableStream","Request","Response","Headers"].map(Wo),AY=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fm(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),tf(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(zm(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(r=0;r<a;r++)c=o[r],t.call(null,e[c],c,e)}}function XM(e,t){if(zm(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 fc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JM=e=>!jd(e)&&e!==fc;function W1(){const{caseless:e,skipUndefined:t}=JM(this)&&this||{},n={},r=(i,o)=>{const a=e&&XM(n,o)||o;Yv(n[a])&&Yv(i)?n[a]=W1(n[a],i):Yv(i)?n[a]=W1({},i):tf(i)?n[a]=i.slice():(!t||!jd(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&Fm(arguments[i],r);return n}const DY=(e,t,n,{allOwnKeys:r}={})=>(Fm(t,(i,o)=>{n&&xi(i)?e[o]=GM(i,n):e[o]=i},{allOwnKeys:r}),e),$Y=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),PY=(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)},MY=(e,t,n,r)=>{let i,o,a;const c={};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))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Lk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zY=(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},LY=e=>{if(!e)return null;if(tf(e))return e;let t=e.length;if(!WM(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},FY=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Lk(Uint8Array)),UY=(e,t)=>{const r=(e&&e[_b]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},VY=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BY=Wo("HTMLFormElement"),HY=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),KA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qY=Wo("RegExp"),QM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Fm(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},KY=e=>{QM(e,(t,n)=>{if(xi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(xi(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+"'")})}})},GY=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return tf(e)?r(e):r(String(e).split(t)),n},ZY=()=>{},YY=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function WY(e){return!!(e&&xi(e.append)&&e[ZM]==="FormData"&&e[_b])}const XY=e=>{const t=new Array(10),n=(r,i)=>{if(Lm(r)){if(t.indexOf(r)>=0)return;if(zm(r))return r;if(!("toJSON"in r)){t[i]=r;const o=tf(r)?[]:{};return Fm(r,(a,c)=>{const d=n(a,i+1);!jd(d)&&(o[c]=d)}),t[i]=void 0,o}}return r};return n(e,0)},JY=Wo("AsyncFunction"),QY=e=>e&&(Lm(e)||xi(e))&&xi(e.then)&&xi(e.catch),ez=((e,t)=>e?setImmediate:t?((n,r)=>(fc.addEventListener("message",({source:i,data:o})=>{i===fc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),fc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xi(fc.postMessage)),eW=typeof queueMicrotask<"u"?queueMicrotask.bind(fc):typeof process<"u"&&process.nextTick||ez,tW=e=>e!=null&&xi(e[_b]),me={isArray:tf,isArrayBuffer:YM,isBuffer:zm,isFormData:jY,isArrayBufferView:yY,isString:bY,isNumber:WM,isBoolean:xY,isObject:Lm,isPlainObject:Yv,isEmptyObject:wY,isReadableStream:IY,isRequest:NY,isResponse:TY,isHeaders:OY,isUndefined:jd,isDate:SY,isFile:_Y,isBlob:CY,isRegExp:qY,isFunction:xi,isStream:EY,isURLSearchParams:RY,isTypedArray:FY,isFileList:kY,forEach:Fm,merge:W1,extend:DY,trim:AY,stripBOM:$Y,inherits:PY,toFlatObject:MY,kindOf:Cb,kindOfTest:Wo,endsWith:zY,toArray:LY,forEachEntry:UY,matchAll:VY,isHTMLForm:BY,hasOwnProperty:KA,hasOwnProp:KA,reduceDescriptors:QM,freezeMethods:KY,toObjectSet:GY,toCamelCase:HY,noop:ZY,toFiniteNumber:YY,findKey:XM,global:fc,isContextDefined:JM,isSpecCompliantForm:WY,toJSONObject:XY,isAsyncFn:JY,isThenable:QY,setImmediate:ez,asap:eW,isIterable:tW};function mt(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)}me.inherits(mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:me.toJSONObject(this.config),code:this.code,status:this.status}}});const tz=mt.prototype,nz={};["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=>{nz[e]={value:e}});Object.defineProperties(mt,nz);Object.defineProperty(tz,"isAxiosError",{value:!0});mt.from=(e,t,n,r,i,o)=>{const a=Object.create(tz);me.toFlatObject(e,a,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return mt.call(a,c,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 nW=null;function X1(e){return me.isPlainObject(e)||me.isArray(e)}function rz(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function GA(e,t,n){return e?e.concat(t).map(function(i,o){return i=rz(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function rW(e){return me.isArray(e)&&!e.some(X1)}const iW=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function Eb(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!me.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||m,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(i))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(me.isDate(x))return x.toISOString();if(me.isBoolean(x))return x.toString();if(!d&&me.isBlob(x))throw new mt("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(x)||me.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(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(me.isArray(x)&&rW(x)||(me.isFileList(x)||me.endsWith(S,"[]"))&&(k=me.toArray(x)))return S=rz(S),k.forEach(function(j,R){!(me.isUndefined(j)||j===null)&&t.append(a===!0?GA([S],R,o):a===null?S:S+"[]",f(j))}),!1}return X1(x)?!0:(t.append(GA(C,S,o),f(x)),!1)}const h=[],v=Object.assign(iW,{defaultVisitor:m,convertValue:f,isVisitable:X1});function y(x,S){if(!me.isUndefined(x)){if(h.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(x),me.forEach(x,function(k,E){(!(me.isUndefined(k)||k===null)&&i.call(t,k,me.isString(E)?E.trim():E,S,v))===!0&&y(k,S?S.concat(E):[E])}),h.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return y(e),t}function ZA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fk(e,t){this._pairs=[],e&&Eb(e,this,t)}const iz=Fk.prototype;iz.append=function(t,n){this._pairs.push([t,n])};iz.toString=function(t){const n=t?function(r){return t.call(this,r,ZA)}:ZA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function oW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oz(e,t,n){if(!t)return e;const r=n&&n.encode||oW;me.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=me.isURLSearchParams(t)?t.toString():new Fk(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class YA{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){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const az={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},aW=typeof URLSearchParams<"u"?URLSearchParams:Fk,sW=typeof FormData<"u"?FormData:null,lW=typeof Blob<"u"?Blob:null,cW={isBrowser:!0,classes:{URLSearchParams:aW,FormData:sW,Blob:lW},protocols:["http","https","file","blob","url","data"]},Uk=typeof window<"u"&&typeof document<"u",J1=typeof navigator=="object"&&navigator||void 0,uW=Uk&&(!J1||["ReactNative","NativeScript","NS"].indexOf(J1.product)<0),dW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fW=Uk&&window.location.href||"http://localhost",pW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Uk,hasStandardBrowserEnv:uW,hasStandardBrowserWebWorkerEnv:dW,navigator:J1,origin:fW},Symbol.toStringTag,{value:"Module"})),Or={...pW,...cW};function mW(e,t){return Eb(e,new Or.classes.URLSearchParams,{visitor:function(n,r,i,o){return Or.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function hW(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gW(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 sz(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&me.isArray(i)?i.length:a,d?(me.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!me.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&me.isArray(i[a])&&(i[a]=gW(i[a])),!c)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,i)=>{t(hW(r),i,n,0)}),n}return null}function vW(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Um={transitional:az,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=me.isObject(t);if(o&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return i?JSON.stringify(sz(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mW(t,this.formSerializer).toString();if((c=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Eb(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),vW(t)):t}],transformResponse:[function(t){const n=this.transitional||Um.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?mt.from(c,mt.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Or.classes.FormData,Blob:Or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{Um.headers[e]={}});const yW=me.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"]),bW=e=>{const t={};let n,r,i;return e&&e.split(`
3
+ `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&yW[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},WA=Symbol("internals");function wp(e){return e&&String(e).trim().toLowerCase()}function Wv(e){return e===!1||e==null?e:me.isArray(e)?e.map(Wv):String(e)}function xW(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 wW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function a_(e,t,n,r,i){if(me.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function SW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _W(e,t){const n=me.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 wi=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(c,d,f){const m=wp(d);if(!m)throw new Error("header name must be a non-empty string");const h=me.findKey(i,m);(!h||i[h]===void 0||f===!0||f===void 0&&i[h]!==!1)&&(i[h||d]=Wv(c))}const a=(c,d)=>me.forEach(c,(f,m)=>o(f,m,d));if(me.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(me.isString(t)&&(t=t.trim())&&!wW(t))a(bW(t),n);else if(me.isObject(t)&&me.isIterable(t)){let c={},d,f;for(const m of t){if(!me.isArray(m))throw TypeError("Object iterator must return a key-value pair");c[f=m[0]]=(d=c[f])?me.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}a(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=wp(t),t){const r=me.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return xW(i);if(me.isFunction(n))return n.call(this,i,r);if(me.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wp(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||a_(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=wp(a),a){const c=me.findKey(r,a);c&&(!n||a_(r,r[c],c,n))&&(delete r[c],i=!0)}}return me.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||a_(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return me.forEach(this,(i,o)=>{const a=me.findKey(r,o);if(a){n[a]=Wv(i),delete n[o];return}const c=t?SW(o):String(o).trim();c!==o&&delete n[o],n[c]=Wv(i),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&me.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(`
4
+ `)}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[WA]=this[WA]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=wp(a);r[c]||(_W(i,a),r[c]=!0)}return me.isArray(t)?t.forEach(o):o(t),this}};wi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(wi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(wi);function s_(e,t){const n=this||Um,r=t||n,i=wi.from(r.headers);let o=r.data;return me.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function lz(e){return!!(e&&e.__CANCEL__)}function nf(e,t,n){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(nf,mt,{__CANCEL__:!0});function cz(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new mt("Request failed with status code "+n.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function CW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kW(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 EW(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 hy=(e,t,n=3)=>{let r=0;const i=kW(50,250);return EW(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,f=i(d),m=a<=c;r=a;const h={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&m?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},XA=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},JA=e=>(...t)=>me.asap(()=>e(...t)),jW=Or.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Or.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Or.origin),Or.navigator&&/(msie|trident)/i.test(Or.navigator.userAgent)):()=>!0,RW=Or.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&c.push(`path=${r}`),me.isString(i)&&c.push(`domain=${i}`),o===!0&&c.push("secure"),me.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.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 IW(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function NW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function uz(e,t,n){let r=!IW(t);return e&&(r||n==!1)?NW(e,t):t}const QA=e=>e instanceof wi?{...e}:e;function jc(e,t){t=t||{};const n={};function r(f,m,h,v){return me.isPlainObject(f)&&me.isPlainObject(m)?me.merge.call({caseless:v},f,m):me.isPlainObject(m)?me.merge({},m):me.isArray(m)?m.slice():m}function i(f,m,h,v){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f,h,v)}else return r(f,m,h,v)}function o(f,m){if(!me.isUndefined(m))return r(void 0,m)}function a(f,m){if(me.isUndefined(m)){if(!me.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function c(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:c,headers:(f,m,h)=>i(QA(f),QA(m),h,!0)};return me.forEach(Object.keys({...e,...t}),function(m){const h=d[m]||i,v=h(e[m],t[m],m);me.isUndefined(v)&&h!==c||(n[m]=v)}),n}const dz=e=>{const t=jc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=wi.from(a),t.url=oz(uz(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),me.isFormData(n)){if(Or.hasStandardBrowserEnv||Or.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(me.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(Or.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&jW(t.url))){const d=i&&o&&RW.read(o);d&&a.set(i,d)}return t},TW=typeof XMLHttpRequest<"u",OW=TW&&function(e){return new Promise(function(n,r){const i=dz(e);let o=i.data;const a=wi.from(i.headers).normalize();let{responseType:c,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=wi.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),T={data:!c||c==="text"||c==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:j,config:e,request:C};cz(function(O){n(O),S()},function(O){r(O),S()},T),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 mt("Request aborted",mt.ECONNABORTED,e,C)),C=null)},C.onerror=function(R){const T=R&&R.message?R.message:"Network Error",N=new mt(T,mt.ERR_NETWORK,e,C);N.event=R||null,r(N),C=null},C.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const T=i.transitional||az;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),r(new mt(R,T.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,C)),C=null},o===void 0&&a.setContentType(null),"setRequestHeader"in C&&me.forEach(a.toJSON(),function(R,T){C.setRequestHeader(T,R)}),me.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),c&&c!=="json"&&(C.responseType=i.responseType),f&&([v,x]=hy(f,!0),C.addEventListener("progress",v)),d&&C.upload&&([h,y]=hy(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(m=j=>{C&&(r(!j||j.type?new nf(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=CW(i.url);if(E&&Or.protocols.indexOf(E)===-1){r(new mt("Unsupported protocol "+E+":",mt.ERR_BAD_REQUEST,e));return}C.send(o||null)})},AW=(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,c();const m=f instanceof Error?f:this.reason;r.abort(m instanceof mt?m:new nf(m instanceof Error?m.message:m))}};let a=t&&setTimeout(()=>{a=null,o(new mt(`timeout ${t} of ms exceeded`,mt.ETIMEDOUT))},t);const c=()=>{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=()=>me.asap(c),d}},DW=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},$W=async function*(e,t){for await(const n of PW(e))yield*DW(n,t)},PW=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()}},eD=(e,t,n,r)=>{const i=$W(e,t);let o=0,a,c=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:m}=await i.next();if(f){c(),d.close();return}let h=m.byteLength;if(n){let v=o+=h;n(v)}d.enqueue(new Uint8Array(m))}catch(f){throw c(f),f}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},tD=64*1024,{isFunction:iv}=me,MW=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:nD,TextEncoder:rD}=me.global,iD=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zW=e=>{e=me.merge.call({skipUndefined:!0},MW,e);const{fetch:t,Request:n,Response:r}=e,i=t?iv(t):typeof fetch=="function",o=iv(n),a=iv(r);if(!i)return!1;const c=i&&iv(nD),d=i&&(typeof rD=="function"?(x=>S=>x.encode(S))(new rD):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=o&&c&&iD(()=>{let x=!1;const S=new n(Or.origin,{body:new nD,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!S}),m=a&&c&&iD(()=>me.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 mt(`Response type '${x}' is not supported`,mt.ERR_NOT_SUPPORT,C)})});const v=async x=>{if(x==null)return 0;if(me.isBlob(x))return x.size;if(me.isSpecCompliantForm(x))return(await new n(Or.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(me.isArrayBufferView(x)||me.isArrayBuffer(x))return x.byteLength;if(me.isURLSearchParams(x)&&(x=x+""),me.isString(x))return(await d(x)).byteLength},y=async(x,S)=>{const C=me.toFiniteNumber(x.getContentLength());return C??v(S)};return async x=>{let{url:S,method:C,data:k,signal:E,cancelToken:j,timeout:R,onDownloadProgress:T,onUploadProgress:N,responseType:O,headers:M,withCredentials:L="same-origin",fetchOptions:K}=dz(x),ee=t||fetch;O=O?(O+"").toLowerCase():"text";let q=AW([E,j&&j.toAbortSignal()],R),Y=null;const U=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let H;try{if(N&&f&&C!=="get"&&C!=="head"&&(H=await y(M,k))!==0){let $=new n(S,{method:"POST",body:k,duplex:"half"}),V;if(me.isFormData(k)&&(V=$.headers.get("content-type"))&&M.setContentType(V),$.body){const[A,J]=XA(H,hy(JA(N)));k=eD($.body,tD,A,J)}}me.isString(L)||(L=L?"include":"omit");const z=o&&"credentials"in n.prototype,W={...K,signal:q,method:C.toUpperCase(),headers:M.normalize().toJSON(),body:k,duplex:"half",credentials:z?L:void 0};Y=o&&new n(S,W);let F=await(o?ee(Y,K):ee(S,W));const te=m&&(O==="stream"||O==="response");if(m&&(T||te&&U)){const $={};["status","statusText","headers"].forEach(fe=>{$[fe]=F[fe]});const V=me.toFiniteNumber(F.headers.get("content-length")),[A,J]=T&&XA(V,hy(JA(T),!0))||[];F=new r(eD(F.body,tD,A,()=>{J&&J(),U&&U()}),$)}O=O||"text";let D=await h[me.findKey(h,O)||"text"](F,x);return!te&&U&&U(),await new Promise(($,V)=>{cz($,V,{data:D,headers:wi.from(F.headers),status:F.status,statusText:F.statusText,config:x,request:Y})})}catch(z){throw U&&U(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,x,Y),{cause:z.cause||z}):mt.from(z,z&&z.code,x,Y)}}},LW=new Map,fz=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,c=a,d,f,m=LW;for(;c--;)d=o[c],f=m.get(d),f===void 0&&m.set(d,f=c?new Map:zW(t)),m=f;return f};fz();const Vk={http:nW,xhr:OW,fetch:{get:fz}};me.forEach(Vk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const oD=e=>`- ${e}`,FW=e=>me.isFunction(e)||e===null||e===!1;function UW(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let c;if(i=r,!FW(r)&&(i=Vk[(c=String(r)).toLowerCase()],i===void 0))throw new mt(`Unknown adapter '${c}'`);if(i&&(me.isFunction(i)||(i=i.get(t))))break;o[c||"#"+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 c=n?a.length>1?`since :
5
+ `+a.map(oD).join(`
6
+ `):" "+oD(a[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return i}const pz={getAdapter:UW,adapters:Vk};function l_(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nf(null,e)}function aD(e){return l_(e),e.headers=wi.from(e.headers),e.data=s_.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pz.getAdapter(e.adapter||Um.adapter,e)(e).then(function(r){return l_(e),r.data=s_.call(e,e.transformResponse,r),r.headers=wi.from(r.headers),r},function(r){return lz(r)||(l_(e),r&&r.response&&(r.response.data=s_.call(e,e.transformResponse,r.response),r.response.headers=wi.from(r.response.headers))),Promise.reject(r)})}const mz="1.13.2",jb={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jb[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const sD={};jb.transitional=function(t,n,r){function i(o,a){return"[Axios v"+mz+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new mt(i(a," has been removed"+(n?" in "+n:"")),mt.ERR_DEPRECATED);return n&&!sD[a]&&(sD[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};jb.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function VW(e,t,n){if(typeof e!="object")throw new mt("options must be an object",mt.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 c=e[o],d=c===void 0||a(c,o,e);if(d!==!0)throw new mt("option "+o+" must be "+d,mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new mt("Unknown option "+o,mt.ERR_BAD_OPTION)}}const Xv={assertOptions:VW,validators:jb},ia=Xv.validators;let bc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new YA,response:new YA}}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+=`
7
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=jc(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Xv.assertOptions(r,{silentJSONParsing:ia.transitional(ia.boolean),forcedJSONParsing:ia.transitional(ia.boolean),clarifyTimeoutError:ia.transitional(ia.boolean)},!1),i!=null&&(me.isFunction(i)?n.paramsSerializer={serialize:i}:Xv.assertOptions(i,{encode:ia.function,serialize:ia.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Xv.assertOptions(n,{baseUrl:ia.spelling("baseURL"),withXsrfToken:ia.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&me.merge(o.common,o[n.method]);o&&me.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),n.headers=wi.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(d=d&&S.synchronous,c.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=[aD.bind(this),void 0];for(x.unshift(...c),x.push(...f),v=x.length,m=Promise.resolve(n);h<v;)m=m.then(x[h++],x[h++]);return m}v=c.length;let y=n;for(;h<v;){const x=c[h++],S=c[h++];try{y=x(y)}catch(C){S.call(this,C);break}}try{m=aD.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=jc(this.defaults,t);const n=uz(t.baseURL,t.url,t.allowAbsoluteUrls);return oz(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){bc.prototype[t]=function(n,r){return this.request(jc(r||{},{method:t,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,c){return this.request(jc(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}bc.prototype[t]=n(),bc.prototype[t+"Form"]=n(!0)});let BW=class hz{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(c=>{r.subscribe(c),o=c}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new nf(o,a,c),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 hz(function(i){t=i}),cancel:t}}};function HW(e){return function(n){return e.apply(null,n)}}function qW(e){return me.isObject(e)&&e.isAxiosError===!0}const Q1={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(Q1).forEach(([e,t])=>{Q1[t]=e});function gz(e){const t=new bc(e),n=GM(bc.prototype.request,t);return me.extend(n,bc.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return gz(jc(e,i))},n}const Ln=gz(Um);Ln.Axios=bc;Ln.CanceledError=nf;Ln.CancelToken=BW;Ln.isCancel=lz;Ln.VERSION=mz;Ln.toFormData=Eb;Ln.AxiosError=mt;Ln.Cancel=Ln.CanceledError;Ln.all=function(t){return Promise.all(t)};Ln.spread=HW;Ln.isAxiosError=qW;Ln.mergeConfig=jc;Ln.AxiosHeaders=wi;Ln.formToJSON=e=>sz(me.isHTMLForm(e)?new FormData(e):e);Ln.getAdapter=pz.getAdapter;Ln.HttpStatusCode=Q1;Ln.default=Ln;const{Axios:K$e,AxiosError:G$e,CanceledError:Z$e,isCancel:Y$e,CancelToken:W$e,VERSION:X$e,all:J$e,Cancel:Q$e,isAxiosError:e2e,spread:t2e,toFormData:n2e,AxiosHeaders:r2e,HttpStatusCode:i2e,formToJSON:o2e,getAdapter:a2e,mergeConfig:s2e}=Ln,Gt=Ln.create({withCredentials:!0,baseURL:"/",timeout:15e3,headers:{"Content-Type":"application/json"}});function Zr(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function KW(e){return e.replicated?.some(t=>vz(t))??!1}function GW(e){return e.status!=="failed"}function vz(e){return e.status==="failed"}function ZW(e){if(KW(e.data)){const t=e.data.replicated.filter(GW),n=e.data.replicated.filter(vz),r=t.length?`The operation partially succeeded, but ${Zr(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(`
8
+ `);return Promise.reject(r+`
9
+ `+i)}return e}function Uc(e=1e3){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}function YW(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 c=5e3*Math.pow(2,r.__retryCount-1);return await Uc(c),e.request(r)}}function Qa({id:e=An,operationsUrl:t,port:n,secure:r,forceFabricConnect:i}={}){let o=t||Et.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||Et.checkForFabricConnect(e);a&&(e.startsWith("clu-")?o=Gt.defaults.baseURL+`/Cluster/${e}/operation`:e.startsWith("ins-")&&(o=Gt.defaults.baseURL+`/HDBInstance/${e}/operation`));const c=Et.checkForBasicAuth(e),d=Ln.create({auth:a?void 0:c,withCredentials:a||!c,timeout:15e3,headers:{"Content-Type":"application/json"},baseURL:o});return d.interceptors.response.use(ZW,YW(d)),d}var rf=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(){}},WW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},XW=class{#e=WW;#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)}},pc=new XW;function JW(e){setTimeout(e,0)}var Rc=typeof window>"u"||"Deno"in globalThis;function Gr(){}function QW(e,t){return typeof e=="function"?e(t):e}function eC(e){return typeof e=="number"&&e>=0&&e!==1/0}function yz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ol(e,t){return typeof e=="function"?e(t):e}function ho(e,t){return typeof e=="function"?e(t):e}function lD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==Bk(a,t.options))return!1}else if(!pm(t.queryKey,a))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||o&&!o(t))}function cD(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ic(t.options.mutationKey)!==Ic(o))return!1}else if(!pm(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Bk(e,t){return(t?.queryKeyHashFn||Ic)(e)}function Ic(e){return JSON.stringify(e,(t,n)=>tC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>pm(e[n],t[n])):!1}var eX=Object.prototype.hasOwnProperty;function bz(e,t){if(e===t)return e;const n=uD(e)&&uD(t);if(!n&&!(tC(e)&&tC(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=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){c[m]=h,(n?f<i:eX.call(e,m))&&d++;continue}if(h===null||v===null||typeof h!="object"||typeof v!="object"){c[m]=v;continue}const y=bz(h,v);c[m]=y,y===h&&d++}return i===a&&d===i?e:c}function gy(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 uD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tC(e){if(!dD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dD(e){return Object.prototype.toString.call(e)==="[object Object]"}function tX(e){return new Promise(t=>{pc.setTimeout(t,e)})}function nC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bz(e,t):t}function nX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function rX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hk=Symbol();function xz(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Hk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wz(e,t){return typeof e=="function"?e(...t):!!e}var iX=class extends rf{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Rc&&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"}},qk=new iX;function rC(){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 oX=JW;function aX(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=oX;const o=c=>{t?e.push(c):i(()=>{n(c)})},a=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||a()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var sr=aX(),sX=class extends rf{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Rc&&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}},vy=new sX;function lX(e){return Math.min(1e3*2**e,3e4)}function Sz(e){return(e??"online")==="online"?vy.isOnline():!0}var iC=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function _z(e){let t=!1,n=0,r;const i=rC(),o=()=>i.status!=="pending",a=S=>{if(!o()){const C=new iC(S);v(C),e.onCancel?.(C)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>qk.isFocused()&&(e.networkMode==="always"||vy.isOnline())&&e.canRun(),m=()=>Sz(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??(Rc?0:3),j=e.retryDelay??lX,R=typeof j=="function"?j(n,k):j,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!T){v(k);return}n++,e.onFail?.(n,k),tX(R).then(()=>f()?void 0:y()).then(()=>{t?v(k):x()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:m,start:()=>(m()?x():y().then(x),i)}}var Cz=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eC(this.gcTime)&&(this.#e=pc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(pc.clearTimeout(this.#e),this.#e=void 0)}},cX=class extends Cz{#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=pD(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=pD(this.options);t.data!==void 0&&(this.setState(fD(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=nC(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=>ho(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ol(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:!yz(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 c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const c=xz(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(c,f,this):c(f)},a=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();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=_z({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof iC&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#o({type:"failed",failureCount:c,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 c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof iC){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#o({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}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,...kz(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fD(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"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),sr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function kz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Sz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pD(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 Ez=class extends rf{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=rC(),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),mD(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oC(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oC(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 ho(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&&!gy(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&hD(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||ho(this.options.enabled,this.#t)!==ho(t.enabled,this.#t)||ol(this.options.staleTime,this.#t)!==ol(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||ho(this.options.enabled,this.#t)!==ho(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 dX(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=ol(this.options.staleTime,this.#t);if(Rc||this.#i.isStale||!eC(e))return;const n=yz(this.#i.dataUpdatedAt,e)+1;this.#c=pc.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,!(Rc||ho(this.options.enabled,this.#t)===!1||!eC(this.#l)||this.#l===0)&&(this.#u=pc.setInterval(()=>{(this.options.refetchIntervalInBackground||qk.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(pc.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(pc.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 M=this.hasListeners(),L=!M&&mD(e,t),K=M&&hD(e,n,t,r);(L||K)&&(m={...m,...kz(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 M;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(M=i.data,C=!0):M=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,M!==void 0&&(S="success",v=nC(i?.data,M,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=nC(i?.data,v,t),this.#f=v,this.#o=null}catch(M){this.#o=M}this.#o&&(y=this.#o,v=this.#f,x=Date.now(),S="error");const k=m.fetchStatus==="fetching",E=S==="pending",j=S==="error",R=E&&k,T=v!==void 0,O={status:S,fetchStatus:m.fetchStatus,isPending:E,isSuccess:S==="success",isError:j,isInitialLoading:R,isLoading:R,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&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:j&&T,isStale:Kk(e,t),refetch:this.refetch,promise:this.#s,isEnabled:ho(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=ee=>{O.status==="error"?ee.reject(O.error):O.data!==void 0&&ee.resolve(O.data)},L=()=>{const ee=this.#s=O.promise=rC();M(ee)},K=this.#s;switch(K.status){case"pending":e.queryHash===n.queryHash&&M(K);break;case"fulfilled":(O.status==="error"||O.data!==K.value)&&L();break;case"rejected":(O.status!=="error"||O.error!==K.reason)&&L();break}}return O}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),gy(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 c=a;return this.#i[c]!==e[c]&&o.has(c)})};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){sr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uX(e,t){return ho(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mD(e,t){return uX(e,t)||e.state.data!==void 0&&oC(e,t,t.refetchOnMount)}function oC(e,t,n){if(ho(t.enabled,e)!==!1&&ol(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Kk(e,t)}return!1}function hD(e,t,n,r){return(e!==t||ho(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Kk(e,n)}function Kk(e,t){return ho(t.enabled,e)!==!1&&e.isStaleByTime(ol(t.staleTime,e))}function dX(e,t){return!gy(e.getCurrentResult(),t)}function gD(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 c={pages:[],pageParams:[]},d=0;const f=async()=>{let m=!1;const h=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},v=xz(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 N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return h(N),N})(),j=await v(E),{maxPages:R}=t.options,T=C?rX:nX;return{pages:T(x.pages,j,R),pageParams:T(x.pageParams,S,R)}};if(i&&o.length){const x=i==="backward",S=x?fX:vD,C={pages:o,pageParams:a},k=S(r,C);c=await y(C,k,x)}else{const x=e??o.length;do{const S=d===0?a[0]??r.initialPageParam:vD(r,c);if(d>0&&S==null)break;c=await y(c,S),d++}while(d<x)}return c};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 vD(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 fX(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var pX=class extends Cz{#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||jz(),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=_z({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{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error: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),sr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function jz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rz=class extends rf{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 pX({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=ov(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=ov(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=ov(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=ov(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){sr.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=>cD(t,n))}findAll(e={}){return this.getAll().filter(t=>cD(e,t))}notify(e){sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return sr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Gr))))}};function ov(e){return e.options.scope?.id}var mX=class extends rf{#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),gy(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ic(n.mutationKey)!==Ic(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??jz();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){sr.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};t?.type==="success"?(this.#i.onSuccess?.(t.data,n,r,i),this.#i.onSettled?.(t.data,null,n,r,i)):t?.type==="error"&&(this.#i.onError?.(t.error,n,r,i),this.#i.onSettled?.(void 0,t.error,n,r,i))}this.listeners.forEach(n=>{n(this.#t)})})}},Iz=class extends rf{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Bk(r,t);let o=this.get(i);return o||(o=new cX({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(){sr.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=>lD(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lD(e,n)):t}notify(e){sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){sr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hX=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new Iz,this.#t=e.mutationCache||new Rz,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=qk.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=vy.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(ol(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=QW(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return sr.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;sr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return sr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=sr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Gr).catch(Gr)}invalidateQueries(e,t={}){return sr.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=sr.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(ol(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=gD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gr).catch(Gr)}ensureInfiniteQueryData(e){return e.behavior=gD(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vy.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(Ic(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{pm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ic(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{pm(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=Bk(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===Hk&&(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()}},c_={exports:{}},ut={};var yD;function gX(){if(yD)return ut;yD=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"),c=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($){return $===null||typeof $!="object"?null:($=v&&$[v]||$["@@iterator"],typeof $=="function"?$:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k($,V,A){this.props=$,this.context=V,this.refs=C,this.updater=A||x}k.prototype.isReactComponent={},k.prototype.setState=function($,V){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,V,"setState")},k.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function E(){}E.prototype=k.prototype;function j($,V,A){this.props=$,this.context=V,this.refs=C,this.updater=A||x}var R=j.prototype=new E;R.constructor=j,S(R,k.prototype),R.isPureReactComponent=!0;var T=Array.isArray;function N(){}var O={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function L($,V,A){var J=A.ref;return{$$typeof:e,type:$,key:V,ref:J!==void 0?J:null,props:A}}function K($,V){return L($.type,V,$.props)}function ee($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function q($){var V={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(A){return V[A]})}var Y=/\/+/g;function U($,V){return typeof $=="object"&&$!==null&&$.key!=null?q(""+$.key):V.toString(36)}function H($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(N,N):($.status="pending",$.then(function(V){$.status==="pending"&&($.status="fulfilled",$.value=V)},function(V){$.status==="pending"&&($.status="rejected",$.reason=V)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function z($,V,A,J,fe){var ge=typeof $;(ge==="undefined"||ge==="boolean")&&($=null);var B=!1;if($===null)B=!0;else switch(ge){case"bigint":case"string":case"number":B=!0;break;case"object":switch($.$$typeof){case e:case t:B=!0;break;case m:return B=$._init,z(B($._payload),V,A,J,fe)}}if(B)return fe=fe($),B=J===""?"."+U($,0):J,T(fe)?(A="",B!=null&&(A=B.replace(Y,"$&/")+"/"),z(fe,V,A,"",function(Ie){return Ie})):fe!=null&&(ee(fe)&&(fe=K(fe,A+(fe.key==null||$&&$.key===fe.key?"":(""+fe.key).replace(Y,"$&/")+"/")+B)),V.push(fe)),1;B=0;var se=J===""?".":J+":";if(T($))for(var _e=0;_e<$.length;_e++)J=$[_e],ge=se+U(J,_e),B+=z(J,V,A,ge,fe);else if(_e=y($),typeof _e=="function")for($=_e.call($),_e=0;!(J=$.next()).done;)J=J.value,ge=se+U(J,_e++),B+=z(J,V,A,ge,fe);else if(ge==="object"){if(typeof $.then=="function")return z(H($),V,A,J,fe);throw V=String($),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return B}function W($,V,A){if($==null)return $;var J=[],fe=0;return z($,J,"","",function(ge){return V.call(A,ge,fe++)}),J}function F($){if($._status===-1){var V=$._result;V=V(),V.then(function(A){($._status===0||$._status===-1)&&($._status=1,$._result=A)},function(A){($._status===0||$._status===-1)&&($._status=2,$._result=A)}),$._status===-1&&($._status=0,$._result=V)}if($._status===1)return $._result.default;throw $._result}var te=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},D={map:W,forEach:function($,V,A){W($,function(){V.apply(this,arguments)},A)},count:function($){var V=0;return W($,function(){V++}),V},toArray:function($){return W($,function(V){return V})||[]},only:function($){if(!ee($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return ut.Activity=h,ut.Children=D,ut.Component=k,ut.Fragment=n,ut.Profiler=i,ut.PureComponent=j,ut.StrictMode=r,ut.Suspense=d,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ut.__COMPILER_RUNTIME={__proto__:null,c:function($){return O.H.useMemoCache($)}},ut.cache=function($){return function(){return $.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.cloneElement=function($,V,A){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var J=S({},$.props),fe=$.key;if(V!=null)for(ge in V.key!==void 0&&(fe=""+V.key),V)!M.call(V,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&V.ref===void 0||(J[ge]=V[ge]);var ge=arguments.length-2;if(ge===1)J.children=A;else if(1<ge){for(var B=Array(ge),se=0;se<ge;se++)B[se]=arguments[se+2];J.children=B}return L($.type,fe,J)},ut.createContext=function($){return $={$$typeof:a,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:o,_context:$},$},ut.createElement=function($,V,A){var J,fe={},ge=null;if(V!=null)for(J in V.key!==void 0&&(ge=""+V.key),V)M.call(V,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(fe[J]=V[J]);var B=arguments.length-2;if(B===1)fe.children=A;else if(1<B){for(var se=Array(B),_e=0;_e<B;_e++)se[_e]=arguments[_e+2];fe.children=se}if($&&$.defaultProps)for(J in B=$.defaultProps,B)fe[J]===void 0&&(fe[J]=B[J]);return L($,ge,fe)},ut.createRef=function(){return{current:null}},ut.forwardRef=function($){return{$$typeof:c,render:$}},ut.isValidElement=ee,ut.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:F}},ut.memo=function($,V){return{$$typeof:f,type:$,compare:V===void 0?null:V}},ut.startTransition=function($){var V=O.T,A={};O.T=A;try{var J=$(),fe=O.S;fe!==null&&fe(A,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(N,te)}catch(ge){te(ge)}finally{V!==null&&A.types!==null&&(V.types=A.types),O.T=V}},ut.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ut.use=function($){return O.H.use($)},ut.useActionState=function($,V,A){return O.H.useActionState($,V,A)},ut.useCallback=function($,V){return O.H.useCallback($,V)},ut.useContext=function($){return O.H.useContext($)},ut.useDebugValue=function(){},ut.useDeferredValue=function($,V){return O.H.useDeferredValue($,V)},ut.useEffect=function($,V){return O.H.useEffect($,V)},ut.useEffectEvent=function($){return O.H.useEffectEvent($)},ut.useId=function(){return O.H.useId()},ut.useImperativeHandle=function($,V,A){return O.H.useImperativeHandle($,V,A)},ut.useInsertionEffect=function($,V){return O.H.useInsertionEffect($,V)},ut.useLayoutEffect=function($,V){return O.H.useLayoutEffect($,V)},ut.useMemo=function($,V){return O.H.useMemo($,V)},ut.useOptimistic=function($,V){return O.H.useOptimistic($,V)},ut.useReducer=function($,V,A){return O.H.useReducer($,V,A)},ut.useRef=function($){return O.H.useRef($)},ut.useState=function($){return O.H.useState($)},ut.useSyncExternalStore=function($,V,A){return O.H.useSyncExternalStore($,V,A)},ut.useTransition=function(){return O.H.useTransition()},ut.version="19.2.3",ut}var bD;function Vm(){return bD||(bD=1,c_.exports=gX()),c_.exports}var b=Vm();const Q=ef(b),Gk=dY({__proto__:null,default:Q},[b]);var Nz=b.createContext(void 0),rr=e=>{const t=b.useContext(Nz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vX=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Nz.Provider,{value:e,children:t})),Tz=b.createContext(!1),yX=()=>b.useContext(Tz);Tz.Provider;function bX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xX=b.createContext(bX()),wX=()=>b.useContext(xX),SX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},_X=e=>{b.useEffect(()=>{e.clearReset()},[e])},CX=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||wz(n,[e.error,r])),kX=(e,t)=>t.state.data===void 0,EX=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))}},jX=(e,t)=>e.isLoading&&e.isFetching&&!t,RX=(e,t)=>e?.suspense&&t.isPending,xD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Oz(e,t,n){const r=yX(),i=wX(),o=rr(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",EX(a),SX(a,i),_X(i);const c=!o.getQueryCache().get(a.queryHash),[d]=b.useState(()=>new t(o,a)),f=d.getOptimisticResult(a),m=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(h=>{const v=m?d.subscribe(sr.batchCalls(h)):Gr;return d.updateResult(),v},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),b.useEffect(()=>{d.setOptions(a)},[a,d]),RX(a,f))throw xD(a,d,i);if(CX({result:f,errorResetBoundary:i,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,f),a.experimental_prefetchInRender&&!Rc&&jX(f,r)&&(c?xD(a,d,i):o.getQueryCache().get(a.queryHash)?.promise)?.catch(Gr).finally(()=>{d.updateResult()}),a.notifyOnChangeProps?f:d.trackResult(f)}function Pt(e,t){return Oz(e,Ez)}function Wi(e,t){return Oz({...e,enabled:!0,suspense:!0,throwOnError:kX,placeholderData:void 0},Ez)}function c2e(e){return e}function ct(e,t){const n=rr(),[r]=b.useState(()=>new mX(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(sr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((a,c)=>{r.mutate(a,c).catch(Gr)},[r]);if(i.error&&wz(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}async function Az(){const{data:e}=await Gt.get("/User/current");return e}const Rb=["current-user"];function IX(){return{queryKey:Rb,queryFn:Az,retry:!1}}async function Bm({instanceClient:e,entityId:t}){const{data:n}=await e.post("/",{operation:"logout"});if(Et.flagForBasicAuth(t,null),n)return n;throw new Error("Something went wrong")}async function al({instanceClient:e,...t}){const{data:n}=await e.post("/",{operation:"user_info"},t);return n}function Zk(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(Ed)),t.includes("://")||(n.protocol="https:"),n.toString()}function Yk(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 An="OverallAppSignIn";class NX{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[An]={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 An}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!==An)try{const n=Qa({id:t});await Bm({entityId:t,instanceClient:n})}catch(n){console.error(`Failed to log out from ${t}, carrying on`,n)}}calculateKeyFromEntity(t){return An}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 Uc(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 mY}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===An?hd&&(r=await al({instanceClient:Qa()})):t&&(r=await al({instanceClient:Qa({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 Et=new NX,gd=new WeakMap,Jv=new WeakMap,yy={current:[]};let u_=!1,em=0;const Gp=new Set,av=new Map;function Dz(e){const t=Array.from(e).sort((n,r)=>n instanceof vd&&n.options.deps.includes(r)?1:r instanceof vd&&r.options.deps.includes(n)?-1:0);for(const n of t){if(yy.current.includes(n))continue;yy.current.push(n),n.recompute();const r=Jv.get(n);if(r)for(const i of r){const o=gd.get(i);o&&Dz(o)}}}function TX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function OX(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function $z(e){if(em>0&&!av.has(e)&&av.set(e,e.prevState),Gp.add(e),!(em>0)&&!u_)try{for(u_=!0;Gp.size>0;){const t=Array.from(Gp);Gp.clear();for(const n of t){const r=av.get(n)??n.prevState;n.prevState=r,TX(n)}for(const n of t){const r=gd.get(n);r&&(yy.current.push(n),Dz(r))}for(const n of t){const r=gd.get(n);if(r)for(const i of r)OX(i)}}}finally{u_=!1,yy.current=[],av.clear()}}function tm(e){em++;try{e()}finally{if(em--,em===0){const t=Gp.values().next().value;t&&$z(t)}}}function AX(e){return typeof e=="function"}class aC{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):AX(t)?this.state=t(this.prevState):this.state=t,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),$z(this)}}class vd{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 vd&&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 vd)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof aC){let r=gd.get(n);r||(r=new Set,gd.set(n,r)),r.add(this);let i=Jv.get(this);i||(i=new Set,Jv.set(this,i)),i.add(n)}}unregisterFromGraph(t=this.options.deps){for(const n of t)if(n instanceof vd)this.unregisterFromGraph(n.options.deps);else if(n instanceof aC){const r=gd.get(n);r&&r.delete(this);const i=Jv.get(this);i&&i.delete(n)}}}const sl="__TSR_index",wD="popstate",SD="beforeunload";function DX(e){let t=e.getLocation();const n=new Set,r=a=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:a}))},i=a=>{e.notifyOnIndexChange??!0?r(a):t=e.getLocation()},o=async({task:a,navigateOpts:c,...d})=>{if(c?.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=mm(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,c,d)=>{const f=t.state[sl];c=_D(f+1,c),o({task:()=>{e.pushState(a,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:a,state:c})},replace:(a,c,d)=>{const f=t.state[sl];c=_D(f,c),o({task:()=>{e.replaceState(a,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:a,state:c})},go:(a,c)=>{o({task:()=>{e.go(a),i({type:"GO",index:a})},navigateOpts:c,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[sl]!==0,createHref:a=>e.createHref(a),block:a=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,a]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==a))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function _D(e,t){t||(t={});const n=Wk();return{...t,key:n,__TSR_key:n,[sl]:e}}function Pz(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=M=>i=M,c=e?.createHref??(M=>M),d=e?.parseLocation??(()=>mm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=Wk();t.history.replaceState({[sl]:0,key:M,__TSR_key:M},"")}let f=d(),m,h=!1,v=!1,y=!1,x=!1;const S=()=>f;let C,k;const E=()=>{C&&(O._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),O._ignoreSubscribers=!1,C=void 0,k=void 0,m=void 0)},j=(M,L,K)=>{const ee=c(L);k||(m=f),f=mm(L,K),C={href:ee,state:K,isPush:C?.isPush||M==="push"},k||(k=Promise.resolve().then(()=>E()))},R=M=>{f=d(),O.notify({type:M})},T=async()=>{if(v){v=!1;return}const M=d(),L=M.state[sl]-f.state[sl],K=L===1,ee=L===-1,q=!K&&!ee||h;h=!1;const Y=q?"GO":ee?"BACK":"FORWARD",U=q?{type:"GO",index:L}:{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:M,action:Y})){v=!0,t.history.go(1),O.notify(U);return}}}f=d(),O.notify(U)},N=M=>{if(x){x=!1;return}let L=!1;const K=o();if(typeof document<"u"&&K.length)for(const ee of K){const q=ee.enableBeforeUnload??!0;if(q===!0){L=!0;break}if(typeof q=="function"&&q()===!0){L=!0;break}}if(L)return M.preventDefault(),M.returnValue=""},O=DX({getLocation:S,getLength:()=>t.history.length,pushState:(M,L)=>j("push",M,L),replaceState:(M,L)=>j("replace",M,L),back:M=>(M&&(y=!0),x=!0,t.history.back()),forward:M=>{M&&(y=!0),x=!0,t.history.forward()},go:M=>{h=!0,t.history.go(M)},createHref:M=>c(M),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(SD,N,{capture:!0}),t.removeEventListener(wD,T)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:o,setBlockers:a,notifyOnIndexChange:!1});return t.addEventListener(SD,N,{capture:!0}),t.addEventListener(wD,T),t.history.pushState=function(...M){const L=n.apply(t.history,M);return O._ignoreSubscribers||R("PUSH"),L},t.history.replaceState=function(...M){const L=r.apply(t.history,M);return O._ignoreSubscribers||R("REPLACE"),L},O}function $X(e){const t=typeof document<"u"?window:void 0;return Pz({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("#")}`,c=`${r}${i}${a}`;return mm(c,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function mm(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),i=Wk();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||{[sl]:0,key:i,__TSR_key:i}}}function Wk(){return(Math.random()+1).toString(36).substring(7)}function sC(e){return e[e.length-1]}function PX(e){return typeof e=="function"}function xc(e,t){return PX(e)?e(t):e}const MX=Object.prototype.hasOwnProperty;function po(e,t){if(e===t)return e;const n=t,r=ED(e)&&ED(n);if(!r&&!(by(e)&&by(n)))return n;const i=r?e:CD(e);if(!i)return n;const o=r?n:CD(n);if(!o)return n;const a=i.length,c=o.length,d=r?new Array(c):{};let f=0;for(let m=0;m<c;m++){const h=r?m:o[m],v=e[h],y=n[h];if(v===y){d[h]=v,(r?m<a:MX.call(e,h))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){d[h]=y;continue}const x=po(v,y);d[h]=x,x===v&&f++}return a===c&&f===a?e:d}function CD(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 by(e){if(!kD(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!kD(n)||!n.hasOwnProperty("isPrototypeOf"))}function kD(e){return Object.prototype.toString.call(e)==="[object Object]"}function ED(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function wc(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(!wc(e[r],t[r],n))return!1;return!0}if(by(e)&&by(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const a in t)if((!r||t[a]!==void 0)&&!wc(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||!wc(e[a],t[a],n)))return!1;return i===o}return!1}function Rd(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 zX(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 ll(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}var LX="Invariant failed";function ns(e,t){if(!e)throw new Error(LX)}const gi="__root__",ha=0,Nc=1,Id=2,Nd=3;function es(e){return Xk(e.filter(t=>t!==void 0).join("/"))}function Xk(e){return e.replace(/\/{2,}/g,"/")}function Jk(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function cl(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Qv(e){return cl(Jk(e))}function xy(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function FX(e,t,n){return xy(e,n)===xy(t,n)}function UX(e){const{type:t,value:n}=e;if(t===ha)return n;const{prefixSegment:r,suffixSegment:i}=e;if(t===Nc){const o=n.substring(1);if(r&&i)return`${r}{$${o}}${i}`;if(r)return`${r}{$${o}}`;if(i)return`{$${o}}${i}`}if(t===Nd){const o=n.substring(1);return r&&i?`${r}{-$${o}}${i}`:r?`${r}{-$${o}}`:i?`{-$${o}}${i}`:`{-$${o}}`}if(t===Id){if(r&&i)return`${r}{$}${i}`;if(r)return`${r}{$}`;if(i)return`{$}${i}`}return n}function VX({base:e,to:t,trailingSlash:n="never",parseCache:r}){let i=Mz(e,r).slice();const o=Ib(t,r);i.length>1&&sC(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&&(sC(i).value==="/"?n==="never"&&i.pop():n==="always"&&i.push({type:ha,value:"/"}));const a=i.map(UX);return es(a)}const Mz=(e,t)=>zz(e,t,!0),Ib=(e,t)=>zz(e,t,!1),zz=(e,t,n)=>{if(!e)return[];const r=t?.get(e);if(r)return r;const i=ZX(e,n);return t?.set(e,i),i},BX=/^\$.{1,}$/,HX=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,qX=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,KX=/^\$$/,GX=/^(.*?)\{\$\}(.*)$/;function ZX(e,t){e=Xk(e);const n=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),n.push({type:ha,value:"/"})),!e)return n;const r=e.split("/").filter(Boolean);return n.push(...r.map(i=>{const o=!t&&i!==gi&&i.slice(-1)==="_"?i.slice(0,-1):i,a=o.match(GX);if(a){const f=a[1],m=a[2];return{type:Id,value:"$",prefixSegment:f||void 0,suffixSegment:m||void 0}}const c=o.match(qX);if(c){const f=c[1],m=c[2],h=c[3];return{type:Nd,value:m,prefixSegment:f||void 0,suffixSegment:h||void 0}}const d=o.match(HX);if(d){const f=d[1],m=d[2],h=d[3];return{type:Nc,value:""+m,prefixSegment:f||void 0,suffixSegment:h||void 0}}if(BX.test(o)){const f=o.substring(1);return{type:Nc,value:"$"+f,prefixSegment:void 0,suffixSegment:void 0}}return KX.test(o)?{type:Id,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ha,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:ha,value:"/"})),n}function sv({path:e,params:t,leaveWildcards:n,leaveParams:r,decodeCharMap:i,parseCache:o}){const a=Ib(e,o);function c(h){const v=t[h],y=typeof v=="string";return h==="*"||h==="_splat"?y?encodeURI(v):v:y?YX(v,i):v}let d=!1;const f={},m=es(a.map(h=>{if(h.type===ha)return h.value;if(h.type===Id){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=c("_splat");return n?`${v}${h.value}${x??""}${y}`:`${v}${x}${y}`}if(h.type===Nc){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=c(h.value);return`${y}${h.value}${S??""}${x}`}return`${y}${c(v)??"undefined"}${x}`}if(h.type===Nd){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=c(h.value);return`${y}${h.value}${S??""}${x}`}return n?`${y}${v}${c(v)??""}${x}`:`${y}${c(v)??""}${x}`}return h.value}));return{usedParams:f,interpolatedPath:m,isMissingParams:d}}function YX(e,t){let n=encodeURIComponent(e);if(t)for(const[r,i]of t)n=n.replaceAll(r,i);return n}function lC(e,t,n){const r=WX(e,t,n);if(!(t.to&&!r))return r??{}}function WX(e,{to:t,fuzzy:n,caseSensitive:r},i){const o=t,a=Mz(e.startsWith("/")?e:`/${e}`,i),c=Ib(o.startsWith("/")?o:`/${o}`,i),d={};return XX(a,c,d,n,r)?d:void 0}function XX(e,t,n,r,i){let o=0,a=0;for(;o<e.length||a<t.length;){const c=e[o],d=t[a];if(d){if(d.type===Id){const f=e.slice(o);let m;if(d.prefixSegment||d.suffixSegment){if(!c)return!1;const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.value;if("prefixSegment"in d&&!y.startsWith(h)||"suffixSegment"in d&&!e[e.length-1]?.value.endsWith(v))return!1;let x=decodeURI(es(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(es(f.map(h=>h.value)));return n["*"]=m,n._splat=m,!0}if(d.type===ha){if(d.value==="/"&&!c?.value){a++;continue}if(c){if(i){if(d.value!==c.value)return!1}else if(d.value.toLowerCase()!==c.value.toLowerCase())return!1;o++,a++;continue}else return!1}if(d.type===Nc){if(!c||c.value==="/")return!1;let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.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(c.value),m=!0;m&&(n[d.value.substring(1)]=f,o++),a++;continue}if(d.type===Nd){if(!c){a++;continue}if(c.value==="/"){a++;continue}let f="",m=!1;if(d.prefixSegment||d.suffixSegment){const h=d.prefixSegment||"",v=d.suffixSegment||"",y=c.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===ha&&y.value===c.value){h=!1;break}if(y?.type===Nc||y?.type===Id){e.length<t.length&&(h=!1);break}}h&&(f=decodeURIComponent(c.value),m=!0)}m&&(n[d.value.substring(1)]=f,o++),a++;continue}}if(o<e.length&&a>=t.length)return n["**"]=es(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!==Nd)return!1;break}break}return!0}const JX=.75,QX=1,eJ=.5,tJ=.4,nJ=.25,rJ=.2,iJ=.05,oJ=.02,aJ=.01,jD=2e-4,RD=1e-4;function ID(e,t){return e.prefixSegment&&e.suffixSegment?t+iJ+jD*e.prefixSegment.length+RD*e.suffixSegment.length:e.prefixSegment?t+oJ+jD*e.prefixSegment.length:e.suffixSegment?t+aJ+RD*e.suffixSegment.length:t}function sJ(e){const t=[];return e.forEach((r,i)=>{if(r.isRoot||!r.path)return;const o=Jk(r.fullPath);let a=Ib(o),c=0;for(;a.length>c+1&&a[c]?.value==="/";)c++;c>0&&(a=a.slice(c));let d=0,f=!1;const m=a.map((h,v)=>{if(h.value==="/")return JX;if(h.type===ha)return QX;let y;h.type===Nc?y=eJ:h.type===Nd?(y=tJ,d++):y=nJ;for(let x=v+1;x<a.length;x++){const S=a[x];if(S.type===ha&&S.value!=="/")return f=!0,ID(h,y+rJ)}return ID(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 lJ({routeTree:e,initRoute:t}){const n={},r={},i=a=>{a.forEach((c,d)=>{t?.(c,d);const f=n[c.id];if(ns(!f,`Duplicate routes found with id: ${String(c.id)}`),n[c.id]=c,!c.isRoot&&c.path){const h=cl(c.fullPath);(!r[h]||c.fullPath.endsWith("/"))&&(r[h]=c)}const m=c.children;m?.length&&i(m)})};i([e]);const o=sJ(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function Bo(e){return!!e?.isNotFound}function cJ(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const wy="tsr-scroll-restoration-v1_3",uJ=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function dJ(){const e=cJ();if(!e)return null;const t=e.getItem(wy);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=xc(r,n)||n,e.setItem(wy,JSON.stringify(n)))}}const lv=dJ(),cC=e=>e.state.__TSR_key||e.href;function fJ(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 Sy=!1;function Lz({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 c=t||window.history.state?.__TSR_key,d=a[c];Sy=!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)}}Sy=!1}function pJ(e,t){if(!lv&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!lv))return;e.isScrollRestorationSetup=!0,Sy=!1;const r=e.options.getScrollRestorationKey||cC;window.history.scrollRestoration="manual";const i=o=>{if(Sy||!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=fJ(o.target)}const c=r(e.state.location);lv.set(d=>{const f=d[c]||={},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",uJ(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})||(Lz({storageKey:wy,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&lv.set(c=>(c[a]||={},c)))})}function mJ(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 hJ(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 d_(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function gJ(e){const t=new URLSearchParams(e),n={};for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=d_(i):Array.isArray(o)?o.push(d_(i)):n[r]=[o,d_(i)]}return n}const vJ=bJ(JSON.parse),yJ=xJ(JSON.stringify,JSON.parse);function bJ(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=gJ(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function xJ(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=hJ(i,r);return o?`?${o}`:""}}function Vc(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 ua(e){return e instanceof Response&&!!e.options}function wJ(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 c=t.get(o);if(c)c.value=a,i(c);else{const d={key:o,value:a,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const ey=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Nb=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Fz=(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),ns(n.options.notFoundComponent);const r=e.matches.find(i=>i.routeId===n.id);ns(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,Fz(e,t))},Qs=(e,t,n)=>{if(!(!ua(n)&&!Bo(n))){if(ua(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=ua(n)?"redirected":"notFound";e.updateMatch(t.id,i=>({...i,status:r,isFetching:!1,error:n})),Bo(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ua(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Fz(e,n),n)}},Uz=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Sp=(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,Qs(e,e.router.getMatch(i),n);try{a.options.onError?.(n)}catch(c){n=c,Qs(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},SJ=(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===gi;return}if(a?.ssr===!1){i.ssr=!1;return}const c=y=>y===!0&&a?.ssr==="data-only"?"data-only":y,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=c(d);return}if(typeof r.options.ssr!="function"){i.ssr=c(r.options.ssr);return}const{search:f,params:m}=i,h={search:cv(f,i.searchError),params:cv(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:cv(y.search,y.searchError),params:cv(y.params,y.paramsError),ssr:y.ssr}))},v=r.options.ssr(h);if(ll(v))return v.then(y=>{i.ssr=c(y??d)});i.ssr=c(v??d)},Vz=(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&&!Nb(e,t)&&(n.options.loader||n.options.beforeLoad||qz(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const a=setTimeout(()=>{ey(e)},i);r._nonReactive.pendingTimeout=a}},_J=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Vz(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Qs(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},CJ=(e,t,n,r)=>{const i=e.router.getMatch(t),o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Rd(()=>{o?.resolve()});const{paramsError:a,searchError:c}=i;a&&Sp(e,n,a,"PARSE_PARAMS"),c&&Sp(e,n,c,"VALIDATE_SEARCH"),Vz(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,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:d,context:v})))},S=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){tm(()=>{x(),S()});return}i._nonReactive.beforeLoadPromise=Rd();const{search:C,params:k,cause:E}=i,j=Nb(e,t),R={search:C,abortController:d,params:k,preload:j,context:v,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":E,matches:e.matches,...e.router.options.additionalContext},T=O=>{if(O===void 0){tm(()=>{x(),S()});return}(ua(O)||Bo(O))&&(x(),Sp(e,n,O,"BEFORE_LOAD")),tm(()=>{x(),e.updateMatch(t,M=>({...M,__beforeLoadContext:O,context:{...M.context,...O}})),S()})};let N;try{if(N=r.options.beforeLoad(R),ll(N))return x(),N.catch(O=>{Sp(e,n,O,"BEFORE_LOAD")}).then(T)}catch(O){x(),Sp(e,n,O,"BEFORE_LOAD")}T(N)},kJ=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=SJ(e,n,t,i);if(ll(d))return d.then(c)}return c()},a=()=>CJ(e,n,t,i),c=()=>{if(Uz(e,n))return;const d=_J(e,n,i);return ll(d)?d.then(a):a()};return o()},nm=(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,c])=>{const d=o?.meta,f=o?.links,m=o?.scripts,h=o?.styles;return{meta:d,links:f,headScripts:m,headers:c,scripts:a,styles:h}})},Bz=(e,t,n,r)=>{const i=e.matchPromises[n-1],{params:o,loaderDeps:a,abortController:c,context:d,cause:f}=e.router.getMatch(t),m=Nb(e,t);return{params:o,deps:a,preload:!!m,parentMatchPromise:i,abortController:c,context:d,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:m?"preload":f,route:r,...e.router.options.additionalContext}},ND=async(e,t,n,r)=>{try{const i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&Hz(r);const o=r.options.loader?.(Bz(e,t,n,r)),a=r.options.loader&&ll(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;Qs(e,e.router.getMatch(t),h),h!==void 0&&e.updateMatch(t,v=>({...v,loaderData:h}))}r._lazyPromise&&await r._lazyPromise;const d=nm(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 c=i._nonReactive.minPendingPromise;c&&await c,Bo(o)&&await r.options.notFoundComponent?.preload?.(),Qs(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(m){a=m,Qs(e,e.router.getMatch(t),m)}const d=nm(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=nm(e,t,r);if(a){const c=await a;e.updateMatch(t,d=>({...d,...c}))}o._nonReactive.loaderPromise=void 0}Qs(e,o,i)}},EJ=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let i=!1,o=!1;const a=e.router.looseRoutesById[r];if(Uz(e,n)){if(e.router.isServer){const f=nm(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&&Qs(e,m,m.error)}else{const m=Date.now()-f.updatedAt,h=Nb(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(Bz(e,n,t,a)):y,S=!!h&&!e.router.state.matches.some(j=>j.id===n),C=e.router.getMatch(n);C._nonReactive.loaderPromise=Rd(),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 ND(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){ua(j)&&await e.router.navigate(j.options)}})();else if(k!=="success"||i&&e.sync)await ND(e,n,t,a);else{const j=nm(e,n,a);if(j){const R=await j;e.updateMatch(n,T=>({...T,...R}))}}}}const c=e.router.getMatch(n);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const d=o?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(n,f=>({...f,isFetching:d,invalid:!1})),e.router.getMatch(n)):c};async function TD(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&ey(t);try{for(let i=0;i<t.matches.length;i++){const o=kJ(t,i);ll(o)&&await o}const n=t.firstBadMatchIndex??t.matches.length;for(let i=0;i<n;i++)t.matchPromises.push(EJ(t,i));await Promise.all(t.matchPromises);const r=ey(t);ll(r)&&await r}catch(n){if(Bo(n)&&!t.preload){const r=ey(t);throw ll(r)&&await r,n}if(ua(n))throw n}return t.matches}async function Hz(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 Kz){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 cv(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function qz(e){for(const t of Kz)if(e.options[t]?.preload)return!0;return!1}const Kz=["component","errorComponent","pendingComponent","notFoundComponent"];function jJ(e){return{input:({url:t})=>{for(const n of e)t=Gz(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Zz(e[n],t);return t}}}function RJ(e){const t=Qv(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const c=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return c===i?a.pathname="/":c.startsWith(o)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=es(["/",t,a.pathname]),a)}}function Gz(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 Zz(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 Sc(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 IJ{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=Pz())),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 aC(TJ(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(v=>!["redirected"].includes(v.status))}}}),pJ(this));let c=!1;const d=this.options.basepath??"/",f=this.options.rewrite;if(o||i!==d||a!==f){this.basepath=d;const v=[];Qv(d)!==""&&v.push(RJ({basepath:d})),f&&v.push(f),this.rewrite=v.length===0?void 0:v.length===1?v[0]:jJ(v),this.history&&this.updateLatestLocation(),c=!0}c&&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}=lJ({routeTree:this.routeTree,initRoute:(a,c)=>{a.init({originalIndex:c})}});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=Gz(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:po(r?.search,v),hash:C.split("#").reverse()[0]??"",state:po(r?.state,f)}},o=i(n),{__tempLocation:a,__tempKey:c}=o.state;if(a&&(!c||c===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)=>VX({base:n,to:Xk(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=wJ(1e3),this.getMatchedRoutes=(n,r)=>OJ({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,c=this.matchRoutes(a,{_buildLocation:!0}),d=sC(c);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,xc(o.params,v)),S=sv({path:y,params:x,parseCache:this.parsePathnameCache}).interpolatedPath,C=this.matchRoutes(S,void 0,{_buildLocation:!0}).map(K=>this.looseRoutesById[K.routeId]);if(Object.keys(x).length>0)for(const K of C){const ee=K.options.params?.stringify??K.options.stringifyParams;ee&&Object.assign(x,ee(x))}const k=sv({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 K={};C.forEach(ee=>{if(ee.options.validateSearch)try{Object.assign(K,uC(ee.options.validateSearch,{...K,...E}))}catch{}}),E=K}E=AJ({search:E,dest:o,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),E=po(h,E);const j=this.options.stringifySearch(E),R=o.hash===!0?a.hash:o.hash?xc(o.hash,a.hash):void 0,T=R?`#${R}`:"";let N=o.state===!0?a.state:o.state?xc(o.state,a.state):{};N=po(a.state,N);const O=`${k}${j}${T}`,M=new URL(O,this.origin),L=Zz(this.rewrite,M);return{publicHref:L.pathname+L.search+L.hash,href:O,url:L.href,pathname:k,search:E,searchStr:j,state:N,hash:R??"",unmaskOnReload:o.unmaskOnReload}},i=(o={},a)=>{const c=r(o);let d=a?r(a):void 0;if(!d){let f={};const m=this.options.routeMasks?.find(h=>{const v=lC(c.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&&(c.maskedLocation=d),c};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=wc(i.state,this.latestLocation.state);return d.forEach(m=>{delete i.state[m]}),f},a=cl(this.latestLocation.href)===cl(i.href),c=this.commitLocationPromise;if(this.commitLocationPromise=Rd(()=>{c?.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:c,...d}={})=>{if(c){const m=this.history.location.state.__TSR_index,h=mm(c,{__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(Qv(i(this.latestLocation.href))!==Qv(i(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),Vc({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(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Sc({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Sc({resolvedLocation:f,location:d})}),await TD({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let m,h,v;tm(()=>{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){ua(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Bo(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),c()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(c=>c.status==="error")&&(a=500),a!==void 0&&this.__store.setState(c=>({...c,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,c=typeof r.types=="function"?r.types(Sc({resolvedLocation:a,location:o})):r.types;if(c===!1){n();return}i={update:n,types:c}}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=Hz,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(c=>c.id)),a=new Set([...o,...this.state.cachedMatches.map(c=>c.id)]);tm(()=>{i.forEach(c=>{a.has(c.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,c]}))})});try{return i=await TD({router:this,matches:i,location:r,preload:!0,updateMatch:(c,d)=>{o.has(c)?i=i.map(f=>f.id===c?d(f):f):this.updateMatch(c,d)}}),i}catch(c){if(ua(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});Bo(c)||console.error(c);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 c=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=lC(c.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!wc(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?wc(c.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??yJ,parseSearch:t.parseSearch??vJ}),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["**"]:cl(t.pathname))&&(this.options.notFoundRoute?i.push(this.options.notFoundRoute):a=!0);const c=(()=>{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 gi}})(),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 q=v?.search??t.search,Y=v?._strictSearch??void 0;try{const U=uC(m.options.validateSearch,{...q})??void 0;return[{...q,...U},{...Y,...U},void 0]}catch(U){let H=U;if(U instanceof _y||(H=new _y(U.message,{cause:U})),n?.throwOnError)throw H;return[q,{},H]}})(),C=m.options.loaderDeps?.({search:y})??"",k=C?JSON.stringify(C):"",{interpolatedPath:E,usedParams:j}=sv({path:m.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),R=sv({path:m.id,params:o,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+k,T=this.getMatch(R),N=this.state.matches.find(q=>q.routeId===m.id),O=T?._strictParams??j;let M;if(!T){const q=m.options.params?.parse??m.options.parseParams;if(q)try{Object.assign(O,q(O))}catch(Y){if(M=new NJ(Y.message,{cause:Y}),n?.throwOnError)throw M}}Object.assign(o,O);const L=N?"stay":"enter";let K;if(T)K={...T,cause:L,params:N?po(N.params,o):o,_strictParams:O,search:po(N?N.search:T.search,y),_strictSearch:x};else{const q=m.options.loader||m.options.beforeLoad||m.lazyFn||qz(m)?"pending":"success";K={id:R,index:h,routeId:m.id,params:N?po(N.params,o):o,_strictParams:O,pathname:E,updatedAt:Date.now(),search:N?po(N.search,y):y,_strictSearch:x,searchError:void 0,status:q,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:Rd()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:L,loaderDeps:N?po(N.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||(K.globalNotFound=c===m.id),K.searchError=S;const ee=f(v);K.context={...ee,...K.__routeContext,...K.__beforeLoadContext},d.push(K)}),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 _y extends Error{}class NJ extends Error{}function TJ(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function uC(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new _y("Async validation not supported");if(n.issues)throw new _y(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 OJ({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:i,flatRoutes:o,parseCache:a}){let c={};const d=cl(e),f=y=>lC(d,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},a);let m=t!==void 0?r[t]:void 0;if(m)c=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,c=S;break}}!m&&y&&(m=y.foundRoute,c=y.routeParams)}let h=m||i[gi];const v=[h];for(;h.parentRoute;)h=h.parentRoute,v.push(h);return v.reverse(),{matchedRoutes:v,routeParams:c,foundRoute:m}}function AJ({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const i=n.reduce((c,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,...uC(d.options.validateSearch,y)??void 0}}catch{return y}};f.push(m)}return c.concat(f)},[])??[],o=({search:c})=>t.search?t.search===!0?c:xc(t.search,c):{};i.push(o);const a=(c,d)=>{if(c>=i.length)return d;const f=i[c];return f({search:d,next:h=>a(c+1,h)})};return a(0,e)}const DJ="Error preloading route! ☝️";class Yz{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=gi:this.parentRoute||ns(!1);let o=i?gi:r?.path;o&&o!=="/"&&(o=Jk(o));const a=r?.id||o;let c=i?gi:es([this.parentRoute.id===gi?"":this.parentRoute.id,a]);o===gi&&(o="/"),c!==gi&&(c=es(["/",c]));const d=c===gi?"/":es([this.parentRoute.fullPath,o]);this._path=o,this._id=c,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 $J extends Yz{constructor(t){super(t)}}function Qk(e){const t=e.errorComponent??Tb;return u.jsx(PJ,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}class PJ 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 Tb({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 MJ({children:e,fallback:t=null}){return zJ()?u.jsx(Q.Fragment,{children:e}):u.jsx(Q.Fragment,{children:t})}function zJ(){return Q.useSyncExternalStore(LJ,()=>!0,()=>!1)}function LJ(){return()=>{}}var f_={exports:{}},p_={},m_={exports:{}},h_={};var OD;function FJ(){if(OD)return h_;OD=1;var e=Vm();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 c(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:c;return h_.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,h_}var AD;function UJ(){return AD||(AD=1,m_.exports=FJ()),m_.exports}var DD;function VJ(){if(DD)return p_;DD=1;var e=Vm(),t=UJ();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,c=e.useMemo,d=e.useDebugValue;return p_.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=c(function(){function k(N){if(!E){if(E=!0,j=N,N=v(N),y!==void 0&&S.hasValue){var O=S.value;if(y(O,N))return R=O}return R=N}if(O=R,r(j,N))return O;var M=v(N);return y!==void 0&&y(O,M)?(j=N,O):(j=N,R=M)}var E=!1,j,R,T=h===void 0?null:h;return[function(){return k(m())},T===null?void 0:function(){return k(T())}]},[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},p_}var $D;function BJ(){return $D||($D=1,f_.exports=VJ()),f_.exports}var HJ=BJ();function qJ(e,t=n=>n){return HJ.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,KJ)}function KJ(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=PD(e);if(n.length!==PD(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 PD(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const g_=b.createContext(null);function Wz(){return typeof document>"u"?g_:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=g_,g_)}function xn(e){const t=b.useContext(Wz());return e?.warn,t}function Yr(e){const t=xn({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return qJ(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=po(r.current,e.select(i));return r.current=o,o}return e.select(i)}return i})}const Ob=b.createContext(void 0),GJ=b.createContext(void 0);function Ho(e){const t=b.useContext(e.from?GJ:Ob);return Yr({select:r=>{const i=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(ns(!((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 Hm(e){return Ho({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function eE(e){const{select:t,...n}=e;return Ho({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function it(e){return Ho({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 Er(e){return Ho({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function En(e){const t=xn();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function _c(e){const t=xn(),n=En(),r=b.useRef(null);return b.useEffect(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}var v_={exports:{}},Rr={};var MD;function ZJ(){if(MD)return Rr;MD=1;var e=Vm();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 c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Rr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Rr.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)},Rr.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()}},Rr.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))},Rr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Rr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,h=c(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})}},Rr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=c(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)},Rr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,h=c(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})}},Rr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=c(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)},Rr.requestFormReset=function(d){r.d.r(d)},Rr.unstable_batchedUpdates=function(d,f){return d(f)},Rr.useFormState=function(d,f,m){return a.H.useFormState(d,f,m)},Rr.useFormStatus=function(){return a.H.useHostTransitionStatus()},Rr.version="19.2.3",Rr}var zD;function Xz(){if(zD)return v_.exports;zD=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(),v_.exports=ZJ(),v_.exports}var of=Xz();const tE=ef(of),uv=typeof window<"u"?b.useLayoutEffect:b.useEffect;function y_(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 YJ(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 WJ(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}function XJ(e,t){const n=xn(),[r,i]=b.useState(!1),o=b.useRef(!1),a=WJ(t),{activeProps:c,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:R,style:T,className:N,onClick:O,onFocus:M,onMouseEnter:L,onMouseLeave:K,onTouchStart:ee,ignoreBlocker:q,params:Y,search:U,hash:H,state:z,mask:W,reloadDocument:F,unsafeRelative:te,from:D,_fromLocation:$,...V}=e,A=Yr({select:Ce=>Ce.location.search,structuralSharing:!0}),J=e.from,fe=b.useMemo(()=>({...e,from:J}),[n,A,J,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ge=b.useMemo(()=>n.buildLocation({...fe}),[n,fe]),B=b.useMemo(()=>{if(R)return;let Ce=ge.maskedLocation?ge.maskedLocation.url:ge.url,re=!1;return n.origin&&(Ce.startsWith(n.origin)?Ce=n.history.createHref(Ce.replace(n.origin,""))||"/":re=!0),{href:Ce,external:re}},[R,ge.maskedLocation,ge.url,n.origin,n.history]),se=b.useMemo(()=>{if(B?.external)return B.href;try{return new URL(m),m}catch{}},[m,B]),_e=e.reloadDocument||se?!1:h??n.options.defaultPreload,Ie=v??n.options.defaultPreloadDelay??0,Fe=Yr({select:Ce=>{if(se)return!1;if(f?.exact){if(!FX(Ce.location.pathname,ge.pathname,n.basepath))return!1}else{const re=xy(Ce.location.pathname,n.basepath),ue=xy(ge.pathname,n.basepath);if(!(re.startsWith(ue)&&(re.length===ue.length||re[ue.length]==="/")))return!1}return(f?.includeSearch??!0)&&!wc(Ce.location.search,ge.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?Ce.location.hash===ge.hash:!0}}),Le=b.useCallback(()=>{n.preloadRoute({...fe}).catch(Ce=>{console.warn(Ce),console.warn(DJ)})},[n,fe]),We=b.useCallback(Ce=>{Ce?.isIntersecting&&Le()},[Le]);YJ(a,We,nQ,{disabled:!!R||_e!=="viewport"}),b.useEffect(()=>{o.current||!R&&_e==="render"&&(Le(),o.current=!0)},[R,Le,_e]);const gt=Ce=>{const re=Ce.currentTarget.target,ue=j!==void 0?j:re;if(!R&&!rQ(Ce)&&!Ce.defaultPrevented&&(!ue||ue==="_self")&&Ce.button===0){Ce.preventDefault(),of.flushSync(()=>{i(!0)});const X=n.subscribe("onResolved",()=>{X(),i(!1)});n.navigate({...fe,replace:x,resetScroll:C,hashScrollIntoView:y,startTransition:S,viewTransition:k,ignoreBlocker:q})}};if(se)return{...V,ref:a,href:se,...E&&{children:E},...j&&{target:j},...R&&{disabled:R},...T&&{style:T},...N&&{className:N},...O&&{onClick:O},...M&&{onFocus:M},...L&&{onMouseEnter:L},...K&&{onMouseLeave:K},...ee&&{onTouchStart:ee}};const Qt=Ce=>{R||_e&&Le()},Tn=Qt,sn=Ce=>{if(!(R||!_e))if(!Ie)Le();else{const re=Ce.target;if(_p.has(re))return;const ue=setTimeout(()=>{_p.delete(re),Le()},Ie);_p.set(re,ue)}},jr=Ce=>{if(R||!_e||!Ie)return;const re=Ce.target,ue=_p.get(re);ue&&(clearTimeout(ue),_p.delete(re))},Mt=Fe?xc(c,{})??JJ:b_,G=Fe?b_:xc(d,{})??b_,ae=[N,Mt.className,G.className].filter(Boolean).join(" "),pe=(T||Mt.style||G.style)&&{...T,...Mt.style,...G.style};return{...V,...Mt,...G,href:B?.href,ref:a,onClick:Cp([O,gt]),onFocus:Cp([M,Qt]),onMouseEnter:Cp([L,sn]),onMouseLeave:Cp([K,jr]),onTouchStart:Cp([ee,Tn]),disabled:!!R,target:j,...pe&&{style:pe},...ae&&{className:ae},...R&&QJ,...Fe&&eQ,...r&&tQ}}const b_={},JJ={className:"active"},QJ={role:"link","aria-disabled":!0},eQ={"data-status":"active","aria-current":"page"},tQ={"data-transitioning":"transitioning"},_p=new WeakMap,nQ={rootMargin:"100px"},Cp=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Ze=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,ref:o,...a}=XJ(r,t),c=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},c)});function rQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class iQ extends Yz{constructor(t){super(t),this.useMatch=n=>Ho({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ho({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Er({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>it({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>eE({...n,from:this.id}),this.useLoaderData=n=>Hm({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=Q.forwardRef((n,r)=>u.jsx(Ze,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function rt(e){return new iQ(e)}function oQ(){return e=>sQ(e)}class aQ extends $J{constructor(t){super(t),this.useMatch=n=>Ho({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ho({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Er({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>it({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>eE({...n,from:this.id}),this.useLoaderData=n=>Hm({...n,from:this.id}),this.useNavigate=()=>En({from:this.fullPath}),this.Link=Q.forwardRef((n,r)=>u.jsx(Ze,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function sQ(e){return new aQ(e)}function LD(e){return typeof e=="object"?new FD(e,{silent:!0}).createRoute(e):new FD(e,{silent:!0}).createRoute}class FD{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const i=rt(r);return i.isRoot=!1,i},this.silent=n?.silent}}class dC{constructor(t){this.useMatch=n=>Ho({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ho({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>Er({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>it({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>eE({...n,from:this.options.id}),this.useLoaderData=n=>Hm({...n,from:this.options.id}),this.useNavigate=()=>{const n=xn();return En({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function u2e(e){return t=>new dC({id:e,...t})}function UD(e){return typeof e=="object"?new dC(e):t=>new dC({id:e,...t})}function Jz(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,zX(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),c=function(f){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)throw a();return b.createElement(r,f)};return c.preload=a,c}function lQ(){const e=xn(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:o}=Yr({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),a=y_(o),c=o||n||i,d=y_(c),f=o||i,m=y_(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 cl(e.latestLocation.href)!==cl(v.href)&&e.commitLocation({...v,replace:!0}),()=>{h()}},[e,e.history]),uv(()=>{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]),uv(()=>{a&&!o&&e.emit({type:"onLoad",...Sc(e.state)})},[a,e,o]),uv(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...Sc(e.state)})},[f,m,e]),uv(()=>{d&&!c&&(e.emit({type:"onResolved",...Sc(e.state)}),e.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),mJ(e))},[c,d,e]),null}function cQ(e){const t=Yr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(Qk,{getResetKey:()=>t,onCatch:(n,r)=>{if(Bo(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Bo(n))return e.fallback?.(n);throw n},children:e.children})}function uQ(){return u.jsx("p",{children:"Not Found"})}function id(e){return u.jsx(u.Fragment,{children:e.children})}function Qz(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(uQ,{})}function dQ({children:e}){const t=xn();return t.isServer?u.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(`
10
+ `)+";$_TSR.c()"}}):null}function fQ(){const e=xn();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||cC)(e.latestLocation),r=n!==cC(e.latestLocation)?n:void 0,i={storageKey:wy,shouldScrollRestoration:!0};return r&&(i.key=r),u.jsx(dQ,{children:`(${Lz.toString()})(${JSON.stringify(i)})`})}const e4=b.memo(function({matchId:t}){const n=xn(),r=Yr({select:k=>{const E=k.matches.find(j=>j.id===t);return ns(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,c=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:id,v=c?Qk:id,y=f?cQ:id,x=Yr({select:k=>k.loadedAt}),S=Yr({select:k=>{const E=k.matches.findIndex(j=>j.id===t);return k.matches[E-1]?.routeId}}),C=i.isRoot?i.options.shellComponent??id:id;return u.jsxs(C,{children:[u.jsx(Ob.Provider,{value:t,children:u.jsx(h,{fallback:a,children:u.jsx(v,{getResetKey:()=>x,errorComponent:c||Tb,onCatch:(k,E)=>{if(Bo(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(MJ,{fallback:a,children:u.jsx(VD,{matchId:t})}):u.jsx(VD,{matchId:t})})})})}),S===gi&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(pQ,{}),u.jsx(fQ,{})]}):null]})});function pQ(){const e=xn(),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",...Sc(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const VD=b.memo(function({matchId:t}){const n=xn(),{match:r,key:i,routeId:o}=Yr({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],c=b.useMemo(()=>{const d=a.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(kl,{})},[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=Rd();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 ns(Bo(r.error)),Qz(n,a,r.error);if(r.status==="redirected")throw ns(ua(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(a.options.errorComponent??n.options.defaultErrorComponent)||Tb;return u.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return c}),kl=b.memo(function(){const t=xn(),n=b.useContext(Ob),r=Yr({select:f=>f.matches.find(m=>m.id===n)?.routeId}),i=t.routesById[r],o=Yr({select:f=>{const h=f.matches.find(v=>v.id===n);return ns(h),h.globalNotFound}}),a=Yr({select:f=>{const m=f.matches,h=m.findIndex(v=>v.id===n);return m[h+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(o)return Qz(t,i,void 0);if(!a)return null;const d=u.jsx(e4,{matchId:a});return n===gi?u.jsx(b.Suspense,{fallback:c,children:d}):d});function mQ(){const e=xn(),n=e.routesById[gi].options.pendingComponent??e.options.defaultPendingComponent,r=n?u.jsx(n,{}):null,i=e.isServer||typeof document<"u"&&e.ssr?id:b.Suspense,o=u.jsxs(i,{fallback:r,children:[!e.isServer&&u.jsx(lQ,{}),u.jsx(hQ,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:o}):o}function hQ(){const e=xn(),t=Yr({select:i=>i.matches[0]?.id}),n=Yr({select:i=>i.loadedAt}),r=t?u.jsx(e4,{matchId:t}):null;return u.jsx(Ob.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(Qk,{getResetKey:()=>n,errorComponent:Tb,onCatch:i=>{i.message||i.toString()},children:r})})}const gQ=e=>new vQ(e);class vQ extends IJ{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=LD,globalThis.createLazyFileRoute=UD):typeof window<"u"&&(window.createFileRoute=LD,window.createLazyFileRoute=UD);function yQ({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=Wz(),i=u.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:i}):i}function bQ({router:e,...t}){return u.jsx(yQ,{router:e,...t,children:u.jsx(mQ,{})})}function qm(e){return Ho({...e,select:t=>e.select?e.select(t.context):t.context})}function xQ(e){return Yr({select:t=>t.location})}function wQ(){const[e,t]=b.useState(Et.getAllConnections());return b.useEffect(()=>Et.listenToAllEntities((n,r)=>{t({...e,[r]:n})}),[e]),e}function Bc(){const e=Et.calculateIdFromEntity(An),[t,n]=b.useState(Et.getConnectionById(An));return b.useEffect(()=>Et.listenToEntity(e,n),[e]),t}function El(){return Bc()}function fs(e){const t=An,{clusterId:n,instanceId:r}=it({strict:!1}),[i,o]=b.useState(Et.getConnectionById(t));return b.useEffect(()=>Et.listenToEntity(t,o),[t]),i}function t4(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=t4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function n4(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=t4(e))&&(r&&(r+=" "),r+=t);return r}const BD=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_i=n4,Ab=(e,t)=>n=>{var r;if(t?.variants==null)return _i(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=BD(m)||BD(h);return i[f][v]}),c=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,...c}[S]):{...o,...c}[S]===C})?[...f,h,v]:f},[]);return _i(e,a,d,n?.class,n?.className)},kp="hover:-translate-y-1 transition duration-200",Ep="border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40",SQ=Ab(`inline-flex
11
+ items-center
12
+ justify-center
13
+ gap-2
14
+ whitespace-nowrap
15
+ rounded-lg
16
+ text-sm
17
+ transition-[color,box-shadow]
18
+ disabled:pointer-events-none
19
+ disabled:opacity-50
20
+ [&_svg]:pointer-events-none
21
+ [&_svg:not([class*='size-'])]:size-4
22
+ [&_svg]:shrink-0
23
+ ring-ring/10
24
+ dark:ring-ring/20
25
+ dark:outline-ring/40
26
+ outline-ring/50
27
+ focus-visible:ring-1
28
+ focus-visible:outline-1
29
+ focus-visible:ring-purple-200
30
+ 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:`${Ep} ${kp}`,ghostOutline:`${Ep} ${kp} border-none`,positiveOutline:`${Ep} ${kp} border-green`,destructiveOutline:`${Ep} ${kp} border-destructive`,defaultOutline:`${Ep} ${kp} 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"}}),_Q=(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},CQ=(e,t)=>({classGroupId:e,validator:t}),r4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cy="-",HD=[],kQ="arbitrary..",EQ=e=>{const t=RQ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return jQ(a);const c=a.split(Cy),d=c[0]===""&&c.length>1?1:0;return i4(c,d,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],f=n[a];return d?f?_Q(f,d):d:f||HD}return n[a]||HD}}},i4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const f=i4(e,t+1,o);if(f)return f}const a=n.validators;if(a===null)return;const c=t===0?e.join(Cy):e.slice(t).join(Cy),d=a.length;for(let f=0;f<d;f++){const m=a[f];if(m.validator(c))return m.classGroupId}},jQ=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?kQ+r:void 0})(),RQ=e=>{const{theme:t,classGroups:n}=e;return IQ(n,t)},IQ=(e,t)=>{const n=r4();for(const r in e){const i=e[r];nE(i,n,r,t)}return n},nE=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const a=e[o];NQ(a,t,n,r)}},NQ=(e,t,n,r)=>{if(typeof e=="string"){TQ(e,t,n);return}if(typeof e=="function"){OQ(e,t,n,r);return}AQ(e,t,n,r)},TQ=(e,t,n)=>{const r=e===""?t:o4(t,e);r.classGroupId=n},OQ=(e,t,n,r)=>{if(DQ(e)){nE(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(CQ(n,e))},AQ=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let a=0;a<o;a++){const[c,d]=i[a];nE(d,o4(t,c),n,r)}},o4=(e,t)=>{let n=e;const r=t.split(Cy),i=r.length;for(let o=0;o<i;o++){const a=r[o];let c=n.nextPart.get(a);c||(c=r4(),n.nextPart.set(a,c)),n=c}return n},DQ=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$Q=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)}}},fC="!",qD=":",PQ=[],KD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),MQ=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let a=0,c=0,d=0,f;const m=i.length;for(let S=0;S<m;S++){const C=i[S];if(a===0&&c===0){if(C===qD){o.push(i.slice(d,S)),d=S+1;continue}if(C==="/"){f=S;continue}}C==="["?a++:C==="]"?a--:C==="("?c++:C===")"&&c--}const h=o.length===0?i:i.slice(d);let v=h,y=!1;h.endsWith(fC)?(v=h.slice(0,-1),y=!0):h.startsWith(fC)&&(v=h.slice(1),y=!0);const x=f&&f>d?f-d:void 0;return KD(o,y,v,x)};if(t){const i=t+qD,o=r;r=a=>a.startsWith(i)?o(a.slice(i.length)):KD(PQ,!1,a,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},zQ=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],c=a[0]==="[",d=t.has(a);c||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}},LQ=e=>({cache:$Q(e.cacheSize),parseClassName:MQ(e),sortModifiers:zQ(e),...EQ(e)}),FQ=/\s+/,UQ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],c=e.trim().split(FQ);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[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+fC:E,R=j+k;if(a.indexOf(R)>-1)continue;a.push(R);const T=i(k,C);for(let N=0;N<T.length;++N){const O=T[N];a.push(j+O)}d=m+(d.length>0?" "+d:d)}return d},VQ=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=a4(n))&&(i&&(i+=" "),i+=r);return i},a4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=a4(e[r]))&&(n&&(n+=" "),n+=t);return n},BQ=(e,...t)=>{let n,r,i,o;const a=d=>{const f=t.reduce((m,h)=>h(m),e());return n=LQ(f),r=n.cache.get,i=n.cache.set,o=c,c(d)},c=d=>{const f=r(d);if(f)return f;const m=UQ(d,n);return i(d,m),m};return o=a,(...d)=>o(VQ(...d))},HQ=[],ar=e=>{const t=n=>n[e]||HQ;return t.isThemeGetter=!0,t},s4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,l4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qQ=/^\d+\/\d+$/,KQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GQ=/\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$/,ZQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ku=e=>qQ.test(e),Ct=e=>!!e&&!Number.isNaN(Number(e)),Bs=e=>!!e&&Number.isInteger(Number(e)),x_=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),Ga=e=>KQ.test(e),XQ=()=>!0,JQ=e=>GQ.test(e)&&!ZQ.test(e),c4=()=>!1,QQ=e=>YQ.test(e),eee=e=>WQ.test(e),tee=e=>!He(e)&&!qe(e),nee=e=>af(e,f4,c4),He=e=>s4.test(e),oc=e=>af(e,p4,JQ),w_=e=>af(e,see,Ct),GD=e=>af(e,u4,c4),ree=e=>af(e,d4,eee),dv=e=>af(e,m4,QQ),qe=e=>l4.test(e),jp=e=>sf(e,p4),iee=e=>sf(e,lee),ZD=e=>sf(e,u4),oee=e=>sf(e,f4),aee=e=>sf(e,d4),fv=e=>sf(e,m4,!0),af=(e,t,n)=>{const r=s4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sf=(e,t,n=!1)=>{const r=l4.exec(e);return r?r[1]?t(r[1]):n:!1},u4=e=>e==="position"||e==="percentage",d4=e=>e==="image"||e==="url",f4=e=>e==="length"||e==="size"||e==="bg-size",p4=e=>e==="length",see=e=>e==="number",lee=e=>e==="family-name",m4=e=>e==="shadow",cee=()=>{const e=ar("color"),t=ar("font"),n=ar("text"),r=ar("font-weight"),i=ar("tracking"),o=ar("leading"),a=ar("breakpoint"),c=ar("container"),d=ar("spacing"),f=ar("radius"),m=ar("shadow"),h=ar("inset-shadow"),v=ar("text-shadow"),y=ar("drop-shadow"),x=ar("blur"),S=ar("perspective"),C=ar("aspect"),k=ar("ease"),E=ar("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...R(),qe,He],N=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[qe,He,d],L=()=>[Ku,"full","auto",...M()],K=()=>[Bs,"none","subgrid",qe,He],ee=()=>["auto",{span:["full",Bs,qe,He]},Bs,qe,He],q=()=>[Bs,"auto",qe,He],Y=()=>["auto","min","max","fr",qe,He],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...M()],W=()=>[Ku,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],F=()=>[e,qe,He],te=()=>[...R(),ZD,GD,{position:[qe,He]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",oee,nee,{size:[qe,He]}],V=()=>[x_,jp,oc],A=()=>["","none","full",f,qe,He],J=()=>["",Ct,jp,oc],fe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[Ct,x_,ZD,GD],se=()=>["","none",x,qe,He],_e=()=>["none",Ct,qe,He],Ie=()=>["none",Ct,qe,He],Fe=()=>[Ct,qe,He],Le=()=>[Ku,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[XQ],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[tee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",Ct],text:[Ga],"text-shadow":[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ku,He,qe,C]}],container:["container"],columns:[{columns:[Ct,He,qe,c]}],"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:T()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",qe,He]}],basis:[{basis:[Ku,"full","auto",c,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,Ku,"auto","initial","none",He]}],grow:[{grow:["",Ct,qe,He]}],shrink:[{shrink:["",Ct,qe,He]}],order:[{order:[Bs,"first","last","none",qe,He]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],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":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[c,"screen",...W()]}],"min-w":[{"min-w":[c,"screen","none",...W()]}],"max-w":[{"max-w":[c,"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,jp,oc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,qe,w_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",x_,He]}],"font-family":[{font:[iee,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,w_]}],leading:[{leading:[o,...M()]}],"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:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",qe,oc]}],"text-decoration-color":[{decoration:F()}],"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:M()}],"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:te()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,qe,He],radial:["",qe,He],conic:[Bs,qe,He]},aee,ree]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,qe,He]}],"outline-w":[{outline:["",Ct,jp,oc]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",m,fv,dv]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",h,fv,dv]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Ct,oc]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",v,fv,dv]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Ct,qe,He]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[qe,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,He]}],filter:[{filter:["","none",qe,He]}],blur:[{blur:se()}],brightness:[{brightness:[Ct,qe,He]}],contrast:[{contrast:[Ct,qe,He]}],"drop-shadow":[{"drop-shadow":["","none",y,fv,dv]}],"drop-shadow-color":[{"drop-shadow":F()}],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":se()}],"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":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"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":T()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Ie()}],"scale-x":[{"scale-x":Ie()}],"scale-y":[{"scale-y":Ie()}],"scale-z":[{"scale-z":Ie()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[qe,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",...F()]}],"stroke-w":[{stroke:[Ct,jp,oc,w_]}],stroke:[{stroke:["none",...F()]}],"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"]}},uee=BQ(cee);function Ue(...e){return uee(n4(e))}function YD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lf(...e){return t=>{let n=!1;const r=e.map(i=>{const o=YD(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():YD(e[i],null)}}}}function ft(...e){return b.useCallback(lf(...e),e)}var dee=Symbol.for("react.lazy"),ky=Gk[" use ".trim().toString()];function fee(e){return typeof e=="object"&&e!==null&&"then"in e}function h4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===dee&&"_payload"in e&&fee(e._payload)}function g4(e){const t=pee(e),n=b.forwardRef((r,i)=>{let{children:o,...a}=r;h4(o)&&typeof ky=="function"&&(o=ky(o._payload));const c=b.Children.toArray(o),d=c.find(hee);if(d){const f=d.props.children,m=c.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 rE=g4("Slot");function pee(e){const t=b.forwardRef((n,r)=>{let{children:i,...o}=n;if(h4(i)&&typeof ky=="function"&&(i=ky(i._payload)),b.isValidElement(i)){const a=vee(i),c=gee(o,i.props);return i.type!==b.Fragment&&(c.ref=r?lf(r,a):a),b.cloneElement(i,c)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mee=Symbol("radix.slottable");function hee(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mee}function gee(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]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function vee(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?rE:"button";return u.jsx(o,{"data-slot":"button",className:Ue(SQ({variant:t,size:n,className:e})),...i})}function Tc({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 jl({className:e,...t}){return u.jsx("div",{"data-slot":"card-header",className:Ue("flex flex-col gap-1.5 px-6",e),...t})}function Rl({className:e,...t}){return u.jsx("div",{"data-slot":"card-title",className:Ue("leading-none text-lg",e),...t})}function Hc({className:e,...t}){return u.jsx("div",{"data-slot":"card-description",className:Ue("text-muted-foreground text-xs",e),...t})}function ps({className:e,...t}){return u.jsx("div",{"data-slot":"card-content",className:Ue("px-6",e),...t})}function yee(e){return e!==null&&!!e.username}function qc(e){if(e&&!yee(e)){const t=Object.keys(e.roles);if(t.length===1)return`/${t[0]}`}return"/"}const bee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xee=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),WD=e=>{const t=xee(e);return t.charAt(0).toUpperCase()+t.slice(1)},v4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),wee=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var See={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 _ee=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...c},d)=>b.createElement("svg",{ref:d,...See,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:v4("lucide",i),...!o&&!wee(c)&&{"aria-hidden":"true"},...c},[...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(_ee,{ref:o,iconNode:t,className:v4(`lucide-${bee(WD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=WD(e),n};const Cee=[["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"}]],kee=Ve("activity",Cee);const Eee=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Db=Ve("arrow-down",Eee);const jee=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Oc=Ve("arrow-left",jee);const Ree=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],vi=Ve("arrow-right",Ree);const Iee=[["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"}]],Nee=Ve("arrow-up-down",Iee);const Tee=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Oee=Ve("arrow-up",Tee);const Aee=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Dee=Ve("ban",Aee);const $ee=[["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"}]],y4=Ve("book-open-text",$ee);const Pee=[["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"}]],Mee=Ve("boxes",Pee);const zee=[["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"}]],Lee=Ve("bug",zee);const Fee=[["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"}]],b4=Ve("chart-pie",Fee);const Uee=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iE=Ve("check",Uee);const Vee=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],x4=Ve("chevron-down",Vee);const Bee=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Hee=Ve("chevron-up",Bee);const qee=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Kee=Ve("circle-check-big",qee);const Gee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],w4=Ve("circle",Gee);const Zee=[["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"}]],Yee=Ve("clipboard-check",Zee);const Wee=[["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"}]],Xee=Ve("cloud-alert",Wee);const Jee=[["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"}]],Qee=Ve("cloud-download",Jee);const ete=[["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"}]],S4=Ve("cloud-upload",ete);const tte=[["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"}]],nte=Ve("columns-3-cog",tte);const rte=[["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"}]],_4=Ve("copy",rte);const ite=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],C4=Ve("credit-card",ite);const ote=[["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"}]],ate=Ve("database",ote);const ste=[["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"}]],k4=Ve("download",ste);const lte=[["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"}]],oE=Ve("ellipsis",lte);const cte=[["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"}]],ute=Ve("external-link",cte);const dte=[["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"}]],fte=Ve("file",dte);const pte=[["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"}]],mte=Ve("folder",pte);const hte=[["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"}]],gte=Ve("funnel-plus",hte);const vte=[["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"}]],XD=Ve("funnel-x",vte);const yte=[["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"}]],bte=Ve("funnel",yte);const xte=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],wte=Ve("gauge",xte);const Ste=[["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"}]],_te=Ve("git-branch",Ste);const Cte=[["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"}]],aE=Ve("github",Cte);const kte=[["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"}]],Ete=Ve("grip-vertical",kte);const jte=[["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"}]],E4=Ve("handshake",jte);const Rte=[["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"}]],Ite=Ve("house",Rte);const Nte=[["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"}]],j4=Ve("key",Nte);const Tte=[["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"}]],Ote=Ve("link",Tte);const Ate=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],R4=Ve("loader-circle",Ate);const Dte=[["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"}]],$te=Ve("lock",Dte);const Pte=[["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"}]],Mte=Ve("log-in",Pte);const zte=[["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"}]],Lte=Ve("log-out",zte);const Fte=[["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"}]],Ute=Ve("mail-warning",Fte);const Vte=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],I4=Ve("menu",Vte);const Bte=[["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"}]],Hte=Ve("notepad-text",Bte);const qte=[["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"}]],sE=Ve("package",qte);const Kte=[["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"}]],Gte=Ve("panel-right-close",Kte);const Zte=[["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"}]],Yte=Ve("panel-right-open",Zte);const Wte=[["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"}]],N4=Ve("pencil",Wte);const Xte=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xr=Ve("plus",Xte);const Jte=[["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"}]],T4=Ve("receipt-text",Jte);const Qte=[["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"}]],ene=Ve("receipt",Qte);const tne=[["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"}]],ba=Ve("refresh-cw",tne);const nne=[["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"}]],O4=Ve("rocket",nne);const rne=[["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"}]],ine=Ve("rotate-ccw",rne);const one=[["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"}]],jo=Ve("save",one);const ane=[["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"}]],sne=Ve("server",ane);const lne=[["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"}]],cne=Ve("settings",lne);const une=[["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"}]],dne=Ve("table",une);const fne=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],lE=Ve("terminal",fne);const pne=[["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"}]],mne=Ve("trash-2",pne);const hne=[["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",hne);const gne=[["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"}]],vne=Ve("triangle-alert",gne);const yne=[["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"}]],bne=Ve("undo-2",yne);const xne=[["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"}]],A4=Ve("users",xne);const wne=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D4=Ve("x",wne);function Ey({className:e,error:t,title:n,showReturnToHome:r,children:i}){const{user:o,isLoading:a}=Bc();return qc(o),u.jsxs(Tc,{className:Ue("text-red p-5 border border-red rounded-md m-12 mt-36",e),children:[u.jsxs(jl,{children:[u.jsx(Rl,{className:"text-2xl",children:u.jsx("h2",{children:n??"Component Error"})}),u.jsx(Hc,{children:t.message})]}),u.jsxs(ps,{children:[i,r!==!1&&(o&&!a?u.jsx(Ze,{to:ya,children:u.jsxs(be,{children:[" ",u.jsx(Oc,{})," Return to Home"]})}):u.jsx(Ze,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(Oc,{})," Go to Sign In Page"]})}))]})]})}function Sne(){const{user:e,isLoading:t}=Bc();return qc(e),u.jsx("div",{className:"flex items-center justify-center h-screen px-3",children:u.jsxs(Tc,{className:"text-red p-5 border border-red rounded-md w-full max-w-md",children:[u.jsx(jl,{children:u.jsx(Rl,{className:"text-2xl",children:u.jsx("h2",{children:"Sorry, Page Not Found"})})}),u.jsx(ps,{children:e&&!t?u.jsx(Ze,{to:ya,children:u.jsxs(be,{children:[" ",u.jsx(Oc,{})," Return to Home"]})}):u.jsx(Ze,{to:"/sign-in",children:u.jsxs(be,{children:[" ",u.jsx(Oc,{})," Go Sign In Page"]})})})]})})}function _ne(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function Cne(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 kne=e=>{switch(e){case"success":return Rne;case"info":return Nne;case"warning":return Ine;case"error":return Tne;default:return null}},Ene=Array(12).fill(0),jne=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},Ene.map((n,r)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Rne=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),Ine=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.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"})),Nne=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),Tne=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),One=Q.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"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ane=()=>{const[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let pC=1;class Dne{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:pC++,a=this.toasts.find(d=>d.id===o),c=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:c,title:r}):d):this.addToast({title:r,...i,dismissible:c,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 c=i.then(async f=>{if(a=["resolve",f],Q.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(Pne(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"&&!Q.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"&&!Q.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"&&!Q.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"&&!Q.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)=>c.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||pC++;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 mi=new Dne,$ne=(e,t)=>{const n=t?.id||pC++;return mi.addToast({title:e,...t,id:n}),n},Pne=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mne=$ne,zne=()=>mi.toasts,Lne=()=>mi.getActiveToasts(),we=Object.assign(Mne,{success:mi.success,info:mi.info,warning:mi.warning,error:mi.error,custom:mi.custom,message:mi.message,promise:mi.promise,dismiss:mi.dismiss,loading:mi.loading},{getHistory:zne,getToasts:Lne});Cne("[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 pv(e){return e.label!==void 0}const Fne=3,Une="24px",Vne="16px",JD=4e3,Bne=356,Hne=14,qne=45,Kne=200;function oa(...e){return e.filter(Boolean).join(" ")}function Gne(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Zne=e=>{var t,n,r,i,o,a,c,d,f;const{invert:m,toast:h,unstyled:v,interacting:y,setHeights:x,visibleToasts:S,heights:C,index:k,toasts:E,expanded:j,removeToast:R,defaultRichColors:T,closeButton:N,style:O,cancelButtonStyle:M,actionButtonStyle:L,className:K="",descriptionClassName:ee="",duration:q,position:Y,gap:U,expandByDefault:H,classNames:z,icons:W,closeButtonAriaLabel:F="Close toast"}=e,[te,D]=Q.useState(null),[$,V]=Q.useState(null),[A,J]=Q.useState(!1),[fe,ge]=Q.useState(!1),[B,se]=Q.useState(!1),[_e,Ie]=Q.useState(!1),[Fe,Le]=Q.useState(!1),[We,gt]=Q.useState(0),[Qt,Tn]=Q.useState(0),sn=Q.useRef(h.duration||q||JD),jr=Q.useRef(null),Mt=Q.useRef(null),G=k===0,ae=k+1<=S,pe=h.type,Ce=h.dismissible!==!1,re=h.className||"",ue=h.descriptionClassName||"",X=Q.useMemo(()=>C.findIndex(Xe=>Xe.toastId===h.id)||0,[C,h.id]),ve=Q.useMemo(()=>{var Xe;return(Xe=h.closeButton)!=null?Xe:N},[h.closeButton,N]),Ee=Q.useMemo(()=>h.duration||q||JD,[h.duration,q]),Ke=Q.useRef(0),et=Q.useRef(0),Vt=Q.useRef(0),jn=Q.useRef(null),[ln,zt]=Y.split("-"),wn=Q.useMemo(()=>C.reduce((Xe,en,Yn)=>Yn>=X?Xe:Xe+en.height,0),[C,X]),_t=Ane(),ur=h.invert||m,Sn=pe==="loading";et.current=Q.useMemo(()=>X*U+wn,[X,wn]),Q.useEffect(()=>{sn.current=Ee},[Ee]),Q.useEffect(()=>{J(!0)},[]),Q.useEffect(()=>{const Xe=Mt.current;if(Xe){const en=Xe.getBoundingClientRect().height;return Tn(en),x(Yn=>[{toastId:h.id,height:en,position:h.position},...Yn]),()=>x(Yn=>Yn.filter(dr=>dr.toastId!==h.id))}},[x,h.id]),Q.useLayoutEffect(()=>{if(!A)return;const Xe=Mt.current,en=Xe.style.height;Xe.style.height="auto";const Yn=Xe.getBoundingClientRect().height;Xe.style.height=en,Tn(Yn),x(dr=>dr.find(cn=>cn.toastId===h.id)?dr.map(cn=>cn.toastId===h.id?{...cn,height:Yn}:cn):[{toastId:h.id,height:Yn,position:h.position},...dr])},[A,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const Fr=Q.useCallback(()=>{ge(!0),gt(et.current),x(Xe=>Xe.filter(en=>en.toastId!==h.id)),setTimeout(()=>{R(h)},Kne)},[h,R,x,et]);Q.useEffect(()=>{if(h.promise&&pe==="loading"||h.duration===1/0||h.type==="loading")return;let Xe;return j||y||_t?(()=>{if(Vt.current<Ke.current){const dr=new Date().getTime()-Ke.current;sn.current=sn.current-dr}Vt.current=new Date().getTime()})():sn.current!==1/0&&(Ke.current=new Date().getTime(),Xe=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Fr()},sn.current)),()=>clearTimeout(Xe)},[j,y,h,pe,_t,Fr]),Q.useEffect(()=>{h.delete&&(Fr(),h.onDismiss==null||h.onDismiss.call(h,h))},[Fr,h.delete]);function vs(){var Xe;if(W?.loading){var en;return Q.createElement("div",{className:oa(z?.loader,h==null||(en=h.classNames)==null?void 0:en.loader,"sonner-loader"),"data-visible":pe==="loading"},W.loading)}return Q.createElement(jne,{className:oa(z?.loader,h==null||(Xe=h.classNames)==null?void 0:Xe.loader),visible:pe==="loading"})}const ys=h.icon||W?.[pe]||kne(pe);var Ra,Bt;return Q.createElement("li",{tabIndex:0,ref:Mt,className:oa(K,re,z?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,z?.default,z?.[pe],h==null||(n=h.classNames)==null?void 0:n[pe]),"data-sonner-toast":"","data-rich-colors":(Ra=h.richColors)!=null?Ra:T,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":A,"data-promise":!!h.promise,"data-swiped":Fe,"data-removed":fe,"data-visible":ae,"data-y-position":ln,"data-x-position":zt,"data-index":k,"data-front":G,"data-swiping":B,"data-dismissible":Ce,"data-type":pe,"data-invert":ur,"data-swipe-out":_e,"data-swipe-direction":$,"data-expanded":!!(j||H&&A),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":E.length-k,"--offset":`${fe?We:et.current}px`,"--initial-height":H?"auto":`${Qt}px`,...O,...h.style},onDragEnd:()=>{se(!1),D(null),jn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(Sn||!Ce||(jr.current=new Date,gt(et.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(se(!0),jn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,en,Yn;if(_e||!Ce)return;jn.current=null;const dr=Number(((Xe=Mt.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qo=Number(((en=Mt.current)==null?void 0:en.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),cn=new Date().getTime()-((Yn=jr.current)==null?void 0:Yn.getTime()),ni=te==="x"?dr:Qo,Ul=Math.abs(ni)/cn;if(Math.abs(ni)>=qne||Ul>.11){gt(et.current),h.onDismiss==null||h.onDismiss.call(h,h),V(te==="x"?dr>0?"right":"left":Qo>0?"down":"up"),Fr(),Ie(!0);return}else{var ri,ii;(ri=Mt.current)==null||ri.style.setProperty("--swipe-amount-x","0px"),(ii=Mt.current)==null||ii.style.setProperty("--swipe-amount-y","0px")}Le(!1),se(!1),D(null)},onPointerMove:Xe=>{var en,Yn,dr;if(!jn.current||!Ce||((en=window.getSelection())==null?void 0:en.toString().length)>0)return;const cn=Xe.clientY-jn.current.y,ni=Xe.clientX-jn.current.x;var Ul;const ri=(Ul=e.swipeDirections)!=null?Ul:Gne(Y);!te&&(Math.abs(ni)>1||Math.abs(cn)>1)&&D(Math.abs(ni)>Math.abs(cn)?"x":"y");let ii={x:0,y:0};const su=Oo=>1/(1.5+Math.abs(Oo)/20);if(te==="y"){if(ri.includes("top")||ri.includes("bottom"))if(ri.includes("top")&&cn<0||ri.includes("bottom")&&cn>0)ii.y=cn;else{const Oo=cn*su(cn);ii.y=Math.abs(Oo)<Math.abs(cn)?Oo:cn}}else if(te==="x"&&(ri.includes("left")||ri.includes("right")))if(ri.includes("left")&&ni<0||ri.includes("right")&&ni>0)ii.x=ni;else{const Oo=ni*su(ni);ii.x=Math.abs(Oo)<Math.abs(ni)?Oo:ni}(Math.abs(ii.x)>0||Math.abs(ii.y)>0)&&Le(!0),(Yn=Mt.current)==null||Yn.style.setProperty("--swipe-amount-x",`${ii.x}px`),(dr=Mt.current)==null||dr.style.setProperty("--swipe-amount-y",`${ii.y}px`)}},ve&&!h.jsx&&pe!=="loading"?Q.createElement("button",{"aria-label":F,"data-disabled":Sn,"data-close-button":!0,onClick:Sn||!Ce?()=>{}:()=>{Fr(),h.onDismiss==null||h.onDismiss.call(h,h)},className:oa(z?.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Bt=W?.close)!=null?Bt:One):null,(pe||h.icon||h.promise)&&h.icon!==null&&(W?.[pe]!==null||h.icon)?Q.createElement("div",{"data-icon":"",className:oa(z?.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||vs():null,h.type!=="loading"?ys:null):null,Q.createElement("div",{"data-content":"",className:oa(z?.content,h==null||(o=h.classNames)==null?void 0:o.content)},Q.createElement("div",{"data-title":"",className:oa(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?Q.createElement("div",{"data-description":"",className:oa(ee,ue,z?.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),Q.isValidElement(h.cancel)?h.cancel:h.cancel&&pv(h.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:Xe=>{pv(h.cancel)&&Ce&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Xe),Fr())},className:oa(z?.cancelButton,h==null||(d=h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,Q.isValidElement(h.action)?h.action:h.action&&pv(h.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||L,onClick:Xe=>{pv(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Xe),!Xe.defaultPrevented&&Fr())},className:oa(z?.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function QD(){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 Yne(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,a=o?"--mobile-offset":"--offset",c=o?Vne:Une;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}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}const Wne=Q.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:m,mobileOffset:h,theme:v="light",richColors:y,duration:x,style:S,visibleToasts:C=Fne,toastOptions:k,dir:E=QD(),gap:j=Hne,icons:R,containerAriaLabel:T="Notifications"}=t,[N,O]=Q.useState([]),M=Q.useMemo(()=>r?N.filter(A=>A.toasterId===r):N.filter(A=>!A.toasterId),[N,r]),L=Q.useMemo(()=>Array.from(new Set([o].concat(M.filter(A=>A.position).map(A=>A.position)))),[M,o]),[K,ee]=Q.useState([]),[q,Y]=Q.useState(!1),[U,H]=Q.useState(!1),[z,W]=Q.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=Q.useRef(null),te=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Q.useRef(null),$=Q.useRef(!1),V=Q.useCallback(A=>{O(J=>{var fe;return(fe=J.find(ge=>ge.id===A.id))!=null&&fe.delete||mi.dismiss(A.id),J.filter(({id:ge})=>ge!==A.id)})},[]);return Q.useEffect(()=>mi.subscribe(A=>{if(A.dismiss){requestAnimationFrame(()=>{O(J=>J.map(fe=>fe.id===A.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{tE.flushSync(()=>{O(J=>{const fe=J.findIndex(ge=>ge.id===A.id);return fe!==-1?[...J.slice(0,fe),{...J[fe],...A},...J.slice(fe+1)]:[A,...J]})})})}),[N]),Q.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 A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:J})=>{W(J?"dark":"light")})}catch{A.addListener(({matches:fe})=>{try{W(fe?"dark":"light")}catch(ge){console.error(ge)}})}},[v]),Q.useEffect(()=>{N.length<=1&&Y(!1)},[N]),Q.useEffect(()=>{const A=J=>{var fe;if(a.every(se=>J[se]||J.code===se)){var B;Y(!0),(B=F.current)==null||B.focus()}J.code==="Escape"&&(document.activeElement===F.current||(fe=F.current)!=null&&fe.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[a]),Q.useEffect(()=>{if(F.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,$.current=!1)}},[F.current]),Q.createElement("section",{ref:n,"aria-label":`${T} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((A,J)=>{var fe;const[ge,B]=A.split("-");return M.length?Q.createElement("ol",{key:A,dir:E==="auto"?QD():E,tabIndex:-1,ref:F,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ge,"data-x-position":B,style:{"--front-toast-height":`${((fe=K[0])==null?void 0:fe.height)||0}px`,"--width":`${Bne}px`,"--gap":`${j}px`,...S,...Yne(m,h)},onBlur:se=>{$.current&&!se.currentTarget.contains(se.relatedTarget)&&($.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$.current||($.current=!0,D.current=se.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{U||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},M.filter(se=>!se.position&&J===0||se.position===A).map((se,_e)=>{var Ie,Fe;return Q.createElement(Zne,{key:se.id,icons:R,index:_e,toast:se,defaultRichColors:y,duration:(Ie=k?.duration)!=null?Ie:x,className:k?.className,descriptionClassName:k?.descriptionClassName,invert:i,visibleToasts:C,closeButton:(Fe=k?.closeButton)!=null?Fe:d,interacting:U,position:A,style:k?.style,unstyled:k?.unstyled,classNames:k?.classNames,cancelButtonStyle:k?.cancelButtonStyle,actionButtonStyle:k?.actionButtonStyle,closeButtonAriaLabel:k?.closeButtonAriaLabel,removeToast:V,toasts:M.filter(Le=>Le.position==se.position),heights:K.filter(Le=>Le.position==se.position),setHeights:ee,expandByDefault:c,gap:j,expanded:q,swipeDirections:t.swipeDirections})})):null}))});function e$(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 jy=new hX({queryCache:new Iz({onError:e$}),mutationCache:new Rz({onError:e$})});function Xo(e){return!!e}const $b={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Xa=console,od={};Object.keys($b).forEach(e=>{od[e]=Xa[e]});const Rp="Datadog Browser SDK:",ht={debug:od.debug.bind(Xa,Rp),log:od.log.bind(Xa,Rp),info:od.info.bind(Xa,Rp),warn:od.warn.bind(Xa,Rp),error:od.error.bind(Xa,Rp)},Pb="https://docs.datadoghq.com",Xne=`${Pb}/real_user_monitoring/browser/troubleshooting`,cE="More details:";function $4(e,t){return(...n)=>{try{return e(...n)}catch(r){ht.error(t,r)}}}function mc(e){return e!==0&&Math.random()*100<=e}function ld(e,t){return+e.toFixed(t)}function Jne(e){return Km(e)&&e>=0&&e<=100}function Km(e){return typeof e=="number"}function hm(e){return{...e}}function Ry(e,t){return Object.keys(e).some(n=>e[n]===t)}function Il(e){return Object.keys(e).length===0}function P4(e,t){const n={};for(const r of Object.keys(e))n[r]=t(e[r]);return n}function Ro(){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 xa=Ro(),Mb="WorkerGlobalScope"in xa;function pl(e,t){const n=Ro();let r;return n.Zone&&typeof n.Zone.__symbol__=="function"&&(r=e[n.Zone.__symbol__(t)]),r||(r=e[t]),r}let mC,M4=!1;function Qne(e){mC=e}function ere(e){M4=e}function St(e){return function(...t){return ul(e,this,t)}}function ul(e,t,n){try{return e.apply(t,n)}catch(r){ml(r)}}function ml(e){if(hC(e),mC)try{mC(e)}catch(t){hC(t)}}function hC(...e){M4&&ht.error("[MONITOR]",...e)}function Ar(e,t){return pl(Ro(),"setTimeout")(St(e),t)}function yo(e){pl(Ro(),"clearTimeout")(e)}function cf(e,t){return pl(Ro(),"setInterval")(St(e),t)}function zb(e){pl(Ro(),"clearInterval")(e)}function t$(e){var t;const n=(t=xa.queueMicrotask)===null||t===void 0?void 0:t.bind(xa);typeof n=="function"?n(St(e)):Promise.resolve().then(St(e))}class $t{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 z4(...e){return new $t(t=>{const n=e.map(r=>r.subscribe(i=>t.notify(i)));return()=>n.forEach(r=>r.unsubscribe())})}class L4 extends $t{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 t$(()=>{for(const i of this.buffer){if(n)return;t(i)}n||this.addObserver(t)}),r}unbuffer(){t$(()=>{this.maxBufferSize=this.buffer.length=0})}}const Mr=1e3,Jr=60*Mr,F4=60*Jr,tre=24*F4,U4=365*tre;function Lb(e){return{relative:e,timeStamp:rre(e)}}function nre(e){return{relative:uE(e),timeStamp:e}}function rre(e){const t=Wr()-performance.now();return t>Gm()?Math.round(uf(t,e)):ore(e)}function ire(){return Math.round(Wr()-uf(Gm(),performance.now()))}function bt(e){return Km(e)?ld(e*1e6,0):e}function Wr(){return new Date().getTime()}function Cr(){return Wr()}function Bi(){return performance.now()}function cr(){return{relative:Bi(),timeStamp:Cr()}}function V4(){return{relative:0,timeStamp:Gm()}}function Gn(e,t){return t-e}function uf(e,t){return e+t}function uE(e){return e-Gm()}function ore(e){return Math.round(uf(Gm(),e))}function are(e){return e<U4}let S_;function Gm(){var e,t;return S_===void 0&&(S_=(t=(e=performance.timing)===null||e===void 0?void 0:e.navigationStart)!==null&&t!==void 0?t:performance.timeOrigin),S_}function Fb(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,c;return{throttled:(...d)=>{if(o){a=d;return}r?e(...d):a=d,o=!0,c=Ar(()=>{i&&a&&e(...a),o=!1,a=void 0},t)},cancel:()=>{yo(c),o=!1,a=void 0}}}function Jt(){}function $r(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,$r)}const Td=/([\w-]+)\s*=\s*([^;]+)/g;function gm(e,t){for(Td.lastIndex=0;;){const n=Td.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function sre(e){const t=new Map;for(Td.lastIndex=0;;){const n=Td.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 lre(e){const t=new Map;for(Td.lastIndex=0;;){const n=Td.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function dE(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 cre(){return B4()===0}function d2e(){return B4()===1}let mv;function B4(){return mv??(mv=ure())}function ure(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 fE(e){return Ub(e,location.href).href}function dre(e){try{return!!Ub(e)}catch{return!1}}function fre(e){const t=Ub(e).pathname;return t[0]==="/"?t:`/${t}`}function Ub(e,t){const{URL:n}=pre();try{return t!==void 0?new n(e,t):new n(e)}catch(r){throw new Error(`Failed to construct URL: ${String(r)}`)}}let __;function pre(){if(!__){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=xa}__={URL:t.URL},e?.remove()}return __}function Vb(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",c=r&&r.domain?`;domain=${r.domain}`:"",d=r&&r.secure?";secure":"",f=r&&r.partitioned?";partitioned":"";document.cookie=`${e}=${t};${o};path=/;samesite=${a}${c}${d}${f}`}function Bb(e){return gm(document.cookie,e)}function mre(e){return sre(document.cookie).get(e)||[]}let C_;function el(e){return C_||(C_=lre(document.cookie)),C_.get(e)}function H4(e,t){Vb(e,"",0,t)}function hre(e){if(document.cookie===void 0||document.cookie===null)return!1;try{const t=`dd_cookie_test_${$r()}`,n="test";Vb(t,n,Jr,e);const r=Bb(t)===n;return H4(t,e),r}catch(t){return ht.error(t),!1}}let k_;function q4(e=location.hostname,t=document.referrer){if(k_===void 0){const n=gre(e,t);if(n){const r=`dd_site_test_${$r()}`,i="test",o=n.split(".");let a=o.pop();for(;o.length&&!Bb(r);)a=`${o.pop()}.${a}`,Vb(r,i,Mr,{domain:a});H4(r,{domain:a}),k_=a}}return k_}function gre(e,t){try{return e||Ub(t).hostname}catch{}}const rs="_dd_s";function K4(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(t(r,n,e))return r}}function G4(e){return Object.values(e)}function pE(e){return Object.entries(e)}const Kc=4*F4,Z4=15*Jr,vre=U4,Y4="0",Od={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},W4=/^([a-zA-Z]+)=([a-z0-9-]+)$/,mE="&";function yre(e){return!!e&&(e.indexOf(mE)!==-1||W4.test(e))}const bre="1";function sc(e,t){const n={isExpired:bre};return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function ty(e){return Il(e)}function X4(e){return!ty(e)}function rm(e){return e.isExpired!==void 0||!xre(e)}function xre(e){return(e.created===void 0||Wr()-Number(e.created)<Kc)&&(e.expire===void 0||Wr()<Number(e.expire))}function J4(e){e.expire=String(Wr()+Z4)}function gC(e){return pE(e).map(([t,n])=>t==="anonymousId"?`aid=${n}`:`${t}=${n}`).join(mE)}function Hb(e){const t={};return yre(e)&&e.split(mE).forEach(n=>{const r=W4.exec(n);if(r!==null){const[,i,o]=r;i==="aid"?t.anonymousId=o:t[i]=o}}),t}const wre="_dd",Sre="_dd_r",_re="_dd_l",Cre="rum",kre="logs";function Ere(e){if(!el(rs)){const n=el(wre),r=el(Sre),i=el(_re),o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[kre]=i),r&&/^[012]$/.test(r)&&(o[Cre]=r),X4(o)&&(J4(o),e.persistSession(o))}}const jre=0;function n$(e){const t=Ire(e);return t&&hre(t)?{type:Od.COOKIE,cookieOptions:t}:void 0}function Rre(e,t){const n={isLockEnabled:cre(),persistSession:r=>r$(t,e,r,Z4),retrieveSession:()=>Q4(t,e),expireSession:r=>r$(t,e,sc(r,e),Kc)};return Ere(n),n}function r$(e,t,n,r){let i=gC(n);t.betaEncodeCookieOptions&&(i=gC({...n,...Il(n)?{}:{c:eL(e)}})),Vb(rs,i,t.trackAnonymousUser?vre:r,e)}function Q4(e,t){if(t.betaEncodeCookieOptions)return Nre(e);const n=Bb(rs);return Hb(n)}function Ire(e){const t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){const n=q4();if(!n)return;t.domain=n}return t}function eL(e){const t=e.domain?e.domain.split(".").length-1:0;let n=0;return n|=jre<<5,n|=t<<1,n|=e.crossSite?1:0,n.toString(16)}function Nre(e){const t=mre(rs),n=eL(e);let r;for(const i of t.reverse())if(r=Hb(i),r.c===n)break;return r==null||delete r.c,r??{}}const Tre="_dd_test_";function i$(){try{const e=$r(),t=`${Tre}${e}`;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Od.LOCAL_STORAGE}:void 0}catch{return}}function Ore(e){return{isLockEnabled:!1,persistSession:tL,retrieveSession:nL,expireSession:t=>Are(t,e)}}function tL(e){localStorage.setItem(rs,gC(e))}function nL(){const e=localStorage.getItem(rs);return Hb(e)}function Are(e,t){tL(sc(e,t))}const Dre=10,$re=100,Pre=Mr,rL="--",iL=[];let ny;function lc(e,t,n=0){var r;const{isLockEnabled:i,persistSession:o,expireSession:a}=t,c=v=>o({...v,lock:f}),d=()=>{const{lock:v,...y}=t.retrieveSession();return{session:y,lock:v&&!zre(v)?v:void 0}};if(ny||(ny=e),e!==ny){iL.push(e);return}if(i&&n>=$re){o$(t);return}let f,m=d();if(i){if(m.lock){hv(e,t,n);return}if(f=Mre(),c(m.session),m=d(),m.lock!==f){hv(e,t,n);return}}let h=e.process(m.session);if(i&&(m=d(),m.lock!==f)){hv(e,t,n);return}if(h&&(rm(h)?a(h):(J4(h),i?c(h):o(h))),i&&!(h&&rm(h))){if(m=d(),m.lock!==f){hv(e,t,n);return}o(m.session),h=m.session}(r=e.after)===null||r===void 0||r.call(e,h||m.session),o$(t)}function hv(e,t,n){Ar(()=>{lc(e,t,n+1)},Dre)}function o$(e){ny=void 0;const t=iL.shift();t&&lc(t,e)}function Mre(){return $r()+rL+Cr()}function zre(e){const[,t]=e.split(rL);return!t||Gn(Number(t),Cr())>Pre}const a$=Mr;function Lre(e){switch(e.sessionPersistence){case Od.COOKIE:return n$(e);case Od.LOCAL_STORAGE:return i$();case void 0:{let t=n$(e);return!t&&e.allowFallbackToLocalStorage&&(t=i$()),t}default:ht.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function Fre(e,t){return e.type===Od.COOKIE?Rre(t,e.cookieOptions):Ore(t)}function Ure(e,t,n,r,i=Fre(e,t)){const o=new $t,a=new $t,c=new $t,d=cf(y,a$);let f;S();const{throttled:m,cancel:h}=Fb(()=>{lc({process:N=>{if(ty(N))return;const O=x(N);return C(O),O},after:N=>{X4(N)&&!k()&&R(N),f=N}},i)},a$);function v(){lc({process:N=>k()?x(N):void 0},i)}function y(){const N=i.retrieveSession();rm(N)?lc({process:O=>rm(O)?sc(O,t):void 0,after:x},i):x(N)}function x(N){return rm(N)&&(N=sc(N,t)),k()&&(E(N)?j():(c.notify({previousState:f,newState:N}),f=N)),N}function S(){lc({process:N=>{if(ty(N))return N.anonymousId=$r(),sc(N,t)},after:N=>{f=N}},i)}function C(N){if(ty(N))return!1;const O=r(N[n]);N[n]=O,delete N.isExpired,O!==Y4&&!N.id&&(N.id=$r(),N.created=String(Wr()))}function k(){return f?.[n]!==void 0}function E(N){return f.id!==N.id||f[n]!==N[n]}function j(){f=sc(f,t),a.notify()}function R(N){f=N,o.notify()}function T(N){lc({process:O=>({...O,...N}),after:x},i)}return{expandOrRenewSession:m,expandSession:v,getSession:()=>f,renewObservable:o,expireObservable:a,sessionStateUpdateObservable:c,restartSession:S,expire:N=>{h(),N===!1&&f&&delete f.anonymousId,i.expireSession(f),x(sc(f,t))},stop:()=>{zb(d)},updateSessionState:T}}const vC={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Vre(e){const t=new $t;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===vC.GRANTED},observable:t}}function Gc(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function vm(e){const t=Gc(e);return t==="string"||t==="function"||e instanceof RegExp}function qb(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){ht.error(i)}return!1})}const Bre=["chrome-extension://","moz-extension://"];function s$(e){return Bre.some(t=>e.includes(t))}function Hre(e,t=""){if(s$(e))return!1;const r=t.split(`
31
+ `).filter(i=>{const o=i.trim();return o.length&&/^at\s+|@/.test(o)})[1]||"";return s$(r)}const qre="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",Kre="SDK initialized on a non-allowed domain.";function Gre(e,t,n=typeof location<"u"?location.origin:""){const r=e.allowedTrackingOrigins;if(!r)return Hre(n,t)?(ht.error(qre),!1):!0;const i=qb(r,n);return i||ht.error(Kre),i}const oL="datad0g.com",Zre="dd0g-gov.com",hc="datadoghq.com",Yre="datadoghq.eu",Wre="ddog-gov.com",Xre="pci.browser-intake-datadoghq.com",Jre=["ddsource","dd-api-key","dd-request-id"];function Zs(e,t,n){const r=Qre(e,t);return{build(i,o){const a=eie(e,t,i,o,n);return r(a)},trackType:t}}function Qre(e,t){const n=`/api/v2/${t}`,r=e.proxy;if(typeof r=="string"){const o=fE(r);return a=>`${o}?ddforward=${encodeURIComponent(`${n}?${a}`)}`}if(typeof r=="function")return o=>r({path:n,parameters:o});const i=aL(t,e);return o=>`https://${i}${n}?${o}`}function aL(e,t){const{site:n=hc,internalAnalyticsSubdomain:r}=t;if(e==="logs"&&t.usePciIntake&&n===hc)return Xre;if(r&&n===hc)return`${r}.${hc}`;if(n===Zre)return`http-intake.logs.${n}`;const i=n.split("."),o=i.pop();return`browser-intake-${i.join("-")}.${o}`}function eie({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},r,i,{retry:o,encoding:a},c=[]){const d=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.25.0")}`,"dd-evp-origin=browser",`dd-request-id=${$r()}`].concat(c);return a&&d.push(`dd-evp-encoding=${a}`),r==="rum"&&(d.push(`batch_time=${Cr()}`,`_dd.api=${i}`),o&&d.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),t&&d.reverse(),d.join("&")}function tie(e){const t=e.site||hc,n=nie(e.source),r=rie({...e,site:t,source:n});return{replica:iie({...e,site:t,source:n}),site:t,source:n,...r}}function nie(e){return e==="flutter"||e==="unity"?e:"browser"}function rie(e){return{logsEndpointBuilder:Zs(e,"logs"),rumEndpointBuilder:Zs(e,"rum"),profilingEndpointBuilder:Zs(e,"profile"),sessionReplayEndpointBuilder:Zs(e,"replay"),exposuresEndpointBuilder:Zs(e,"exposures"),flagEvaluationEndpointBuilder:Zs(e,"flagevaluation")}}function iie(e){if(!e.replica)return;const t={...e,site:hc,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Zs(t,"logs"),rumEndpointBuilder:Zs(t,"rum",[`application.id=${e.replica.applicationId}`])}}function oie(e){return Jre.every(t=>e.includes(t))}const cd={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},yC={ALL:"all",SAMPLED:"sampled"};function E_(e,t){return e!=null&&typeof e!="string"?(ht.error(`${t} must be defined as a string`),!1):!0}function aie(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(ht.error(`Site should be a valid Datadog site. ${cE} ${Pb}/getting_started/site/.`),!1):!0}function ud(e,t){return e!==void 0&&!Jne(e)?(ht.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function sie(e,t){var n,r,i,o,a,c,d,f,m,h;if(!e||!e.clientToken){ht.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){ht.error("Allowed Tracking Origins must be an array");return}if(!(!aie(e.site)||!ud(e.sessionSampleRate,"Session")||!ud(e.telemetrySampleRate,"Telemetry")||!ud(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!ud(e.telemetryUsageSampleRate,"Telemetry Usage")||!E_(e.version,"Version")||!E_(e.env,"Env")||!E_(e.service,"Service")||!Gre(e,t??""))){if(e.trackingConsent!==void 0&&!Ry(vC,e.trackingConsent)){ht.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&$4(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Mb?void 0:Lre(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:(c=e.env)!==null&&c!==void 0?c: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:vC.GRANTED,trackAnonymousUser:(h=e.trackAnonymousUser)!==null&&h!==void 0?h:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...tie(e)}}}function lie(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 hl;(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"})(hl||(hl={}));const hE=new Set;function cie(e){Array.isArray(e)&&uie(e.filter(t=>Ry(hl,t)))}function uie(e){e.forEach(t=>{hE.add(t)})}function Zm(e){return hE.has(e)}function die(){return hE}const Ad="?";function Kb(e){var t,n;const r=[];let i=j_(e,"stack");const o=String(e);if(i&&i.startsWith(o)&&(i=i.slice(o.length)),i&&i.split(`
32
+ `).forEach(a=>{const c=mie(a)||gie(a)||yie(a)||wie(a);c&&(!c.func&&c.line&&(c.func=Ad),r.push(c))}),r.length>0&&kie()&&e instanceof Error){const a=[];let c=e;for(;(c=Object.getPrototypeOf(c))&&lL(c);){const d=((t=c.constructor)===null||t===void 0?void 0:t.name)||Ad;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:j_(e,"message"),name:j_(e,"name"),stack:r}}const sL="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Dd="(?::(\\d+))",fie=new RegExp(`^\\s*at (.*?) ?\\(${sL}${Dd}?${Dd}?\\)?\\s*$`,"i"),pie=new RegExp(`\\((\\S*)${Dd}${Dd}\\)`);function mie(e){const t=fie.exec(e);if(!t)return;const n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,i=pie.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]||Ad,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}const hie=new RegExp(`^\\s*at ?${sL}${Dd}?${Dd}??\\s*$`,"i");function gie(e){const t=hie.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:Ad,line:t[2]?+t[2]:void 0,url:t[1]}}const vie=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function yie(e){const t=vie.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ad,line:+t[3],url:t[2]}}const bie=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,xie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function wie(e){const t=bie.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,r=xie.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]||Ad,line:t[4]?+t[4]:void 0,url:t[3]}}function j_(e,t){if(typeof e!="object"||!e||!(t in e))return;const n=e[t];return typeof n=="string"?n:void 0}function Sie(e,t,n,r){if(t===void 0)return;const{name:i,message:o}=Cie(e);return{name:i,message:o,stack:[{url:t,column:r,line:n}]}}const _ie=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Cie(e){let t,n;return{}.toString.call(e)==="[object String]"&&([,t,n]=_ie.exec(e)),{name:t,message:n}}function lL(e){return String(e.constructor).startsWith("class ")}let gv;function kie(){if(gv!==void 0)return gv;class e extends Error{constructor(){super(),this.name="Error"}}const[t,n]=[e,Error].map(r=>new r);return gv=lL(Object.getPrototypeOf(t))&&n.stack!==t.stack,gv}function ym(e){const n=new Error(e);n.name="HandlingStack";let r;return ul(()=>{const i=Kb(n);i.stack=i.stack.slice(2),r=Gb(i)}),r}function Gb(e){let t=cL(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+=`
33
+ at ${r}${i} @ ${n.url}${o}${a}`}),t}function cL(e){return`${e.name||"Error"}: ${e.message}`}function ga(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!="function")if(t in e&&typeof t=="string"&&t.startsWith("on"))i=Jt;else return{stop:Jt};let o=!1;const a=function(){if(o)return i.apply(this,arguments);const c=Array.from(arguments);let d;ul(n,null,[{target:this,parameters:c,onPostCall:m=>{d=m},handlingStack:r?ym("instrumented method"):void 0}]);const f=i.apply(this,c);return d&&ul(d,null,[f]),f};return e[t]=a,{stop:()=>{o=!0,e[t]===a&&(e[t]=i)}}}function f2e(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:Jt};const i=Jt;let o=(c,d)=>{Ar(()=>{o!==i&&n(c,d)},0)};const a=function(c){r.set.call(this,c),o(this,c)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{var c;((c=Object.getOwnPropertyDescriptor(e,t))===null||c===void 0?void 0:c.set)===a&&Object.defineProperty(e,t,r),o=i}}}const Zc=1024,uL=1024*Zc,Eie=/[^\u0000-\u007F]/;function dL(e){return Eie.test(e)?window.TextEncoder!==void 0?new TextEncoder().encode(e).length:new Blob([e]).size:e.length}function fL(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 $d(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);const r=dd(Object.prototype),i=dd(Array.prototype),o=dd(Object.getPrototypeOf(e)),a=dd(e);try{return JSON.stringify(e,t,n)}catch{return"<error: unable to serialize object>"}finally{r(),i(),o(),a()}}function dd(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):Jt}const jie=220*Zc,Rie="$",Iie=3;function vn(e,t=jie){const n=dd(Object.prototype),r=dd(Array.prototype),i=[],o=new WeakMap,a=R_(e,Rie,void 0,i,o),c=JSON.stringify(a);let d=c?c.length:0;if(d>t){I_(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=R_(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){I_(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=R_(f.source[h],f.path,h,i,o);if(v!==void 0&&(d+=JSON.stringify(v).length+m+h.length+Iie,m=1),d>t){I_(t,"truncated",e);break}f.target[h]=v}}return n(),r(),a}function R_(e,t,n,r,i){const o=Oie(e);if(!o||typeof o!="object")return Nie(o);const a=bC(o);if(a!=="[Object]"&&a!=="[Array]"&&a!=="[Error]")return a;const c=e;if(i.has(c))return`[Reference seen at ${i.get(c)}]`;const d=n!==void 0?`${t}.${n}`:t,f=Array.isArray(o)?[]:{};return i.set(c,d),r.push({source:o,target:f,path:d}),f}function Nie(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 bC(e){try{if(e instanceof Event)return Tie(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 Tie(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?bC(e.currentTarget):null,target:e.target?bC(e.target):null}}function Oie(e){const t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function I_(e,t,n){ht.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}const pL="No stack, consider using an instance of Error";function mL({originalError:e,stackTrace:t,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){const o=Nl(e);return!t&&o&&(t=Kb(e)),{source:n,type:t?t.name:void 0,message:Aie(t,o,i,e),stack:t?Gb(t):r?pL:void 0}}function gE({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:o,useFallbackStack:a=!0,source:c,handling:d}){const f=mL({originalError:t,stackTrace:e,source:c,useFallbackStack:a,nonErrorPrefix:o});return{startClocks:i,handling:d,handlingStack:n,componentStack:r,originalError:t,...f,causes:Nl(t)?Pie(t,c):void 0,fingerprint:Die(t),context:$ie(t)}}function Aie(e,t,n,r){return e?.message&&e?.name?e.message:t?"Empty message":n?`${n} ${$d(vn(r))}`:$d(vn(r))}function Die(e){return Nl(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function $ie(e){if(e!==null&&typeof e=="object"&&"dd_context"in e)return e.dd_context}function Nl(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function Pie(e,t){const n=[];let r=e.cause;for(;r!=null&&n.length<10;){const i=mL({originalError:r,source:t,useFallbackStack:!1});n.push(i),r=Nl(r)?r.cause:void 0}return n.length?n:void 0}const df={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Mie(){return new $t(e=>{const t=(i,o)=>{const a=gE({stackTrace:o,originalError:i,startClocks:cr(),nonErrorPrefix:"Uncaught",source:df.SOURCE,handling:"unhandled"});e.notify(a)},{stop:n}=zie(t),{stop:r}=Lie(t);return()=>{n(),r()}})}function zie(e){return ga(Ro(),"onerror",({parameters:[t,n,r,i,o]})=>{let a;Nl(o)||(a=Sie(t,n,r,i)),e(o??t,a)})}function Lie(e){return ga(Ro(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function Fie(e){const t={version:"6.25.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return ere},enumerable:!1}),t}function Uie(e,t,n){const r=e[t];r&&!r.q&&r.version&&ht.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=>$4(i,"onReady callback threw an error:")())}function hL(e,t){t.silentMultipleInit||ht.error(`${e} is already initialized.`)}function Dn(e,t,n,r,i){return gl(e,t,[n],r,i)}function gl(e,t,n,r,{once:i,capture:o,passive:a}={}){const c=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=pl(f,"addEventListener");n.forEach(v=>m.call(t,v,c,d));function h(){const v=pl(f,"removeEventListener");n.forEach(y=>v.call(t,y,c,d))}return{stop:h}}const bm={intervention:"intervention",cspViolation:"csp_violation"};function Vie(e,t){const n=[];t.includes(bm.cspViolation)&&n.push(Hie(e));const r=t.filter(i=>i!==bm.cspViolation);return r.length&&n.push(Bie(r)),z4(...n)}function Bie(e){return new $t(t=>{if(!window.ReportingObserver)return;const n=St((i,o)=>i.forEach(a=>t.notify(qie(a)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function Hie(e){return new $t(t=>{const{stop:n}=Dn(e,document,"securitypolicyviolation",r=>{t.notify(Kie(r))});return n})}function qie(e){const{type:t,body:n}=e;return gL({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:vL(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Kie(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return gL({type:e.effectiveDirective,message:`${bm.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:vL(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${dE(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function gL(e){return{startClocks:cr(),source:df.REPORT,handling:"unhandled",...e}}function vL(e,t,n,r,i){return n?Gb({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:i??void 0}]}):void 0}const Gie=200;function yL(e){const{env:t,service:n,version:r,datacenter:i,sdkVersion:o,variant:a}=e,c=[Gu("sdk_version",o??"6.25.0")];return t&&c.push(Gu("env",t)),n&&c.push(Gu("service",n)),r&&c.push(Gu("version",r)),i&&c.push(Gu("datacenter",i)),a&&c.push(Gu("variant",a)),c}function Gu(e,t){const n=t?`${e}:${t}`:e;return(n.length>Gie||Yie(n))&&ht.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${cE} ${Pb}/getting_started/tagging/#defining-tags`),Zie(n)}function Zie(e){return e.replace(/,/g,"_")}function Yie(e){return Wie()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function Wie(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function bL(e,t){const n=xa.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Iy(e,t,n=Xie()){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]=Iy(i[o],t[o],n);return i}const r=Gc(e)==="object"?e:{};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Iy(r[i],t[i],n));return r}function vE(e){return Iy(void 0,e)}function is(...e){let t;for(const n of e)n!=null&&(t=Iy(t,n));return t}function Xie(){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 xL(){var e;const t=xa.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 Jie(e){return e>=500}function Qie(e){try{return e.clone()}catch{return}}const eoe=80*Zc,toe=32,wL=20*uL,noe=Jr,SL=Mr;function _L(e,t,n,r,i,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?kL(e,t,n,o,{onSuccess:()=>EL(0,t,n,r,i,o),onFailure:()=>{t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),CL(t,n,r,i,o)}}):t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function CL(e,t,n,r,i){e.transportStatus===2&&Ar(()=>{const o=e.queuedPayloads.first();kL(o,e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=SL,EL(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(noe,e.currentBackoffTime*2),CL(e,t,n,r,i)}})},e.currentBackoffTime)}function kL(e,t,n,r,{onSuccess:i,onFailure:o}){t.bandwidthMonitor.add(e),n(e,a=>{t.bandwidthMonitor.remove(e),roe(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 EL(e,t,n,r,i,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${wL/uL}MiB`,source:df.AGENT,startClocks:cr()}),t.queueFullReported=!0);const a=t.queuedPayloads;for(t.queuedPayloads=jL();a.size()>0;)_L(a.dequeue(),t,n,r,i,o)}function roe(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||Jie(e.status))}function ioe(){return{transportStatus:0,currentBackoffTime:SL,bandwidthMonitor:ooe(),queuedPayloads:jL(),queueFullReported:!1}}function jL(){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>=wL}}}function ooe(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=eoe&&this.ongoingRequestCount<toe},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 xC=16*Zc;function RL(e,t,n=xC){const r=new $t,i=ioe();return{observable:r,send:o=>{for(const a of e)_L(o,i,(c,d)=>{Zm(hl.AVOID_FETCH_KEEPALIVE)?Ny(a,c,d):loe(a,n,c,d)},a.trackType,t,r)},sendOnExit:o=>{for(const a of e)aoe(a,n,o)}}}function aoe(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){soe(i)}Ny(e,n)}let l$=!1;function soe(e){l$||(l$=!0,ml(e))}function loe(e,t,n,r){if(coe()&&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(()=>Ny(e,n,r)))}else Ny(e,n,r)}function Ny(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 coe(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function Ym(){const e=uoe();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 IL(e){const t=Ym();return!!t&&t.getCapabilities().includes(e)}function Pd(e){var t;e===void 0&&(e=(t=Ro().location)===null||t===void 0?void 0:t.hostname);const n=Ym();return!!n&&n.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function uoe(){return Ro().DatadogEventBridge}const yd={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function doe(e){return new $t(t=>{const{stop:n}=gl(e,window,["visibilitychange","freeze"],i=>{i.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:yd.HIDDEN}):i.type==="freeze"&&t.notify({reason:yd.FROZEN})},{capture:!0}),r=Dn(e,window,"beforeunload",()=>{t.notify({reason:yd.UNLOADING})}).stop;return()=>{n(),r()}})}function foe(e){return G4(yd).includes(e)}const c$=256*Zc;function NL({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:`
34
+ ${m}`,y=>{n.notifyAfterAddMessage(y-h)})}function a(m){return m!==void 0&&r[m]!==void 0}function c(m){const h=r[m];delete r[m];const v=e.estimateEncodedBytesCount(h);n.notifyAfterRemoveMessage(v)}function d(m,h){const v=$d(m),y=e.estimateEncodedBytesCount(v);if(y>=c$){ht.warn(`Discarded a message whose size was bigger than the maximum allowed size ${c$/Zc}KiB. ${cE} ${Xne}/#technical-limitations`);return}a(h)&&c(h),o(v,y,h)}function f(m){const h=G4(r).join(`
35
+ `);r={};const v=foe(m.reason),y=v?t.sendOnExit:t.send;if(v&&e.isAsync){const x=e.finishSync();x.outputBytesCount&&y(u$(x));const S=[x.pendingData,h].filter(Boolean).join(`
36
+ `);S&&y({data:S,bytesCount:dL(S)})}else h&&e.write(e.isEmpty?h:`
37
+ ${h}`),e.finish(x=>{y(u$(x))})}return{flushController:n,add:d,upsert:d,stop:i.unsubscribe}}function u$(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 poe=30*Mr,moe=Mb?1:50;function TL({pageMayExitObservable:e,sessionExpireObservable:t}){const n=e.subscribe(h=>c(h.reason)),r=t.subscribe(()=>c("session_expire")),i=new $t(()=>()=>{n.unsubscribe(),r.unsubscribe()});let o=0,a=0;function c(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=Ar(()=>{c("duration_limit")},poe))}function m(){yo(d),d=void 0}return{flushObservable:i,get messagesCount(){return a},notifyBeforeAddMessage(h){o+h>=xC&&c("bytes_limit"),a+=1,o+=h,f()},notifyAfterAddMessage(h=0){o+=h,a>=moe?c("messages_limit"):o>=xC&&c("bytes_limit")},notifyAfterRemoveMessage(h){o-=h,a-=1,a===0&&m()}}}const vl="DISCARDED",Hi="SKIPPED";function hoe(){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===vl)return vl;a!==Hi&&i.push(a)}return is(...i)}}}const dl={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},goe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],voe=1,yoe=[Wre],boe=15;let N_;function ff(){return N_||(N_=new L4(100)),N_}function xoe(e,t,n,r,i,o){const a=new $t,{stop:c}=Soe(t,r,i,o,a),{enabled:d,metricsEnabled:f}=woe(e,t,n,a);return{stop:c,enabled:d,metricsEnabled:f}}function woe(e,t,n,r,i=voe,o=boe){const a={},c=!yoe.includes(t.site)&&mc(t.telemetrySampleRate),d={[dl.LOG]:c,[dl.CONFIGURATION]:c&&mc(t.telemetryConfigurationSampleRate),[dl.USAGE]:c&&mc(t.telemetryUsageSampleRate),metric:c&&mc(i)},f=_oe(),m=ff();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=$d(v);if(S.has(C))return;const k=n.triggerHook(1,{startTime:cr().relative});if(k===vl)return;const E=h(k,e,v,f);r.notify(E),bL("telemetry",E),S.add(C)}),m.unbuffer(),Qne(yE),{enabled:c,metricsEnabled:d.metric};function h(v,y,x,S){const k={type:"telemetry",date:cr().timeStamp,service:y,version:"6.25.0",source:"browser",_dd:{format_version:2},telemetry:is(x,{runtime_env:S,connectivity:xL(),sdk_setup:"npm"}),ddtags:yL(t).join(","),experimental_features:Array.from(die())};return is(k,v)}}function Soe(e,t,n,r,i){const o=[];if(Pd()){const a=Ym(),c=i.subscribe(d=>a.send("internal_telemetry",d));o.push(c.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Coe(e)&&a.push(e.replica.rumEndpointBuilder);const c=NL({encoder:r(4),request:RL(a,t),flushController:TL({pageMayExitObservable:n,sessionExpireObservable:new $t})});o.push(c.stop);const d=i.subscribe(c.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function _oe(){var e;return{is_local_file:((e=xa.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Mb}}function Coe(e){return e.site===oL}function Wm(e,t){hC($b.debug,e,t),ff().notify({rawEvent:{type:dl.LOG,message:e,status:"debug",...t}})}function yE(e,t){ff().notify({rawEvent:{type:dl.LOG,status:"error",...Eoe(e),...t}})}function koe(e){ff().notify({rawEvent:{type:dl.CONFIGURATION,configuration:e}})}function Zb(e,t){ff().notify({rawEvent:{type:dl.LOG,message:e,status:"debug",...t},metricName:e})}function mr(e){ff().notify({rawEvent:{type:dl.USAGE,usage:e}})}function Eoe(e){if(Nl(e)){const t=Kb(e);return{error:{kind:t.name,stack:Gb(joe(t))},message:t.message}}return{error:{stack:pL},message:`Uncaught ${$d(e)}`}}function joe(e){return e.stack=e.stack.filter(t=>!t.url||goe.some(n=>t.url.startsWith(n))),e}function OL(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Cc(e){return Array.isArray(e)&&e.length>0}const vv=1/0,Roe=Jr;let Ip=null;const ry=new Set;function Ioe(){ry.forEach(e=>e())}function pf({expireDelay:e,maxEntries:t}){let n=[];Ip||(Ip=cf(()=>Ioe(),Roe));const r=()=>{const m=Bi()-e;for(;n.length>0&&n[n.length-1].endTime<m;)n.pop()};ry.add(r);function i(m,h){const v={value:m,startTime:h,endTime:vv,remove:()=>{OL(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(m=vv,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===vv&&h.close(m)}function c(m=vv,h=0){const v=uf(m,h);return n.filter(y=>y.startTime<=v&&m<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){ry.delete(r),ry.size===0&&Ip&&(zb(Ip),Ip=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f}}const Noe="datadog-synthetics-public-id",Toe="datadog-synthetics-result-id",Ooe="datadog-synthetics-injects-rum";function AL(){return Mb?!1:!!(xa._DATADOG_SYNTHETICS_INJECTS_RUM||el(Ooe))}function DL(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||el(Noe);return typeof e=="string"?e:void 0}function $L(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||el(Toe);return typeof e=="string"?e:void 0}function PL(){return!!(DL()&&$L())}const Aoe=Jr,Doe=Kc;function $oe(e,t,n,r){const i=new $t,o=new $t,a=Ure(e.sessionStoreStrategyType,e,t,n),c=pf({expireDelay:Doe});if(a.renewObservable.subscribe(()=>{c.add(d(),Bi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),c.closeActive(Bi())}),a.expandOrRenewSession(),c.add(d(),V4().relative),Zm(hl.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Foe(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Poe(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),Moe(e,()=>a.expandSession()),zoe(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Loe(e).catch(()=>{}),{id:"invalid",trackingType:Y4,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,m)=>c.find(f,m),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Poe(e,t){const{stop:n}=gl(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function Moe(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=Dn(e,document,"visibilitychange",n);cf(n,Aoe)}function zoe(e,t){const{stop:n}=Dn(e,window,"resume",t,{capture:!0})}async function Loe(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===Od.COOKIE?(n=Q4(t.cookieOptions,e),r={cookie:await ML(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=nL(),Wm("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:PL(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Foe(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Wr(),{stop:i}=Dn(e,cookieStore,"change",o);function o(a){const c=K4(a.changed,f=>f.name===rs);if(!c)return;const d=Wr()-n;if(d>14*Jr)i();else{const f=Hb(c.value);if(f.id&&f.id!==t.id){i();const m=Wr()-r;ML().then(h=>{Wm("Session cookie changed",{time:m,session_age:d,old:t,new:f,cookie:h})}).catch(ml)}}}}async function ML(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(rs):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(rs)),{count:e.length,domain:q4()||"undefined",...e}}function Uoe(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=dL(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 Voe{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 Boe=3e3;function T_(e,t,n=Boe){let r=0,i=!1;return{isLimitReached(){if(r===0&&Ar(()=>{r=0},Jr),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:df.AGENT,startClocks:cr()})}finally{i=!1}}return!0}}}function bE(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Jt}):Dn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function Hoe(e,t){return new Promise(n=>{bE(e,t,n)})}let O_;const xE=new WeakMap;function qoe(e){return O_||(O_=Koe(e)),O_}function Koe(e){return new $t(t=>{const{stop:n}=ga(XMLHttpRequest.prototype,"open",Goe),{stop:r}=ga(XMLHttpRequest.prototype,"send",o=>{Zoe(o,e,t)},{computeHandlingStack:!0}),{stop:i}=ga(XMLHttpRequest.prototype,"abort",Yoe);return()=>{n(),r(),i()}})}function Goe({target:e,parameters:[t,n]}){xE.set(e,{state:"open",method:String(t).toUpperCase(),url:fE(String(n))})}function Zoe({target:e,parameters:[t],handlingStack:n},r,i){const o=xE.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=cr(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let c=!1;const{stop:d}=ga(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),c)return;c=!0;const h=o;h.state="complete",h.duration=Gn(a.startClocks.timeStamp,Cr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(hm(h))},{stop:m}=Dn(r,e,"loadend",f);i.notify(a)}function Yoe({target:e}){const t=xE.get(e);t&&(t.isAborted=!0)}async function Woe(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(Jt),t.collectStreamBody?fL(r):void 0}let A_;const zL=[];function LL({responseBodyAction:e}={}){return e&&zL.push(e),A_||(A_=Xoe()),A_}function Xoe(){return new $t(e=>{if(!xa.fetch)return;const{stop:t}=ga(xa,"fetch",n=>Joe(n,e),{computeHandlingStack:!0});return t})}function Joe({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 c=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:fE(String(i)),f=cr(),m={state:"start",init:o,input:i,method:c,startClocks:f,url:d,handlingStack:n};r.notify(m),e[0]=m.input,e[1]=m.init,t(h=>{Qoe(r,h,m).catch(ml)})}async function Qoe(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 c=zL.reduce((d,f)=>Math.max(d,f(o)),0);if(c!==0){const d=Qie(a);if(d&&d.body)try{const f=await Woe(d.body,{collectStreamBody:c===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function eae(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(St(e),t);return()=>window.cancelIdleCallback(n)}return nae(e)}const tae=50;function nae(e){const t=Wr(),n=Ar(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,tae-(Wr()-t))})},0);return()=>yo(n)}const rae=Mr,iae=30;function oae(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>iae-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){eae(t,{timeout:rae})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let D_={};function aae(e){const t=e.map(n=>(D_[n]||(D_[n]=sae(n)),D_[n]));return z4(...t)}function sae(e){return new $t(t=>{const n=Xa[e];return Xa[e]=(...r)=>{n.apply(console,r);const i=ym("console error");ul(()=>{t.notify(lae(r,e,i))})},()=>{Xa[e]=n}})}function lae(e,t,n){const r=e.map(i=>cae(i)).join(" ");if(t===$b.error){const i=e.find(Nl),o=gE({originalError:i,handlingStack:n,startClocks:cr(),source:df.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 cae(e){return typeof e=="string"?vn(e):Nl(e)?cL(Kb(e)):$d(vn(e),void 0,2)}const uae=500;function dae(){const e=[];return{add:i=>{e.push(i)>uae&&e.splice(0,1)},remove:i=>{OL(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function fae(e){const t=Gc(e)==="object";return t||ht.error("Unsupported context:",e),t}function $_(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!d$(r[i])&&(r[i]=String(r[i])),o&&d$(r[i])&&ht.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function d$(e){return e==null||e===""}function Yb(e="",{propertiesConfig:t={}}={}){let n={};const r=new $t,i={getContext:()=>vE(n),setContext:o=>{fae(o)?n=vn($_(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=vn($_({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],$_(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Vr(e,t,n,r){return St((...i)=>(r&&mr({feature:r}),e()[t][n](...i)))}const pae="_dd_c",mae=[];function wE(e,t,n,r){const i=hae(n,r);mae.push(Dn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(c);const o=is(d(),t.getContext());Il(o)||t.setContext(o);function a(){t.setContext(d())}function c(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function hae(e,t){return`${pae}_${e}_${t}`}function gae(e,t,n){const r=FL();return t.storeContextsAcrossPages&&wE(t,r,n,4),e.register(0,()=>{const i=r.getContext();return Il(i)||!i.id?Hi:{account:i}}),r}function FL(){return Yb("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function vae(e,t,n,r){const i=UL();return t.storeContextsAcrossPages&&wE(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function UL(){return Yb("global context")}function yae(e,t,n,r){const i=VL();return t.storeContextsAcrossPages&&wE(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const c=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!c.anonymous_id&&t.trackAnonymousUser&&(c.anonymous_id=d.anonymousId),Il(c)?Hi:{type:o,usr:c}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function VL(){return Yb("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const hr={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"},Wb={FETCH:Kr.FETCH,XHR:Kr.XHR},bae=500;function xae(e=Mie){const t=new L4(bae),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function wae(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const xt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},BL={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Ja={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},SE={CLICK:"click",CUSTOM:"custom"},Np={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},xm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Sae(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function _ae(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,f$(a))}function o(a,c,d,f){if(!Zm(hl.FEATURE_OPERATION_VITAL))return;const{operationKey:m,context:h,description:v}=d||{},y={name:a,type:xm.OPERATION_STEP,operationKey:m,failureReason:f,stepType:c,startClocks:cr(),context:vn(h),description:v};e.notify(12,f$(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,c={})=>HL(n,a,c),stopDurationVital:(a,c={})=>{qL(i,n,a,c)}}}function HL({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:cr(),...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(Cae(o,o.startClocks,i,cr())),typeof r=="string"?t.delete(r):n.delete(r))}function Cae(e,t,n,r){var i;return{name:e.name,type:xm.DURATION,startClocks:t,duration:Gn(t.timeStamp,r.timeStamp),context:is(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function f$(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:$r(),type:n,name:r,description:i,...n===xm.DURATION?{duration:bt(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:xt.VITAL,context:o},startTime:t.relative,duration:n===xm.DURATION?e.duration:void 0,domainContext:{}}}function KL(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const p$=new Map;function GL(e,t){if(t===100)return!0;if(t===0)return!1;const n=p$.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=kae(BigInt(`0x${e.split("-")[4]}`),t):r=mc(t),p$.set(t,{sessionId:e,decision:r}),r}function kae(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function Eae(){return YL(64)}function ZL(){return YL(63)}function YL(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 Zu(e){return e.toString(16).padStart(16,"0")}function jae(e){const t=e;return Gc(t)==="object"&&vm(t.match)&&Array.isArray(t.propagatorTypes)}function Rae(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Iae(e,t,n,r){return{clearTracingIfNeeded:Rae,traceFetch:i=>m$(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(c=>{i.input.headers.append(c,o[c])});else{i.init=hm(i.init);const c=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{c.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{c.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{c.push([d,i.init.headers[d]])}),i.init.headers=c.concat(pE(o))}}),traceXhr:(i,o)=>m$(e,i,t,n,r,a=>{Object.keys(a).forEach(c=>{o.setRequestHeader(c,a[c])})})}}function m$(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const c=e.allowedTracingUrls.find(m=>qb([m.match],t.url,!0));if(!c)return;const d=GL(a.id,e.traceSampleRate);(d||e.traceContextInjection===yC.ALL)&&(t.traceSampled=d,t.traceId=Eae(),t.spanId=ZL(),o(Nae(t.traceId,t.spanId,t.traceSampled,a.id,c.propagatorTypes,r,i,e)))}function Nae(e,t,n,r,i,o,a,c){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${Zu(e)}-${Zu(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Zu(e)}-${Zu(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Zu(e),"X-B3-SpanId":Zu(t),"X-B3-Sampled":n?"1":"0"});break}}}),c.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 WL=["tracecontext","datadog"];function Tae(e,t){var n,r,i,o,a,c,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&ht.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){ht.error("Application ID is not configured, no RUM data will be collected.");return}if(!ud(e.sessionReplaySampleRate,"Session Replay")||!ud(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){ht.error("Excluded Activity Urls should be an array");return}const f=Oae(e);if(!f)return;const m=sie(e,t),h=Dae(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:Km(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:!!(!((c=e.trackLongTasks)!==null&&c!==void 0)||c),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Ry(cd,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:cd.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Ry(yC,e.traceContextInjection)?e.traceContextInjection:yC.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...m}}function Oae(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){ht.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){ht.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{vm(n)?t.push({match:n,propagatorTypes:WL}):jae(n)?t.push(n):ht.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function Aae(e){const t=new Set;return Cc(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{vm(n)?WL.forEach(r=>t.add(r)):Gc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Dae(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return ht.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{vm(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&vm(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function $ae(e){return Cc(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Pae(e){return Cc(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Mae(e){var t;const n=lie(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:Cc(e.allowedTracingUrls),use_allowed_graph_ql_urls:Cc(e.allowedGraphQlUrls),use_track_graph_ql_payload:$ae(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Pae(e.allowedGraphQlUrls),selected_tracing_propagators:Aae(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Cc(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 zae(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=h$[n].find(c=>Hae[c](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!Gae(i.escapeSequence))return[];o+=Yae(i.escapeSequence),i.escapeSequence=void 0}qae.includes(r)?o+=a:Kae.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 h$[n].includes(1)?(o!==""&&t.push(o),t):[]}const Lae=/[a-zA-Z_$]/,Fae=/[a-zA-Z0-9_$]/,Uae=/[0-9]/,Vae=/[a-fA-F0-9]/,Bae=`'"`,Hae={0:()=>!1,1:()=>!1,2:e=>Lae.test(e),3:e=>Fae.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Uae.test(e),8:e=>Bae.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?Vae.test(e):!1},h$={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]},qae=[2,3,7,10],Kae=[4,5,6];function Gae(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const Zae={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
38
+ `,r:"\r",t:" "};function Yae(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Zae[e]}const Wae="v1",Xae=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Jae(e,t){let n;const r=ese(),i=await ise(e);return i.ok?(r.increment("fetch","success"),n=Qae(e,i.value,t,r)):(r.increment("fetch","failure"),ht.error(i.error)),Zb("remote configuration metrics",{metrics:r.get()}),n}function Qae(e,t,n,r){const i={...e};return Xae.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(tse(v)){if(nse(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return XL(v.value);case"dynamic":return c(v);default:ht.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return P4(v,o)}return v}function a(v,y){y.forEach(({key:x,value:S})=>{v.setContextProperty(x,o(S))})}function c(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:ht.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof x=="string"?rse(S,x):x}function d({name:v}){const y=Bb(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{ht.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!x){r.increment("dom","missing");return}if(m(x,y)){ht.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=zae(v);if(x.length===0){ht.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){ht.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function ese(){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 tse(e){return typeof e=="object"&&e!==null}function nse(e){return"rcSerializedType"in e}function XL(e){try{return new RegExp(e)}catch{ht.error(`Invalid regex in the remote configuration: '${e}'`)}}function rse(e,t){const n=XL(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 ise(e){let t;try{t=await fetch(ose(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 ose(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${aL("rum",e)}/${Wae}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function ase({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=dae(),a=UL();P_(a,hr.globalContext,o);const c=VL();P_(c,hr.userContext,o);const d=FL();P_(d,hr.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 R;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),R=f.options}const T=i(v,m,R);o.drain(T)}function C(R,T){const N=Pd();if(N&&(R=sse(R)),h=R,koe(Mae(R)),v){hL("DD_RUM",R);return}const O=Tae(R,T);if(O){if(!N&&!O.sessionStoreStrategyType){ht.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!N&&t&&(m=t(O,"Datadog RUM",Jt),!m)||(v=O,LL().subscribe(Jt),n.tryToInit(O.trackingConsent),S())}}const k=R=>{o.add(T=>T.addDurationVital(R))};return{init(R,T,N){if(!R){ht.error("Missing configuration");return}cie(R.enableExperimentalFeatures),h=R,!(e&&AL())&&(KL(R.plugins,"onInit",{initConfiguration:R,publicApi:T}),R.remoteConfigurationId?Jae(R,{user:c,context:a}).then(O=>{O&&C(O,N)}).catch(ml):C(R,N))},get initConfiguration(){return h},getInternalContext:Jt,stopSession:Jt,addTiming(R,T=Cr()){o.add(N=>N.addTiming(R,T))},startView(R,T=cr()){const N=O=>{O.startView(R,T)};o.add(N),f||(f={options:R,callback:N},S())},setViewName(R){o.add(T=>T.setViewName(R))},setViewContext(R){o.add(T=>T.setViewContext(R))},setViewContextProperty(R,T){o.add(N=>N.setViewContextProperty(R,T))},getViewContext:()=>x,globalContext:a,userContext:c,accountContext:d,addAction(R){o.add(T=>T.addAction(R))},addError(R){o.add(T=>T.addError(R))},addFeatureFlagEvaluation(R,T){o.add(N=>N.addFeatureFlagEvaluation(R,T))},startDurationVital(R,T){return HL(r,R,T)},stopDurationVital(R,T){qL(k,r,R,T)},addDurationVital:k,addOperationStepVital:(R,T,N,O)=>{o.add(M=>M.addOperationStepVital(vn(R),T,vn(N),vn(O)))}}}function sse(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=Ym())===null||n===void 0?void 0:n.getPrivacyLevel()}}function P_(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function lse(e,t,n,r={}){const i=Vre(),o=Sae(),a=xae().observable;let c=ase(r,i,o,(h,v,y)=>{const x=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Uoe,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,x),c=cse(c,S),KL(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=St(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),mr({feature:"start-view"})}),m=Fie({init:h=>{const v=new Error().stack;ul(()=>c.init(h,m,v))},setTrackingConsent:St(h=>{i.update(h),mr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:St(h=>{c.setViewName(h),mr({feature:"set-view-name"})}),setViewContext:St(h=>{c.setViewContext(h),mr({feature:"set-view-context"})}),setViewContextProperty:St((h,v)=>{c.setViewContextProperty(h,v),mr({feature:"set-view-context-property"})}),getViewContext:St(()=>(mr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:St(h=>c.getInternalContext(h)),getInitConfiguration:St(()=>vE(c.initConfiguration)),addAction:(h,v)=>{const y=ym("action");ul(()=>{c.addAction({name:vn(h),context:vn(v),startClocks:cr(),type:SE.CUSTOM,handlingStack:y}),mr({feature:"add-action"})})},addError:(h,v)=>{const y=ym("error");ul(()=>{c.addError({error:h,handlingStack:y,context:vn(v),startClocks:cr()}),mr({feature:"add-error"})})},addTiming:St((h,v)=>{c.addTiming(vn(h),v)}),setGlobalContext:Vr(d,hr.globalContext,Br.setContext,"set-global-context"),getGlobalContext:Vr(d,hr.globalContext,Br.getContext,"get-global-context"),setGlobalContextProperty:Vr(d,hr.globalContext,Br.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Vr(d,hr.globalContext,Br.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Vr(d,hr.globalContext,Br.clearContext,"clear-global-context"),setUser:Vr(d,hr.userContext,Br.setContext,"set-user"),getUser:Vr(d,hr.userContext,Br.getContext,"get-user"),setUserProperty:Vr(d,hr.userContext,Br.setContextProperty,"set-user-property"),removeUserProperty:Vr(d,hr.userContext,Br.removeContextProperty,"remove-user-property"),clearUser:Vr(d,hr.userContext,Br.clearContext,"clear-user"),setAccount:Vr(d,hr.accountContext,Br.setContext,"set-account"),getAccount:Vr(d,hr.accountContext,Br.getContext,"get-account"),setAccountProperty:Vr(d,hr.accountContext,Br.setContextProperty,"set-account-property"),removeAccountProperty:Vr(d,hr.accountContext,Br.removeContextProperty,"remove-account-property"),clearAccount:Vr(d,hr.accountContext,Br.clearContext,"clear-account"),startView:f,stopSession:St(()=>{c.stopSession(),mr({feature:"stop-session"})}),addFeatureFlagEvaluation:St((h,v)=>{c.addFeatureFlagEvaluation(vn(h),vn(v)),mr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:St(()=>t.getSessionReplayLink()),startSessionReplayRecording:St(h=>{t.start(h),mr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:St(()=>t.stop()),addDurationVital:St((h,v)=>{mr({feature:"add-duration-vital"}),c.addDurationVital({name:vn(h),type:xm.DURATION,startClocks:nre(v.startTime),duration:v.duration,context:vn(v&&v.context),description:vn(v&&v.description)})}),startDurationVital:St((h,v)=>(mr({feature:"start-duration-vital"}),c.startDurationVital(vn(h),{context:vn(v&&v.context),description:vn(v&&v.description)}))),stopDurationVital:St((h,v)=>{mr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?vn(h):h,{context:vn(v&&v.context),description:vn(v&&v.description)})}),startFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:St((h,v)=>{mr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:St((h,v,y)=>{mr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return m}function cse(e,t){return{init:n=>{hL("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function use(){const e=dse();return new $t(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 dse(){let e;const t=window;if(t.Zone&&(e=pl(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Jt),r=pl(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function fse(){const e=new $t,{stop:t}=ga(window,"open",()=>e.notify());return{observable:e,stop:t}}function pse(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){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:c.referrer,url:c.url}}}}}}const mse=Voe,hse=Kc;function gse(e){const t=pf({expireDelay:hse});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 JL="initial_document",vse=[[Kr.DOCUMENT,e=>JL===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 yse(e){const t=e.name;if(!dre(t))return Kr.OTHER;const n=fre(t);for(const[r,i]of vse)if(i(e.initiatorType,n))return r;return Kr.OTHER}function g$(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function QL(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function bse(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Gn(n,r):t}function xse(e){if(!tF(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:m,requestStart:h,responseStart:v,responseEnd:y}=e,x={download:ac(t,v,y),first_byte:ac(t,h,v)};return 0<r&&r<n&&(x.worker=ac(t,r,n)),n<m&&(x.connect=ac(t,d,m),d<=f&&f<=m&&(x.ssl=ac(t,f,m))),n<c&&(x.dns=ac(t,a,c)),t<o&&(x.redirect=ac(t,i,o)),x}function eF(e){return e.duration>=0}function tF(e){const t=g$(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=wse(e)?g$(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function wse(e){return e.redirectEnd>e.startTime}function ac(e,t,n){if(e<=t&&t<=n)return{duration:bt(Gn(t,n)),start:bt(Gn(e,t))}}function Sse(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function _se(e){return e.deliveryType===""?"other":e.deliveryType}function Cse(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 _E(e){return e&&(!oie(e)||Zm(hl.TRACK_INTAKE_REQUESTS))}const kse=/data:(.+)?(;base64)?,/g,Ese=24e3;function jse(e,t=Ese){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(kse);return n?`${n[0]}[...]`:e}const Rse=32*Zc;function Ise(e,t){const n=Tse(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Nse(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Nse(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Cc(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 nF(e,t){return t.allowedGraphQlUrls.find(n=>qb([n.match],e))}function Tse(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 c=n.query.trim();r=Ose(c),t&&(i=dE(c,Rse,"..."))}const o=n.operationName;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:r,operationName:o,variables:a,payload:i}}function Ose(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let v$=1;function Ase(e,t,n,r,i){const o=Iae(t,n,r,i);Dse(e,t,o),$se(e,t,o)}function Dse(e,t,n){const r=qoe(t).subscribe(i=>{const o=i;if(_E(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=rF(),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:Wb.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 $se(e,t,n){const r=LL({responseBodyAction:i=>{var o;return!((o=nF(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(_E(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=rF(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Gn(a.startClocks.timeStamp,Cr()),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:Wb.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 rF(){const e=v$;return v$+=1,e}function iF(e){return Km(e)&&e<0?void 0:e}function oF({lifeCycle:e,isChildEvent:t,onChange:n=Jt}){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 xt.ERROR:r.errorCount+=1,n();break;case xt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case xt.LONG_TASK:r.longTaskCount+=1,n();break;case xt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Pse(e,t){const n=Wr();let r=!1;const{stop:i}=gl(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Bi(),processingEnd:Bi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){gl(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Wr()-n&&t(c)}}}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 wa(e,t){return new $t(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Lse(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(St(d=>{o?i=Ar(()=>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=Ar(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Mse(e);let c;return!Yc(Ut.FIRST_INPUT)&&t.type===Ut.FIRST_INPUT&&({stop:c}=Pse(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),yo(i)}})}let Tp;function Mse(e){return!Tp&&zse()&&"addEventListener"in performance&&(Tp=Dn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Tp?.stop()}}function zse(){return window.performance!==void 0&&"getEntries"in performance}function Yc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Lse(e){return e.filter(t=>!Fse(t))}function Fse(e){return e.entryType===Ut.RESOURCE&&(!_E(e.name)||!eF(e))}function wC(e){return e.nodeType===Node.TEXT_NODE}function Use(e){return e.nodeType===Node.COMMENT_NODE}function os(e){return e.nodeType===Node.ELEMENT_NODE}function aF(e){return os(e)&&!!e.shadowRoot}function Vse(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&os(t.host)}function p2e(e){return e.childNodes.length>0||aF(e)}function m2e(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;aF(e)&&t(e.shadowRoot)}function Bse(e){return Vse(e)?e.host:e.parentNode}const sF=100,Hse=100,y$="data-dd-excluded-activity-mutations";function CE(e,t,n,r,i,o){const a=Kse(e,t,n,r);return qse(a,i,o)}function qse(e,t,n){let r,i=!1;const o=Ar(St(()=>f({hadActivity:!1})),sF),a=n!==void 0?Ar(St(()=>f({hadActivity:!0,end:Cr()})),n):void 0,c=e.subscribe(({isBusy:m})=>{yo(o),yo(r);const h=Cr();m||(r=Ar(St(()=>f({hadActivity:!0,end:h})),Hse))}),d=()=>{i=!0,yo(o),yo(r),yo(a),c.unsubscribe()};function f(m){i||(d(),t(m))}return{stop:d}}function Kse(e,t,n,r){return new $t(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(Gse)||d()}),n.subscribe(d),wa(r,{type:Ut.RESOURCE}).subscribe(f=>{f.some(m=>!M_(r,m.name))&&d()}),e.subscribe(7,f=>{M_(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{M_(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function M_(e,t){return qb(e.excludedActivityUrls,t)}function Gse(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&os(t)&&t.matches(`[${y$}], [${y$}] *`))}const Xb="data-dd-action-name",lF="Masked Element",cF=[Xb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Zse=[dF,Wse],Yse=[dF,Xse,Jse];function Xm(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=b$(r,Zse,ele,t,n);if(i)return i;n=b$(r,Yse,tle,t,n)||Jb(Qse(r),n),r=r.parentElement}return n}function uF(e){return/[0-9]/.test(e)}function Wse(e){if(e.id&&!uF(e.id))return`#${CSS.escape(e.id)}`}function Xse(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!uF(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function Jse(e){return CSS.escape(e.tagName)}function dF(e,t){if(t){const r=n(t);if(r)return r}for(const r of cF){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 Qse(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 b$(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return Jb(a,i)}}function ele(e,t,n){return e.ownerDocument.querySelectorAll(Jb(t,n)).length===1}function tle(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=Jb(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function Jb(e,t){return t?`${e}>${t}`:e}const kt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:cd.ALLOW,MASK:cd.MASK,MASK_USER_INPUT:cd.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:cd.MASK_UNLESS_ALLOWLISTED},fF="data-dd-privacy",h2e="hidden",nle="dd-privacy-",z_="***",g2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",rle={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},ile="x";function cc(e){return`[${fF}="${e}"], .${nle}${e}`}function Qb(e,t,n){if(n&&n.has(e))return n.get(e);const r=Bse(e),i=r?Qb(r,t,n):t,o=ale(e),a=ole(o,i);return n&&n.set(e,a),a}function ole(e,t){switch(t){case kt.HIDDEN:case kt.IGNORE:return t}switch(e){case kt.ALLOW:case kt.MASK:case kt.MASK_USER_INPUT:case kt.MASK_UNLESS_ALLOWLISTED:case kt.HIDDEN:case kt.IGNORE:return e;default:return t}}function ale(e){if(os(e)){if(e.tagName==="BASE")return kt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return kt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return kt.MASK}if(e.matches(cc(kt.HIDDEN)))return kt.HIDDEN;if(e.matches(cc(kt.MASK)))return kt.MASK;if(e.matches(cc(kt.MASK_UNLESS_ALLOWLISTED)))return kt.MASK_UNLESS_ALLOWLISTED;if(e.matches(cc(kt.MASK_USER_INPUT)))return kt.MASK_USER_INPUT;if(e.matches(cc(kt.ALLOW)))return kt.ALLOW;if(lle(e))return kt.IGNORE}}function pF(e,t){switch(t){case kt.MASK:case kt.HIDDEN:case kt.IGNORE:return!0;case kt.MASK_UNLESS_ALLOWLISTED:return wC(e)?yv(e.parentNode)?!0:!hF(e.textContent||""):yv(e);case kt.MASK_USER_INPUT:return wC(e)?yv(e.parentNode):yv(e);default:return!1}}function sle(e,t,n,r,i){if(r!==kt.MASK&&r!==kt.MASK_UNLESS_ALLOWLISTED||t===fF||cF.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 yv(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!!rle[t.tagName]}const mF=e=>e.replace(/\S/g,ile);function v2e(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=z_;else if(a===kt.HIDDEN)i=z_;else if(pF(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=z_:a===kt.MASK_UNLESS_ALLOWLISTED?i=gF(i):i=mF(i);return i}function lle(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 hF(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function gF(e,t){return hF(e)?e:t||mF(e)}const vF=Mr,cle=100;function ule(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),yo(i),i=Ar(c,vF)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){yo(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!dle(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function dle(e,t){return e.target===t.target&&fle(e,t)<=cle&&e.timeStamp-t.timeStamp<=vF}function fle(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function ple(e,t,n=kt.ALLOW){const r=new Map,{actionNameAttribute:i}=t,o=x$(e,Xb)||i&&x$(e,i);return o?{name:o,nameSource:"custom_attribute"}:n===kt.MASK?{name:lF,nameSource:"mask_placeholder"}:w$(e,mle,t,r)||w$(e,hle,t,r)||{name:"",nameSource:"blank"}}function x$(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return bF(yF(r.trim()))}const mle=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return iy(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 iy(e,t,n)},(e,t,n)=>Op(e,"aria-label",t,n),(e,t,n)=>{const r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(i=>vle(e,i)).filter(i=>!!i).map(i=>xF(i,t,n)).join(" "),nameSource:"text_content"}},(e,t,n)=>Op(e,"alt",t,n),(e,t,n)=>Op(e,"name",t,n),(e,t,n)=>Op(e,"title",t,n),(e,t,n)=>Op(e,"placeholder",t,n),(e,t,n)=>{if("options"in e&&e.options.length>0)return iy(e.options[0],t,n)}],hle=[(e,t,n)=>iy(e,t,n)],gle=10;function w$(e,t,n,r){let i=e,o=0;for(;o<=gle&&i&&i.nodeName!=="BODY"&&i.nodeName!=="HTML"&&i.nodeName!=="HEAD";){for(const a of t){const c=a(i,n,r);if(c){const{name:d,nameSource:f}=c,m=d&&d.trim();if(m)return{name:bF(yF(m)),nameSource:f}}}if(i.nodeName==="FORM")break;i=i.parentElement,o+=1}}function yF(e){return e.replace(/\s+/g," ")}function bF(e){return e.length>100?`${dE(e,100)} [...]`:e}function vle(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Op(e,t,n,r){const{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=n;let a=e.getAttribute(t);if(a&&i){const c=Qb(e,o,r);sle(e.tagName,t,a,c,n)&&(a=gF(a,lF))}else a||(a="");return{name:a,nameSource:"standard_attribute"}}function iy(e,t,n){return{name:xF(e,t,n)||"",nameSource:"text_content"}}function xF(e,t,n){if(e.isContentEditable)return;const{enablePrivacyForActionName:r,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Zm(hl.USE_TREE_WALKER_FOR_ACTION_NAME))return yle(e,i,r,o,n);if("innerText"in e){let a=e.innerText;const c=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 c(`[${Xb}]`),i&&c(`[${i}]`),r&&c(`${cc(kt.HIDDEN)}, ${cc(kt.MASK)}`),a}return e.textContent}function yle(e,t,n,r,i){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(os(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 c(d){const f=Qb(d,r,i);if(n&&f&&pF(d,f))return NodeFilter.FILTER_REJECT;if(os(d)){if(d.hasAttribute(Xb)||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 ble(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[Dn(e,window,"pointerdown",c=>{_$(c)&&(r=S$(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),Dn(e,window,"selectionchange",()=>{(!r||!S$())&&(i.selection=!0)},{capture:!0}),Dn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),Dn(e,window,"pointerup",c=>{if(_$(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),Dn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function S$(){const e=window.getSelection();return!e||e.isCollapsed}function _$(e){return e.target instanceof Element&&e.isPrimary!==!1}const C$=3;function xle(e,t){if(wle(e))return t.addFrustration(Np.RAGE_CLICK),e.some(k$)&&t.addFrustration(Np.DEAD_CLICK),t.hasError&&t.addFrustration(Np.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(Np.ERROR_CLICK),k$(r)&&!n&&r.addFrustration(Np.DEAD_CLICK)}),{isRage:!1}}function wle(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(C$-1);t+=1)if(e[t+C$-1].event.timeStamp-e[t].event.timeStamp<=Mr)return!0;return!1}const Sle='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 k$(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(Sle)}const wF=10*Mr,im=new Map;function _le(e){const t=im.get(e);return im.delete(e),t}function SF(e,t){im.set(e,t),im.forEach((n,r)=>{Gn(r,Bi())>wF&&im.delete(r)})}const Cle=5*Jr;function kle(e,t,n,r){const i=pf({expireDelay:Cle}),o=new $t;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,m),e.subscribe(11,h=>{h.reason===yd.UNLOADING&&m()});const{stop:c}=ble(r,{onPointerDown:h=>Ele(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,x)=>{jle(r,e,t,n,i,o,f,h,y,x,v)}});return{stop:()=>{m(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=ule(h,y=>{Ile(y,v)})}}function m(){a&&a.stop()}}function Ele(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=Qb(r.target,e.defaultPrivacyLevel):o=kt.ALLOW,o===kt.HIDDEN)return;const a=Rle(r,o,e);let c=!1;return CE(t,n,i,e,d=>{c=d.hadActivity},sF),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function jle(e,t,n,r,i,o,a,c,d,f,m){var h;const v=_F(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&SF(d.timeStamp,y);const{stop:x}=CE(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()},wF),S=t.subscribe(5,({endClocks:k})=>{v.stop(k.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function Rle(e,t,n){const r=e.target.getBoundingClientRect(),i=Xm(e.target,n.actionNameAttribute);i&&SF(e.timeStamp,i);const{name:o,nameSource:a}=ple(e.target,n,t);return{type:SE.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 _F(e,t,n,r,i){const o=$r(),a=cr(),c=t.add(o,a.relative),d=oF({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 $t;function y(x){f===0&&(m=x,f=1,m?c.close(uE(m)):c.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:()=>_F(e,t,n,r,i),validate:x=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:k}=d.eventCounts,E={duration:m&&Gn(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 Ile(e,t){const{isRage:n}=xle(e,t);n?(e.forEach(r=>r.discard()),t.stop(Cr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Nle(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,E$(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==xt.ERROR&&f!==xt.RESOURCE&&f!==xt.LONG_TASK)return Hi;const m=a.findActionId(d);return m?{type:f,action:{id:m}}:Hi}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Jt},c=Jt;return i.trackUserInteractions&&({actionContexts:a,stop:c}=kle(e,n,r,i)),{addAction:d=>{e.notify(12,E$(d))},actionContexts:a,stop:()=>{o(),c()}}}function E$(e){const t=L_(e)?{action:{id:e.id,loading_time:iF(bt(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=is({action:{id:$r(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:xt.ACTION},t),r=L_(e)?e.duration:void 0,i=L_(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function L_(e){return e.type!==SE.CUSTOM}function Tle(e){const t=aae([$b.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function Ole(e,t){const n=Vie(e,[bm.cspViolation,bm.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Ale(e,t,n){const r=new $t;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Tle(r),Ole(t,r),r.subscribe(i=>e.notify(14,{error:i})),Dle(e)}function Dle(e){return e.subscribe(14,({error:t})=>{e.notify(12,$le(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=gE({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:df.CUSTOM,handling:"handled"});a.context=is(a.context,o),e.notify(14,{error:a})}}}function $le(e){const t={date:e.startClocks.timeStamp,error:{id:$r(),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:xt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const j$=new WeakSet;function Ple(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=>!j$.has(r)).filter(r=>eF(r)&&tF(r)).filter(r=>Mle(r,e.startClocks.relative,CF({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return j$.add(n[0]),n[0].toJSON()}function CF(e){return uf(e.startTime,e.duration)}function Mle(e,t,n){return e.startTime>=t-1&&CF(e)<=uf(n,1)}const zle=2*Jr;function Lle(e){const t=Fle(e)||Ule(e);if(!(!t||t.traceTime<=Wr()-zle))return t.traceId}function Fle(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return kF(t&&t.content,n&&n.content)}function Ule(e){const t=Vle(e);if(t)return kF(gm(t,"trace-id"),gm(t,"trace-time"))}function kF(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function Vle(e){for(let t=0;t<e.childNodes.length;t+=1){const n=R$(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=R$(n);if(r)return r;if(!wC(n))break}}function R$(e){if(e&&Use(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function EF(){if(Yc(Ut.NAVIGATION)){const n=performance.getEntriesByType(Ut.NAVIGATION)[0];if(n)return n}const e=Ble(),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 Ble(){const e={},t=performance.timing;for(const n in t)if(Km(t[n])){const r=n,i=t[r];e[r]=i===0?0:uE(i)}return e}function Hle(e,t,n=EF){bE(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Ut.RESOURCE,initiatorType:JL,duration:r.responseEnd,traceId:Lle(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const qle=1e3;function Kle(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>qle&&(Wm("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function Gle(e,t,n,r=oae(),i=Hle){let o;const a=t.trackEarlyRequests;a?o=Kle(e):e.subscribe(8,f=>{d(()=>Zle(f,t,n))});const c=wa(t,{type:Ut.RESOURCE,buffered:!0}).subscribe(f=>{for(const m of f)(a||!QL(m))&&d(()=>I$(m,t,n,o))});i(t,f=>{d(()=>I$(f,t,n,o))});function d(f){r.push(()=>{const m=f();m&&e.notify(12,m)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function Zle(e,t,n){const r=Ple(e);return jF(r,e,n,t)}function I$(e,t,n,r){const i=QL(e)&&r?r.getMatchingRequest(e):void 0;return jF(e,i,n,t)}function jF(e,t,n,r){if(!e&&!t)return;const i=t?Jle(t,r):Qle(e,r);if(!r.trackResources&&!i)return;const o=e?Lb(e.startTime):t.startClocks,a=e?bse(e):ece(n,o,t.duration),c=t&&Yle(t,r),d=is({date:o.timeStamp,resource:{id:$r(),duration:bt(a),type:t?t.type===Wb.XHR?Kr.XHR:Kr.FETCH:yse(e),method:t?t.method:void 0,status_code:t?t.status:tce(e.responseStatus),url:t?jse(t.url):e.name,protocol:e&&Sse(e),delivery_type:e&&_se(e),graphql:c},type:xt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&Xle(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:Wle(e,t)}}function Yle(e,t){const n=nF(e.url,t);if(n)return Ise(e,n)}function Wle(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Wb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function Xle(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Cse(e),...xse(e)}}}function Jle(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 Qle(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:ZL().toString(),rule_psr:t.rulePsr}}}function ece(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function tce(e){return e===0?void 0:e}function nce(e,t,n){const{stop:r,eventCounts:i}=oF({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const rce=10*Jr;function ice(e,t,n){return{stop:wa(e,{type:Ut.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<rce);o&&n(o.startTime)}).unsubscribe}}function oce(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Gn(e,Bi()))})})}function ace(e,t,n){const r=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Gn(o.startTime,o.processingStart);let c;o.target&&os(o.target)&&(c=Xm(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function sce(e,t,n=EF){return uce(e,()=>{const r=n();cce(r)||t(lce(r))})}function lce(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Bi()?e.responseStart:void 0}}function cce(e){return e.loadEventEnd<=0}function uce(e,t){let n;const{stop:r}=bE(e,"complete",()=>{n=Ar(()=>t())});return{stop:()=>{r(),yo(n)}}}const dce=10*Jr;function fce(e,t,n,r){let i=1/0;const{stop:o}=gl(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=wa(e,{type:Ut.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=K4(d,m=>m.entryType===Ut.LARGEST_CONTENTFUL_PAINT&&m.startTime<i&&m.startTime<t.timeStamp&&m.startTime<dce&&m.size>a);if(f){let m;f.element&&(m=Xm(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:m,resourceUrl:pce(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function pce(e){return e.url===""?void 0:e.url}function RF(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Jt};if(Yc(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:Jt}}let r=1/0;const{stop:i}=gl(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 mce(e,t,n,r){const i={},{stop:o}=sce(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=RF(e,t),{stop:c}=ice(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=fce(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=ace(e,a,h=>{i.firstInput=h,r()});function m(){o(),c(),d(),f(),a.stop()}return{stop:m,initialViewMetrics:i}}const SC=(e,t)=>e*t,hce=(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:SC(i-n,o-r)},N$=e=>{const t=SC(e.previousRect.width,e.previousRect.height),n=SC(e.currentRect.width,e.currentRect.height),r=hce(e.previousRect,e.currentRect);return t+n-r};function gce(e,t,n){if(!wce())return{stop:Jt};let r=0,i;n({value:0});const o=xce(),a=wa(e,{type:Ut.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:m,isMaxValue:h}=o.update(f);if(h){const v=vce(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Gn(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:ld(r,4),targetSelector:v&&Xm(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?T$(i.previousRect):void 0,currentRect:i?.currentRect?T$(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function vce(e){let t;for(const n of e)if(n.node&&os(n.node)){const r=N$(n);(!t||N$(t)<r)&&(t=n)}return t}function T$({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const yce=5*Mr,bce=Mr;function xce(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=bce||i.startTime-t>=yce;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 wce(){return Yc(Ut.LAYOUT_SHIFT)&&"WeakRef"in window}let oy,IF=0,F_=1/0,U_=0;function Sce(){"interactionCount"in performance||oy||(oy=new window.PerformanceObserver(St(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(F_=Math.min(F_,n.interactionId),U_=Math.max(U_,n.interactionId),IF=(U_-F_)/7+1)})})),oy.observe({type:"event",buffered:!0,durationThreshold:0}))}const O$=()=>oy?IF:window.performance.interactionCount||0,A$=10,_ce=1*Jr;function Cce(e,t,n){if(!jce())return{getInteractionToNextPaint:()=>{},setViewEnd:Jt,stop:Jt};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Ece(n);let o=1/0;const a=kce(r);let c=-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!==c&&(c=x.duration,f=Gn(t,x.startTime),d=_le(x.startTime),!d&&x.target&&os(x.target)&&(d=Xm(x.target,e.actionNameAttribute)))}const h=wa(e,{type:Ut.FIRST_INPUT,buffered:!0}).subscribe(m),v=wa(e,{type:Ut.EVENT,durationThreshold:40,buffered:!0}).subscribe(m);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,_ce),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function kce(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(A$)}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<A$||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Ece(e){Sce();const t=e===Ja.INITIAL_LOAD?0:O$();let n={stopped:!1};function r(){return O$()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function jce(){return Yc(Ut.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Rce(e,t,n,r,i,o,a){let c=i===Ja.INITIAL_LOAD,d=!0;const f=[],m=RF(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<m.timeStamp-o.relative&&a(y)}}const{stop:v}=CE(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Gn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),m.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function y2e(){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 Ice(){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 V_;function Nce(e){return V_||(V_=Tce(e)),V_}function Tce(e){return new $t(t=>{const{throttled:n}=Fb(()=>{t.notify(kE())},200);return Dn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function kE(){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 Oce=Mr;function Ace(e,t,n,r=$ce(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:m})=>{let h=!1;if(d>i&&(i=d,h=!0),m>o){o=m;const v=Bi();a=Gn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Dce(){const e=Ice(),{height:t}=kE(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function $ce(e,t=Oce){return new $t(n=>{function r(){n.notify(Dce())}if(window.ResizeObserver){const i=Fb(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(St(i.throttled));o&&a.observe(o);const c=Dn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Pce(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Rce(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:m}=Ace(r,a,S=>{c.scroll=S}),{stop:h}=gce(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:x}=Cce(r,a.relative,o);return{stop:()=>{d(),h(),m()},stopINPTracking:v,setLoadEvent:f,setViewEnd:x,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Mce(e,t){const{stop:n}=Dn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function zce(e,t,n){oce(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Lce=3e3,Fce=5*Jr,Uce=5*Jr;function Vce(e,t,n,r,i,o,a,c){const d=new Set;let f=v(Ja.INITIAL_LOAD,V4(),c),m;y();let h;a&&(h=x(o),i.trackBfcacheViews&&(m=Mce(i,S=>{f.end();const C=Lb(S.timeStamp);f=v(Ja.BF_CACHE,C,void 0)})));function v(S,C,k){const E=Bce(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(Ja.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(Ja.ROUTE_CHANGE))})}return{addTiming:(S,C=Cr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Ja.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 Bce(e,t,n,r,i,o,a=cr(),c){const d=$r(),f=new $t,m={};let h=0,v;const y=hm(i),x=Yb();let S=!0,C=c?.name;const k=c?.service||r.service,E=c?.version||r.version,j=c?.context;j&&x.setContext(j);const R={id:d,name:C,startClocks:a,service:k,version:E,context:j};e.notify(1,R),e.notify(2,R);const{throttled:T,cancel:N}=Fb(D,Lce,{leading:!1}),{setLoadEvent:O,setViewEnd:M,stop:L,stopINPTracking:K,getCommonViewMetrics:ee}=Pce(e,t,n,r,te,o,a),{stop:q,initialViewMetrics:Y}=o===Ja.INITIAL_LOAD?mce(r,a,O,te):{stop:Jt,initialViewMetrics:{}};o===Ja.BF_CACHE&&zce(a,Y,te);const{stop:U,eventCounts:H}=nce(e,d,te),z=cf(D,Fce),W=e.subscribe(11,$=>{$.reason===yd.UNLOADING&&D()});D(),x.changeObservable.subscribe(te);function F(){e.notify(3,{id:d,name:C,context:x.getContext(),startClocks:a,sessionIsActive:S})}function te(){F(),T()}function D(){N(),F(),h+=1;const $=v===void 0?Cr():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:Y,duration:Gn(a.timeStamp,$),isActive:v===void 0,sessionIsActive:S,eventCounts:H})}return{get name(){return C},service:k,version:E,contextManager:x,stopObservable:f,end($={}){var V,A;v||(v=(V=$.endClocks)!==null&&V!==void 0?V:cr(),S=(A=$.sessionIsActive)!==null&&A!==void 0?A:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),zb(z),M(v.relative),L(),W.unsubscribe(),D(),Ar(()=>{this.stop()},Uce))},stop(){q(),U(),K(),f.notify()},addTiming($,V){if(v)return;const A=are(V)?V:Gn(a.timeStamp,V);m[Hce($)]=A,te()},setViewName($){C=$,D()}}}function Hce(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&ht.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function qce(e,t){return e.pathname!==t.pathname||!Kce(t.hash)&&D$(t.hash)!==D$(e.hash)}function Kce(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function D$(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Gce(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,m=>e.notify(12,Zce(m,n,c))),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}}:vl}),t.register(1,({startTime:m})=>{var h;return{view:{id:(h=d.findView(m))===null||h===void 0?void 0:h.id}}}),Vce(r,e,i,o,n,a,!n.trackViewsManually,f)}function Zce(e,t,n){var r,i,o,a,c,d,f,m,h,v,y,x,S,C,k,E,j,R;const T=n.getReplayStats(e.id),N=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,O={_dd:{document_version:e.documentVersion,replay_stats:T,cls:N?{device_pixel_ratio:N}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:xt.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:bt((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:bt((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:bt((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:bt((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domContentLoaded),dom_interactive:bt((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:bt(e.initialViewMetrics.firstContentfulPaint),first_input_delay:bt((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:bt((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:bt((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:bt((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:bt((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:bt((R=e.initialViewMetrics.navigationTimings)===null||R===void 0?void 0:R.loadEvent),loading_time:iF(bt(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Yce(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:bt(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:bt(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:wae()}};return Il(e.customTimings)||(O.view.custom_timings=P4(e.customTimings,bt)),{rawRumEvent:O,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Yce({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:bt(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:bt(n)},fid:r&&{duration:bt(r.delay),timestamp:bt(r.time),target_selector:r.targetSelector},inp:t&&{duration:bt(t.value),timestamp:bt(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:bt(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const Wce="rum";function Xce(e,t,n){const r=$oe(e,Wce,i=>Qce(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 Jce(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:IL("records")?1:0};return{findTrackedSession:()=>e,expire:Jt,expireObservable:new $t,setForcedReplay:Jt}}function Qce(e,t){return eue(t)?t:mc(e.sessionSampleRate)?mc(e.sessionReplaySampleRate)?"1":"2":"0"}function eue(e){return e==="0"||e==="1"||e==="2"}function tue(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=NL({encoder:o(2),request:RL(a,n),flushController:TL({pageMayExitObservable:r,sessionExpireObservable:i})});return t.subscribe(13,d=>{d.type===xt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function nue(e){const t=Ym();e.subscribe(13,n=>{t.send("rum",n)})}const rue=Kc;function iue(e,t,n,r){const i=pf({expireDelay:rue});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({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=Bi();i.closeActive(m),i.add(c({url:d.href,referrer:f.referrer}),m)}});function c({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}}:vl}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function oue(e,t){let n=hm(t);return new $t(r=>{const{stop:i}=aue(e,a),{stop:o}=sue(e,a);function a(){if(n.href===t.href)return;const c=hm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function aue(e,t){const{stop:n}=ga($$("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=ga($$("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=Dn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function sue(e,t){return Dn(e,window,"hashchange",t)}function $$(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const lue=Kc;function cue(e,t,n){const r=pf({expireDelay:lue});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([xt.VIEW,xt.ERROR]).includes(o))return Hi;const c=r.find(i);return!c||Il(c)?Hi:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const uue=10*Mr;let bd,bv;function due(e,t,n){e.metricsEnabled&&(NF(),bv=!1,t.subscribe(13,()=>{bv=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{bv&&(bv=!1,bd.batchCount+=1,M$(bd.batchBytesCount,r),M$(bd.batchMessagesCount,i))}),cf(fue,uue))}function fue(){bd.batchCount!==0&&(Zb("Customer data measures",bd),NF())}function P$(){return{min:1/0,max:0,sum:0}}function M$(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function NF(){bd={batchCount:0,batchBytesCount:P$(),batchMessagesCount:P$()}}const pue=4e3,mue=500,hue=Kc;function gue(e,t,n=mue){const r=pf({expireDelay:hue,maxEntries:pue});let i;Yc(Ut.VISIBILITY_STATE)&&performance.getEntriesByType(Ut.VISIBILITY_STATE).forEach(f=>{const m=f.name==="hidden"?"hidden":"active";a(m,f.startTime)}),a(TF(),Bi());const{stop:o}=gl(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(yue(d),d.timeStamp)},{capture:!0});function a(d,f=Bi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(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===xt.VIEW){const h=r.findAll(d,f);return{type:m,_dd:{page_states:vue(h,d,n)}}}return m===xt.ACTION||m===xt.ERROR?{type:m,view:{in_foreground:c("active",d,0)}}:Hi}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function vue(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:bt(Gn(t,i))}))}function yue(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":TF()}function TF(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function bue(e,t){let n;const r=requestAnimationFrame(St(()=>{n=kE()})),i=Nce(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 xue(e,t){const n=window.cookieStore?wue(e):_ue;return new $t(r=>n(t,i=>r.notify(i)))}function wue(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 Sue=Mr;function _ue(e,t){const n=gm(document.cookie,e),r=cf(()=>{const i=gm(document.cookie,e);i!==n&&t(i)},Sue);return()=>{zb(r)}}const z$="datadog-ci-visibility-test-execution-id";function Cue(e,t,n=xue(e,z$)){var r;let i=el(z$)||((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"?Hi:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function kue(e,t){const n=wa(t,{type:Ut.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_ANIMATION_FRAME,duration:bt(i.duration),blocking_duration:bt(i.blockingDuration),first_ui_event_timestamp:bt(i.firstUIEventTimestamp),render_start:bt(i.renderStart),style_and_layout_start:bt(i.styleAndLayoutStart),start_time:bt(i.startTime),scripts:i.scripts.map(c=>({duration:bt(c.duration),pause_duration:bt(c.pauseDuration),forced_style_and_layout_duration:bt(c.forcedStyleAndLayoutDuration),start_time:bt(c.startTime),execution_start:bt(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Eue(e,t){const n=wa(t,{type:Ut.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Ut.LONG_TASK||!t.trackLongTasks)break;const o=Lb(i.startTime),a={date:o.timeStamp,long_task:{id:$r(),entry_type:BL.LONG_TASK,duration:bt(i.duration)},type:xt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function jue(e){e.register(0,({eventType:t})=>{if(!PL())return Hi;const n=DL(),r=$L();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:AL()}}})}function Rue(e,t,n){const r=vE(e),i=n(r);return pE(t).forEach(([o,a])=>_C(e,r,o.split(/\.|(?=\[\])/),a)),i}function _C(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>_C(a,t[c],o,r));return}if(!(!L$(e)||!L$(t))){if(o.length>0)return _C(e[i],t[i],o,r);Iue(e,i,t[i],r)}}function Iue(e,t,n,r){const i=Gc(n);i===r?e[t]=vn(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function L$(e){return Gc(e)==="object"}const Yu={"view.name":"string","view.url":"string","view.referrer":"string"},Wu={context:"object"},Xu={service:"string",version:"string"};let OF;function Nue(e,t,n,r,i){OF={[xt.VIEW]:{"view.performance.lcp.resource_url":"string",...Wu,...Yu,...Xu},[xt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Wu,...Yu,...Xu},[xt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...Wu,...Yu,...Xu},[xt.ACTION]:{"action.target.name":"string",...Wu,...Yu,...Xu},[xt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...Wu,...Yu,...Xu},[xt.VITAL]:{...Wu,...Yu,...Xu}};const o={[xt.ERROR]:T_(xt.ERROR,r,i),[xt.ACTION]:T_(xt.ACTION,r,i),[xt.VITAL]:T_(xt.VITAL,r,i)};t.subscribe(12,({startTime:a,duration:c,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:a,duration:c});if(m===vl)return;const h=is(m,d,{ddtags:yL(e).join(",")});Tue(h,e.beforeSend,f,o)&&(Il(h.context)&&delete h.context,t.notify(13,h))})}function Tue(e,t,n,r){var i;if(t){const a=Rue(e,OF[e.type],c=>t(c,n));if(a===!1&&e.type!==xt.VIEW)return!1;a===!1&&ht.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function Oue(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return vl;let d,f,m;return i===xt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,m=c.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}}:Hi})}function Aue(e){e.register(0,({eventType:t})=>({type:t,connectivity:xL()}))}function Due(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:ire(),configuration:{session_sample_rate:ld(t.sessionSampleRate,3),session_replay_sample_rate:ld(t.sessionReplaySampleRate,3),profiling_sample_rate:ld(t.profilingSampleRate,3),trace_sample_rate:ld(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:Pd()?"6.25.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Cr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function $ue(e,t){e.register(1,()=>t.isGranted()?Hi:vl)}const Pue=hoe,Mue=[xt.ACTION,xt.ERROR,xt.LONG_TASK,xt.RESOURCE,xt.VITAL];function zue(e){return{addEvent:(t,n,r,i)=>{Mue.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Lue(e,t){if(!t.metricsEnabled)return{stop:Jt};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(Zb("Initial view metrics",{metrics:Fue(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Fue(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Uue(e,t,n,r,i,o,a,c,d){const f=[],m=new mse,h=Pue();m.subscribe(13,R=>bL("rum",R));const v=R=>{m.notify(14,{error:R}),Wm("Error reported to customer",{"error.message":R.message})},y=doe(e),x=y.subscribe(R=>{m.notify(11,R)});f.push(()=>x.unsubscribe());const S=xoe("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=Pd()?Jce():Xce(e,m,o);if(Pd())nue(m);else{const R=tue(e,m,v,y,C.expireObservable,i);f.push(()=>R.stop()),due(S,m,R.flushController.flushObservable)}$ue(h,o);const{stop:k}=Lue(m,S);f.push(k);const{stop:E,...j}=Vue(m,h,e,C,t,r,a,c,d,v);return f.push(E),c.unbuffer(),f.push(()=>n.stop()),{...j,lifeCycle:m,session:C,stopSession:()=>C.expire(),telemetry:S,stop:()=>{f.forEach(R=>R())},hooks:h}}function Vue(e,t,n,r,i,o,a,c,d,f){const m=[],h=use(),v=oue(n,location),{observable:y,stop:x}=fse();m.push(x),Due(t,n,d);const S=gue(t,n);m.push(()=>S.stop());const C=gse(e);m.push(()=>C.stop());const k=iue(e,t,v,location);m.push(()=>k.stop());const E=cue(e,t,n);Oue(t,r,i,C),Aue(t);const j=vae(t,n,"rum"),R=yae(t,n,r,"rum"),T=gae(t,n,"rum"),N=Nle(e,t,h,y,n);m.push(N.stop);const O=zue(e),M=bue(t,n);m.push(M.stop);const L=Cue(n,t);m.push(L.stop),jue(t),Nue(n,e,t,f);const{addTiming:K,startView:ee,setViewName:q,setViewContext:Y,setViewContextProperty:U,getViewContext:H,stop:z}=Gce(e,t,n,location,h,y,v,i,C,o);m.push(z);const{stop:W}=Gle(e,n,S);if(m.push(W),n.trackLongTasks)if(Yc(Ut.LONG_ANIMATION_FRAME)){const{stop:$}=kue(e,n);m.push($)}else Eue(e,n);const{addError:F}=Ale(e,n,c);Ase(e,n,r,R,T);const te=_ae(e,S,a),D=pse(n.applicationId,r,C,N.actionContexts,k);return{addAction:N.addAction,addEvent:O.addEvent,addError:F,addTiming:K,addFeatureFlagEvaluation:E.addFeatureFlagEvaluation,startView:ee,setViewContext:Y,setViewContextProperty:U,getViewContext:H,setViewName:q,viewHistory:C,getInternalContext:D.get,startDurationVital:te.startDurationVital,stopDurationVital:te.stopDurationVital,addDurationVital:te.addDurationVital,addOperationStepVital:te.addOperationStepVital,globalContext:j,userContext:R,accountContext:T,stop:()=>m.forEach($=>$())}}function Bue(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=Hue(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function Hue(e){const t=e.site,n=e.subdomain||que(e);return`https://${n?`${n}.`:""}${t}`}function que(e){switch(e.site){case hc:case Yre:return"app";case oL:return"dd";default:return}}const Kue=1e3;let go;function b2e(e){return ex(e).segments_count}function x2e(e){ex(e).segments_count+=1}function w2e(e){ex(e).records_count+=1}function S2e(e,t){ex(e).segments_total_raw_size+=t}function Gue(e){return go?.get(e)}function ex(e){go||(go=new Map);let t;return go.has(e)?t=go.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},go.set(e,t),go.size>Kue&&Zue()),t}function Zue(){if(!go)return;const e=go.keys().next().value;e&&go.delete(e)}function AF(e,t,n){let r=0,i=[],o,a=!0,c=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):fL(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:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=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 EE({configuredUrl:e,error:t,source:n,scriptType:r}){if(ht.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&Yue(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.",ht.error(`${i} See documentation at ${Pb}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&yE(t)}function Yue(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Wue=30*Mr;function DF(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.0"};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 Kn={status:0};function $F(e,t,n,r=DF){switch(Kn.status===0&&Xue(e,t,r),Kn.status){case 1:return Kn.initializationFailureCallbacks.push(n),Kn.worker;case 3:return Kn.worker}}function F$(){return Kn.status}function Xue(e,t,n=DF){try{const r=n(e),{stop:i}=Dn(e,r,"error",c=>{B_(e,t,c)}),{stop:o}=Dn(e,r,"message",({data:c})=>{c.type==="errored"?B_(e,t,c.error,c.streamId):c.type==="initialized"&&Que(c.version)});r.postMessage({action:"init"}),Ar(()=>Jue(t),Wue),Kn={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){B_(e,t,r)}}function Jue(e){Kn.status===1&&(ht.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Kn.initializationFailureCallbacks.forEach(t=>t()),Kn={status:2})}function Que(e){Kn.status===1&&(Kn={status:3,worker:Kn.worker,stop:Kn.stop,version:e})}function B_(e,t,n,r){Kn.status===1||Kn.status===0?(EE({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),Kn.status===1&&Kn.initializationFailureCallbacks.forEach(i=>i()),Kn={status:2}):yE(n,{worker_version:Kn.status===3&&Kn.version,stream_id:r})}function PF(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function ede(e,t,n,r){const i=t.findTrackedSession(),o=tde(i,r),a=n.findView();return Bue(e,{viewContext:a,errorType:o,session:i})}function tde(e,t){if(!PF())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 nde(e,t){if(!e.metricsEnabled)return{stop:Jt};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:Cr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Gn(n.timestamp,Cr()));break;case"recorder-settled":n&&(i=Gn(n.timestamp,Cr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&Zb("Recorder init metrics",{metrics:rde(n.forced,i,Gn(n.timestamp,Cr()),a.type,r)});break}});return{stop:o}}function rde(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function ide(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new $t;nde(a,f);const m=async y=>{f.notify({type:"start",forced:y});const[x]=await Promise.all([U$(f,{type:"recorder-settled"},i()),U$(f,{type:"document-ready"},Hoe(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!x){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=x(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const x=n.findTrackedSession();if(ode(x,y)){c=1;return}if(ade(c))return;c=2;const S=sde(x,y)||!1;m(S).catch(ml),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return ede(e,n,r,c!==0)},isRecording:()=>c===3}}function ode(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function ade(e){return e===2||e===3}function sde(e,t){return t&&t.force&&e.sessionReplay===0}async function U$(e,t,n){try{return await n}finally{e.notify(t)}}function lde(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Jt},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function cde(e,t){if(Pd()&&!IL("records")||!PF())return{start:Jt,stop:Jt,getReplayStats:()=>{},onRumStart:Jt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=lde();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>F$()===3&&n.isRecording(),getReplayStats:o=>F$()===3?Gue(o):void 0};function i(o,a,c,d,f,m){let h;function v(){return h||(f??(f=$F(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=AF(a,f,1))),h}n=ide(a,o,c,d,e,v,m),r(a)&&n.start()}}const ude="modulepreload",dde=function(e){return"/"+e},V$={},Jm=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]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=dde(f),f in V$)return;V$[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":ude,m||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),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 c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function fde(e=pde){try{return await e()}catch(t){EE({error:t,source:"Recorder",scriptType:"module"})}}async function pde(){return(await Jm(()=>import("./startRecording-IOmSWGHg.js"),[])).startRecording}function mde(){return Ro().Profiler!==void 0}const hde=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==xt.VIEW&&n!==xt.LONG_TASK?Hi:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function gde(e=vde){try{return await e()}catch(t){EE({error:t,source:"Profiler",scriptType:"module"})}}async function vde(){return(await Jm(()=>import("./profiler-Cnhc6FqT.js"),[])).createRumProfiler}function yde(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!GL(d.id,i.profilingSampleRate))return;const f=hde(r);if(!mde()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}gde().then(m=>{if(!m){Wm("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(i,n,o,f,c),e.start(a.findView())}).catch(ml)}return{onRumStart:t,stop:()=>{e?.stop().catch(ml)}}}const bde=cde(fde),xde=yde(),wde=lse(Uue,bde,xde,{startDeflateWorker:$F,createDeflateEncoder:AF,sdkName:"rum"});Uie(Ro(),"DD_RUM",wde);function ay(e,t){ym("react error"),cr()}const B$={didCatch:!1,error:null};class _2e extends Q.Component{constructor(t){super(t),this.resetError=()=>{this.setState(B$)},this.state=B$}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){ay()}render(){return this.state.didCatch?Q.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let H$=!1;function Sde(){b.useEffect(()=>{H$||(H$=!0)},[])}function _de(){return u.jsx(u.Fragment,{children:u.jsx(kl,{})})}const tx=oQ()({component:_de});function Cde(){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 jE(){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 kde(e,t){const n=b.createContext(t),r=o=>{const{children:a,...c}=o,d=b.useMemo(()=>c,Object.values(c));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 Xi(e,t=[]){let n=[];function r(o,a){const c=b.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...x}=h,S=v?.[e]?.[d]||c,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]||c,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(c){const d=c?.[e]||o;return b.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Ede(i,...t)]}function Ede(...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((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...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 Md(e){const t=jde(e),n=b.forwardRef((r,i)=>{const{children:o,...a}=r,c=b.Children.toArray(o),d=c.find(Ide);if(d){const f=d.props.children,m=c.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 jde(e){const t=b.forwardRef((n,r)=>{const{children:i,...o}=n;if(b.isValidElement(i)){const a=Tde(i),c=Nde(o,i.props);return i.type!==b.Fragment&&(c.ref=r?lf(r,a):a),b.cloneElement(i,c)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var MF=Symbol("radix.slottable");function Rde(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=MF,t}function Ide(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===MF}function Nde(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]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Tde(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 Ode=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=Ode.reduce((e,t)=>{const n=Md(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ty(e,t){e&&of.flushSync(()=>e.dispatchEvent(t))}var nr=globalThis?.document?b.useLayoutEffect:()=>{},Ade=Gk[" useInsertionEffect ".trim().toString()]||nr;function qo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Dde({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const m=b.useRef(e!==void 0);b.useEffect(()=>{const h=m.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"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=c},[c,r])}const f=b.useCallback(m=>{if(c){const h=$de(m)?m(e):m;h!==e&&a.current?.(h)}else o(m)},[c,e,o,a]);return[d,f]}function Dde({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),o=b.useRef(t);return Ade(()=>{o.current=t},[t]),b.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function $de(e){return typeof e=="function"}var Pde=b.createContext(void 0);function Wc(e){const t=b.useContext(Pde);return e||t||"ltr"}function Mde(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=zde(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=ft(r.ref,Lde(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};ir.displayName="Presence";function zde(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Mde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=xv(r.current);o.current=c==="mounted"?f:"none"},[c]),nr(()=>{const f=r.current,m=i.current;if(m!==e){const v=o.current,y=xv(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),nr(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=y=>{const S=xv(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=xv(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(c),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function xv(e){return e?.animationName||"none"}function Lde(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 Fde=Gk[" useId ".trim().toString()]||(()=>{}),Ude=0;function Fi(e){const[t,n]=b.useState(Fde());return nr(()=>{n(r=>r??String(Ude++))},[e]),t?`radix-${t}`:""}function Qm(e){const t=e+"CollectionProvider",[n,r]=Xi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:k}=S,E=Q.useRef(null),j=Q.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:E,children:k})};a.displayName=t;const c=e+"CollectionSlot",d=Md(c),f=Q.forwardRef((S,C)=>{const{scope:k,children:E}=S,j=o(c,k),R=ft(C,j.collectionRef);return u.jsx(d,{ref:R,children:E})});f.displayName=c;const m=e+"CollectionItemSlot",h="data-radix-collection-item",v=Md(m),y=Q.forwardRef((S,C)=>{const{scope:k,children:E,...j}=S,R=Q.useRef(null),T=ft(C,R),N=o(m,k);return Q.useEffect(()=>(N.itemMap.set(R,{ref:R,...j}),()=>{N.itemMap.delete(R)})),u.jsx(v,{[h]:"",ref:T,children:E})});y.displayName=m;function x(S){const C=o(e+"CollectionConsumer",S);return Q.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((N,O)=>j.indexOf(N.ref.current)-j.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}function In(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Vde(e,t=globalThis?.document){const n=In(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 Bde="DismissableLayer",CC="dismissableLayer.update",Hde="dismissableLayer.pointerDownOutside",qde="dismissableLayer.focusOutside",q$,zF=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mf=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=b.useContext(zF),[m,h]=b.useState(null),v=m?.ownerDocument??globalThis?.document,[,y]=b.useState({}),x=ft(t,O=>h(O)),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,R=E>=k,T=Zde(O=>{const M=O.target,L=[...f.branches].some(K=>K.contains(M));!R||L||(i?.(O),a?.(O),O.defaultPrevented||c?.())},v),N=Yde(O=>{const M=O.target;[...f.branches].some(K=>K.contains(M))||(o?.(O),a?.(O),O.defaultPrevented||c?.())},v);return Vde(O=>{E===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},v),b.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(q$=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),K$(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=q$)}},[m,v,n,f]),b.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),K$())},[m,f]),b.useEffect(()=>{const O=()=>y({});return document.addEventListener(CC,O),()=>document.removeEventListener(CC,O)},[]),u.jsx(Ye.div,{...d,ref:x,style:{pointerEvents:j?R?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,T.onPointerDownCapture)})});mf.displayName=Bde;var Kde="DismissableLayerBranch",Gde=b.forwardRef((e,t)=>{const n=b.useContext(zF),r=b.useRef(null),i=ft(t,r);return b.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ye.div,{...e,ref:i})});Gde.displayName=Kde;function Zde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){LF(Hde,n,f,{discrete:!0})};const f={originalEvent:c};c.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 Yde(e,t=globalThis?.document){const n=In(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&LF(qde,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 K$(){const e=new CustomEvent(CC);document.dispatchEvent(e)}function LF(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?Ty(i,o):i.dispatchEvent(o)}function RE(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 FF=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"}),Wde="VisuallyHidden",UF=b.forwardRef((e,t)=>u.jsx(Ye.span,{...e,ref:t,style:{...FF,...e.style}}));UF.displayName=Wde;var VF=UF,Xc="NavigationMenu",[IE,BF,Xde]=Qm(Xc),[kC,Jde,Qde]=Qm(Xc),[NE]=Xi(Xc,[Xde,Qde]),[efe,Io]=NE(Xc),[tfe,nfe]=NE(Xc),HF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...m}=e,[h,v]=b.useState(null),y=ft(t,L=>v(L)),x=Wc(f),S=b.useRef(0),C=b.useRef(0),k=b.useRef(0),[E,j]=b.useState(!0),[R,T]=qo({prop:r,onChange:L=>{const K=L!=="",ee=c>0;K?(window.clearTimeout(k.current),ee&&j(!1)):(window.clearTimeout(k.current),k.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:Xc}),N=b.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>T(""),150)},[T]),O=b.useCallback(L=>{window.clearTimeout(C.current),T(L)},[T]),M=b.useCallback(L=>{R===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),T(L)},a)},[R,T,a]);return b.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(k.current)},[]),u.jsx(qF,{scope:n,isRootMenu:!0,value:R,dir:x,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),E?M(L):O(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),N()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:N,onItemSelect:L=>{T(K=>K===L?"":L)},onItemDismiss:()=>T(""),children:u.jsx(Ye.nav,{"aria-label":"Main","data-orientation":d,dir:x,...m,ref:y})})});HF.displayName=Xc;var EC="NavigationMenuSub",rfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=Io(EC,n),[f,m]=qo({prop:r,onChange:i,defaultProp:o??"",caller:EC});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(Ye.div,{"data-orientation":a,...c,ref:t})})});rfe.displayName=EC;var qF=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,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(efe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:RE(c),baseId:Fi(),dir:i,orientation:o,viewport:x,onViewportChange:S,indicatorTrack:E,onIndicatorTrackChange:j,onTriggerEnter:In(m),onTriggerLeave:In(h),onContentEnter:In(v),onContentLeave:In(y),onItemSelect:In(d),onItemDismiss:In(f),onViewportContentChange:b.useCallback((R,T)=>{k(N=>(N.set(R,T),new Map(N)))},[]),onViewportContentRemove:b.useCallback(R=>{k(T=>T.has(R)?(T.delete(R),new Map(T)):T)},[]),children:u.jsx(IE.Provider,{scope:t,children:u.jsx(tfe,{scope:t,items:C,children:a})})})},KF="NavigationMenuList",GF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(KF,n),o=u.jsx(Ye.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ye.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(IE.Slot,{scope:n,children:i.isRootMenu?u.jsx(eU,{asChild:!0,children:o}):o})})});GF.displayName=KF;var ZF="NavigationMenuItem",[ife,YF]=NE(ZF),WF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Fi(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=b.useRef(null),d=b.useRef(null),f=b.useRef(null),m=b.useRef(()=>{}),h=b.useRef(!1),v=b.useCallback((x="start")=>{if(c.current){m.current();const S=RC(c.current);S.length&&AE(x==="start"?S:S.reverse())}},[]),y=b.useCallback(()=>{if(c.current){const x=RC(c.current);x.length&&(m.current=mfe(x))}},[]);return u.jsx(ife,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ye.li,{...i,ref:t})})});WF.displayName=ZF;var jC="NavigationMenuTrigger",ofe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=Io(jC,e.__scopeNavigationMenu),a=YF(jC,e.__scopeNavigationMenu),c=b.useRef(null),d=ft(c,a.triggerRef,t),f=nU(o.baseId,a.value),m=rU(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(IE.ItemSlot,{scope:n,value:a.value,children:u.jsx(tU,{asChild:!0,children:u.jsx(Ye.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":DE(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,Oy(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:Re(e.onPointerLeave,Oy(()=>{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(VF,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const S=a.contentRef.current,C=x.relatedTarget,k=C===c.current,E=S?.contains(C);(k||!E)&&a.onFocusProxyEnter(k?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":m})]})]})});ofe.displayName=jC;var afe="NavigationMenuLink",G$="navigationMenu.linkSelect",XF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(tU,{asChild:!0,children:u.jsx(Ye.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:Re(e.onClick,a=>{const c=a.target,d=new CustomEvent(G$,{bubbles:!0,cancelable:!0});if(c.addEventListener(G$,f=>i?.(f),{once:!0}),Ty(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(sy,{bubbles:!0,cancelable:!0});Ty(c,f)}},{checkForDefaultPrevented:!1})})})});XF.displayName=afe;var TE="NavigationMenuIndicator",sfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(TE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?tE.createPortal(u.jsx(ir,{present:n||o,children:u.jsx(lfe,{...r,ref:t})}),i.indicatorTrack):null});sfe.displayName=TE;var lfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(TE,n),o=BF(n),[a,c]=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&&c(x)},[o,i.value]);const v=()=>{a&&f({size:m?a.offsetWidth:a.offsetHeight,offset:m?a.offsetLeft:a.offsetTop})};return IC(a,v),IC(i.indicatorTrack,v),d?u.jsx(Ye.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}),zd="NavigationMenuContent",cfe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Io(zd,e.__scopeNavigationMenu),o=YF(zd,e.__scopeNavigationMenu),a=ft(o.contentRef,t),c=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(ufe,{forceMount:n,...d,ref:a}):u.jsx(ir,{present:n||c,children:u.jsx(JF,{"data-state":DE(c),...d,ref:a,onPointerEnter:Re(e.onPointerEnter,i.onContentEnter),onPointerLeave:Re(e.onPointerLeave,Oy(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});cfe.displayName=zd;var ufe=b.forwardRef((e,t)=>{const n=Io(zd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return nr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),nr(()=>()=>i(e.value),[e.value,i]),null}),sy="navigationMenu.rootContentDismiss",JF=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,m=Io(zd,n),h=b.useRef(null),v=ft(h,t),y=nU(m.baseId,r),x=rU(m.baseId,r),S=BF(n),C=b.useRef(null),{onItemDismiss:k}=m;b.useEffect(()=>{const j=h.current;if(m.isRootMenu&&j){const R=()=>{k(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(sy,R),()=>j.removeEventListener(sy,R)}},[m.isRootMenu,e.value,i,k,c]);const E=b.useMemo(()=>{const R=S().map(K=>K.value);m.dir==="rtl"&&R.reverse();const T=R.indexOf(m.value),N=R.indexOf(m.previousValue),O=r===m.value,M=N===R.indexOf(r);if(!O&&!M)return C.current;const L=(()=>{if(T!==N){if(O&&N!==-1)return T>N?"from-end":"from-start";if(M&&T!==-1)return T>N?"to-start":"to-end"}return null})();return C.current=L,L},[m.previousValue,m.value,m.dir,S,r]);return u.jsx(eU,{asChild:!0,children:u.jsx(mf,{id:x,"aria-labelledby":y,"data-motion":E,"data-orientation":m.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(sy,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:Re(e.onFocusOutside,j=>{d();const R=j.target;m.rootNavigationMenu?.contains(R)&&j.preventDefault()}),onPointerDownOutside:Re(e.onPointerDownOutside,j=>{const R=j.target,T=S().some(O=>O.ref.current?.contains(R)),N=m.isRootMenu&&m.viewport?.contains(R);(T||N||!m.isRootMenu)&&j.preventDefault()}),onKeyDown:Re(e.onKeyDown,j=>{const R=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!R){const N=RC(j.currentTarget),O=document.activeElement,M=N.findIndex(ee=>ee===O),K=j.shiftKey?N.slice(0,M).reverse():N.slice(M+1,N.length);AE(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:Re(e.onEscapeKeyDown,j=>{a.current=!0})})})}),OE="NavigationMenuViewport",QF=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!Io(OE,e.__scopeNavigationMenu).value;return u.jsx(ir,{present:n||o,children:u.jsx(dfe,{...r,ref:t})})});QF.displayName=OE;var dfe=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=Io(OE,n),a=ft(t,o.onViewportChange),c=nfe(zd,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 IC(m,()=>{m&&f({width:m.offsetWidth,height:m.offsetHeight})}),u.jsx(Ye.div,{"data-state":DE(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,Oy(o.onContentLeave)),children:Array.from(c.items).map(([k,{ref:E,forceMount:j,...R}])=>{const T=S===k;return u.jsx(ir,{present:j||T,children:u.jsx(JF,{...R,ref:lf(E,N=>{T&&N&&h(N)})})},k)})})}),ffe="FocusGroup",eU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Io(ffe,n);return u.jsx(kC.Provider,{scope:n,children:u.jsx(kC.Slot,{scope:n,children:u.jsx(Ye.div,{dir:i.dir,...r,ref:t})})})}),Z$=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],pfe="FocusGroupItem",tU=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Jde(n),o=Io(pfe,n);return u.jsx(kC.ItemSlot,{scope:n,children:u.jsx(Ye.button,{...r,ref:t,onKeyDown:Re(e.onKeyDown,a=>{if(["Home","End",...Z$].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),Z$.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>AE(d)),a.preventDefault()}})})})});function RC(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 AE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function mfe(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 IC(e,t){const n=In(t);nr(()=>{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 DE(e){return e?"open":"closed"}function nU(e,t){return`${e}-trigger-${t}`}function rU(e,t){return`${e}-content-${t}`}function Oy(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hfe=HF,gfe=GF,vfe=WF,yfe=XF,bfe=QF;function xfe({className:e,...t}){return u.jsx("div",{className:Ue("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(bfe,{"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 iU({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(hfe,{"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(xfe,{})]})}function NC({className:e,...t}){return u.jsx(vfe,{"data-slot":"navigation-menu-item",className:Ue("relative",e),...t})}function TC({className:e,...t}){return u.jsx(yfe,{"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 oU({className:e,...t}){return u.jsx(gfe,{"data-slot":"navigation-menu-list",className:Ue("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const aU=Ab("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 $E(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:Ue(aU({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.14"," BETA"]})})}function eh(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return Qa({id:An,operationsUrl:e,port:t,secure:n})}function nx(e,t,n){const{instanceId:r,clusterId:i}=it({strict:!1});return{instanceClient:Qa({id:An,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Zt(e,t,n){const r=it({strict:!1});return b.useMemo(()=>sU({...r,operationsUrl:e,port:t,secure:n}),[r,e,t,n])}function sU({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=An;return{instanceClient:Qa({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function wfe(){localStorage.clear()}function Sfe(){sessionStorage.clear()}async function _fe(){Et.setUserForEntity(An,null),jy.getQueryCache().clear(),wfe(),Sfe(),await jy.invalidateQueries({refetchType:"none"})}async function Cfe(e){await Et.signOutFromPotentiallyAuthenticatedInstances(),await Bm({...e,entityId:An})}function kfe(){const e=eh();return ct({mutationFn:()=>Cfe({instanceClient:e}),onSuccess:_fe})}function rx(e){const{user:t}=El(),{organizationId:n}=it({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 hf(e){const{user:t}=El(),{organizationId:n}=it({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 ix(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return lU(n,e??r,t??i)}function lU(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 Efe(e,t){const{user:n}=El(),{organizationId:r,clusterId:i}=it({strict:!1});return cU(n,r,i)}function cU(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 PE(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0:!1}function gf(e){const{clusterId:t,instanceId:n}=it({strict:!1}),{user:r}=fs(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function H_(e,t,n,r){const{clusterId:i,instanceId:o}=it({strict:!1}),{user:a}=fs(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const ME={className:"text-white"};function uU(){const{mutate:e}=kfe(),t=En(),{user:n}=Bc(),r=xn(),{organizationId:i}=it({strict:!1}),{update:o}=rx(i),{view:a}=hf(i),c=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(()=>[!hd,!hd,!hd,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(y4,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(Lee,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(Cde,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(Lte,{}),text:"Sign Out",textBreakpoint:"md"}].filter(Xo),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Ife,{menuItems:f}),u.jsx(Rfe,{menuItems:f})]}):u.jsx(jfe,{})}function dU(e){return e.items!==void 0}function jfe(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(Ze,{to:"/sign-in",children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsxs(oU,{className:"text-grey-400",children:[u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(y4,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(NC,{children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:"/sign-in",className:"flex-row items-center",activeProps:ME,children:[u.jsx(Mte,{})," Sign In"]})})})]})})]})}function Rfe({menuItems:e}){const{user:t}=Bc();return qc(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(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{})]}),u.jsx(iU,{children:u.jsx(oU,{className:"text-grey-400",children:e.map(n=>dU(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(Y$,{menuItem:r},r.text))},n.text):u.jsx(Y$,{menuItem:n},n.text))})})]})})}function Y$({menuItem:e}){return u.jsx(NC,{className:"text-gray-400 hover:text-white",children:u.jsx(TC,{asChild:!0,children:u.jsxs(Ze,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?ME: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 Ife({menuItems:e}){const{user:t}=Bc();qc(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(Ze,{to:ya,children:u.jsx(jE,{})}),u.jsx($E,{}),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(D4,{}):u.jsx(I4,{})]})]}),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=>dU(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(W$,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(W$,{menuItem:a,onClick:o},a.text))})]})}function W$({menuItem:e,onClick:t}){const n=b.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(Ze,{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?ME:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function Ap({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 Nfe(){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(uU,{})}),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(Ap,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(Ap,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(Ap,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(Ap,{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(Ap,{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(kl,{})})]})]})}function Tfe(){b.useEffect(()=>{},[])}const Ofe=["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 zE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of Ofe)if(t===n||t.endsWith("."+n))return null;return t}let q_=null;function Afe(){const e=En(),t=xn(),n=rr(),{redirect:r}=Er({strict:!1});return b.useEffect(()=>{q_||(q_=(async function(){const i=await Az().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{Et.setUserForEntity(An,i);const o=qc(i);zE(i.email),await n.invalidateQueries({queryKey:Rb,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}q_=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(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Dfe=["top","right","bottom","left"],yl=Math.min,Mi=Math.max,Ay=Math.round,wv=Math.floor,va=e=>({x:e,y:e}),$fe={left:"right",right:"left",bottom:"top",top:"bottom"},Pfe={start:"end",end:"start"};function OC(e,t,n){return Mi(e,yl(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function ss(e){return e.split("-")[0]}function vf(e){return e.split("-")[1]}function LE(e){return e==="x"?"y":"x"}function FE(e){return e==="y"?"height":"width"}const Mfe=new Set(["top","bottom"]);function da(e){return Mfe.has(ss(e))?"y":"x"}function UE(e){return LE(da(e))}function zfe(e,t,n){n===void 0&&(n=!1);const r=vf(e),i=UE(e),o=FE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Dy(a)),[a,Dy(a)]}function Lfe(e){const t=Dy(e);return[AC(e),t,AC(t)]}function AC(e){return e.replace(/start|end/g,t=>Pfe[t])}const X$=["left","right"],J$=["right","left"],Ffe=["top","bottom"],Ufe=["bottom","top"];function Vfe(e,t,n){switch(e){case"top":case"bottom":return n?t?J$:X$:t?X$:J$;case"left":case"right":return t?Ffe:Ufe;default:return[]}}function Bfe(e,t,n,r){const i=vf(e);let o=Vfe(ss(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(AC)))),o}function Dy(e){return e.replace(/left|right|bottom|top/g,t=>$fe[t])}function Hfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function fU(e){return typeof e!="number"?Hfe(e):{top:e,right:e,bottom:e,left:e}}function $y(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 Q$(e,t,n){let{reference:r,floating:i}=e;const o=da(t),a=UE(t),c=FE(a),d=ss(t),f=o==="y",m=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/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(vf(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const qfe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=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}=Q$(f,r,d),v=r,y={},x=0;for(let S=0;S<c.length;S++){const{name:C,fn:k}=c[S],{x:E,y:j,data:R,reset:T}=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],...R}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(f=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:m,y:h}=Q$(f,v,d)),S=-1)}return{x:m,y:h,placement:v,strategy:i,middlewareData:y}};async function wm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=as(t,e),x=fU(y),C=c[v?h==="floating"?"reference":"floating":h],k=$y(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(c.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(c.floating)),R=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},T=$y(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:j,strategy:d}):E);return{top:(k.top-T.top+x.top)/R.y,bottom:(T.bottom-k.bottom+x.bottom)/R.y,left:(k.left-T.left+x.left)/R.x,right:(T.right-k.right+x.right)/R.x}}const Kfe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:m=0}=as(e,t)||{};if(f==null)return{};const h=fU(m),v={x:n,y:r},y=UE(i),x=FE(y),S=await a.getDimensions(f),C=y==="y",k=C?"top":"left",E=C?"bottom":"right",j=C?"clientHeight":"clientWidth",R=o.reference[x]+o.reference[y]-v[y]-o.floating[x],T=v[y]-o.reference[y],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let O=N?N[j]:0;(!O||!await(a.isElement==null?void 0:a.isElement(N)))&&(O=c.floating[j]||o.floating[x]);const M=R/2-T/2,L=O/2-S[x]/2-1,K=yl(h[k],L),ee=yl(h[E],L),q=K,Y=O-S[x]-ee,U=O/2-S[x]/2+M,H=OC(q,U,Y),z=!d.arrow&&vf(i)!=null&&U!==H&&o.reference[x]/2-(U<q?K:ee)-S[x]/2<0,W=z?U<q?U-q:U-Y:0;return{[y]:v[y]+W,data:{[y]:H,centerOffset:U-H-W,...z&&{alignmentOffset:W}},reset:z}}}),Gfe=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:c,platform:d,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...C}=as(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=ss(i),E=da(c),j=ss(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),T=v||(j||!S?[Dy(c)]:Lfe(c)),N=x!=="none";!v&&N&&T.push(...Bfe(c,S,x,R));const O=[c,...T],M=await wm(t,C),L=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&L.push(M[k]),h){const U=zfe(i,a,R);L.push(M[U[0]],M[U[1]])}if(K=[...K,{placement:i,overflows:L}],!L.every(U=>U<=0)){var ee,q;const U=(((ee=o.flip)==null?void 0:ee.index)||0)+1,H=O[U];if(H&&(!(h==="alignment"?E!==da(H):!1)||K.every(F=>da(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:U,overflows:K},reset:{placement:H}};let z=(q=K.filter(W=>W.overflows[0]<=0).sort((W,F)=>W.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!z)switch(y){case"bestFit":{var Y;const W=(Y=K.filter(F=>{if(N){const te=da(F.placement);return te===E||te==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((F,te)=>F[1]-te[1])[0])==null?void 0:Y[0];W&&(z=W);break}case"initialPlacement":z=c;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function e2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function t2(e){return Dfe.some(t=>e[t]>=0)}const Zfe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=as(e,t);switch(r){case"referenceHidden":{const o=await wm(t,{...i,elementContext:"reference"}),a=e2(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:t2(a)}}}case"escaped":{const o=await wm(t,{...i,altBoundary:!0}),a=e2(o,n.floating);return{data:{escapedOffsets:a,escaped:t2(a)}}}default:return{}}}}},pU=new Set(["left","top"]);async function Yfe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ss(n),c=vf(n),d=da(n)==="y",f=pU.has(a)?-1:1,m=o&&d?-1:1,h=as(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 c&&typeof x=="number"&&(y=c==="end"?x*-1:x),d?{x:y*m,y:v*f}:{x:v*f,y:y*m}}const Wfe=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:c}=t,d=await Yfe(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},Xfe=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:c={fn:C=>{let{x:k,y:E}=C;return{x:k,y:E}}},...d}=as(e,t),f={x:n,y:r},m=await wm(t,d),h=da(ss(i)),v=LE(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=OC(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=OC(E,x,j)}const S=c.fn({...t,[v]:y,[h]:x});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},Jfe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=as(e,t),m={x:n,y:r},h=da(i),v=LE(h);let y=m[v],x=m[h];const S=as(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",R=o.reference[v]-o.floating[j]+C.mainAxis,T=o.reference[v]+o.reference[j]-C.mainAxis;y<R?y=R:y>T&&(y=T)}if(f){var k,E;const j=v==="y"?"width":"height",R=pU.has(ss(i)),T=o.reference[h]-o.floating[j]+(R&&((k=a.offset)==null?void 0:k[h])||0)+(R?0:C.crossAxis),N=o.reference[h]+o.reference[j]+(R?0:((E=a.offset)==null?void 0:E[h])||0)-(R?C.crossAxis:0);x<T?x=T:x>N&&(x=N)}return{[v]:y,[h]:x}}}},Qfe=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:c}=t,{apply:d=()=>{},...f}=as(e,t),m=await wm(t,f),h=ss(i),v=vf(i),y=da(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(c.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,R=yl(S-m[C],E),T=yl(x-m[k],j),N=!t.middlewareData.shift;let O=R,M=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),N&&!v){const K=Mi(m.left,0),ee=Mi(m.right,0),q=Mi(m.top,0),Y=Mi(m.bottom,0);y?M=x-2*(K!==0||ee!==0?K+ee:Mi(m.left,m.right)):O=S-2*(q!==0||Y!==0?q+Y:Mi(m.top,m.bottom))}await d({...t,availableWidth:M,availableHeight:O});const L=await a.getDimensions(c.floating);return x!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function ox(){return typeof window<"u"}function yf(e){return mU(e)?(e.nodeName||"").toLowerCase():"#document"}function Ui(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ka(e){var t;return(t=(mU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mU(e){return ox()?e instanceof Node||e instanceof Ui(e).Node:!1}function Ko(e){return ox()?e instanceof Element||e instanceof Ui(e).Element:!1}function Sa(e){return ox()?e instanceof HTMLElement||e instanceof Ui(e).HTMLElement:!1}function n2(e){return!ox()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ui(e).ShadowRoot}const epe=new Set(["inline","contents"]);function th(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!epe.has(i)}const tpe=new Set(["table","td","th"]);function npe(e){return tpe.has(yf(e))}const rpe=[":popover-open",":modal"];function ax(e){return rpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const ipe=["transform","translate","scale","rotate","perspective"],ope=["transform","translate","scale","rotate","perspective","filter"],ape=["paint","layout","strict","content"];function VE(e){const t=BE(),n=Ko(e)?Go(e):e;return ipe.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)||ope.some(r=>(n.willChange||"").includes(r))||ape.some(r=>(n.contain||"").includes(r))}function spe(e){let t=bl(e);for(;Sa(t)&&!Ld(t);){if(VE(t))return t;if(ax(t))return null;t=bl(t)}return null}function BE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lpe=new Set(["html","body","#document"]);function Ld(e){return lpe.has(yf(e))}function Go(e){return Ui(e).getComputedStyle(e)}function sx(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bl(e){if(yf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n2(e)&&e.host||ka(e);return n2(t)?t.host:t}function hU(e){const t=bl(e);return Ld(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&th(t)?t:hU(t)}function Sm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hU(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ui(i);if(o){const c=DC(a);return t.concat(a,a.visualViewport||[],th(i)?i:[],c&&n?Sm(c):[])}return t.concat(i,Sm(i,[],n))}function DC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gU(e){const t=Go(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,c=Ay(n)!==o||Ay(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function HE(e){return Ko(e)?e:e.contextElement}function xd(e){const t=HE(e);if(!Sa(t))return va(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=gU(t);let a=(o?Ay(n.width):n.width)/r,c=(o?Ay(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const cpe=va(0);function vU(e){const t=Ui(e);return!BE()||!t.visualViewport?cpe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function upe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ui(e)?!1:t}function Ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=HE(e);let a=va(1);t&&(r?Ko(r)&&(a=xd(r)):a=xd(e));const c=upe(o,n,r)?vU(o):va(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,m=i.width/a.x,h=i.height/a.y;if(o){const v=Ui(o),y=r&&Ko(r)?Ui(r):r;let x=v,S=DC(x);for(;S&&r&&y!==x;){const C=xd(S),k=S.getBoundingClientRect(),E=Go(S),j=k.left+(S.clientLeft+parseFloat(E.paddingLeft))*C.x,R=k.top+(S.clientTop+parseFloat(E.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=j,f+=R,x=Ui(S),S=DC(x)}}return $y({width:m,height:h,x:d,y:f})}function lx(e,t){const n=sx(e).scrollLeft;return t?t.left+n:Ac(ka(e)).left+n}function yU(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-lx(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function dpe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=ka(r),c=t?ax(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=va(1);const m=va(0),h=Sa(r);if((h||!h&&!o)&&((yf(r)!=="body"||th(a))&&(d=sx(r)),Sa(r))){const y=Ac(r);f=xd(r),m.x=y.x+r.clientLeft,m.y=y.y+r.clientTop}const v=a&&!h&&!o?yU(a,d):va(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 fpe(e){return Array.from(e.getClientRects())}function ppe(e){const t=ka(e),n=sx(e),r=e.ownerDocument.body,i=Mi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Mi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+lx(e);const c=-n.scrollTop;return Go(r).direction==="rtl"&&(a+=Mi(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const r2=25;function mpe(e,t){const n=Ui(e),r=ka(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const m=BE();(!m||m&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=lx(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<=r2&&(o-=x)}else f<=r2&&(o+=f);return{width:o,height:a,x:c,y:d}}const hpe=new Set(["absolute","fixed"]);function gpe(e,t){const n=Ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Sa(e)?xd(e):va(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function i2(e,t,n){let r;if(t==="viewport")r=mpe(e,n);else if(t==="document")r=ppe(ka(e));else if(Ko(t))r=gpe(t,n);else{const i=vU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return $y(r)}function bU(e,t){const n=bl(e);return n===t||!Ko(n)||Ld(n)?!1:Go(n).position==="fixed"||bU(n,t)}function vpe(e,t){const n=t.get(e);if(n)return n;let r=Sm(e,[],!1).filter(c=>Ko(c)&&yf(c)!=="body"),i=null;const o=Go(e).position==="fixed";let a=o?bl(e):e;for(;Ko(a)&&!Ld(a);){const c=Go(a),d=VE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&hpe.has(i.position)||th(a)&&!d&&bU(e,a))?r=r.filter(m=>m!==a):i=c,a=bl(a)}return t.set(e,r),r}function ype(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ax(t)?[]:vpe(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,m)=>{const h=i2(t,m,i);return f.top=Mi(h.top,f.top),f.right=yl(h.right,f.right),f.bottom=yl(h.bottom,f.bottom),f.left=Mi(h.left,f.left),f},i2(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function bpe(e){const{width:t,height:n}=gU(e);return{width:t,height:n}}function xpe(e,t,n){const r=Sa(t),i=ka(t),o=n==="fixed",a=Ac(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=va(0);function f(){d.x=lx(i)}if(r||!r&&!o)if((yf(t)!=="body"||th(i))&&(c=sx(t)),r){const y=Ac(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?yU(i,c):va(0),h=a.left+c.scrollLeft-d.x-m.x,v=a.top+c.scrollTop-d.y-m.y;return{x:h,y:v,width:a.width,height:a.height}}function K_(e){return Go(e).position==="static"}function o2(e,t){if(!Sa(e)||Go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ka(e)===n&&(n=n.ownerDocument.body),n}function xU(e,t){const n=Ui(e);if(ax(e))return n;if(!Sa(e)){let i=bl(e);for(;i&&!Ld(i);){if(Ko(i)&&!K_(i))return i;i=bl(i)}return n}let r=o2(e,t);for(;r&&npe(r)&&K_(r);)r=o2(r,t);return r&&Ld(r)&&K_(r)&&!VE(r)?n:r||spe(e)||n}const wpe=async function(e){const t=this.getOffsetParent||xU,n=this.getDimensions,r=await n(e.floating);return{reference:xpe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Spe(e){return Go(e).direction==="rtl"}const _pe={convertOffsetParentRelativeRectToViewportRelativeRect:dpe,getDocumentElement:ka,getClippingRect:ype,getOffsetParent:xU,getElementRects:wpe,getClientRects:fpe,getDimensions:bpe,getScale:xd,isElement:Ko,isRTL:Spe};function wU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cpe(e,t){let n=null,r;const i=ka(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:m,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const x=wv(h),S=wv(i.clientWidth-(m+v)),C=wv(i.clientHeight-(h+y)),k=wv(m),j={rootMargin:-x+"px "+-S+"px "+-C+"px "+-k+"px",threshold:Mi(0,yl(1,d))||1};let R=!0;function T(N){const O=N[0].intersectionRatio;if(O!==d){if(!R)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!wU(f,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(T,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,j)}n.observe(e)}return a(!0),o}function kpe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=HE(e),m=i||o?[...f?Sm(f):[],...Sm(t)]:[];m.forEach(k=>{i&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&c?Cpe(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?Ac(e):null;d&&C();function C(){const k=Ac(e);S&&!wU(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 Epe=Wfe,jpe=Xfe,Rpe=Gfe,Ipe=Qfe,Npe=Zfe,a2=Kfe,Tpe=Jfe,Ope=(e,t,n)=>{const r=new Map,i={platform:_pe,...n},o={...i.platform,_c:r};return qfe(e,t,{...i,platform:o})};var Ape=typeof document<"u",Dpe=function(){},ly=Ape?b.useLayoutEffect:Dpe;function Py(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(!Py(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)&&!Py(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function SU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s2(e,t){const n=SU(e);return Math.round(t*n)/n}function G_(e){const t=b.useRef(e);return ly(()=>{t.current=e}),t}function $pe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!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);Py(v,r)||y(r);const[x,S]=b.useState(null),[C,k]=b.useState(null),E=b.useCallback(F=>{F!==N.current&&(N.current=F,S(F))},[]),j=b.useCallback(F=>{F!==O.current&&(O.current=F,k(F))},[]),R=o||x,T=a||C,N=b.useRef(null),O=b.useRef(null),M=b.useRef(m),L=d!=null,K=G_(d),ee=G_(i),q=G_(f),Y=b.useCallback(()=>{if(!N.current||!O.current)return;const F={placement:t,strategy:n,middleware:v};ee.current&&(F.platform=ee.current),Ope(N.current,O.current,F).then(te=>{const D={...te,isPositioned:q.current!==!1};U.current&&!Py(M.current,D)&&(M.current=D,of.flushSync(()=>{h(D)}))})},[v,t,n,ee,q]);ly(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const U=b.useRef(!1);ly(()=>(U.current=!0,()=>{U.current=!1}),[]),ly(()=>{if(R&&(N.current=R),T&&(O.current=T),R&&T){if(K.current)return K.current(R,T,Y);Y()}},[R,T,Y,K,L]);const H=b.useMemo(()=>({reference:N,floating:O,setReference:E,setFloating:j}),[E,j]),z=b.useMemo(()=>({reference:R,floating:T}),[R,T]),W=b.useMemo(()=>{const F={position:n,left:0,top:0};if(!z.floating)return F;const te=s2(z.floating,m.x),D=s2(z.floating,m.y);return c?{...F,transform:"translate("+te+"px, "+D+"px)",...SU(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:Y,refs:H,elements:z,floatingStyles:W}),[m,Y,H,z,W])}const Ppe=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?a2({element:r.current,padding:i}).fn(n):{}:r?a2({element:r,padding:i}).fn(n):{}}}},Mpe=(e,t)=>({...Epe(e),options:[e,t]}),zpe=(e,t)=>({...jpe(e),options:[e,t]}),Lpe=(e,t)=>({...Tpe(e),options:[e,t]}),Fpe=(e,t)=>({...Rpe(e),options:[e,t]}),Upe=(e,t)=>({...Ipe(e),options:[e,t]}),Vpe=(e,t)=>({...Npe(e),options:[e,t]}),Bpe=(e,t)=>({...Ppe(e),options:[e,t]});var Hpe="Arrow",_U=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ye.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"})})});_U.displayName=Hpe;var qpe=_U;function CU(e){const[t,n]=b.useState(void 0);return nr(()=>{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,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var qE="Popper",[kU,bf]=Xi(qE),[Kpe,EU]=kU(qE),jU=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return u.jsx(Kpe,{scope:t,anchor:r,onAnchorChange:i,children:n})};jU.displayName=qE;var RU="PopperAnchor",IU=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=EU(RU,n),a=b.useRef(null),c=ft(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(Ye.div,{...i,ref:c})});IU.displayName=RU;var KE="PopperContent",[Gpe,Zpe]=kU(KE),NU=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,...S}=e,C=EU(KE,n),[k,E]=b.useState(null),j=ft(t,B=>E(B)),[R,T]=b.useState(null),N=CU(R),O=N?.width??0,M=N?.height??0,L=r+(o!=="center"?"-"+o:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ee=Array.isArray(f)?f:[f],q=ee.length>0,Y={padding:K,boundary:ee.filter(Wpe),altBoundary:q},{refs:U,floatingStyles:H,placement:z,isPositioned:W,middlewareData:F}=$pe({strategy:"fixed",placement:L,whileElementsMounted:(...B)=>kpe(...B,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Mpe({mainAxis:i+M,alignmentAxis:a}),d&&zpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Lpe():void 0,...Y}),d&&Fpe({...Y}),Upe({...Y,apply:({elements:B,rects:se,availableWidth:_e,availableHeight:Ie})=>{const{width:Fe,height:Le}=se.reference,We=B.floating.style;We.setProperty("--radix-popper-available-width",`${_e}px`),We.setProperty("--radix-popper-available-height",`${Ie}px`),We.setProperty("--radix-popper-anchor-width",`${Fe}px`),We.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),R&&Bpe({element:R,padding:c}),Xpe({arrowWidth:O,arrowHeight:M}),v&&Vpe({strategy:"referenceHidden",...Y})]}),[te,D]=AU(z),$=In(x);nr(()=>{W&&$?.()},[W,$]);const V=F.arrow?.x,A=F.arrow?.y,J=F.arrow?.centerOffset!==0,[fe,ge]=b.useState();return nr(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),u.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Gpe,{scope:n,placedSide:te,onArrowChange:T,arrowX:V,arrowY:A,shouldHideArrow:J,children:u.jsx(Ye.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:W?void 0:"none"}})})})});NU.displayName=KE;var TU="PopperArrow",Ype={top:"bottom",right:"left",bottom:"top",left:"right"},OU=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Zpe(TU,r),a=Ype[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(qpe,{...i,ref:n,style:{...i.style,display:"block"}})})});OU.displayName=TU;function Wpe(e){return e!==null}var Xpe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,m]=AU(n),h={start:"0%",center:"50%",end:"100%"}[m],v=(i.arrow?.x??0)+c/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 AU(e){const[t,n="center"]=e.split("-");return[t,n]}var GE=jU,ZE=IU,YE=NU,WE=OU,Jpe="Portal",nh=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=b.useState(!1);nr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?tE.createPortal(u.jsx(Ye.div,{...r,ref:t}),a):null});nh.displayName=Jpe;var[cx]=Xi("Tooltip",[bf]),ux=bf(),DU="TooltipProvider",Qpe=700,$C="tooltip.open",[eme,XE]=cx(DU),$U=e=>{const{__scopeTooltip:t,delayDuration:n=Qpe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=b.useRef(!0),c=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(eme,{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:c,onPointerInTransitChange:b.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};$U.displayName=DU;var _m="Tooltip",[tme,rh]=cx(_m),PU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=XE(_m,e.__scopeTooltip),f=ux(t),[m,h]=b.useState(null),v=Fi(),y=b.useRef(0),x=a??d.disableHoverableContent,S=c??d.delayDuration,C=b.useRef(!1),[k,E]=qo({prop:r,defaultProp:i??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent($C))):d.onClose(),o?.(O)},caller:_m}),j=b.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),R=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,E(!0)},[E]),T=b.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E(!1)},[E]),N=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(GE,{...f,children:u.jsx(tme,{scope:t,contentId:v,open:k,stateAttribute:j,trigger:m,onTriggerChange:h,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?N():R()},[d.isOpenDelayedRef,N,R]),onTriggerLeave:b.useCallback(()=>{x?T():(window.clearTimeout(y.current),y.current=0)},[T,x]),onOpen:R,onClose:T,disableHoverableContent:x,children:n})})};PU.displayName=_m;var PC="TooltipTrigger",MU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=rh(PC,n),o=XE(PC,n),a=ux(n),c=b.useRef(null),d=ft(t,c,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(ZE,{asChild:!0,...a,children:u.jsx(Ye.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)})})});MU.displayName=PC;var JE="TooltipPortal",[nme,rme]=cx(JE,{forceMount:void 0}),zU=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=rh(JE,t);return u.jsx(nme,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};zU.displayName=JE;var Fd="TooltipContent",LU=b.forwardRef((e,t)=>{const n=rme(Fd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=rh(Fd,e.__scopeTooltip);return u.jsx(ir,{present:r||a.open,children:a.disableHoverableContent?u.jsx(FU,{side:i,...o,ref:t}):u.jsx(ime,{side:i,...o,ref:t})})}),ime=b.forwardRef((e,t)=>{const n=rh(Fd,e.__scopeTooltip),r=XE(Fd,e.__scopeTooltip),i=b.useRef(null),o=ft(t,i),[a,c]=b.useState(null),{trigger:d,onClose:f}=n,m=i.current,{onPointerInTransitChange:h}=r,v=b.useCallback(()=>{c(null),h(!1)},[h]),y=b.useCallback((x,S)=>{const C=x.currentTarget,k={x:x.clientX,y:x.clientY},E=lme(k,C.getBoundingClientRect()),j=cme(k,E),R=ume(S.getBoundingClientRect()),T=fme([...j,...R]);c(T),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=!dme(k,a);E?v():j&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,a,f,v]),u.jsx(FU,{...e,ref:o})}),[ome,ame]=cx(_m,{isInside:!1}),sme=Rde("TooltipContent"),FU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=rh(Fd,n),f=ux(n),{onClose:m}=d;return b.useEffect(()=>(document.addEventListener($C,m),()=>document.removeEventListener($C,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(mf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:m,children:u.jsxs(YE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.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(sme,{children:r}),u.jsx(ome,{scope:n,isInside:!0,children:u.jsx(VF,{id:d.contentId,role:"tooltip",children:i||r})})]})})});LU.displayName=Fd;var UU="TooltipArrow",VU=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ux(n);return ame(UU,n).isInside?null:u.jsx(WE,{...i,...r,ref:t})});VU.displayName=UU;function lme(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 cme(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 ume(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 dme(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 c=t[o],d=t[a],f=c.x,m=c.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function fme(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),pme(t)}function pme(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 mme=$U,hme=PU,gme=MU,vme=zU,yme=LU,bme=VU;function xme({delayDuration:e=0,...t}){return u.jsx(mme,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function dx({...e}){return u.jsx(xme,{children:u.jsx(hme,{"data-slot":"tooltip",...e})})}function fx({...e}){return u.jsx(gme,{"data-slot":"tooltip-trigger",...e})}function px({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(vme,{children:u.jsxs(yme,{"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(bme,{className:Ue("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}const Dp=new Map;function bo(e){if(!e)return"";if(Dp.has(e))return Dp.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return Dp.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return Dp.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const c=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(c)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(c)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(c+d),a++):r.push(c)}const o=r.map(wme).join(" ");return Dp.set(e,o),o}function wme(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function mx({restartRequired:e}){const t=xQ(),{organization:n,instance:r,cluster:i}=qm({strict:!1}),o="Instance",a=b.useMemo(()=>{const c=t.pathname.split("/").filter(f=>f&&f.length>0),d=[u.jsxs(Ze,{to:"/",children:[u.jsx(Ite,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]},"home")];for(let f=0;f<c.length;f++){const m=c[f];if(m==="instance")continue;let h=`/${c.slice(0,f+1).join("/")}`,v=bo(m),y;m==="databases"&&c.length===f+3?(v=c[f+2],f+=2):v.startsWith("Org ")?v=n?.name||"Org":v.startsWith("Clu ")?(v=i?.name||"Cluster",c[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(Ze,{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(dx,{children:[u.jsx(fx,{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(px,{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 ih=e=>e.type==="checkbox",gc=e=>e instanceof Date,hi=e=>e==null;const BU=e=>typeof e=="object";var tr=e=>!hi(e)&&!Array.isArray(e)&&BU(e)&&!gc(e),HU=e=>tr(e)&&e.target?ih(e.target)?e.target.checked:e.target.value:e,Sme=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qU=(e,t)=>e.has(Sme(t)),_me=e=>{const t=e.constructor&&e.constructor.prototype;return tr(t)&&t.hasOwnProperty("isPrototypeOf")},QE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(QE&&(e instanceof Blob||r))&&(n||tr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!_me(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=kn(e[i]));else return e;return t}var hx=e=>/^\w*$/.test(e),yn=e=>e===void 0,gx=e=>Array.isArray(e)?e.filter(Boolean):[],ej=e=>gx(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!tr(e))return n;const r=(hx(t)?[t]:ej(t)).reduce((i,o)=>hi(i)?i:i[o],e);return yn(r)||r===e?yn(e[t])?n:e[t]:r},$i=e=>typeof e=="boolean",qt=(e,t,n)=>{let r=-1;const i=hx(t)?[t]:ej(t),o=i.length,a=o-1;for(;++r<o;){const c=i[r];let d=n;if(r!==a){const f=e[c];d=tr(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const My={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Za={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},tj=Q.createContext(null);tj.displayName="HookFormContext";const oh=()=>Q.useContext(tj),Cme=e=>{const{children:t,...n}=e;return Q.createElement(tj.Provider,{value:n},t)};var KU=(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]!==xo.all&&(t._proxyFormState[a]=!r||xo.all),n&&(n[a]=!0),e[a]}});return i};const vx=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function nj(e){const t=oh(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=Q.useState(n._formState),d=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return vx(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),Q.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),Q.useMemo(()=>KU(a,n,d.current,!1),[a,n])}var zi=e=>typeof e=="string",MC=(e,t,n,r,i)=>zi(e)?(r&&t.watch.add(e),Pe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Pe(n,o))):(r&&(t.watchAll=!0),n),zC=e=>hi(e)||!BU(e);function zo(e,t,n=new WeakSet){if(zC(e)||zC(t))return Object.is(e,t);if(gc(e)&&gc(t))return 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 c=t[o];if(gc(a)&&gc(c)||tr(a)&&tr(c)||Array.isArray(a)&&Array.isArray(c)?!zo(a,c,n):!Object.is(a,c))return!1}}return!0}function kme(e){const t=oh(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=Q.useRef(i),f=Q.useRef(c),m=Q.useRef(void 0),h=Q.useRef(n),v=Q.useRef(r);f.current=c;const[y,x]=Q.useState(()=>{const R=n._getWatch(r,d.current);return f.current?f.current(R):R}),S=Q.useCallback(R=>{const T=MC(r,n._names,R||n._formValues,!1,d.current);return f.current?f.current(T):T},[n._formValues,n._names,r]),C=Q.useCallback(R=>{if(!o){const T=MC(r,n._names,R||n._formValues,!1,d.current);if(f.current){const N=f.current(T);zo(N,m.current)||(x(N),m.current=N)}else x(T)}},[n._formValues,n._names,o,r]);vx(()=>((h.current!==n||!zo(v.current,r))&&(h.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:a,callback:R=>{C(R.values)}})),[n,a,r,C]),Q.useEffect(()=>n._removeUnmounted());const k=h.current!==n,E=v.current,j=Q.useMemo(()=>{if(o)return null;const R=!k&&!zo(E,r);return k||R?S():null},[o,k,r,E,S]);return j!==null?j:y}function Eme(e){const t=oh(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a,exact:c=!0}=e,d=qU(i._names.array,n),f=Q.useMemo(()=>Pe(i._formValues,n,Pe(i._defaultValues,n,a)),[i,n,a]),m=kme({control:i,name:n,defaultValue:f,exact:c}),h=nj({control:i,name:n,exact:c}),v=Q.useRef(e),y=Q.useRef(void 0),x=Q.useRef(i.register(n,{...e.rules,value:m,...$i(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const S=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(h.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(h.errors,n)}}),[h,n]),C=Q.useCallback(R=>x.current.onChange({target:{value:HU(R),name:n},type:My.CHANGE}),[n]),k=Q.useCallback(()=>x.current.onBlur({target:{value:Pe(i._formValues,n),name:n},type:My.BLUR}),[n,i._formValues]),E=Q.useCallback(R=>{const T=Pe(i._fields,n);T&&R&&(T._f.ref={focus:()=>R.focus&&R.focus(),select:()=>R.select&&R.select(),setCustomValidity:N=>R.setCustomValidity(N),reportValidity:()=>R.reportValidity()})},[i._fields,n]),j=Q.useMemo(()=>({name:n,value:m,...$i(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:E}),[n,r,h.disabled,C,k,E,m]);return Q.useEffect(()=>{const R=i._options.shouldUnregister||o,T=y.current;T&&T!==n&&!d&&i.unregister(T),i.register(n,{...v.current.rules,...$i(v.current.disabled)?{disabled:v.current.disabled}:{}});const N=(O,M)=>{const L=Pe(i._fields,O);L&&L._f&&(L._f.mount=M)};if(N(n,!0),R){const O=kn(Pe(i._options.defaultValues,n,v.current.defaultValue));qt(i._defaultValues,n,O),yn(Pe(i._formValues,n))&&qt(i._formValues,n,O)}return!d&&i.register(n),y.current=n,()=>{(d?R&&!i._state.action:R)?i.unregister(n):N(n,!1)}},[n,i,d,o]),Q.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),Q.useMemo(()=>({field:j,formState:h,fieldState:S}),[j,h,S])}const jme=e=>e.render(Eme(e));var rj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},bi=e=>Array.isArray(e)?e:[e],l2=()=>{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 GU(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&tr(i)&&o){const a=GU(i,o);tr(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var Nr=e=>tr(e)&&!Object.keys(e).length,ij=e=>e.type==="file",Lo=e=>typeof e=="function",zy=e=>{if(!QE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ZU=e=>e.type==="select-multiple",oj=e=>e.type==="radio",Rme=e=>oj(e)||ih(e),Z_=e=>zy(e)&&e.isConnected;function Ime(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=yn(e)?r++:e[t[r++]];return e}function Nme(e){for(const t in e)if(e.hasOwnProperty(t)&&!yn(e[t]))return!1;return!0}function qn(e,t){const n=Array.isArray(t)?t:hx(t)?[t]:ej(t),r=n.length===1?e:Ime(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(tr(r)&&Nr(r)||Array.isArray(r)&&Nme(r))&&qn(e,n.slice(0,-1)),e}var Tme=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function YU(e){return Array.isArray(e)||tr(e)&&!Tme(e)}function LC(e,t={}){for(const n in e){const r=e[n];YU(r)?(t[n]=Array.isArray(r)?[]:{},LC(r,t[n])):yn(r)||(t[n]=!0)}return t}function ad(e,t,n){n||(n=LC(t));for(const r in e){const i=e[r];if(YU(i))yn(t)||zC(n[r])?n[r]=LC(i,Array.isArray(i)?[]:{}):ad(i,hi(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!zo(i,o)}}return n}const c2={value:!1,isValid:!1},u2={value:!0,isValid:!0};var WU=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&&!yn(e[0].attributes.value)?yn(e[0].value)||e[0].value===""?u2:{value:e[0].value,isValid:!0}:u2:c2}return c2},XU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>yn(e)?e:t?e===""?NaN:e&&+e:n&&zi(e)?new Date(e):r?r(e):e;const d2={isValid:!1,value:null};var JU=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,d2):d2;function f2(e){const t=e.ref;return ij(t)?t.files:oj(t)?JU(e.refs).value:ZU(t)?[...t.selectedOptions].map(({value:n})=>n):ih(t)?WU(e.refs).value:XU(yn(t.value)?e.ref.value:t.value,e)}var Ome=(e,t,n,r)=>{const i={};for(const o of e){const a=Pe(t,o);a&&qt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Ly=e=>e instanceof RegExp,$p=e=>yn(e)?e:Ly(e)?e.source:tr(e)?Ly(e.value)?e.value.source:e.value:e,fd=e=>({isOnSubmit:!e||e===xo.onSubmit,isOnBlur:e===xo.onBlur,isOnChange:e===xo.onChange,isOnAll:e===xo.all,isOnTouch:e===xo.onTouched});const p2="AsyncFunction";var Ame=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===p2||tr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===p2)),Dme=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),FC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wd=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Pe(e,i);if(o){const{_f:a,...c}=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(wd(c,t))break}else if(tr(c)&&wd(c,t))break}}};function m2(e,t,n){const r=Pe(e,n);if(r||hx(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Pe(t,o),c=Pe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};if(c&&c.root&&c.root.type)return{name:`${o}.root`,error:c.root};i.pop()}return{name:n}}var $me=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||xo.all))},Pme=(e,t,n)=>!e||!t||e===t||bi(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Mme=(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,zme=(e,t)=>!gx(Pe(e,t)).length&&qn(e,t),QU=(e,t,n)=>{const r=bi(Pe(e,n));return qt(r,"root",t[n]),qt(e,n,r),e};function h2(e,t,n="validate"){if(zi(e)||Array.isArray(e)&&e.every(zi)||$i(e)&&!e)return{type:n,message:zi(e)?e:"",ref:t}}var Ju=e=>tr(e)&&!Ly(e)?e:{value:e,message:""},UC=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:m,min:h,max:v,pattern:y,validate:x,name:S,valueAsNumber:C,mount:k}=e._f,E=Pe(n,S);if(!k||t.has(S))return{};const j=c?c[0]:a,R=q=>{i&&j.reportValidity&&(j.setCustomValidity($i(q)?"":q||""),j.reportValidity())},T={},N=oj(a),O=ih(a),M=N||O,L=(C||ij(a))&&yn(a.value)&&yn(E)||zy(a)&&a.value===""||E===""||Array.isArray(E)&&!E.length,K=rj.bind(null,S,r,T),ee=(q,Y,U,H=Za.maxLength,z=Za.minLength)=>{const W=q?Y:U;T[S]={type:q?H:z,message:W,ref:a,...K(q?H:z,W)}};if(o?!Array.isArray(E)||!E.length:d&&(!M&&(L||hi(E))||$i(E)&&!E||O&&!WU(c).isValid||N&&!JU(c).isValid)){const{value:q,message:Y}=zi(d)?{value:!!d,message:d}:Ju(d);if(q&&(T[S]={type:Za.required,message:Y,ref:j,...K(Za.required,Y)},!r))return R(Y),T}if(!L&&(!hi(h)||!hi(v))){let q,Y;const U=Ju(v),H=Ju(h);if(!hi(E)&&!isNaN(E)){const z=a.valueAsNumber||E&&+E;hi(U.value)||(q=z>U.value),hi(H.value)||(Y=z<H.value)}else{const z=a.valueAsDate||new Date(E),W=D=>new Date(new Date().toDateString()+" "+D),F=a.type=="time",te=a.type=="week";zi(U.value)&&E&&(q=F?W(E)>W(U.value):te?E>U.value:z>new Date(U.value)),zi(H.value)&&E&&(Y=F?W(E)<W(H.value):te?E<H.value:z<new Date(H.value))}if((q||Y)&&(ee(!!q,U.message,H.message,Za.max,Za.min),!r))return R(T[S].message),T}if((f||m)&&!L&&(zi(E)||o&&Array.isArray(E))){const q=Ju(f),Y=Ju(m),U=!hi(q.value)&&E.length>+q.value,H=!hi(Y.value)&&E.length<+Y.value;if((U||H)&&(ee(U,q.message,Y.message),!r))return R(T[S].message),T}if(y&&!L&&zi(E)){const{value:q,message:Y}=Ju(y);if(Ly(q)&&!E.match(q)&&(T[S]={type:Za.pattern,message:Y,ref:a,...K(Za.pattern,Y)},!r))return R(Y),T}if(x){if(Lo(x)){const q=await x(E,n),Y=h2(q,j);if(Y&&(T[S]={...Y,...K(Za.validate,Y.message)},!r))return R(Y.message),T}else if(tr(x)){let q={};for(const Y in x){if(!Nr(q)&&!r)break;const U=h2(await x[Y](E,n),j,Y);U&&(q={...U,...K(Y,U.message)},R(U.message),r&&(T[S]=q))}if(!Nr(q)&&(T[S]={ref:j,...q},!r))return T}}return R(!0),T};const Lme={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function Fme(e={}){let t={...Lme,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=tr(t.defaultValues)||tr(t.values)?kn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:kn(i),a={action:!1,mount:!1,watch:!1},c={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};let h={...m};const v={array:l2(),state:l2()},y=t.criteriaMode===xo.all,x=G=>ae=>{clearTimeout(f),f=setTimeout(G,ae)},S=async G=>{if(!t.disabled&&(m.isValid||h.isValid||G)){const ae=t.resolver?Nr((await O()).errors):await L(r,!0);ae!==n.isValid&&v.state.next({isValid:ae})}},C=(G,ae)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((G||Array.from(c.mount)).forEach(pe=>{pe&&(ae?qt(n.validatingFields,pe,ae):qn(n.validatingFields,pe))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Nr(n.validatingFields)}))},k=(G,ae=[],pe,Ce,re=!0,ue=!0)=>{if(Ce&&pe&&!t.disabled){if(a.action=!0,ue&&Array.isArray(Pe(r,G))){const X=pe(Pe(r,G),Ce.argA,Ce.argB);re&&qt(r,G,X)}if(ue&&Array.isArray(Pe(n.errors,G))){const X=pe(Pe(n.errors,G),Ce.argA,Ce.argB);re&&qt(n.errors,G,X),zme(n.errors,G)}if((m.touchedFields||h.touchedFields)&&ue&&Array.isArray(Pe(n.touchedFields,G))){const X=pe(Pe(n.touchedFields,G),Ce.argA,Ce.argB);re&&qt(n.touchedFields,G,X)}(m.dirtyFields||h.dirtyFields)&&(n.dirtyFields=ad(i,o)),v.state.next({name:G,isDirty:ee(G,ae),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qt(o,G,ae)},E=(G,ae)=>{qt(n.errors,G,ae),v.state.next({errors:n.errors})},j=G=>{n.errors=G,v.state.next({errors:n.errors,isValid:!1})},R=(G,ae,pe,Ce)=>{const re=Pe(r,G);if(re){const ue=Pe(o,G,yn(pe)?Pe(i,G):pe);yn(ue)||Ce&&Ce.defaultChecked||ae?qt(o,G,ae?ue:f2(re._f)):U(G,ue),a.mount&&!a.action&&S()}},T=(G,ae,pe,Ce,re)=>{let ue=!1,X=!1;const ve={name:G};if(!t.disabled){if(!pe||Ce){(m.isDirty||h.isDirty)&&(X=n.isDirty,n.isDirty=ve.isDirty=ee(),ue=X!==ve.isDirty);const Ee=zo(Pe(i,G),ae);X=!!Pe(n.dirtyFields,G),Ee?qn(n.dirtyFields,G):qt(n.dirtyFields,G,!0),ve.dirtyFields=n.dirtyFields,ue=ue||(m.dirtyFields||h.dirtyFields)&&X!==!Ee}if(pe){const Ee=Pe(n.touchedFields,G);Ee||(qt(n.touchedFields,G,pe),ve.touchedFields=n.touchedFields,ue=ue||(m.touchedFields||h.touchedFields)&&Ee!==pe)}ue&&re&&v.state.next(ve)}return ue?ve:{}},N=(G,ae,pe,Ce)=>{const re=Pe(n.errors,G),ue=(m.isValid||h.isValid)&&$i(ae)&&n.isValid!==ae;if(t.delayError&&pe?(d=x(()=>E(G,pe)),d(t.delayError)):(clearTimeout(f),d=null,pe?qt(n.errors,G,pe):qn(n.errors,G)),(pe?!zo(re,pe):re)||!Nr(Ce)||ue){const X={...Ce,...ue&&$i(ae)?{isValid:ae}:{},errors:n.errors,name:G};n={...n,...X},v.state.next(X)}},O=async G=>{C(G,!0);const ae=await t.resolver(o,t.context,Ome(G||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(G),ae},M=async G=>{const{errors:ae}=await O(G);if(G)for(const pe of G){const Ce=Pe(ae,pe);Ce?qt(n.errors,pe,Ce):qn(n.errors,pe)}else n.errors=ae;return ae},L=async(G,ae,pe={valid:!0})=>{for(const Ce in G){const re=G[Ce];if(re){const{_f:ue,...X}=re;if(ue){const ve=c.array.has(ue.name),Ee=re._f&&Ame(re._f);Ee&&m.validatingFields&&C([ue.name],!0);const Ke=await UC(re,c.disabled,o,y,t.shouldUseNativeValidation&&!ae,ve);if(Ee&&m.validatingFields&&C([ue.name]),Ke[ue.name]&&(pe.valid=!1,ae))break;!ae&&(Pe(Ke,ue.name)?ve?QU(n.errors,Ke,ue.name):qt(n.errors,ue.name,Ke[ue.name]):qn(n.errors,ue.name))}!Nr(X)&&await L(X,ae,pe)}}return pe.valid},K=()=>{for(const G of c.unMount){const ae=Pe(r,G);ae&&(ae._f.refs?ae._f.refs.every(pe=>!Z_(pe)):!Z_(ae._f.ref))&&B(G)}c.unMount=new Set},ee=(G,ae)=>!t.disabled&&(G&&ae&&qt(o,G,ae),!zo(D(),i)),q=(G,ae,pe)=>MC(G,c,{...a.mount?o:yn(ae)?i:zi(G)?{[G]:ae}:ae},pe,ae),Y=G=>gx(Pe(a.mount?o:i,G,t.shouldUnregister?Pe(i,G,[]):[])),U=(G,ae,pe={})=>{const Ce=Pe(r,G);let re=ae;if(Ce){const ue=Ce._f;ue&&(!ue.disabled&&qt(o,G,XU(ae,ue)),re=zy(ue.ref)&&hi(ae)?"":ae,ZU(ue.ref)?[...ue.ref.options].forEach(X=>X.selected=re.includes(X.value)):ue.refs?ih(ue.ref)?ue.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(re)?X.checked=!!re.find(ve=>ve===X.value):X.checked=re===X.value||!!re)}):ue.refs.forEach(X=>X.checked=X.value===re):ij(ue.ref)?ue.ref.value="":(ue.ref.value=re,ue.ref.type||v.state.next({name:G,values:kn(o)})))}(pe.shouldDirty||pe.shouldTouch)&&T(G,re,pe.shouldTouch,pe.shouldDirty,!0),pe.shouldValidate&&te(G)},H=(G,ae,pe)=>{for(const Ce in ae){if(!ae.hasOwnProperty(Ce))return;const re=ae[Ce],ue=G+"."+Ce,X=Pe(r,ue);(c.array.has(G)||tr(re)||X&&!X._f)&&!gc(re)?H(ue,re,pe):U(ue,re,pe)}},z=(G,ae,pe={})=>{const Ce=Pe(r,G),re=c.array.has(G),ue=kn(ae);qt(o,G,ue),re?(v.array.next({name:G,values:kn(o)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&pe.shouldDirty&&v.state.next({name:G,dirtyFields:ad(i,o),isDirty:ee(G,ue)})):Ce&&!Ce._f&&!hi(ue)?H(G,ue,pe):U(G,ue,pe),FC(G,c)&&v.state.next({...n,name:G}),v.state.next({name:a.mount?G:void 0,values:kn(o)})},W=async G=>{a.mount=!0;const ae=G.target;let pe=ae.name,Ce=!0;const re=Pe(r,pe),ue=Ee=>{Ce=Number.isNaN(Ee)||gc(Ee)&&isNaN(Ee.getTime())||zo(Ee,Pe(o,pe,Ee))},X=fd(t.mode),ve=fd(t.reValidateMode);if(re){let Ee,Ke;const et=ae.type?f2(re._f):HU(G),Vt=G.type===My.BLUR||G.type===My.FOCUS_OUT,jn=!Dme(re._f)&&!t.resolver&&!Pe(n.errors,pe)&&!re._f.deps||Mme(Vt,Pe(n.touchedFields,pe),n.isSubmitted,ve,X),ln=FC(pe,c,Vt);qt(o,pe,et),Vt?(!ae||!ae.readOnly)&&(re._f.onBlur&&re._f.onBlur(G),d&&d(0)):re._f.onChange&&re._f.onChange(G);const zt=T(pe,et,Vt),wn=!Nr(zt)||ln;if(!Vt&&v.state.next({name:pe,type:G.type,values:kn(o)}),jn)return(m.isValid||h.isValid)&&(t.mode==="onBlur"?Vt&&S():Vt||S()),wn&&v.state.next({name:pe,...ln?{}:zt});if(!Vt&&ln&&v.state.next({...n}),t.resolver){const{errors:_t}=await O([pe]);if(ue(et),Ce){const ur=m2(n.errors,r,pe),Sn=m2(_t,r,ur.name||pe);Ee=Sn.error,pe=Sn.name,Ke=Nr(_t)}}else C([pe],!0),Ee=(await UC(re,c.disabled,o,y,t.shouldUseNativeValidation))[pe],C([pe]),ue(et),Ce&&(Ee?Ke=!1:(m.isValid||h.isValid)&&(Ke=await L(r,!0)));Ce&&(re._f.deps&&(!Array.isArray(re._f.deps)||re._f.deps.length>0)&&te(re._f.deps),N(pe,Ke,Ee,zt))}},F=(G,ae)=>{if(Pe(n.errors,ae)&&G.focus)return G.focus(),1},te=async(G,ae={})=>{let pe,Ce;const re=bi(G);if(t.resolver){const ue=await M(yn(G)?G:re);pe=Nr(ue),Ce=G?!re.some(X=>Pe(ue,X)):pe}else G?(Ce=(await Promise.all(re.map(async ue=>{const X=Pe(r,ue);return await L(X&&X._f?{[ue]:X}:X)}))).every(Boolean),!(!Ce&&!n.isValid)&&S()):Ce=pe=await L(r);return v.state.next({...!zi(G)||(m.isValid||h.isValid)&&pe!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:pe}:{},errors:n.errors}),ae.shouldFocus&&!Ce&&wd(r,F,G?re:c.mount),Ce},D=(G,ae)=>{let pe={...a.mount?o:i};return ae&&(pe=GU(ae.dirtyFields?n.dirtyFields:n.touchedFields,pe)),yn(G)?pe:zi(G)?Pe(pe,G):G.map(Ce=>Pe(pe,Ce))},$=(G,ae)=>({invalid:!!Pe((ae||n).errors,G),isDirty:!!Pe((ae||n).dirtyFields,G),error:Pe((ae||n).errors,G),isValidating:!!Pe(n.validatingFields,G),isTouched:!!Pe((ae||n).touchedFields,G)}),V=G=>{G&&bi(G).forEach(ae=>qn(n.errors,ae)),v.state.next({errors:G?n.errors:{}})},A=(G,ae,pe)=>{const Ce=(Pe(r,G,{_f:{}})._f||{}).ref,re=Pe(n.errors,G)||{},{ref:ue,message:X,type:ve,...Ee}=re;qt(n.errors,G,{...Ee,...ae,ref:Ce}),v.state.next({name:G,errors:n.errors,isValid:!1}),pe&&pe.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},J=(G,ae)=>Lo(G)?v.state.subscribe({next:pe=>"values"in pe&&G(q(void 0,ae),pe)}):q(G,ae,!0),fe=G=>v.state.subscribe({next:ae=>{Pme(G.name,ae.name,G.exact)&&$me(ae,G.formState||m,sn,G.reRenderRoot)&&G.callback({values:{...o},...n,...ae,defaultValues:i})}}).unsubscribe,ge=G=>(a.mount=!0,h={...h,...G.formState},fe({...G,formState:h})),B=(G,ae={})=>{for(const pe of G?bi(G):c.mount)c.mount.delete(pe),c.array.delete(pe),ae.keepValue||(qn(r,pe),qn(o,pe)),!ae.keepError&&qn(n.errors,pe),!ae.keepDirty&&qn(n.dirtyFields,pe),!ae.keepTouched&&qn(n.touchedFields,pe),!ae.keepIsValidating&&qn(n.validatingFields,pe),!t.shouldUnregister&&!ae.keepDefaultValue&&qn(i,pe);v.state.next({values:kn(o)}),v.state.next({...n,...ae.keepDirty?{isDirty:ee()}:{}}),!ae.keepIsValid&&S()},se=({disabled:G,name:ae})=>{($i(G)&&a.mount||G||c.disabled.has(ae))&&(G?c.disabled.add(ae):c.disabled.delete(ae))},_e=(G,ae={})=>{let pe=Pe(r,G);const Ce=$i(ae.disabled)||$i(t.disabled);return qt(r,G,{...pe||{},_f:{...pe&&pe._f?pe._f:{ref:{name:G}},name:G,mount:!0,...ae}}),c.mount.add(G),pe?se({disabled:$i(ae.disabled)?ae.disabled:t.disabled,name:G}):R(G,!0,ae.value),{...Ce?{disabled:ae.disabled||t.disabled}:{},...t.progressive?{required:!!ae.required,min:$p(ae.min),max:$p(ae.max),minLength:$p(ae.minLength),maxLength:$p(ae.maxLength),pattern:$p(ae.pattern)}:{},name:G,onChange:W,onBlur:W,ref:re=>{if(re){_e(G,ae),pe=Pe(r,G);const ue=yn(re.value)&&re.querySelectorAll&&re.querySelectorAll("input,select,textarea")[0]||re,X=Rme(ue),ve=pe._f.refs||[];if(X?ve.find(Ee=>Ee===ue):ue===pe._f.ref)return;qt(r,G,{_f:{...pe._f,...X?{refs:[...ve.filter(Z_),ue,...Array.isArray(Pe(i,G))?[{}]:[]],ref:{type:ue.type,name:G}}:{ref:ue}}}),R(G,!1,void 0,ue)}else pe=Pe(r,G,{}),pe._f&&(pe._f.mount=!1),(t.shouldUnregister||ae.shouldUnregister)&&!(qU(c.array,G)&&a.action)&&c.unMount.add(G)}}},Ie=()=>t.shouldFocusError&&wd(r,F,c.mount),Fe=G=>{$i(G)&&(v.state.next({disabled:G}),wd(r,(ae,pe)=>{const Ce=Pe(r,pe);Ce&&(ae.disabled=Ce._f.disabled||G,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(re=>{re.disabled=Ce._f.disabled||G}))},0,!1))},Le=(G,ae)=>async pe=>{let Ce;pe&&(pe.preventDefault&&pe.preventDefault(),pe.persist&&pe.persist());let re=kn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:ue,values:X}=await O();n.errors=ue,re=kn(X)}else await L(r);if(c.disabled.size)for(const ue of c.disabled)qn(re,ue);if(qn(n.errors,"root"),Nr(n.errors)){v.state.next({errors:{}});try{await G(re,pe)}catch(ue){Ce=ue}}else ae&&await ae({...n.errors},pe),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},We=(G,ae={})=>{Pe(r,G)&&(yn(ae.defaultValue)?z(G,kn(Pe(i,G))):(z(G,ae.defaultValue),qt(i,G,kn(ae.defaultValue))),ae.keepTouched||qn(n.touchedFields,G),ae.keepDirty||(qn(n.dirtyFields,G),n.isDirty=ae.defaultValue?ee(G,kn(Pe(i,G))):ee()),ae.keepError||(qn(n.errors,G),m.isValid&&S()),v.state.next({...n}))},gt=(G,ae={})=>{const pe=G?kn(G):i,Ce=kn(pe),re=Nr(G),ue=re?i:Ce;if(ae.keepDefaultValues||(i=pe),!ae.keepValues){if(ae.keepDirtyValues){const X=new Set([...c.mount,...Object.keys(ad(i,o))]);for(const ve of Array.from(X))Pe(n.dirtyFields,ve)?qt(ue,ve,Pe(o,ve)):z(ve,Pe(ue,ve))}else{if(QE&&yn(G))for(const X of c.mount){const ve=Pe(r,X);if(ve&&ve._f){const Ee=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(zy(Ee)){const Ke=Ee.closest("form");if(Ke){Ke.reset();break}}}}if(ae.keepFieldsRef)for(const X of c.mount)z(X,Pe(ue,X));else r={}}o=t.shouldUnregister?ae.keepDefaultValues?kn(i):{}:kn(ue),v.array.next({values:{...ue}}),v.state.next({values:{...ue}})}c={mount:ae.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!m.isValid||!!ae.keepIsValid||!!ae.keepDirtyValues||!t.shouldUnregister&&!Nr(ue),a.watch=!!t.shouldUnregister,a.action=!1,ae.keepErrors||(n.errors={}),v.state.next({submitCount:ae.keepSubmitCount?n.submitCount:0,isDirty:re?!1:ae.keepDirty?n.isDirty:!!(ae.keepDefaultValues&&!zo(G,i)),isSubmitted:ae.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:re?{}:ae.keepDirtyValues?ae.keepDefaultValues&&o?ad(i,o):n.dirtyFields:ae.keepDefaultValues&&G?ad(i,G):ae.keepDirty?n.dirtyFields:{},touchedFields:ae.keepTouched?n.touchedFields:{},errors:ae.keepErrors?n.errors:{},isSubmitSuccessful:ae.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Qt=(G,ae)=>gt(Lo(G)?G(o):G,ae),Tn=(G,ae={})=>{const pe=Pe(r,G),Ce=pe&&pe._f;if(Ce){const re=Ce.refs?Ce.refs[0]:Ce.ref;re.focus&&(re.focus(),ae.shouldSelect&&Lo(re.select)&&re.select())}},sn=G=>{n={...n,...G}},Mt={control:{register:_e,unregister:B,getFieldState:$,handleSubmit:Le,setError:A,_subscribe:fe,_runSchema:O,_focusError:Ie,_getWatch:q,_getDirty:ee,_setValid:S,_setFieldArray:k,_setDisabledField:se,_setErrors:j,_getFieldArray:Y,_reset:gt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(G=>{Qt(G,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Fe,_subjects:v,_proxyFormState:m,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(G){a=G},get _defaultValues(){return i},get _names(){return c},set _names(G){c=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:ge,trigger:te,register:_e,handleSubmit:Le,watch:J,setValue:z,getValues:D,reset:Qt,resetField:We,clearErrors:V,unregister:B,setError:A,setFocus:Tn,getFieldState:$};return{...Mt,formControl:Mt}}var Hs=()=>{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)})},Y_=(e,t,n={})=>n.shouldFocus||yn(n.shouldFocus)?n.focusName||`${e}.${yn(n.focusIndex)?t:n.focusIndex}.`:"",W_=(e,t)=>[...e,...bi(t)],X_=e=>Array.isArray(e)?e.map(()=>{}):void 0;function J_(e,t,n){return[...e.slice(0,t),...bi(n),...e.slice(t)]}var Q_=(e,t,n)=>Array.isArray(e)?(yn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],e1=(e,t)=>[...bi(t),...bi(e)];function Ume(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return gx(r).length?r:[]}var t1=(e,t)=>yn(t)?[]:Ume(e,bi(t).sort((n,r)=>n-r)),n1=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},g2=(e,t,n)=>(e[t]=n,e);function aj(e){const t=oh(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=Q.useState(n._getFieldArray(r)),f=Q.useRef(n._getFieldArray(r).map(Hs)),m=Q.useRef(!1);n._names.array.add(r),Q.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),vx(()=>n._subjects.array.subscribe({next:({values:R,name:T})=>{if(T===r||!T){const N=Pe(R,r);Array.isArray(N)&&(d(N),f.current=N.map(Hs))}}}).unsubscribe,[n,r]);const h=Q.useCallback(R=>{m.current=!0,n._setFieldArray(r,R)},[n,r]),v=(R,T)=>{const N=bi(kn(R)),O=W_(n._getFieldArray(r),N);n._names.focus=Y_(r,O.length-1,T),f.current=W_(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,W_,{argA:X_(R)})},y=(R,T)=>{const N=bi(kn(R)),O=e1(n._getFieldArray(r),N);n._names.focus=Y_(r,0,T),f.current=e1(f.current,N.map(Hs)),h(O),d(O),n._setFieldArray(r,O,e1,{argA:X_(R)})},x=R=>{const T=t1(n._getFieldArray(r),R);f.current=t1(f.current,R),h(T),d(T),!Array.isArray(Pe(n._fields,r))&&qt(n._fields,r,void 0),n._setFieldArray(r,T,t1,{argA:R})},S=(R,T,N)=>{const O=bi(kn(T)),M=J_(n._getFieldArray(r),R,O);n._names.focus=Y_(r,R,N),f.current=J_(f.current,R,O.map(Hs)),h(M),d(M),n._setFieldArray(r,M,J_,{argA:R,argB:X_(T)})},C=(R,T)=>{const N=n._getFieldArray(r);n1(N,R,T),n1(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,n1,{argA:R,argB:T},!1)},k=(R,T)=>{const N=n._getFieldArray(r);Q_(N,R,T),Q_(f.current,R,T),h(N),d(N),n._setFieldArray(r,N,Q_,{argA:R,argB:T},!1)},E=(R,T)=>{const N=kn(T),O=g2(n._getFieldArray(r),R,N);f.current=[...O].map((M,L)=>!M||L===R?Hs():f.current[L]),h(O),d([...O]),n._setFieldArray(r,O,g2,{argA:R,argB:N},!0,!1)},j=R=>{const T=bi(kn(R));f.current=T.map(Hs),h([...T]),d([...T]),n._setFieldArray(r,[...T],N=>N,{},!0,!1)};return Q.useEffect(()=>{if(n._state.action=!1,FC(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!fd(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!fd(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(R=>{const T=Pe(R.errors,r),N=Pe(n._formState.errors,r);(N?!T&&N.type||T&&(N.type!==T.type||N.message!==T.message):T&&T.type)&&(T?qt(n._formState.errors,r,T):qn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const R=Pe(n._fields,r);R&&R._f&&!(fd(n._options.reValidateMode).isOnSubmit&&fd(n._options.mode).isOnSubmit)&&UC(R,n._names.disabled,n._formValues,n._options.criteriaMode===xo.all,n._options.shouldUseNativeValidation,!0).then(T=>!Nr(T)&&n._subjects.state.next({errors:QU(n._formState.errors,T,r)}))}n._subjects.state.next({name:r,values:kn(n._formValues)}),n._names.focus&&wd(n._fields,(R,T)=>{if(n._names.focus&&T.startsWith(n._names.focus)&&R.focus)return R.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[c,r,n]),Q.useEffect(()=>(!Pe(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(T,N)=>{const O=Pe(n._fields,T);O&&O._f&&(O._f.mount=N)};n._options.shouldUnregister||o?n.unregister(r):R(r,!1)}),[r,n,i,o]),{swap:Q.useCallback(C,[h,r,n]),move:Q.useCallback(k,[h,r,n]),prepend:Q.useCallback(y,[h,r,n]),append:Q.useCallback(v,[h,r,n]),remove:Q.useCallback(x,[h,r,n]),insert:Q.useCallback(S,[h,r,n]),update:Q.useCallback(E,[h,r,n]),replace:Q.useCallback(j,[h,r,n]),fields:Q.useMemo(()=>c.map((R,T)=>({...R,[i]:f.current[T]||Hs()})),[c,i])}}function on(e={}){const t=Q.useRef(void 0),n=Q.useRef(void 0),[r,i]=Q.useState({isDirty:!1,isValidating:!1,isLoading:Lo(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:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=Fme(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,vx(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),Q.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Q.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),Q.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),Q.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),Q.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),Q.useEffect(()=>{var a;e.values&&!zo(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(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),Q.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=KU(r,o),t.current}const an=Cme,e6=b.createContext({}),t6=b.createContext({});function yx(){const e=b.useContext(e6),t=b.useContext(t6),{getFieldState:n}=oh(),r=nj({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 De({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=yx();return u.jsx(rE,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function $e({...e}){return u.jsx(e6,{value:{name:e.name},children:u.jsx(jme,{...e})})}function Ne({className:e,...t}){const n=b.useId();return u.jsx(t6,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:Ue("grid gap-2",e),...t})})}var Vme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],n6=Vme.reduce((e,t)=>{const n=g4(`Primitive.${t}`),r=b.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Bme="Label",r6=b.forwardRef((e,t)=>u.jsx(n6.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));r6.displayName=Bme;var Hme=r6;function ah({className:e,...t}){return u.jsx(Hme,{"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 Te({className:e,...t}){const{error:n,formItemId:r}=yx();return u.jsx(ah,{"data-slot":"form-label","data-error":!!n,className:Ue("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function Oe({className:e,...t}){const{error:n,formMessageId:r}=yx(),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 Me({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
39
+ selection:text-primary-foreground
40
+ dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
41
+ dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
42
+ aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
43
+ flex h-9 w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
44
+ file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
45
+ focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
46
+ 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 bx=["RUNNING"],sj=["TERMINATING","TERMINATED","REMOVED"];function qme(){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 VC({username:e,password:t,instanceClient:n,entityId:r}){const{data:{message:i}}=await n.post("/",{operation:"login",username:e,password:t});try{const c=await al({instanceClient:n});return{message:i,user:c}}catch(c){console.error("Failed to get user after login, trying basic auth",c)}try{const c=await al({instanceClient:n,auth:{username:e,password:t}});return Et.flagForBasicAuth(r,{username:e,password:t}),{message:i,user:c}}catch(c){throw c}const o=Qa({id:r,forceFabricConnect:!0}),a=await al({instanceClient:o});return Et.flagForFabricConnect(r,!0),{message:i,user:a,instanceClient:n}}function Kme(){return ct({mutationFn:VC})}function Gme({cluster:e,instance:t,instanceParams:n}){const r=En(),i=xn(),{redirect:o}=Er({strict:!1}),{mutate:a,isPending:c}=Kme(),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)Et.setUserForEntity(y,h);const v=An;Et.setUserForEntity(v,h),i.invalidate(),await r({to:o?.startsWith("/")?o:ya})}})},[e,t,n,r,o,i,a]);return{isPending:c,submitForm:d}}async function lj(e){const{data:t}=await Gt.get(`/Cluster/${e}`);return t}function Tl(e,t){return{queryKey:[e],queryFn:()=>lj(e),retry:!1,staleTime:1900,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}const i6=Object.freeze({status:"aborted"});function oe(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=a.prototype,m=Object.keys(f);for(let h=0;h<m.length;h++){const v=m[h];v in c||(c[v]=f[v].bind(c))}}const i=n?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(c){var d;const f=n?.Parent?new o:this;r(f,c),(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:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const o6=Symbol("zod_brand");class kc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class xx extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Fy={};function Pr(e){return e&&Object.assign(Fy,e),Fy}function Zme(e){return e}function Yme(e){return e}function Wme(e){}function Xme(e){throw new Error("Unexpected value in exhaustive check")}function Jme(e){}function cj(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 Ae(e,t="|"){return e.map(n=>st(n)).join(t)}function Uy(e,t){return typeof t=="bigint"?t.toString():t}function sh(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Jc(e){return e==null}function wx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function a6(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(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return a%c/10**o}const v2=Symbol("evaluating");function It(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==v2)return r===void 0&&(r=v2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Qme(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ol(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ms(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ehe(e){return ms(e._zod.def)}function the(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function nhe(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 rhe(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 BC(e){return JSON.stringify(e)}function s6(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const uj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ud(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const l6=sh(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Dc(e){if(Ud(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ud(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Sx(e){return Dc(e)?{...e}:Array.isArray(e)?[...e]:e}function ihe(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const ohe=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}`)}},Vy=new Set(["string","number","symbol"]),c6=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ls(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function No(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ke(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 ahe(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 st(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function u6(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const d6={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]},f6={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function p6(e,t){const n=e._zod.def,r=ms(e._zod.def,{get shape(){const i={};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(i[o]=n.shape[o])}return Ol(this,"shape",i),i},checks:[]});return No(e,r)}function m6(e,t){const n=e._zod.def,r=ms(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete i[o]}return Ol(this,"shape",i),i},checks:[]});return No(e,r)}function h6(e,t){if(!Dc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ms(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Ol(this,"shape",o),o},checks:[]});return No(e,i)}function g6(e,t){if(!Dc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Ol(this,"shape",r),r},checks:e._zod.def.checks};return No(e,n)}function v6(e,t){const n=ms(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Ol(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return No(e,n)}function y6(e,t,n){const r=ms(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=e?new e({type:"optional",innerType:i[a]}):i[a])}else for(const a in i)o[a]=e?new e({type:"optional",innerType:i[a]}):i[a];return Ol(this,"shape",o),o},checks:[]});return No(t,r)}function b6(e,t,n){const r=ms(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 Ol(this,"shape",o),o},checks:[]});return No(t,r)}function vc(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 Fo(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Zp(e){return typeof e=="string"?e:e?.message}function Eo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Zp(e.inst?._zod.def?.error?.(e))??Zp(t?.error?.(e))??Zp(n.customError?.(e))??Zp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function _x(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Cx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function she(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function x6(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 w6(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function lhe(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return x6(t+n)}function che(e){return w6(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function uhe(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 dhe(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class fhe{constructor(...t){}}const S6=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:f6,Class:fhe,NUMBER_FORMAT_RANGES:d6,aborted:vc,allowsEval:l6,assert:Jme,assertEqual:Zme,assertIs:Wme,assertNever:Xme,assertNotEqual:Yme,assignProp:Ol,base64ToUint8Array:x6,base64urlToUint8Array:lhe,cached:sh,captureStackTrace:uj,cleanEnum:she,cleanRegex:wx,clone:No,cloneDef:ehe,createTransparentProxy:ahe,defineLazy:It,esc:BC,escapeRegex:ls,extend:h6,finalizeIssue:Eo,floatSafeRemainder:a6,getElementAtPath:the,getEnumValues:cj,getLengthableOrigin:Cx,getParsedType:ohe,getSizableOrigin:_x,hexToUint8Array:uhe,isObject:Ud,isPlainObject:Dc,issue:Vd,joinValues:Ae,jsonStringifyReplacer:Uy,merge:v6,mergeDefs:ms,normalizeParams:ke,nullish:Jc,numKeys:ihe,objectClone:Qme,omit:m6,optionalKeys:u6,partial:y6,pick:p6,prefixIssues:Fo,primitiveTypes:c6,promiseAllObject:nhe,propertyKeyTypes:Vy,randomString:rhe,required:b6,safeExtend:g6,shallowClone:Sx,slugify:s6,stringifyPrimitive:st,uint8ArrayToBase64:w6,uint8ArrayToBase64url:che,uint8ArrayToHex:dhe,unwrapMessage:Zp},Symbol.toStringTag,{value:"Module"})),_6=(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,Uy,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kx=oe("$ZodError",_6),Ji=oe("$ZodError",_6,{Parent:Error});function dj(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 fj(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,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(t(o))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return r(e),n}function C6(e,t=n=>n.message){const n={errors:[]},r=(i,o=[])=>{var a,c;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=[]),(c=m.items)[v]??(c[v]={errors:[]}),m=m.items[v]),y&&m.errors.push(t(d)),h++}}};return r(e),n}function k6(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 E6(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 ${k6(r.path)}`);return t.join(`
47
+ `)}const lh=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 kc;if(a.issues.length){const c=new(i?.Err??e)(a.issues.map(d=>Eo(d,o,Pr())));throw uj(c,i?.callee),c}return a.value},By=lh(Ji),ch=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 c=new(i?.Err??e)(a.issues.map(d=>Eo(d,o,Pr())));throw uj(c,i?.callee),c}return a.value},Hy=ch(Ji),uh=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 kc;return o.issues.length?{success:!1,error:new(e??kx)(o.issues.map(a=>Eo(a,i,Pr())))}:{success:!0,data:o.value}},j6=uh(Ji),dh=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=>Eo(a,i,Pr())))}:{success:!0,data:o.value}},R6=dh(Ji),pj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lh(e)(t,n,i)},phe=pj(Ji),mj=e=>(t,n,r)=>lh(e)(t,n,r),mhe=mj(Ji),hj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ch(e)(t,n,i)},hhe=hj(Ji),gj=e=>async(t,n,r)=>ch(e)(t,n,r),ghe=gj(Ji),vj=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return uh(e)(t,n,i)},vhe=vj(Ji),yj=e=>(t,n,r)=>uh(e)(t,n,r),yhe=yj(Ji),bj=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return dh(e)(t,n,i)},bhe=bj(Ji),xj=e=>async(t,n,r)=>dh(e)(t,n,r),xhe=xj(Ji),I6=/^[cC][^\s-]{8,}$/,N6=/^[0-9a-z]+$/,T6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,O6=/^[0-9a-vA-V]{20}$/,A6=/^[A-Za-z0-9]{27}$/,D6=/^[a-zA-Z0-9_-]{21}$/,$6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,whe=/^[-+]?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)?)??$/,P6=/^([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})$/,Bd=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)$/,She=Bd(4),_he=Bd(6),Che=Bd(7),M6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,khe=/^[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])?)*$/,Ehe=/^(([^<>()\[\]\\.,;:\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,}))$/,z6=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,jhe=z6,Rhe=/^[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])?)*$/,Ihe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function L6(){return new RegExp(Ihe,"u")}const F6=/^(?:(?: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])$/,U6=/^(([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}|:))$/,V6=e=>{const t=ls(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},B6=/^((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])$/,H6=/^(([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}=))?$/,wj=/^[A-Za-z0-9_-]*$/,K6=/^(?=.{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])?)*\.?$/,G6=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Z6=/^\+(?:[0-9]){6,14}[0-9]$/,Y6="(?:(?:\\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])))",W6=new RegExp(`^${Y6}$`);function X6(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 J6(e){return new RegExp(`^${X6(e)}$`)}function Q6(e){const t=X6({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(`^${Y6}T(?:${r})$`)}const e3=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},t3=/^-?\d+n?$/,n3=/^-?\d+$/,r3=/^-?\d+(?:\.\d+)?/,i3=/^(?:true|false)$/i,o3=/^null$/i,a3=/^undefined$/i,s3=/^[^A-Z]*$/,l3=/^[^a-z]*$/,c3=/^[0-9a-fA-F]*$/;function fh(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ph(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const Nhe=/^[0-9a-fA-F]{32}$/,The=fh(22,"=="),Ohe=ph(22),Ahe=/^[0-9a-fA-F]{40}$/,Dhe=fh(27,"="),$he=ph(27),Phe=/^[0-9a-fA-F]{64}$/,Mhe=fh(43,"="),zhe=ph(43),Lhe=/^[0-9a-fA-F]{96}$/,Fhe=fh(64,""),Uhe=ph(64),Vhe=/^[0-9a-fA-F]{128}$/,Bhe=fh(86,"=="),Hhe=ph(86),Sj=Object.freeze(Object.defineProperty({__proto__:null,base64:q6,base64url:wj,bigint:t3,boolean:i3,browserEmail:Rhe,cidrv4:B6,cidrv6:H6,cuid:I6,cuid2:N6,date:W6,datetime:Q6,domain:G6,duration:$6,e164:Z6,email:M6,emoji:L6,extendedDuration:whe,guid:P6,hex:c3,hostname:K6,html5Email:khe,idnEmail:jhe,integer:n3,ipv4:F6,ipv6:U6,ksuid:A6,lowercase:s3,mac:V6,md5_base64:The,md5_base64url:Ohe,md5_hex:Nhe,nanoid:D6,null:o3,number:r3,rfc5322Email:Ehe,sha1_base64:Dhe,sha1_base64url:$he,sha1_hex:Ahe,sha256_base64:Mhe,sha256_base64url:zhe,sha256_hex:Phe,sha384_base64:Fhe,sha384_base64url:Uhe,sha384_hex:Lhe,sha512_base64:Bhe,sha512_base64url:Hhe,sha512_hex:Vhe,string:e3,time:J6,ulid:T6,undefined:a3,unicodeEmail:z6,uppercase:l3,uuid:Bd,uuid4:She,uuid6:_he,uuid7:Che,xid:O6},Symbol.toStringTag,{value:"Module"})),Nn=oe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),u3={number:"number",bigint:"bigint",object:"date"},_j=oe("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const n=u3[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:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cj=oe("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const n=u3[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:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),d3=oe("$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):a6(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})}}),f3=oe("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=d6[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=i,c.maximum=o,n&&(c.pattern=n3)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}c<i&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inst:e})}}),p3=oe("$ZodCheckBigIntFormat",(e,t)=>{Nn.init(e,t);const[n,r]=f6[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,inst:e})}}),m3=oe("$ZodCheckMaxSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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:_x(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),h3=oe("$ZodCheckMinSize",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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:_x(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),g3=oe("$ZodCheckSizeEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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:_x(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})}}),v3=oe("$ZodCheckMaxLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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=Cx(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),y3=oe("$ZodCheckMinLength",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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=Cx(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),b3=oe("$ZodCheckLengthEquals",(e,t)=>{var n;Nn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Jc(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=Cx(i),c=o>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),mh=oe("$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=()=>{})}),x3=oe("$ZodCheckRegex",(e,t)=>{mh.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})}}),w3=oe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=s3),mh.init(e,t)}),S3=oe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=l3),mh.init(e,t)}),_3=oe("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const n=ls(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})}}),C3=oe("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`^${ls(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})}}),k3=oe("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const n=new RegExp(`.*${ls(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 y2(e,t,n){e.issues.length&&t.issues.push(...Fo(n,e.issues))}const E3=oe("$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=>y2(i,n,t.property));y2(r,n,t.property)}}),j3=oe("$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})}}),R3=oe("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class I3{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(`
48
+ `).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(`
49
+ `))}}const N3={major:4,minor:2,patch:1},dt=oe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=N3;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,c,d)=>{let f=vc(a),m;for(const h of c){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 kc;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,a.issues.length!==v&&(f||(f=vc(a,v)))});else{if(a.issues.length===v)continue;f||(f=vc(a,v))}}return m?m.then(()=>a):a},o=(a,c,d)=>{if(vc(a))return a.aborted=!0,a;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new kc;return f.then(m=>e._zod.parse(m,d))}return e._zod.parse(f,d)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const f=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(m=>o(m,a,c)):o(f,a,c)}const d=e._zod.parse(a,c);if(d instanceof Promise){if(c.async===!1)throw new kc;return d.then(f=>i(f,r,c))}return i(d,r,c)}}e["~standard"]={validate:i=>{try{const o=j6(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return R6(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),hh=oe("$ZodString",(e,t)=>{dt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??e3(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}}),fn=oe("$ZodStringFormat",(e,t)=>{mh.init(e,t),hh.init(e,t)}),T3=oe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=P6),fn.init(e,t)}),O3=oe("$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=Bd(r))}else t.pattern??(t.pattern=Bd());fn.init(e,t)}),A3=oe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=M6),fn.init(e,t)}),D3=oe("$ZodURL",(e,t)=>{fn.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})}}}),$3=oe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L6()),fn.init(e,t)}),P3=oe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=D6),fn.init(e,t)}),M3=oe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=I6),fn.init(e,t)}),z3=oe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=N6),fn.init(e,t)}),L3=oe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=T6),fn.init(e,t)}),F3=oe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=O6),fn.init(e,t)}),U3=oe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=A6),fn.init(e,t)}),V3=oe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Q6(t)),fn.init(e,t)}),B3=oe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=W6),fn.init(e,t)}),H3=oe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=J6(t)),fn.init(e,t)}),q3=oe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=$6),fn.init(e,t)}),K3=oe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=F6),fn.init(e,t),e._zod.bag.format="ipv4"}),G3=oe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=U6),fn.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})}}}),Z3=oe("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=V6(t.delimiter)),fn.init(e,t),e._zod.bag.format="mac"}),Y3=oe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=B6),fn.init(e,t)}),W3=oe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=H6),fn.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 kj(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const X3=oe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=q6),fn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{kj(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function J3(e){if(!wj.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return kj(n)}const Q3=oe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=wj),fn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{J3(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),e5=oe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Z6),fn.init(e,t)});function t5(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 n5=oe("$ZodJWT",(e,t)=>{fn.init(e,t),e._zod.check=n=>{t5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),r5=oe("$ZodCustomStringFormat",(e,t)=>{fn.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})}}),Ej=oe("$ZodNumber",(e,t)=>{dt.init(e,t),e._zod.pattern=e._zod.bag.pattern??r3,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}}),i5=oe("$ZodNumberFormat",(e,t)=>{f3.init(e,t),Ej.init(e,t)}),jj=oe("$ZodBoolean",(e,t)=>{dt.init(e,t),e._zod.pattern=i3,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}}),Rj=oe("$ZodBigInt",(e,t)=>{dt.init(e,t),e._zod.pattern=t3,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}}),o5=oe("$ZodBigIntFormat",(e,t)=>{p3.init(e,t),Rj.init(e,t)}),a5=oe("$ZodSymbol",(e,t)=>{dt.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}}),s5=oe("$ZodUndefined",(e,t)=>{dt.init(e,t),e._zod.pattern=a3,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}}),l5=oe("$ZodNull",(e,t)=>{dt.init(e,t),e._zod.pattern=o3,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}}),c5=oe("$ZodAny",(e,t)=>{dt.init(e,t),e._zod.parse=n=>n}),u5=oe("$ZodUnknown",(e,t)=>{dt.init(e,t),e._zod.parse=n=>n}),d5=oe("$ZodNever",(e,t)=>{dt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),f5=oe("$ZodVoid",(e,t)=>{dt.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}}),p5=oe("$ZodDate",(e,t)=>{dt.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 b2(e,t,n){e.issues.length&&t.issues.push(...Fo(n,e.issues)),t.value[n]=e.value}const m5=oe("$ZodArray",(e,t)=>{dt.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 c=i[a],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?o.push(d.then(f=>b2(f,n,a))):b2(d,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function qy(e,t,n,r){e.issues.length&&t.issues.push(...Fo(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function h5(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=u6(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function g5(e,t,n,r,i,o){const a=[],c=i.keySet,d=i.catchall._zod,f=d.def.type;for(const m in t){if(c.has(m))continue;if(f==="never"){a.push(m);continue}const h=d.run({value:t[m],issues:[]},r);h instanceof Promise?e.push(h.then(v=>qy(v,n,m,t))):qy(h,n,m,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const v5=oe("$ZodObject",(e,t)=>{if(dt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=sh(()=>h5(t));It(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const m=c[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=Ud,o=t.catchall;let a;e._zod.parse=(c,d)=>{a??(a=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const m=[],h=a.shape;for(const v of a.keys){const x=h[v]._zod.run({value:f[v],issues:[]},d);x instanceof Promise?m.push(x.then(S=>qy(S,c,v,f))):qy(x,c,v,f)}return o?g5(m,f,c,d,r.value,e):m.length?Promise.all(m).then(()=>c):c}}),y5=oe("$ZodObjectJIT",(e,t)=>{v5.init(e,t);const n=e._zod.parse,r=sh(()=>h5(t)),i=v=>{const y=new I3(["shape","payload","ctx"]),x=r.value,S=j=>{const R=BC(j);return`shape[${R}]._zod.run({ value: input[${R}], 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 R=C[j],T=BC(j);y.write(`const ${R} = ${S(j)};`),y.write(`
50
+ if (${R}.issues.length) {
51
+ payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
52
+ ...iss,
53
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
54
+ })));
55
+ }
56
+
57
+
58
+ if (${R}.value === undefined) {
59
+ if (${T} in input) {
60
+ newResult[${T}] = undefined;
61
+ }
62
+ } else {
63
+ newResult[${T}] = ${R}.value;
64
+ }
65
+
66
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(j,R)=>E(v,j,R)};let o;const a=Ud,c=!Fy.jitless,f=c&&l6.value,m=t.catchall;let h;e._zod.parse=(v,y)=>{h??(h=r.value);const x=v.value;return a(x)?c&&f&&y?.async===!1&&y.jitless!==!0?(o||(o=i(t.shape)),v=o(v,y),m?g5([],x,v,y,h,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),v)}});function x2(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=>!vc(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=>Eo(a,r,Pr())))}),t)}const Ex=oe("$ZodUnion",(e,t)=>{dt.init(e,t),It(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),It(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=>wx(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 c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);if(f instanceof Promise)c.push(f),a=!0;else{if(f.issues.length===0)return f;c.push(f)}}return a?Promise.all(c).then(d=>x2(d,i,e,o)):x2(c,i,e,o)}});function w2(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=>Eo(a,r,Pr())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const b5=oe("$ZodXor",(e,t)=>{Ex.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 c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},o);f instanceof Promise?(c.push(f),a=!0):c.push(f)}return a?Promise.all(c).then(d=>w2(d,i,e,o)):w2(c,i,e,o)}}),x5=oe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ex.init(e,t);const n=e._zod.parse;It(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[c,d]of Object.entries(a)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=sh(()=>{const i=t.options,o=new Map;for(const a of i){const c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const d of c){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(!Ud(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const c=r.value.get(a?.[t.discriminator]);return c?c._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)}}),w5=oe("$ZodIntersection",(e,t)=>{dt.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])=>S2(n,d,f)):S2(n,o,a)}});function HC(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(Dc(e)&&Dc(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=HC(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=HC(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 S2(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),vc(e))return e;const r=HC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Ij=oe("$ZodTuple",(e,t)=>{dt.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=[],c=[...n].reverse().findIndex(m=>m._zod.optin!=="optional"),d=c===-1?0:n.length-c;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}:{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=>Sv(v,r,f))):Sv(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=>Sv(y,r,f))):Sv(v,r,f)}}return a.length?Promise.all(a).then(()=>r):r}});function Sv(e,t,n){e.issues.length&&t.issues.push(...Fo(n,e.issues)),t.value[n]=e.value}const S5=oe("$ZodRecord",(e,t)=>{dt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Dc(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 c=new Set;for(const f of a)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.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(...Fo(f,h.issues)),n.value[f]=h.value})):(m.issues.length&&n.issues.push(...Fo(f,m.issues)),n.value[f]=m.value)}let d;for(const f in i)c.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 c of Reflect.ownKeys(i)){if(c==="__proto__")continue;const d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Eo(m,r,Pr())),input:c,path:[c],inst:e});continue}const f=t.valueType._zod.run({value:i[c],issues:[]},r);f instanceof Promise?o.push(f.then(m=>{m.issues.length&&n.issues.push(...Fo(c,m.issues)),n.value[d.value]=m.value})):(f.issues.length&&n.issues.push(...Fo(c,f.issues)),n.value[d.value]=f.value)}}return o.length?Promise.all(o).then(()=>n):n}}),_5=oe("$ZodMap",(e,t)=>{dt.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,c]of i){const d=t.keyType._zod.run({value:a,issues:[]},r),f=t.valueType._zod.run({value:c,issues:[]},r);d instanceof Promise||f instanceof Promise?o.push(Promise.all([d,f]).then(([m,h])=>{_2(m,h,n,a,i,e,r)})):_2(d,f,n,a,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function _2(e,t,n,r,i,o,a){e.issues.length&&(Vy.has(typeof r)?n.issues.push(...Fo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(c=>Eo(c,a,Pr()))})),t.issues.length&&(Vy.has(typeof r)?n.issues.push(...Fo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(c=>Eo(c,a,Pr()))})),n.value.set(e.value,t.value)}const C5=oe("$ZodSet",(e,t)=>{dt.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 c=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise?o.push(c.then(d=>C2(d,n))):C2(c,n)}return o.length?Promise.all(o).then(()=>n):n}});function C2(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const k5=oe("$ZodEnum",(e,t)=>{dt.init(e,t);const n=cj(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>Vy.has(typeof i)).map(i=>typeof i=="string"?ls(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}}),E5=oe("$ZodLiteral",(e,t)=>{if(dt.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"?ls(r):r?ls(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}}),j5=oe("$ZodFile",(e,t)=>{dt.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}}),R5=oe("$ZodTransform",(e,t)=>{dt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xx(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 kc;return n.value=i,n}});function k2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const I5=oe("$ZodOptional",(e,t)=>{dt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${wx(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=>k2(o,n.value)):k2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),N5=oe("$ZodNullable",(e,t)=>{dt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${wx(n.source)}|null)$`):void 0}),It(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)}),T5=oe("$ZodDefault",(e,t)=>{dt.init(e,t),e._zod.optin="optional",It(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=>E2(o,t)):E2(i,t)}});function E2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const O5=oe("$ZodPrefault",(e,t)=>{dt.init(e,t),e._zod.optin="optional",It(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))}),A5=oe("$ZodNonOptional",(e,t)=>{dt.init(e,t),It(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=>j2(o,e)):j2(i,e)}});function j2(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 D5=oe("$ZodSuccess",(e,t)=>{dt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xx("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)}}),$5=oe("$ZodCatch",(e,t)=>{dt.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(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=>Eo(a,r,Pr()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Eo(o,r,Pr()))},input:n.value}),n.issues=[]),n)}}),P5=oe("$ZodNaN",(e,t)=>{dt.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)}),M5=oe("$ZodPipe",(e,t)=>{dt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(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=>_v(a,t.in,r)):_v(o,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>_v(o,t.out,r)):_v(i,t.out,r)}});function _v(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Nj=oe("$ZodCodec",(e,t)=>{dt.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(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=>Cv(a,t,r)):Cv(o,t,r)}else{const o=t.out._zod.run(n,r);return o instanceof Promise?o.then(a=>Cv(a,t,r)):Cv(o,t,r)}}});function Cv(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=>kv(e,o,t.out,n)):kv(e,i,t.out,n)}else{const i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>kv(e,o,t.in,n)):kv(e,i,t.in,n)}}function kv(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const z5=oe("$ZodReadonly",(e,t)=>{dt.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(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(R2):R2(i)}});function R2(e){return e.value=Object.freeze(e.value),e}const L5=oe("$ZodTemplateLiteral",(e,t)=>{dt.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||c6.has(typeof r))n.push(ls(`${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:"template_literal",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)}),F5=oe("$ZodFunction",(e,t)=>(dt.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?By(e._def.input,r):r,o=Reflect.apply(n,this,i);return e._def.output?By(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 Hy(e._def.input,r):r,o=await Reflect.apply(n,this,i);return e._def.output?await Hy(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 Ij({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)),U5=oe("$ZodPromise",(e,t)=>{dt.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),V5=oe("$ZodLazy",(e,t)=>{dt.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),It(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),It(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),It(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),B5=oe("$ZodCustom",(e,t)=>{Nn.init(e,t),dt.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=>I2(o,n,r,e));I2(i,n,r,e)}});function I2(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(Vd(i))}}const qhe=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"مدخل"};return i=>{switch(i.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${i.expected}، ولكن تم إدخال ${n(i.input)}`;case"invalid_value":return i.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${st(i.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${Ae(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}`:`${r[o.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${Ae(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function Khe(){return{localeError:qhe()}}const Ghe=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${i.expected}, daxil olan ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Yanlış dəyər: gözlənilən ${st(i.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Ae(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ış ${r[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":""}: ${Ae(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 Zhe(){return{localeError:Ghe()}}function N2(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 Yhe=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"лік";case"object":{if(Array.isArray(i))return"масіў";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"увод"};return i=>{switch(i.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${i.expected}, атрымана ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Няправільны ўвод: чакалася ${st(i.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${Ae(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const c=Number(i.maximum),d=N2(c,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 c=Number(i.minimum),d=N2(c,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}`:`Няправільны ${r[o.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${Ae(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function Whe(){return{localeError:Yhe()}}const Xhe=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":{if(Array.isArray(e))return"масив";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Jhe=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??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:"вход"};return r=>{switch(r.code){case"invalid_type":return`Невалиден вход: очакван ${r.expected}, получен ${Xhe(r.input)}`;case"invalid_value":return r.values.length===1?`Невалиден вход: очакван ${st(r.values[0])}`:`Невалидна опция: очаквано едно от ${Ae(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${o.unit??"елемента"}`:`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${o.unit}`:`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let o="Невалиден";return i.format==="emoji"&&(o="Невалидно"),i.format==="datetime"&&(o="Невалидно"),i.format==="date"&&(o="Невалидна"),i.format==="time"&&(o="Невалидно"),i.format==="duration"&&(o="Невалидна"),`${o} ${n[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${Ae(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};function Qhe(){return{localeError:Jhe()}}const ege=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Tipus invàlid: s'esperava ${i.expected}, s'ha rebut ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Valor invàlid: s'esperava ${st(i.values[0])}`:`Opció invàlida: s'esperava una de ${Ae(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 ${r[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":""}: ${Ae(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 tge(){return{localeError:ege()}}const nge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(i))return"pole";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Neplatný vstup: očekáváno ${i.expected}, obdrženo ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Neplatný vstup: očekáváno ${st(i.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${Ae(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 ${r[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: ${Ae(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 rge(){return{localeError:nge()}}const ige=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(a){return e[a]??null}function r(a){return t[a]??a}const i=a=>{const c=typeof a;switch(c){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return c},o={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"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${r(a.expected)}, fik ${r(i(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig værdi: forventede ${st(a.values[0])}`:`Ugyldigt valg: forventede en af følgende ${Ae(a.values,"|")}`;case"too_big":{const c=a.inclusive?"<=":"<",d=n(a.origin),f=r(a.origin);return d?`For stor: forventede ${f??"value"} ${d.verb} ${c} ${a.maximum.toString()} ${d.unit??"elementer"}`:`For stor: forventede ${f??"value"} havde ${c} ${a.maximum.toString()}`}case"too_small":{const c=a.inclusive?">=":">",d=n(a.origin),f=r(a.origin);return d?`For lille: forventede ${f} ${d.verb} ${c} ${a.minimum.toString()} ${d.unit}`:`For lille: forventede ${f} havde ${c} ${a.minimum.toString()}`}case"invalid_format":{const c=a;return c.format==="starts_with"?`Ugyldig streng: skal starte med "${c.prefix}"`:c.format==="ends_with"?`Ugyldig streng: skal ende med "${c.suffix}"`:c.format==="includes"?`Ugyldig streng: skal indeholde "${c.includes}"`:c.format==="regex"?`Ugyldig streng: skal matche mønsteret ${c.pattern}`:`Ugyldig ${o[c.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${Ae(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function oge(){return{localeError:ige()}}const age=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"Zahl";case"object":{if(Array.isArray(i))return"Array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${i.expected}, erhalten ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ungültige Eingabe: erwartet ${st(i.values[0])}`:`Ungültige Option: erwartet eine von ${Ae(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: ${r[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"}: ${Ae(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 sge(){return{localeError:age()}}const lge=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},cge=()=>{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"}};function t(r){return e[r]??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"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${lge(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${st(r.values[0])}`:`Invalid option: expected one of ${Ae(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${o.unit}`:`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Ae(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function H5(){return{localeError:cge()}}const uge=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},dge=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??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"};return r=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${r.expected}, riceviĝis ${uge(r.input)}`;case"invalid_value":return r.values.length===1?`Nevalida enigo: atendiĝis ${st(r.values[0])}`:`Nevalida opcio: atendiĝis unu el ${Ae(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${o.unit}`:`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${Ae(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function fge(){return{localeError:dge()}}const pge=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={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"};function n(a){return e[a]??null}function r(a){return t[a]??a}const i=a=>{const c=typeof a;switch(c){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return c},o={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"};return a=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${r(a.expected)}, recibido ${r(i(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inválida: se esperaba ${st(a.values[0])}`:`Opción inválida: se esperaba una de ${Ae(a.values,"|")}`;case"too_big":{const c=a.inclusive?"<=":"<",d=n(a.origin),f=r(a.origin);return d?`Demasiado grande: se esperaba que ${f??"valor"} tuviera ${c}${a.maximum.toString()} ${d.unit??"elementos"}`:`Demasiado grande: se esperaba que ${f??"valor"} fuera ${c}${a.maximum.toString()}`}case"too_small":{const c=a.inclusive?">=":">",d=n(a.origin),f=r(a.origin);return d?`Demasiado pequeño: se esperaba que ${f} tuviera ${c}${a.minimum.toString()} ${d.unit}`:`Demasiado pequeño: se esperaba que ${f} fuera ${c}${a.minimum.toString()}`}case"invalid_format":{const c=a;return c.format==="starts_with"?`Cadena inválida: debe comenzar con "${c.prefix}"`:c.format==="ends_with"?`Cadena inválida: debe terminar en "${c.suffix}"`:c.format==="includes"?`Cadena inválida: debe incluir "${c.includes}"`:c.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${c.pattern}`:`Inválido ${o[c.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${Ae(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r(a.origin)}`;default:return"Entrada inválida"}}};function mge(){return{localeError:pge()}}const hge=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"عدد";case"object":{if(Array.isArray(i))return"آرایه";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ورودی"};return i=>{switch(i.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${i.expected} می‌بود، ${n(i.input)} دریافت شد`;case"invalid_value":return i.values.length===1?`ورودی نامعتبر: می‌بایست ${st(i.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${Ae(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} مطابقت داشته باشد`:`${r[o.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${Ae(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function gge(){return{localeError:hge()}}const vge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Virheellinen syöte: täytyy olla ${st(i.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${Ae(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 ${r[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"}: ${Ae(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 yge(){return{localeError:vge()}}const bge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nombre";case"object":{if(Array.isArray(i))return"tableau";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Entrée invalide : ${i.expected} attendu, ${n(i.input)} reçu`;case"invalid_value":return i.values.length===1?`Entrée invalide : ${st(i.values[0])} attendu`:`Option invalide : une valeur parmi ${Ae(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}`:`${r[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":""} : ${Ae(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 xge(){return{localeError:bge()}}const wge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Entrée invalide : attendu ${i.expected}, reçu ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Entrée invalide : attendu ${st(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Ae(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}`:`${r[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":""} : ${Ae(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 Sge(){return{localeError:wge()}}const _ge=()=>{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,c=f=>{const m=typeof f;switch(m){case"number":return Number.isNaN(f)?"NaN":"number";case"object":return Array.isArray(f)?"array":f===null?"null":Object.getPrototypeOf(f)!==Object.prototype&&f.constructor?f.constructor.name:"object";default:return m}},d={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"}};return f=>{switch(f.code){case"invalid_type":{const m=f.expected,h=r(m),v=c(f.input),y=e[v]?.label??v;return`קלט לא תקין: צריך להיות ${h}, התקבל ${y}`}case"invalid_value":{if(f.values.length===1)return`ערך לא תקין: הערך חייב להיות ${st(f.values[0])}`;const m=f.values.map(y=>st(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=d[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?"ים":"ה"}: ${Ae(f.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i(f.origin??"array")}`;default:return"קלט לא תקין"}}};function Cge(){return{localeError:_ge()}}const kge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"szám";case"object":{if(Array.isArray(i))return"tömb";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${i.expected}, a kapott érték ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Érvénytelen bemenet: a várt érték ${st(i.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${Ae(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 ${r[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":""}: ${Ae(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 Ege(){return{localeError:kge()}}const jge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${st(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Ae(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}`:`${r[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":""}: ${Ae(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 Rge(){return{localeError:jge()}}const Ige=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Nge=()=>{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(r){return e[r]??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"};return r=>{switch(r.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Ige(r.input)} þar sem á að vera ${r.expected}`;case"invalid_value":return r.values.length===1?`Rangt gildi: gert ráð fyrir ${st(r.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${Ae(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${o.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${o.unit}`:`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Ógildur strengur: verður að byrja á "${i.prefix}"`:i.format==="ends_with"?`Ógildur strengur: verður að enda á "${i.suffix}"`:i.format==="includes"?`Ógildur strengur: verður að innihalda "${i.includes}"`:i.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${Ae(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};function Tge(){return{localeError:Nge()}}const Oge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"numero";case"object":{if(Array.isArray(i))return"vettore";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input non valido: atteso ${st(i.values[0])}`:`Opzione non valida: atteso uno tra ${Ae(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 ${r[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"}: ${Ae(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 Age(){return{localeError:Oge()}}const Dge=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"数値";case"object":{if(Array.isArray(i))return"配列";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"入力値"};return i=>{switch(i.code){case"invalid_type":return`無効な入力: ${i.expected}が期待されましたが、${n(i.input)}が入力されました`;case"invalid_value":return i.values.length===1?`無効な入力: ${st(i.values[0])}が期待されました`:`無効な選択: ${Ae(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}に一致する必要があります`:`無効な${r[o.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${Ae(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function $ge(){return{localeError:Dge()}}const Pge=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[t]??t},Mge=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??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:"შეყვანა"};return r=>{switch(r.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${r.expected}, მიღებული ${Pge(r.input)}`;case"invalid_value":return r.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${st(r.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${Ae(r.values,"|")}-დან`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${o.verb} ${i}${r.maximum.toString()} ${o.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${o.verb} ${i}${r.minimum.toString()} ${o.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${i.prefix}"-ით`:i.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${i.suffix}"-ით`:i.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${i.includes}"-ს`:i.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`:`არასწორი ${n[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${Ae(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};function zge(){return{localeError:Mge()}}const Lge=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(i))return"អារេ (Array)";if(i===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ទិន្នន័យបញ្ចូល"};return i=>{switch(i.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i.expected} ប៉ុន្តែទទួលបាន ${n(i.input)}`;case"invalid_value":return i.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${st(i.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${Ae(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}`:`មិនត្រឹមត្រូវ៖ ${r[o.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${Ae(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function q5(){return{localeError:Lge()}}function Fge(){return q5()}const Uge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"입력"};return i=>{switch(i.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${i.expected}, 받은 타입은 ${n(i.input)}입니다`;case"invalid_value":return i.values.length===1?`잘못된 입력: 값은 ${st(i.values[0])} 이어야 합니다`:`잘못된 옵션: ${Ae(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=i.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",c=t(i.origin),d=c?.unit??"요소";return c?`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${d} ${o}${a}`:`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${o}${a}`}case"too_small":{const o=i.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",c=t(i.origin),d=c?.unit??"요소";return c?`${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} 패턴과 일치해야 합니다`:`잘못된 ${r[o.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${Ae(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=e=>Yp(typeof e,e),Yp=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"nežinomas objektas":t===null?"nulinė reikšmė":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulinė reikšmė"}return e},Pp=e=>e.charAt(0).toUpperCase()+e.slice(1);function T2(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 Hge=()=>{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(r,i,o,a){const c=e[r]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[a][o?"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"};return r=>{switch(r.code){case"invalid_type":return`Gautas tipas ${Bge(r.input)}, o tikėtasi - ${Yp(r.expected)}`;case"invalid_value":return r.values.length===1?`Privalo būti ${st(r.values[0])}`:`Privalo būti vienas iš ${Ae(r.values,"|")} pasirinkimų`;case"too_big":{const i=Yp(r.origin),o=t(r.origin,T2(Number(r.maximum)),r.inclusive??!1,"smaller");if(o?.verb)return`${Pp(i??r.origin??"reikšmė")} ${o.verb} ${r.maximum.toString()} ${o.unit??"elementų"}`;const a=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Pp(i??r.origin??"reikšmė")} turi būti ${a} ${r.maximum.toString()} ${o?.unit}`}case"too_small":{const i=Yp(r.origin),o=t(r.origin,T2(Number(r.minimum)),r.inclusive??!1,"bigger");if(o?.verb)return`${Pp(i??r.origin??"reikšmė")} ${o.verb} ${r.minimum.toString()} ${o.unit??"elementų"}`;const a=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Pp(i??r.origin??"reikšmė")} turi būti ${a} ${r.minimum.toString()} ${o?.unit}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Eilutė privalo prasidėti "${i.prefix}"`:i.format==="ends_with"?`Eilutė privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilutė privalo įtraukti "${i.includes}"`:i.format==="regex"?`Eilutė privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${Ae(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const i=Yp(r.origin);return`${Pp(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function qge(){return{localeError:Hge()}}const Kge=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"број";case"object":{if(Array.isArray(i))return"низа";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"внес"};return i=>{switch(i.code){case"invalid_type":return`Грешен внес: се очекува ${i.expected}, примено ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${st(i.values[0])}`:`Грешана опција: се очекува една ${Ae(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 ${r[o.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${Ae(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function Gge(){return{localeError:Kge()}}const Zge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nombor";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${st(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Ae(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}`:`${r[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: ${Ae(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 Yge(){return{localeError:Zge()}}const Wge=()=>{const e={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"getal";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${st(i.values[0])}`:`Ongeldige optie: verwacht één van ${Ae(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Te groot: verwacht dat ${i.origin??"waarde"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{const o=i.inclusive?">=":">",a=t(i.origin);return a?`Te klein: verwacht dat ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Te klein: 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: ${r[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":""}: ${Ae(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 Xge(){return{localeError:Wge()}}const Jge=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"tall";case"object":{if(Array.isArray(i))return"liste";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${st(i.values[0])}`:`Ugyldig valg: forventet en av ${Ae(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 ${r[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"}: ${Ae(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 Qge(){return{localeError:Jge()}}const eve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"numara";case"object":{if(Array.isArray(i))return"saf";if(i===null)return"gayb";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Fâsit giren: umulan ${i.expected}, alınan ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Fâsit giren: umulan ${st(i.values[0])}`:`Fâsit tercih: mûteberler ${Ae(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 ${r[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":""}: ${Ae(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 tve(){return{localeError:eve()}}const nve=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"عدد";case"object":{if(Array.isArray(i))return"ارې";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ورودي"};return i=>{switch(i.code){case"invalid_type":return`ناسم ورودي: باید ${i.expected} وای, مګر ${n(i.input)} ترلاسه شو`;case"invalid_value":return i.values.length===1?`ناسم ورودي: باید ${st(i.values[0])} وای`:`ناسم انتخاب: باید یو له ${Ae(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} سره مطابقت ولري`:`${r[o.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${Ae(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function rve(){return{localeError:nve()}}const ive=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"liczba";case"object":{if(Array.isArray(i))return"tablica";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${i.expected}, otrzymano ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${st(i.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${Ae(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) ${r[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":""}: ${Ae(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 ove(){return{localeError:ive()}}const ave=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"número";case"object":{if(Array.isArray(i))return"array";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Tipo inválido: esperado ${i.expected}, recebido ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inválida: esperado ${st(i.values[0])}`:`Opção inválida: esperada uma das ${Ae(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}`:`${r[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":""}: ${Ae(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 sve(){return{localeError:ave()}}function O2(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 lve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"число";case"object":{if(Array.isArray(i))return"массив";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ввод"};return i=>{switch(i.code){case"invalid_type":return`Неверный ввод: ожидалось ${i.expected}, получено ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Неверный ввод: ожидалось ${st(i.values[0])}`:`Неверный вариант: ожидалось одно из ${Ae(i.values,"|")}`;case"too_big":{const o=i.inclusive?"<=":"<",a=t(i.origin);if(a){const c=Number(i.maximum),d=O2(c,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 c=Number(i.minimum),d=O2(c,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}`:`Неверный ${r[o.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${Ae(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function cve(){return{localeError:lve()}}const uve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"število";case"object":{if(Array.isArray(i))return"tabela";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${i.expected}, prejeto ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Neveljaven vnos: pričakovano ${st(i.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${Ae(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 ${r[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č"}: ${Ae(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 dve(){return{localeError:uve()}}const fve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"antal";case"object":{if(Array.isArray(i))return"lista";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${i.expected}, fick ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ogiltig inmatning: förväntat ${st(i.values[0])}`:`Ogiltigt val: förväntade en av ${Ae(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) ${r[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"}: ${Ae(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 pve(){return{localeError:fve()}}const mve=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(i))return"அணி";if(i===null)return"வெறுமை";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i.expected}, பெறப்பட்டது ${n(i.input)}`;case"invalid_value":return i.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${st(i.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${Ae(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} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[o.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${Ae(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function hve(){return{localeError:mve()}}const gve=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(i))return"อาร์เรย์ (Array)";if(i===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ข้อมูลที่ป้อน"};return i=>{switch(i.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i.expected} แต่ได้รับ ${n(i.input)}`;case"invalid_value":return i.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${st(i.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${Ae(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}`:`รูปแบบไม่ถูกต้อง: ${r[o.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${Ae(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function vve(){return{localeError:gve()}}const yve=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},bve=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??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"};return r=>{switch(r.code){case"invalid_type":return`Geçersiz değer: beklenen ${r.expected}, alınan ${yve(r.input)}`;case"invalid_value":return r.values.length===1?`Geçersiz değer: beklenen ${st(r.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${Ae(r.values,"|")}`;case"too_big":{const i=r.inclusive?"<=":"<",o=t(r.origin);return o?`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${o.unit??"öğe"}`:`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{const i=r.inclusive?">=":">",o=t(r.origin);return o?`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${o.unit}`:`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{const i=r;return i.format==="starts_with"?`Geçersiz metin: "${i.prefix}" ile başlamalı`:i.format==="ends_with"?`Geçersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Geçersiz metin: "${i.includes}" içermeli`:i.format==="regex"?`Geçersiz metin: ${i.pattern} desenine uymalı`:`Geçersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${Ae(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"число";case"object":{if(Array.isArray(i))return"масив";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"вхідні дані"};return i=>{switch(i.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${i.expected}, отримано ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Неправильні вхідні дані: очікується ${st(i.values[0])}`:`Неправильна опція: очікується одне з ${Ae(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}`:`Неправильний ${r[o.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${Ae(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function K5(){return{localeError:wve()}}function Sve(){return K5()}const _ve=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"نمبر";case"object":{if(Array.isArray(i))return"آرے";if(i===null)return"نل";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"ان پٹ"};return i=>{switch(i.code){case"invalid_type":return`غلط ان پٹ: ${i.expected} متوقع تھا، ${n(i.input)} موصول ہوا`;case"invalid_value":return i.values.length===1?`غلط ان پٹ: ${st(i.values[0])} متوقع تھا`:`غلط آپشن: ${Ae(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} سے میچ ہونا چاہیے`:`غلط ${r[o.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${Ae(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Cve(){return{localeError:_ve()}}const kve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"số";case"object":{if(Array.isArray(i))return"mảng";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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"};return i=>{switch(i.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${i.expected}, nhận được ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Đầu vào không hợp lệ: mong đợi ${st(i.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${Ae(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}`:`${r[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: ${Ae(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 Eve(){return{localeError:kve()}}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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(i))return"数组";if(i===null)return"空值(null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"输入"};return i=>{switch(i.code){case"invalid_type":return`无效输入:期望 ${i.expected},实际接收 ${n(i.input)}`;case"invalid_value":return i.values.length===1?`无效输入:期望 ${st(i.values[0])}`:`无效选项:期望以下之一 ${Ae(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}`:`无效${r[o.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${Ae(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Rve(){return{localeError:jve()}}const Ive=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(i){return e[i]??null}const n=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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:"輸入"};return i=>{switch(i.code){case"invalid_type":return`無效的輸入值:預期為 ${i.expected},但收到 ${n(i.input)}`;case"invalid_value":return i.values.length===1?`無效的輸入值:預期為 ${st(i.values[0])}`:`無效的選項:預期為以下其中之一 ${Ae(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}`:`無效的 ${r[o.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${Ae(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Nve(){return{localeError:Ive()}}const Tve=()=>{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=i=>{const o=typeof i;switch(o){case"number":return Number.isNaN(i)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(i))return"akopọ";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return o},r={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é"};return i=>{switch(i.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${i.expected}, àmọ̀ a rí ${n(i.input)}`;case"invalid_value":return i.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${st(i.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${Ae(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: ${r[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ọ̀: ${Ae(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 Ove(){return{localeError:Tve()}}const G5=Object.freeze(Object.defineProperty({__proto__:null,ar:Khe,az:Zhe,be:Whe,bg:Qhe,ca:tge,cs:rge,da:oge,de:sge,en:H5,eo:fge,es:mge,fa:gge,fi:yge,fr:xge,frCA:Sge,he:Cge,hu:Ege,id:Rge,is:Tge,it:Age,ja:$ge,ka:zge,kh:Fge,km:q5,ko:Vge,lt:qge,mk:Gge,ms:Yge,nl:Xge,no:Qge,ota:tve,pl:ove,ps:rve,pt:sve,ru:cve,sl:dve,sv:pve,ta:hve,th:vve,tr:xve,ua:Sve,uk:K5,ur:Cve,vi:Eve,yo:Ove,zhCN:Rve,zhTW:Nve},Symbol.toStringTag,{value:"Module"}));var A2;const Z5=Symbol("ZodOutput"),Y5=Symbol("ZodInput");class W5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return 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 Tj(){return new W5}(A2=globalThis).__zod_globalRegistry??(A2.__zod_globalRegistry=Tj());const Uo=globalThis.__zod_globalRegistry;function X5(e,t){return new e({type:"string",...ke(t)})}function J5(e,t){return new e({type:"string",coerce:!0,...ke(t)})}function Oj(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Ky(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function Aj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function Dj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function $j(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function Pj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function jx(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function Mj(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function zj(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function Lj(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function Fj(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function Uj(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function Vj(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function Bj(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function Hj(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function qj(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function Q5(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ke(t)})}function Kj(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function Gj(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function Zj(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function Yj(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function Wj(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function Xj(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}const eV={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function tV(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function nV(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function rV(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function iV(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function oV(e,t){return new e({type:"number",checks:[],...ke(t)})}function aV(e,t){return new e({type:"number",coerce:!0,checks:[],...ke(t)})}function sV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}function lV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ke(t)})}function cV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ke(t)})}function uV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ke(t)})}function dV(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ke(t)})}function fV(e,t){return new e({type:"boolean",...ke(t)})}function pV(e,t){return new e({type:"boolean",coerce:!0,...ke(t)})}function mV(e,t){return new e({type:"bigint",...ke(t)})}function hV(e,t){return new e({type:"bigint",coerce:!0,...ke(t)})}function gV(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ke(t)})}function vV(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ke(t)})}function yV(e,t){return new e({type:"symbol",...ke(t)})}function bV(e,t){return new e({type:"undefined",...ke(t)})}function xV(e,t){return new e({type:"null",...ke(t)})}function wV(e){return new e({type:"any"})}function SV(e){return new e({type:"unknown"})}function _V(e,t){return new e({type:"never",...ke(t)})}function CV(e,t){return new e({type:"void",...ke(t)})}function kV(e,t){return new e({type:"date",...ke(t)})}function EV(e,t){return new e({type:"date",coerce:!0,...ke(t)})}function jV(e,t){return new e({type:"nan",...ke(t)})}function xl(e,t){return new _j({check:"less_than",...ke(t),value:e,inclusive:!1})}function Co(e,t){return new _j({check:"less_than",...ke(t),value:e,inclusive:!0})}function wl(e,t){return new Cj({check:"greater_than",...ke(t),value:e,inclusive:!1})}function yi(e,t){return new Cj({check:"greater_than",...ke(t),value:e,inclusive:!0})}function Jj(e){return wl(0,e)}function Qj(e){return xl(0,e)}function eR(e){return Co(0,e)}function tR(e){return yi(0,e)}function Hd(e,t){return new d3({check:"multiple_of",...ke(t),value:e})}function gh(e,t){return new m3({check:"max_size",...ke(t),maximum:e})}function qd(e,t){return new h3({check:"min_size",...ke(t),minimum:e})}function Rx(e,t){return new g3({check:"size_equals",...ke(t),size:e})}function vh(e,t){return new v3({check:"max_length",...ke(t),maximum:e})}function $c(e,t){return new y3({check:"min_length",...ke(t),minimum:e})}function yh(e,t){return new b3({check:"length_equals",...ke(t),length:e})}function Ix(e,t){return new x3({check:"string_format",format:"regex",...ke(t),pattern:e})}function Nx(e){return new w3({check:"string_format",format:"lowercase",...ke(e)})}function Tx(e){return new S3({check:"string_format",format:"uppercase",...ke(e)})}function Ox(e,t){return new _3({check:"string_format",format:"includes",...ke(t),includes:e})}function Ax(e,t){return new C3({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function Dx(e,t){return new k3({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function nR(e,t,n){return new E3({check:"property",property:e,schema:t,...ke(n)})}function $x(e,t){return new j3({check:"mime_type",mime:e,...ke(t)})}function hs(e){return new R3({check:"overwrite",tx:e})}function Px(e){return hs(t=>t.normalize(e))}function Mx(){return hs(e=>e.trim())}function zx(){return hs(e=>e.toLowerCase())}function Lx(){return hs(e=>e.toUpperCase())}function Fx(){return hs(e=>s6(e))}function RV(e,t,n){return new e({type:"array",element:t,...ke(n)})}function Ave(e,t,n){return new e({type:"union",options:t,...ke(n)})}function Dve(e,t,n){return new e({type:"union",options:t,inclusive:!1,...ke(n)})}function $ve(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...ke(r)})}function Pve(e,t,n){return new e({type:"intersection",left:t,right:n})}function Mve(e,t,n,r){const i=n instanceof dt,o=i?r:n,a=i?n:null;return new e({type:"tuple",items:t,rest:a,...ke(o)})}function zve(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...ke(r)})}function Lve(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...ke(r)})}function Fve(e,t,n){return new e({type:"set",valueType:t,...ke(n)})}function Uve(e,t,n){const r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...ke(n)})}function Vve(e,t,n){return new e({type:"enum",entries:t,...ke(n)})}function Bve(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ke(n)})}function IV(e,t){return new e({type:"file",...ke(t)})}function Hve(e,t){return new e({type:"transform",transform:t})}function qve(e,t){return new e({type:"optional",innerType:t})}function Kve(e,t){return new e({type:"nullable",innerType:t})}function Gve(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Sx(n)}})}function Zve(e,t,n){return new e({type:"nonoptional",innerType:t,...ke(n)})}function Yve(e,t){return new e({type:"success",innerType:t})}function Wve(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function Xve(e,t,n){return new e({type:"pipe",in:t,out:n})}function Jve(e,t){return new e({type:"readonly",innerType:t})}function Qve(e,t,n){return new e({type:"template_literal",parts:t,...ke(n)})}function eye(e,t){return new e({type:"lazy",getter:t})}function tye(e,t){return new e({type:"promise",innerType:t})}function NV(e,t,n){const r=ke(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function TV(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function OV(e){const t=AV(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Vd(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(Vd(i))}},e(n.value,n)));return t}function AV(e,t){const n=new Nn({check:"custom",...ke(t)});return n._zod.check=e,n}function DV(e){const t=new Nn({check:"describe"});return t._zod.onattach=[n=>{const r=Uo.get(n)??{};Uo.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function $V(e){const t=new Nn({check:"meta"});return t._zod.onattach=[n=>{const r=Uo.get(n)??{};Uo.add(n,{...r,...e})}],t._zod.check=()=>{},t}function PV(e,t){const n=ke(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),c=e.Codec??Nj,d=e.Boolean??jj,f=e.String??hh,m=new f({type:"string",error:n.error}),h=new d({type:"boolean",error:n.error}),v=new c({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 bh(e,t,n,r={}){const i=ke(r),o={...ke(r),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:c=>n.test(c),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Kd(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??Uo,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 dn(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 c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path},h=e._zod.parent;if(h)a.ref=h,dn(h,t,m),t.seen.get(h).isParent=!0;else 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 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 Gd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,h=e.external.uri??(y=>y);if(m)return{ref:h(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${h("__shared")}#/${a}/${v}`}}if(o[1]===n)return{ref:"#"};const d=`#/${a}/`,f=o[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:d+f}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:d}=r(o);a.def={...a.schema},d&&(a.defId=d);const f=a.schema;for(const m in f)delete f[m];f.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
67
+
68
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){i(o);continue}if(e.external){const d=e.external.registry.get(o[0])?.id;if(t!==o[0]&&d){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&e.reused==="ref"){i(o);continue}}}function Zd(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 c=e.seen.get(a),d=c.def??c.schema,f={...d};if(c.ref===null)return;const m=c.ref;if(c.ref=null,m){r(m);const h=e.seen.get(m).schema;h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(h)):(Object.assign(d,h),Object.assign(d,f))}c.isParent||e.override({zodSchema:a,jsonSchema:d,path:c.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 c=a[1];c.def&&c.defId&&(o[c.defId]=c.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:Cm(t,"input"),output:Cm(t,"output")}},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 MV=(e,t={})=>n=>{const r=Kd({...n,processors:t});return dn(e,r),Gd(r,e),Zd(r,e)},Cm=(e,t)=>n=>{const{libraryOptions:r,target:i}=n??{},o=Kd({...r??{},target:i,io:t,processors:{}});return dn(e,o),Gd(o,e),Zd(o,e)},nye={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zV=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:o,maximum:a,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),c&&(i.format=nye[c]??c,i.format===""&&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}))])}},LV=(e,t,n,r)=>{const i=n,{minimum:o,maximum:a,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:m}=e._zod.bag;typeof c=="string"&&c.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)},FV=(e,t,n,r)=>{n.type="boolean"},UV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},VV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},BV=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},HV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},qV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},KV=(e,t,n,r)=>{n.not={}},GV=(e,t,n,r)=>{},ZV=(e,t,n,r)=>{},YV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},WV=(e,t,n,r)=>{const i=e._zod.def,o=cj(i.entries);o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o},XV=(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},JV=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},QV=(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},eB=(e,t,n,r)=>{const i=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:d}=e._zod.bag;a!==void 0&&(o.minLength=a),c!==void 0&&(o.maxLength=c),d?d.length===1?(o.contentMediaType=d[0],Object.assign(i,o)):i.anyOf=d.map(f=>({...o,contentMediaType:f})):Object.assign(i,o)},tB=(e,t,n,r)=>{n.type="boolean"},nB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},iB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},aB=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},sB=(e,t,n,r)=>{const i=n,o=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=dn(o.element,t,{...r,path:[...r.path,"items"]})},lB=(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]=dn(a[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(a)),d=new Set([...c].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=dn(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},rR=(e,t,n,r)=>{const i=e._zod.def,o=i.inclusive===!1,a=i.options.map((c,d)=>dn(c,t,{...r,path:[...r.path,o?"oneOf":"anyOf",d]}));o?n.oneOf=a:n.anyOf=a},cB=(e,t,n,r)=>{const i=e._zod.def,o=dn(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=dn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(o)?o.allOf:[o],...c(a)?a.allOf:[a]];n.allOf=d},uB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=o.items.map((v,y)=>dn(v,t,{...r,path:[...r.path,a,y]})),f=o.rest?dn(o.rest,t,{...r,path:[...r.path,c,...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)},dB=(e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object",(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=dn(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=dn(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})},fB=(e,t,n,r)=>{const i=e._zod.def,o=dn(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"}]},pB=(e,t,n,r)=>{const i=e._zod.def;dn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},mB=(e,t,n,r)=>{const i=e._zod.def;dn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},hB=(e,t,n,r)=>{const i=e._zod.def;dn(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)))},gB=(e,t,n,r)=>{const i=e._zod.def;dn(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},vB=(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;dn(o,t,r);const a=t.seen.get(e);a.ref=o},yB=(e,t,n,r)=>{const i=e._zod.def;dn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},bB=(e,t,n,r)=>{const i=e._zod.def;dn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},xB=(e,t,n,r)=>{const i=e._zod.def;dn(i.innerType,t,r);const o=t.seen.get(e);o.ref=i.innerType},wB=(e,t,n,r)=>{const i=e._zod.innerType;dn(i,t,r);const o=t.seen.get(e);o.ref=i},qC={string:zV,number:LV,boolean:FV,bigint:UV,symbol:VV,null:BV,undefined:HV,void:qV,never:KV,any:GV,unknown:ZV,date:YV,enum:WV,literal:XV,nan:JV,template_literal:QV,file:eB,success:tB,custom:nB,function:rB,transform:iB,map:oB,set:aB,array:sB,object:lB,union:rR,intersection:cB,tuple:uB,record:dB,nullable:fB,nonoptional:pB,default:mB,prefault:hB,catch:gB,pipe:vB,readonly:yB,promise:bB,optional:xB,lazy:wB};function SB(e,t){if("_idmap"in e){const r=e,i=Kd({...t,processors:qC}),o={};for(const d of r._idmap.entries()){const[f,m]=d;dn(m,i)}const a={},c={registry:r,uri:t?.uri,defs:o};i.external=c;for(const d of r._idmap.entries()){const[f,m]=d;Gd(i,m),a[f]=Zd(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=Kd({...t,processors:qC});return dn(e,n),Gd(n,e),Zd(n,e)}class rye{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=Kd({processors:qC,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 dn(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)),Gd(this.ctx,t);const r=Zd(this.ctx,t),{"~standard":i,...o}=r;return o}}const iye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),oye=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:c5,$ZodArray:m5,$ZodAsyncError:kc,$ZodBase64:X3,$ZodBase64URL:Q3,$ZodBigInt:Rj,$ZodBigIntFormat:o5,$ZodBoolean:jj,$ZodCIDRv4:Y3,$ZodCIDRv6:W3,$ZodCUID:M3,$ZodCUID2:z3,$ZodCatch:$5,$ZodCheck:Nn,$ZodCheckBigIntFormat:p3,$ZodCheckEndsWith:k3,$ZodCheckGreaterThan:Cj,$ZodCheckIncludes:_3,$ZodCheckLengthEquals:b3,$ZodCheckLessThan:_j,$ZodCheckLowerCase:w3,$ZodCheckMaxLength:v3,$ZodCheckMaxSize:m3,$ZodCheckMimeType:j3,$ZodCheckMinLength:y3,$ZodCheckMinSize:h3,$ZodCheckMultipleOf:d3,$ZodCheckNumberFormat:f3,$ZodCheckOverwrite:R3,$ZodCheckProperty:E3,$ZodCheckRegex:x3,$ZodCheckSizeEquals:g3,$ZodCheckStartsWith:C3,$ZodCheckStringFormat:mh,$ZodCheckUpperCase:S3,$ZodCodec:Nj,$ZodCustom:B5,$ZodCustomStringFormat:r5,$ZodDate:p5,$ZodDefault:T5,$ZodDiscriminatedUnion:x5,$ZodE164:e5,$ZodEmail:A3,$ZodEmoji:$3,$ZodEncodeError:xx,$ZodEnum:k5,$ZodError:kx,$ZodFile:j5,$ZodFunction:F5,$ZodGUID:T3,$ZodIPv4:K3,$ZodIPv6:G3,$ZodISODate:B3,$ZodISODateTime:V3,$ZodISODuration:q3,$ZodISOTime:H3,$ZodIntersection:w5,$ZodJWT:n5,$ZodKSUID:U3,$ZodLazy:V5,$ZodLiteral:E5,$ZodMAC:Z3,$ZodMap:_5,$ZodNaN:P5,$ZodNanoID:P3,$ZodNever:d5,$ZodNonOptional:A5,$ZodNull:l5,$ZodNullable:N5,$ZodNumber:Ej,$ZodNumberFormat:i5,$ZodObject:v5,$ZodObjectJIT:y5,$ZodOptional:I5,$ZodPipe:M5,$ZodPrefault:O5,$ZodPromise:U5,$ZodReadonly:z5,$ZodRealError:Ji,$ZodRecord:S5,$ZodRegistry:W5,$ZodSet:C5,$ZodString:hh,$ZodStringFormat:fn,$ZodSuccess:D5,$ZodSymbol:a5,$ZodTemplateLiteral:L5,$ZodTransform:R5,$ZodTuple:Ij,$ZodType:dt,$ZodULID:L3,$ZodURL:D3,$ZodUUID:O3,$ZodUndefined:s5,$ZodUnion:Ex,$ZodUnknown:u5,$ZodVoid:f5,$ZodXID:F3,$ZodXor:b5,$brand:o6,$constructor:oe,$input:Y5,$output:Z5,Doc:I3,JSONSchema:iye,JSONSchemaGenerator:rye,NEVER:i6,TimePrecision:eV,_any:wV,_array:RV,_base64:Zj,_base64url:Yj,_bigint:mV,_boolean:fV,_catch:Wve,_check:AV,_cidrv4:Kj,_cidrv6:Gj,_coercedBigint:hV,_coercedBoolean:pV,_coercedDate:EV,_coercedNumber:aV,_coercedString:J5,_cuid:Lj,_cuid2:Fj,_custom:NV,_date:kV,_decode:mj,_decodeAsync:gj,_default:Gve,_discriminatedUnion:$ve,_e164:Wj,_email:Oj,_emoji:Mj,_encode:pj,_encodeAsync:hj,_endsWith:Dx,_enum:Uve,_file:IV,_float32:lV,_float64:cV,_gt:wl,_gte:yi,_guid:Ky,_includes:Ox,_int:sV,_int32:uV,_int64:gV,_intersection:Pve,_ipv4:Hj,_ipv6:qj,_isoDate:nV,_isoDateTime:tV,_isoDuration:iV,_isoTime:rV,_jwt:Xj,_ksuid:Bj,_lazy:eye,_length:yh,_literal:Bve,_lowercase:Nx,_lt:xl,_lte:Co,_mac:Q5,_map:Lve,_max:Co,_maxLength:vh,_maxSize:gh,_mime:$x,_min:yi,_minLength:$c,_minSize:qd,_multipleOf:Hd,_nan:jV,_nanoid:zj,_nativeEnum:Vve,_negative:Qj,_never:_V,_nonnegative:tR,_nonoptional:Zve,_nonpositive:eR,_normalize:Px,_null:xV,_nullable:Kve,_number:oV,_optional:qve,_overwrite:hs,_parse:lh,_parseAsync:ch,_pipe:Xve,_positive:Jj,_promise:tye,_property:nR,_readonly:Jve,_record:zve,_refine:TV,_regex:Ix,_safeDecode:yj,_safeDecodeAsync:xj,_safeEncode:vj,_safeEncodeAsync:bj,_safeParse:uh,_safeParseAsync:dh,_set:Fve,_size:Rx,_slugify:Fx,_startsWith:Ax,_string:X5,_stringFormat:bh,_stringbool:PV,_success:Yve,_superRefine:OV,_symbol:yV,_templateLiteral:Qve,_toLowerCase:zx,_toUpperCase:Lx,_transform:Hve,_trim:Mx,_tuple:Mve,_uint32:dV,_uint64:vV,_ulid:Uj,_undefined:bV,_union:Ave,_unknown:SV,_uppercase:Tx,_url:jx,_uuid:Aj,_uuidv4:Dj,_uuidv6:$j,_uuidv7:Pj,_void:CV,_xid:Vj,_xor:Dve,clone:No,config:Pr,createStandardJSONSchemaMethod:Cm,createToJSONSchemaMethod:MV,decode:mhe,decodeAsync:ghe,describe:DV,encode:phe,encodeAsync:hhe,extractDefs:Gd,finalize:Zd,flattenError:dj,formatError:fj,globalConfig:Fy,globalRegistry:Uo,initializeContext:Kd,isValidBase64:kj,isValidBase64URL:J3,isValidJWT:t5,locales:G5,meta:$V,parse:By,parseAsync:Hy,prettifyError:E6,process:dn,regexes:Sj,registry:Tj,safeDecode:yhe,safeDecodeAsync:xhe,safeEncode:vhe,safeEncodeAsync:bhe,safeParse:j6,safeParseAsync:R6,toDotPath:k6,toJSONSchema:SB,treeifyError:C6,util:S6,version:N3},Symbol.toStringTag,{value:"Module"})),aye=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Dx,gt:wl,gte:yi,includes:Ox,length:yh,lowercase:Nx,lt:xl,lte:Co,maxLength:vh,maxSize:gh,mime:$x,minLength:$c,minSize:qd,multipleOf:Hd,negative:Qj,nonnegative:tR,nonpositive:eR,normalize:Px,overwrite:hs,positive:Jj,property:nR,regex:Ix,size:Rx,slugify:Fx,startsWith:Ax,toLowerCase:zx,toUpperCase:Lx,trim:Mx,uppercase:Tx},Symbol.toStringTag,{value:"Module"})),iR=oe("ZodISODateTime",(e,t)=>{V3.init(e,t),pn.init(e,t)});function _B(e){return tV(iR,e)}const oR=oe("ZodISODate",(e,t)=>{B3.init(e,t),pn.init(e,t)});function CB(e){return nV(oR,e)}const aR=oe("ZodISOTime",(e,t)=>{H3.init(e,t),pn.init(e,t)});function kB(e){return rV(aR,e)}const sR=oe("ZodISODuration",(e,t)=>{q3.init(e,t),pn.init(e,t)});function EB(e){return iV(sR,e)}const jB=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:oR,ZodISODateTime:iR,ZodISODuration:sR,ZodISOTime:aR,date:CB,datetime:_B,duration:EB,time:kB},Symbol.toStringTag,{value:"Module"})),RB=(e,t)=>{kx.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>fj(e,n)},flatten:{value:n=>dj(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Uy,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Uy,2)}},isEmpty:{get(){return e.issues.length===0}}})},sye=oe("ZodError",RB),Qi=oe("ZodError",RB,{Parent:Error}),IB=lh(Qi),NB=ch(Qi),TB=uh(Qi),OB=dh(Qi),AB=pj(Qi),DB=mj(Qi),$B=hj(Qi),PB=gj(Qi),MB=vj(Qi),zB=yj(Qi),LB=bj(Qi),FB=xj(Qi),wt=oe("ZodType",(e,t)=>(dt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cm(e,"input"),output:Cm(e,"output")}}),e.toJSONSchema=MV(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ms(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(n,r)=>No(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>IB(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>TB(e,n,r),e.parseAsync=async(n,r)=>NB(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>OB(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>AB(e,n,r),e.decode=(n,r)=>DB(e,n,r),e.encodeAsync=async(n,r)=>$B(e,n,r),e.decodeAsync=async(n,r)=>PB(e,n,r),e.safeEncode=(n,r)=>MB(e,n,r),e.safeDecode=(n,r)=>zB(e,n,r),e.safeEncodeAsync=async(n,r)=>LB(e,n,r),e.safeDecodeAsync=async(n,r)=>FB(e,n,r),e.refine=(n,r)=>e.check(YR(n,r)),e.superRefine=n=>e.check(WR(n)),e.overwrite=n=>e.check(hs(n)),e.optional=()=>jm(e),e.nullable=()=>Rm(e),e.nullish=()=>jm(Rm(e)),e.nonoptional=n=>MR(e,n),e.array=()=>cs(e),e.or=n=>l0([e,n]),e.and=n=>CR(e,n),e.transform=n=>Im(e,u0(n)),e.default=n=>DR(e,n),e.prefault=n=>PR(e,n),e.catch=n=>FR(e,n),e.pipe=n=>Im(e,n),e.readonly=()=>BR(e),e.describe=n=>{const r=e.clone();return Uo.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Uo.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Uo.get(e);const r=e.clone();return Uo.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Ux=oe("_ZodString",(e,t)=>{hh.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>zV(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(Ix(...r)),e.includes=(...r)=>e.check(Ox(...r)),e.startsWith=(...r)=>e.check(Ax(...r)),e.endsWith=(...r)=>e.check(Dx(...r)),e.min=(...r)=>e.check($c(...r)),e.max=(...r)=>e.check(vh(...r)),e.length=(...r)=>e.check(yh(...r)),e.nonempty=(...r)=>e.check($c(1,...r)),e.lowercase=r=>e.check(Nx(r)),e.uppercase=r=>e.check(Tx(r)),e.trim=()=>e.check(Mx()),e.normalize=(...r)=>e.check(Px(...r)),e.toLowerCase=()=>e.check(zx()),e.toUpperCase=()=>e.check(Lx()),e.slugify=()=>e.check(Fx())}),xh=oe("ZodString",(e,t)=>{hh.init(e,t),Ux.init(e,t),e.email=n=>e.check(Oj(Vx,n)),e.url=n=>e.check(jx(wh,n)),e.jwt=n=>e.check(Xj(r0,n)),e.emoji=n=>e.check(Mj(Bx,n)),e.guid=n=>e.check(Ky(km,n)),e.uuid=n=>e.check(Aj(fa,n)),e.uuidv4=n=>e.check(Dj(fa,n)),e.uuidv6=n=>e.check($j(fa,n)),e.uuidv7=n=>e.check(Pj(fa,n)),e.nanoid=n=>e.check(zj(Hx,n)),e.guid=n=>e.check(Ky(km,n)),e.cuid=n=>e.check(Lj(qx,n)),e.cuid2=n=>e.check(Fj(Kx,n)),e.ulid=n=>e.check(Uj(Gx,n)),e.base64=n=>e.check(Zj(e0,n)),e.base64url=n=>e.check(Yj(t0,n)),e.xid=n=>e.check(Vj(Zx,n)),e.ksuid=n=>e.check(Bj(Yx,n)),e.ipv4=n=>e.check(Hj(Wx,n)),e.ipv6=n=>e.check(qj(Xx,n)),e.cidrv4=n=>e.check(Kj(Jx,n)),e.cidrv6=n=>e.check(Gj(Qx,n)),e.e164=n=>e.check(Wj(n0,n)),e.datetime=n=>e.check(_B(n)),e.date=n=>e.check(CB(n)),e.time=n=>e.check(kB(n)),e.duration=n=>e.check(EB(n))});function nt(e){return X5(xh,e)}const pn=oe("ZodStringFormat",(e,t)=>{fn.init(e,t),Ux.init(e,t)}),Vx=oe("ZodEmail",(e,t)=>{A3.init(e,t),pn.init(e,t)});function lR(e){return Oj(Vx,e)}const km=oe("ZodGUID",(e,t)=>{T3.init(e,t),pn.init(e,t)});function UB(e){return Ky(km,e)}const fa=oe("ZodUUID",(e,t)=>{O3.init(e,t),pn.init(e,t)});function VB(e){return Aj(fa,e)}function BB(e){return Dj(fa,e)}function HB(e){return $j(fa,e)}function qB(e){return Pj(fa,e)}const wh=oe("ZodURL",(e,t)=>{D3.init(e,t),pn.init(e,t)});function KB(e){return jx(wh,e)}function GB(e){return jx(wh,{protocol:/^https?$/,hostname:G6,...ke(e)})}const Bx=oe("ZodEmoji",(e,t)=>{$3.init(e,t),pn.init(e,t)});function ZB(e){return Mj(Bx,e)}const Hx=oe("ZodNanoID",(e,t)=>{P3.init(e,t),pn.init(e,t)});function YB(e){return zj(Hx,e)}const qx=oe("ZodCUID",(e,t)=>{M3.init(e,t),pn.init(e,t)});function WB(e){return Lj(qx,e)}const Kx=oe("ZodCUID2",(e,t)=>{z3.init(e,t),pn.init(e,t)});function XB(e){return Fj(Kx,e)}const Gx=oe("ZodULID",(e,t)=>{L3.init(e,t),pn.init(e,t)});function JB(e){return Uj(Gx,e)}const Zx=oe("ZodXID",(e,t)=>{F3.init(e,t),pn.init(e,t)});function QB(e){return Vj(Zx,e)}const Yx=oe("ZodKSUID",(e,t)=>{U3.init(e,t),pn.init(e,t)});function eH(e){return Bj(Yx,e)}const Wx=oe("ZodIPv4",(e,t)=>{K3.init(e,t),pn.init(e,t)});function tH(e){return Hj(Wx,e)}const cR=oe("ZodMAC",(e,t)=>{Z3.init(e,t),pn.init(e,t)});function nH(e){return Q5(cR,e)}const Xx=oe("ZodIPv6",(e,t)=>{G3.init(e,t),pn.init(e,t)});function rH(e){return qj(Xx,e)}const Jx=oe("ZodCIDRv4",(e,t)=>{Y3.init(e,t),pn.init(e,t)});function iH(e){return Kj(Jx,e)}const Qx=oe("ZodCIDRv6",(e,t)=>{W3.init(e,t),pn.init(e,t)});function oH(e){return Gj(Qx,e)}const e0=oe("ZodBase64",(e,t)=>{X3.init(e,t),pn.init(e,t)});function aH(e){return Zj(e0,e)}const t0=oe("ZodBase64URL",(e,t)=>{Q3.init(e,t),pn.init(e,t)});function sH(e){return Yj(t0,e)}const n0=oe("ZodE164",(e,t)=>{e5.init(e,t),pn.init(e,t)});function lH(e){return Wj(n0,e)}const r0=oe("ZodJWT",(e,t)=>{n5.init(e,t),pn.init(e,t)});function cH(e){return Xj(r0,e)}const xf=oe("ZodCustomStringFormat",(e,t)=>{r5.init(e,t),pn.init(e,t)});function uH(e,t,n={}){return bh(xf,e,t,n)}function dH(e){return bh(xf,"hostname",K6,e)}function fH(e){return bh(xf,"hex",c3,e)}function pH(e,t){const n=t?.enc??"hex",r=`${e}_${n}`,i=Sj[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return bh(xf,r,i,t)}const Sh=oe("ZodNumber",(e,t)=>{Ej.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>LV(e,r,i),e.gt=(r,i)=>e.check(wl(r,i)),e.gte=(r,i)=>e.check(yi(r,i)),e.min=(r,i)=>e.check(yi(r,i)),e.lt=(r,i)=>e.check(xl(r,i)),e.lte=(r,i)=>e.check(Co(r,i)),e.max=(r,i)=>e.check(Co(r,i)),e.int=r=>e.check(Gy(r)),e.safe=r=>e.check(Gy(r)),e.positive=r=>e.check(wl(0,r)),e.nonnegative=r=>e.check(yi(0,r)),e.negative=r=>e.check(xl(0,r)),e.nonpositive=r=>e.check(Co(0,r)),e.multipleOf=(r,i)=>e.check(Hd(r,i)),e.step=(r,i)=>e.check(Hd(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 i0(e){return oV(Sh,e)}const Qc=oe("ZodNumberFormat",(e,t)=>{i5.init(e,t),Sh.init(e,t)});function Gy(e){return sV(Qc,e)}function mH(e){return lV(Qc,e)}function hH(e){return cV(Qc,e)}function uR(e){return uV(Qc,e)}function gH(e){return dV(Qc,e)}const _h=oe("ZodBoolean",(e,t)=>{jj.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FV(e,n,r)});function Yt(e){return fV(_h,e)}const Ch=oe("ZodBigInt",(e,t)=>{Rj.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>UV(e,r),e.gte=(r,i)=>e.check(yi(r,i)),e.min=(r,i)=>e.check(yi(r,i)),e.gt=(r,i)=>e.check(wl(r,i)),e.gte=(r,i)=>e.check(yi(r,i)),e.min=(r,i)=>e.check(yi(r,i)),e.lt=(r,i)=>e.check(xl(r,i)),e.lte=(r,i)=>e.check(Co(r,i)),e.max=(r,i)=>e.check(Co(r,i)),e.positive=r=>e.check(wl(BigInt(0),r)),e.negative=r=>e.check(xl(BigInt(0),r)),e.nonpositive=r=>e.check(Co(BigInt(0),r)),e.nonnegative=r=>e.check(yi(BigInt(0),r)),e.multipleOf=(r,i)=>e.check(Hd(r,i));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function vH(e){return mV(Ch,e)}const o0=oe("ZodBigIntFormat",(e,t)=>{o5.init(e,t),Ch.init(e,t)});function yH(e){return gV(o0,e)}function bH(e){return vV(o0,e)}const dR=oe("ZodSymbol",(e,t)=>{a5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VV(e,n)});function xH(e){return yV(dR,e)}const fR=oe("ZodUndefined",(e,t)=>{s5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HV(e,n)});function Em(e){return bV(fR,e)}const pR=oe("ZodNull",(e,t)=>{l5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BV(e,n,r)});function mR(e){return xV(pR,e)}const hR=oe("ZodAny",(e,t)=>{c5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GV()});function wH(){return wV(hR)}const gR=oe("ZodUnknown",(e,t)=>{u5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZV()});function Pc(){return SV(gR)}const vR=oe("ZodNever",(e,t)=>{d5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KV(e,n,r)});function a0(e){return _V(vR,e)}const yR=oe("ZodVoid",(e,t)=>{f5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qV(e,n)});function SH(e){return CV(yR,e)}const s0=oe("ZodDate",(e,t)=>{p5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>YV(e,r),e.min=(r,i)=>e.check(yi(r,i)),e.max=(r,i)=>e.check(Co(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 _H(e){return kV(s0,e)}const bR=oe("ZodArray",(e,t)=>{m5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sB(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check($c(n,r)),e.nonempty=n=>e.check($c(1,n)),e.max=(n,r)=>e.check(vh(n,r)),e.length=(n,r)=>e.check(yh(n,r)),e.unwrap=()=>e.element});function cs(e,t){return RV(bR,e,t)}function CH(e){const t=e._zod.def.shape;return Al(Object.keys(t))}const kh=oe("ZodObject",(e,t)=>{y5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lB(e,n,r,i),It(e,"shape",()=>t.shape),e.keyof=()=>Al(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pc()}),e.strict=()=>e.clone({...e._zod.def,catchall:a0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>h6(e,n),e.safeExtend=n=>g6(e,n),e.merge=n=>v6(e,n),e.pick=n=>p6(e,n),e.omit=n=>m6(e,n),e.partial=(...n)=>y6(d0,e,n[0]),e.required=(...n)=>b6(f0,e,n[0])});function Dt(e,t){const n={type:"object",shape:e??{},...ke(t)};return new kh(n)}function kH(e,t){return new kh({type:"object",shape:e,catchall:a0(),...ke(t)})}function EH(e,t){return new kh({type:"object",shape:e,catchall:Pc(),...ke(t)})}const Eh=oe("ZodUnion",(e,t)=>{Ex.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rR(e,n,r,i),e.options=t.options});function l0(e,t){return new Eh({type:"union",options:e,...ke(t)})}const xR=oe("ZodXor",(e,t)=>{Eh.init(e,t),b5.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rR(e,n,r,i),e.options=t.options});function jH(e,t){return new xR({type:"union",options:e,inclusive:!1,...ke(t)})}const wR=oe("ZodDiscriminatedUnion",(e,t)=>{Eh.init(e,t),x5.init(e,t)});function SR(e,t,n){return new wR({type:"union",options:t,discriminator:e,...ke(n)})}const _R=oe("ZodIntersection",(e,t)=>{w5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cB(e,n,r,i)});function CR(e,t){return new _R({type:"intersection",left:e,right:t})}const kR=oe("ZodTuple",(e,t)=>{Ij.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uB(e,n,r,i),e.rest=n=>e.clone({...e._zod.def,rest:n})});function ER(e,t,n){const r=t instanceof dt,i=r?n:t,o=r?t:null;return new kR({type:"tuple",items:e,rest:o,...ke(i)})}const jh=oe("ZodRecord",(e,t)=>{S5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dB(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function c0(e,t,n){return new jh({type:"record",keyType:e,valueType:t,...ke(n)})}function RH(e,t,n){const r=No(e);return r._zod.values=void 0,new jh({type:"record",keyType:r,valueType:t,...ke(n)})}function IH(e,t,n){return new jh({type:"record",keyType:e,valueType:t,mode:"loose",...ke(n)})}const jR=oe("ZodMap",(e,t)=>{_5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oB(e,n),e.keyType=t.keyType,e.valueType=t.valueType});function NH(e,t,n){return new jR({type:"map",keyType:e,valueType:t,...ke(n)})}const RR=oe("ZodSet",(e,t)=>{C5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aB(e,n),e.min=(...n)=>e.check(qd(...n)),e.nonempty=n=>e.check(qd(1,n)),e.max=(...n)=>e.check(gh(...n)),e.size=(...n)=>e.check(Rx(...n))});function TH(e,t){return new RR({type:"set",valueType:e,...ke(t)})}const Yd=oe("ZodEnum",(e,t)=>{k5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(r,i,o)=>WV(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 Yd({...t,checks:[],...ke(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 Yd({...t,checks:[],...ke(i),entries:o})}});function Al(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Yd({type:"enum",entries:n,...ke(t)})}function OH(e,t){return new Yd({type:"enum",entries:e,...ke(t)})}const IR=oe("ZodLiteral",(e,t)=>{E5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XV(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 wf(e,t){return new IR({type:"literal",values:Array.isArray(e)?e:[e],...ke(t)})}const NR=oe("ZodFile",(e,t)=>{j5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eB(e,n,r),e.min=(n,r)=>e.check(qd(n,r)),e.max=(n,r)=>e.check(gh(n,r)),e.mime=(n,r)=>e.check($x(Array.isArray(n)?n:[n],r))});function AH(e){return IV(NR,e)}const TR=oe("ZodTransform",(e,t)=>{R5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iB(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xx(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Vd(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(Vd(a))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function u0(e){return new TR({type:"transform",transform:e})}const d0=oe("ZodOptional",(e,t)=>{I5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function jm(e){return new d0({type:"optional",innerType:e})}const OR=oe("ZodNullable",(e,t)=>{N5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Rm(e){return new OR({type:"nullable",innerType:e})}function DH(e){return jm(Rm(e))}const AR=oe("ZodDefault",(e,t)=>{T5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function DR(e,t){return new AR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Sx(t)}})}const $R=oe("ZodPrefault",(e,t)=>{O5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function PR(e,t){return new $R({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Sx(t)}})}const f0=oe("ZodNonOptional",(e,t)=>{A5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function MR(e,t){return new f0({type:"nonoptional",innerType:e,...ke(t)})}const zR=oe("ZodSuccess",(e,t)=>{D5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tB(e,n,r),e.unwrap=()=>e._zod.def.innerType});function $H(e){return new zR({type:"success",innerType:e})}const LR=oe("ZodCatch",(e,t)=>{$5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function FR(e,t){return new LR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const UR=oe("ZodNaN",(e,t)=>{P5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JV(e,n)});function PH(e){return jV(UR,e)}const p0=oe("ZodPipe",(e,t)=>{M5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vB(e,n,r,i),e.in=t.in,e.out=t.out});function Im(e,t){return new p0({type:"pipe",in:e,out:t})}const m0=oe("ZodCodec",(e,t)=>{p0.init(e,t),Nj.init(e,t)});function MH(e,t,n){return new m0({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const VR=oe("ZodReadonly",(e,t)=>{z5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function BR(e){return new VR({type:"readonly",innerType:e})}const HR=oe("ZodTemplateLiteral",(e,t)=>{L5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QV(e,n,r)});function zH(e,t){return new HR({type:"template_literal",parts:e,...ke(t)})}const qR=oe("ZodLazy",(e,t)=>{V5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wB(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function KR(e){return new qR({type:"lazy",getter:e})}const GR=oe("ZodPromise",(e,t)=>{U5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bB(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function LH(e){return new GR({type:"promise",innerType:e})}const ZR=oe("ZodFunction",(e,t)=>{F5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rB(e,n)});function Zy(e){return new ZR({type:"function",input:Array.isArray(e?.input)?ER(e?.input):e?.input??cs(Pc()),output:e?.output??Pc()})}const Rh=oe("ZodCustom",(e,t)=>{B5.init(e,t),wt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nB(e,n)});function FH(e){const t=new Nn({check:"custom"});return t._zod.check=e,t}function UH(e,t){return NV(Rh,e??(()=>!0),t)}function YR(e,t={}){return TV(Rh,e,t)}function WR(e){return OV(e)}const VH=DV,BH=$V;function HH(e,t={error:`Input not instance of ${e.name}`}){const n=new Rh({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...ke(t)});return n._zod.bag.Class=e,n}const qH=(...e)=>PV({Codec:m0,Boolean:_h,String:xh},...e);function KH(e){const t=KR(()=>l0([nt(e),i0(),Yt(),mR(),cs(t),c0(nt(),t)]));return t}function GH(e,t){return Im(u0(e),t)}const lye=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:hR,ZodArray:bR,ZodBase64:e0,ZodBase64URL:t0,ZodBigInt:Ch,ZodBigIntFormat:o0,ZodBoolean:_h,ZodCIDRv4:Jx,ZodCIDRv6:Qx,ZodCUID:qx,ZodCUID2:Kx,ZodCatch:LR,ZodCodec:m0,ZodCustom:Rh,ZodCustomStringFormat:xf,ZodDate:s0,ZodDefault:AR,ZodDiscriminatedUnion:wR,ZodE164:n0,ZodEmail:Vx,ZodEmoji:Bx,ZodEnum:Yd,ZodFile:NR,ZodFunction:ZR,ZodGUID:km,ZodIPv4:Wx,ZodIPv6:Xx,ZodIntersection:_R,ZodJWT:r0,ZodKSUID:Yx,ZodLazy:qR,ZodLiteral:IR,ZodMAC:cR,ZodMap:jR,ZodNaN:UR,ZodNanoID:Hx,ZodNever:vR,ZodNonOptional:f0,ZodNull:pR,ZodNullable:OR,ZodNumber:Sh,ZodNumberFormat:Qc,ZodObject:kh,ZodOptional:d0,ZodPipe:p0,ZodPrefault:$R,ZodPromise:GR,ZodReadonly:VR,ZodRecord:jh,ZodSet:RR,ZodString:xh,ZodStringFormat:pn,ZodSuccess:zR,ZodSymbol:dR,ZodTemplateLiteral:HR,ZodTransform:TR,ZodTuple:kR,ZodType:wt,ZodULID:Gx,ZodURL:wh,ZodUUID:fa,ZodUndefined:fR,ZodUnion:Eh,ZodUnknown:gR,ZodVoid:yR,ZodXID:Zx,ZodXor:xR,_ZodString:Ux,_default:DR,_function:Zy,any:wH,array:cs,base64:aH,base64url:sH,bigint:vH,boolean:Yt,catch:FR,check:FH,cidrv4:iH,cidrv6:oH,codec:MH,cuid:WB,cuid2:XB,custom:UH,date:_H,describe:VH,discriminatedUnion:SR,e164:lH,email:lR,emoji:ZB,enum:Al,file:AH,float32:mH,float64:hH,function:Zy,guid:UB,hash:pH,hex:fH,hostname:dH,httpUrl:GB,instanceof:HH,int:Gy,int32:uR,int64:yH,intersection:CR,ipv4:tH,ipv6:rH,json:KH,jwt:cH,keyof:CH,ksuid:eH,lazy:KR,literal:wf,looseObject:EH,looseRecord:IH,mac:nH,map:NH,meta:BH,nan:PH,nanoid:YB,nativeEnum:OH,never:a0,nonoptional:MR,null:mR,nullable:Rm,nullish:DH,number:i0,object:Dt,optional:jm,partialRecord:RH,pipe:Im,prefault:PR,preprocess:GH,promise:LH,readonly:BR,record:c0,refine:YR,set:TH,strictObject:kH,string:nt,stringFormat:uH,stringbool:qH,success:$H,superRefine:WR,symbol:xH,templateLiteral:zH,transform:u0,tuple:ER,uint32:gH,uint64:bH,ulid:JB,undefined:Em,union:l0,unknown:Pc,url:KB,uuid:VB,uuidv4:BB,uuidv6:HB,uuidv7:qB,void:SH,xid:QB,xor:jH},Symbol.toStringTag,{value:"Module"})),cye={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 uye(e){Pr({customError:e})}function dye(){return Pr().customError}var KC;KC||(KC={});const ze={...lye,...aye,iso:jB};function fye(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 pye(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 ZH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ze.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 ze.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=pye(i,t),a=Tr(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 ze.null();if(i.length===0)return ze.never();if(i.length===1)return ze.literal(i[0]);if(i.every(a=>typeof a=="string"))return ze.enum(i);const o=i.map(a=>ze.literal(a));return o.length<2?o[0]:ze.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ze.literal(e.const);const n=e.type;if(Array.isArray(n)){const i=n.map(o=>{const a={...e,type:o};return ZH(a,t)});return i.length===0?ze.never():i.length===1?i[0]:ze.union(i)}if(!n)return ze.any();let r;switch(n){case"string":{let i=ze.string();if(e.format){const o=e.format;o==="email"?i=i.check(ze.email()):o==="uri"||o==="uri-reference"?i=i.check(ze.url()):o==="uuid"||o==="guid"?i=i.check(ze.uuid()):o==="date-time"?i=i.check(ze.iso.datetime()):o==="date"?i=i.check(ze.iso.date()):o==="time"?i=i.check(ze.iso.time()):o==="duration"?i=i.check(ze.iso.duration()):o==="ipv4"?i=i.check(ze.ipv4()):o==="ipv6"?i=i.check(ze.ipv6()):o==="mac"?i=i.check(ze.mac()):o==="cidr"?i=i.check(ze.cidrv4()):o==="cidr-v6"?i=i.check(ze.cidrv6()):o==="base64"?i=i.check(ze.base64()):o==="base64url"?i=i.check(ze.base64url()):o==="e164"?i=i.check(ze.e164()):o==="jwt"?i=i.check(ze.jwt()):o==="emoji"?i=i.check(ze.emoji()):o==="nanoid"?i=i.check(ze.nanoid()):o==="cuid"?i=i.check(ze.cuid()):o==="cuid2"?i=i.check(ze.cuid2()):o==="ulid"?i=i.check(ze.ulid()):o==="xid"?i=i.check(ze.xid()):o==="ksuid"&&(i=i.check(ze.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"?ze.number().int():ze.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=ze.boolean();break}case"null":{r=ze.null();break}case"object":{const i={},o=e.properties||{},a=new Set(e.required||[]);for(const[d,f]of Object.entries(o)){const m=Tr(f,t);i[d]=a.has(d)?m:m.optional()}if(e.propertyNames){const d=Tr(e.propertyNames,t),f=e.additionalProperties&&typeof e.additionalProperties=="object"?Tr(e.additionalProperties,t):ze.any();if(Object.keys(i).length===0){r=ze.record(d,f);break}const m=ze.object(i).passthrough(),h=ze.looseRecord(d,f);r=ze.intersection(m,h);break}if(e.patternProperties){const d=e.patternProperties,f=Object.keys(d),m=[];for(const v of f){const y=Tr(d[v],t),x=ze.string().regex(new RegExp(v));m.push(ze.looseRecord(x,y))}const h=[];if(Object.keys(i).length>0&&h.push(ze.object(i).passthrough()),h.push(...m),h.length===0)r=ze.object({}).passthrough();else if(h.length===1)r=h[0];else{let v=ze.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)v=ze.intersection(v,h[y]);r=v}break}const c=ze.object(i);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(Tr(e.additionalProperties,t)):r=c.passthrough();break}case"array":{const i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){const a=i.map(d=>Tr(d,t)),c=o&&typeof o=="object"&&!Array.isArray(o)?Tr(o,t):void 0;c?r=ze.tuple(a).rest(c):r=ze.tuple(a),typeof e.minItems=="number"&&(r=r.check(ze.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ze.maxLength(e.maxItems)))}else if(Array.isArray(o)){const a=o.map(d=>Tr(d,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?Tr(e.additionalItems,t):void 0;c?r=ze.tuple(a).rest(c):r=ze.tuple(a),typeof e.minItems=="number"&&(r=r.check(ze.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(ze.maxLength(e.maxItems)))}else if(o!==void 0){const a=Tr(o,t);let c=ze.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=ze.array(ze.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 Tr(e,t){if(typeof e=="boolean")return e?ze.any():ze.never();let n=ZH(e,t);const r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const i=e.anyOf.map(a=>Tr(a,t)),o=ze.union(i);n=r?ze.intersection(n,o):o}if(e.oneOf&&Array.isArray(e.oneOf)){const i=e.oneOf.map(a=>Tr(a,t)),o=ze.xor(i);n=r?ze.intersection(n,o):o}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:ze.any();else{let i=r?n:Tr(e.allOf[0],t);const o=r?0:1;for(let a=o;a<e.allOf.length;a++)i=ze.intersection(i,Tr(e.allOf[a],t));n=i}return e.nullable===!0&&t.version==="openapi-3.0"&&(n=ze.nullable(n)),e.readOnly===!0&&(n=ze.readonly(n)),n}function mye(e,t){if(typeof e=="boolean")return e?ze.any():ze.never();const n=fye(e,t?.defaultTarget),r=e.$defs||e.definitions||{};return Tr(e,{version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e})}function hye(e){return J5(xh,e)}function gye(e){return aV(Sh,e)}function vye(e){return pV(_h,e)}function yye(e){return hV(Ch,e)}function bye(e){return EV(s0,e)}const xye=Object.freeze(Object.defineProperty({__proto__:null,bigint:yye,boolean:vye,date:bye,number:gye,string:hye},Symbol.toStringTag,{value:"Module"}));Pr(H5());const Sl=Object.freeze(Object.defineProperty({__proto__:null,$brand:o6,$input:Y5,$output:Z5,NEVER:i6,TimePrecision:eV,ZodAny:hR,ZodArray:bR,ZodBase64:e0,ZodBase64URL:t0,ZodBigInt:Ch,ZodBigIntFormat:o0,ZodBoolean:_h,ZodCIDRv4:Jx,ZodCIDRv6:Qx,ZodCUID:qx,ZodCUID2:Kx,ZodCatch:LR,ZodCodec:m0,ZodCustom:Rh,ZodCustomStringFormat:xf,ZodDate:s0,ZodDefault:AR,ZodDiscriminatedUnion:wR,ZodE164:n0,ZodEmail:Vx,ZodEmoji:Bx,ZodEnum:Yd,ZodError:sye,ZodFile:NR,get ZodFirstPartyTypeKind(){return KC},ZodFunction:ZR,ZodGUID:km,ZodIPv4:Wx,ZodIPv6:Xx,ZodISODate:oR,ZodISODateTime:iR,ZodISODuration:sR,ZodISOTime:aR,ZodIntersection:_R,ZodIssueCode:cye,ZodJWT:r0,ZodKSUID:Yx,ZodLazy:qR,ZodLiteral:IR,ZodMAC:cR,ZodMap:jR,ZodNaN:UR,ZodNanoID:Hx,ZodNever:vR,ZodNonOptional:f0,ZodNull:pR,ZodNullable:OR,ZodNumber:Sh,ZodNumberFormat:Qc,ZodObject:kh,ZodOptional:d0,ZodPipe:p0,ZodPrefault:$R,ZodPromise:GR,ZodReadonly:VR,ZodRealError:Qi,ZodRecord:jh,ZodSet:RR,ZodString:xh,ZodStringFormat:pn,ZodSuccess:zR,ZodSymbol:dR,ZodTemplateLiteral:HR,ZodTransform:TR,ZodTuple:kR,ZodType:wt,ZodULID:Gx,ZodURL:wh,ZodUUID:fa,ZodUndefined:fR,ZodUnion:Eh,ZodUnknown:gR,ZodVoid:yR,ZodXID:Zx,ZodXor:xR,_ZodString:Ux,_default:DR,_function:Zy,any:wH,array:cs,base64:aH,base64url:sH,bigint:vH,boolean:Yt,catch:FR,check:FH,cidrv4:iH,cidrv6:oH,clone:No,codec:MH,coerce:xye,config:Pr,core:oye,cuid:WB,cuid2:XB,custom:UH,date:_H,decode:DB,decodeAsync:PB,describe:VH,discriminatedUnion:SR,e164:lH,email:lR,emoji:ZB,encode:AB,encodeAsync:$B,endsWith:Dx,enum:Al,file:AH,flattenError:dj,float32:mH,float64:hH,formatError:fj,fromJSONSchema:mye,function:Zy,getErrorMap:dye,globalRegistry:Uo,gt:wl,gte:yi,guid:UB,hash:pH,hex:fH,hostname:dH,httpUrl:GB,includes:Ox,instanceof:HH,int:Gy,int32:uR,int64:yH,intersection:CR,ipv4:tH,ipv6:rH,iso:jB,json:KH,jwt:cH,keyof:CH,ksuid:eH,lazy:KR,length:yh,literal:wf,locales:G5,looseObject:EH,looseRecord:IH,lowercase:Nx,lt:xl,lte:Co,mac:nH,map:NH,maxLength:vh,maxSize:gh,meta:BH,mime:$x,minLength:$c,minSize:qd,multipleOf:Hd,nan:PH,nanoid:YB,nativeEnum:OH,negative:Qj,never:a0,nonnegative:tR,nonoptional:MR,nonpositive:eR,normalize:Px,null:mR,nullable:Rm,nullish:DH,number:i0,object:Dt,optional:jm,overwrite:hs,parse:IB,parseAsync:NB,partialRecord:RH,pipe:Im,positive:Jj,prefault:PR,preprocess:GH,prettifyError:E6,promise:LH,property:nR,readonly:BR,record:c0,refine:YR,regex:Ix,regexes:Sj,registry:Tj,safeDecode:zB,safeDecodeAsync:FB,safeEncode:MB,safeEncodeAsync:LB,safeParse:TB,safeParseAsync:OB,set:TH,setErrorMap:uye,size:Rx,slugify:Fx,startsWith:Ax,strictObject:kH,string:nt,stringFormat:uH,stringbool:qH,success:$H,superRefine:WR,symbol:xH,templateLiteral:zH,toJSONSchema:SB,toLowerCase:zx,toUpperCase:Lx,transform:u0,treeifyError:C6,trim:Mx,tuple:ER,uint32:gH,uint64:bH,ulid:JB,undefined:Em,union:l0,unknown:Pc,uppercase:Tx,url:KB,util:S6,uuid:VB,uuidv4:BB,uuidv6:HB,uuidv7:qB,void:SH,xid:QB,xor:jH},Symbol.toStringTag,{value:"Module"})),Sf=lR({error:"Please enter a valid email address."}).toLowerCase().trim(),Ih=nt().nonempty({error:"Please enter your password."}),XR=nt().nonempty({error:"Please enter a username."}),wye=Dt({username:XR,password:Ih}),Sye=Dt({email:Sf,password:Ih});function _ye({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 D2=["localhost","127.0.0.1"];var GC=(e=>(e.MixedLoopback="MixedLoopback",e.InsecureCookieOutsideChromeAndFirefox="InsecureCookieOutsideChromeAndFirefox",e))(GC||{});function Cye(e,t,n){if(!n||!t||!e)return null;const r=new URL(n).hostname,i=D2.includes(t),o=D2.includes(r);if(i&&o&&r!==t)return"MixedLoopback";if(!i&&o){const a=e.indexOf("Chrome")>=0,c=e.indexOf("Firefox")>=0;if(!a&&!c)return"InsecureCookieOutsideChromeAndFirefox"}return null}const $2=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ZC=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?$2(r.ref,n,e):r&&r.refs&&r.refs.forEach(i=>$2(i,n,e))}},P2=(e,t)=>{t.shouldUseNativeValidation&&ZC(e,t);const n={};for(const r in e){const i=Pe(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(kye(t.names||Object.keys(e),r)){const a=Object.assign({},Pe(n,r));qt(a,"root",o),qt(n,r,a)}else qt(n,r,o)}return n},kye=(e,t)=>{const n=M2(t);return e.some(r=>M2(r).match(`^${n}\\.\\d+`))};function M2(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 Eye(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 c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.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]=rj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function jye(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 c=r.errors[0][0];n[a]={message:c.message,type:c.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]=rj(a,t,n,i,f?[].concat(f,r.message):r.message)}e.shift()}return n}function mn(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&&ZC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return Array.isArray(c?.issues)})(a))return{values:{},errors:P2(Eye(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"?By:Hy)(e,r,t)).then(function(a){return o.shouldUseNativeValidation&&ZC({},o),{errors:{},values:n.raw?Object.assign({},r):a}})},function(a){if((function(c){return c instanceof kx})(a))return{values:{},errors:P2(jye(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 JR(){const{clusterId:e,instanceId:t}=it({strict:!1}),{data:n}=Pt(Tl(e,!0)),r=b.useMemo(()=>t&&n&&n?.instances?.find(k=>k.id===t)||void 0,[n,t]),i=b.useMemo(()=>n?.status&&bx.includes(n.status),[n?.status]),o="Local",a="instance",c=b.useMemo(()=>n?r?(Et.flagForFabricConnect(r.id,!1),Yk(r)):(Et.flagForFabricConnect(n.id,!1),Zk(n)):null,[n,r]),d=Zt(c),f=b.useMemo(()=>c?.includes("localhost")||c?.includes("127.0.0.1"),[c]),m=b.useMemo(()=>Cye(navigator.userAgent,location.hostname,c),[c]),{data:h}=Pt(_ye(d)),v=on({resolver:mn(wye),defaultValues:{username:"",password:""}}),{control:y,handleSubmit:x}=v,{submitForm:S,isPending:C}=Gme({cluster:n,instance:r,instanceParams:d});return!t&&n&&!n?.fqdn?u.jsx(_c,{to:"../instances",replace:!0}):i&&n?.resetPassword?u.jsx(_c,{to:`/${n.organizationId}/${n.id}/finish-setup`,replace:!0}):!i&&n?.resetPassword?u.jsx(_c,{to:`/${n.organizationId}/${n.id}/starting-up`,replace:!0}):u.jsxs(u.Fragment,{children:[!hd,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(an,{...v,children:u.jsxs("form",{onSubmit:x(S),className:"my-4",children:[u.jsx($e,{control:y,name:"username",render:({field:k})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Username"}),u.jsx(De,{children:u.jsx(Me,{autoComplete:"username",autoFocus:!0,type:"text",...k})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:y,name:"password",render:({field:k})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...k})}),u.jsx(Oe,{})]})}),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:`${c}health`,className:"underline",target:"_blank",children:[c,"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===GC.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===GC.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(Ze,{to:qme(),target:"_blank",children:u.jsx(be,{type:"button",variant:"positive",children:"Connect to Harper Fabric"})})})]})]})})]})})]})}async function Rye({email:e}){const{data:t}=await Gt.post("/ForgotPassword/",{email:e});if(t)return t;throw new Error("Something went wrong")}function Iye(){return ct({mutationFn:e=>Rye(e)})}const Nye=Dt({email:Sf});function Tye(){const e=En(),{me:t}=Er({strict:!1}),n=on({resolver:mn(Nye),defaultValues:{email:t||""}}),r=n.watch("email"),{setFocus:i,control:o,handleSubmit:a}=n;b.useEffect(()=>{i("email")},[i]);const{mutate:c,isPending:d}=Iye(),f=async m=>{c(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(an,{...n,children:u.jsxs("form",{onSubmit:a(f),className:"my-4",children:[u.jsx($e,{control:o,name:"email",render:({field:m})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"Email"}),u.jsx(De,{children:u.jsx(Me,{disabled:d,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Oe,{})]})}),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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:r},children:"Sign in to your account"}),u.jsx(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:r},children:"Sign up for free"})]})]})}const Oye=async({token:e,password:t})=>{const{data:n}=await Gt.put("/ResetPassword/",{token:e,newPassword:t});return n};function Aye(){return ct({mutationFn:e=>Oye(e)})}const Dye=Dt({password:Ih.min(8,{error:"Password must be at least 8 characters long."}).max(50,{error:"Password cannot be longer than 50 characters."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function $ye(){const{token:e}=Er({strict:!1}),t=En();b.useEffect(()=>{e||t({to:"/sign-in"})},[e,t]);const n=on({resolver:mn(Dye),defaultValues:{password:"",confirmPassword:""}}),{setFocus:r,control:i,handleSubmit:o}=n;b.useEffect(()=>{r("password")},[r]);const{mutate:a,isPending:c}=Aye(),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(an,{...n,children:u.jsxs("form",{className:"my-4",onSubmit:o(d),children:[u.jsx($e,{control:i,name:"password",render:({field:f})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"New Password"}),u.jsx(De,{children:u.jsx(Me,{disabled:c,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:i,name:"confirmPassword",render:({field:f})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{disabled:c,type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Oe,{})]})}),u.jsx(be,{variant:"submit",type:"submit",disabled:c,className:"w-full my-2 rounded-full",children:"Submit New Password"})]})})]})}function YH({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(aE,{className:"github-icon"}),e]})})}function WH({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 Pye(){const e=En(),t=rr(),n=xn(),{redirect:r}=Er({strict:!1}),{mutate:i,isPending:o}=Mye(),a=b.useCallback(c=>{i(c,{onSuccess:async d=>{Et.setUserForEntity(An,d);const f=qc(d);zE(d.email),await t.invalidateQueries({queryKey:Rb,refetchType:"none"}),n.invalidate(),await e({to:r?.startsWith("/")?r:f})}})},[e,t,r,n,i]);return{isPending:o,submitForm:a}}function Mye(){return ct({mutationFn:e=>zye(e)})}async function zye({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 Lye(){const{me:e}=Er({strict:!1}),t=on({resolver:mn(Sye),defaultValues:{email:e||"",password:""}}),{handleSubmit:n,control:r}=t,i=t.watch("email"),{submitForm:o,isPending:a}=Pye();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(an,{...t,children:u.jsxs("form",{onSubmit:n(o),className:"my-4",children:[u.jsx($e,{control:r,name:"email",render:({field:c})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Email"}),u.jsx(De,{children:u.jsx(Me,{type:"email",autoFocus:!0,className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...c})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r,name:"password",render:({field:c})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...c})}),u.jsx(Oe,{})]})}),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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-up",search:{me:i},children:"Sign up for free"}),u.jsx(Ze,{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(WH,{text:"Sign in with Google"}),u.jsx(YH,{text:"Sign in with GitHub"})]})]})}async function Fye(e){const{data:t}=await Gt.post("/User/",e);if(t)return t;throw new Error("Something went wrong")}function Uye(){return ct({mutationFn:e=>Fye(e)})}const Vye=Dt({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),firstname:nt().trim().min(2,{error:"Please enter your first name."}).max(40,{error:"First name cannot be longer than 40 characters."}),lastname:nt().trim().min(2,{error:"Please enter your last name."}).max(80,{error:"Last name cannot be longer than 80 characters."}),password:Ih.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function Bye(){const e=En(),{email:t,me:n}=Er({strict:!1}),r=on({resolver:mn(Vye),defaultValues:{firstname:"",lastname:"",email:n||t||"",password:"",confirmPassword:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:c}=r;b.useEffect(()=>{o("firstname")},[o]);const{mutate:d}=Uye(),f=b.useCallback(async m=>{const{confirmPassword:h,...v}=m;d(v,{onSuccess:()=>{zE(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(WH,{text:"Sign up with Google"}),u.jsx(YH,{text:"Sign up with GitHub"})]}),u.jsx("hr",{className:"border-gray-600"}),u.jsx(an,{...r,children:u.jsxs("form",{onSubmit:c(f),className:"grid gap-4 my-4",children:[u.jsx($e,{control:a,name:"firstname",render:({field:m})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"First Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a,name:"lastname",render:({field:m})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Last Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",autoCapitalize:"words",...m})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a,name:"email",render:({field:m})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Email"}),u.jsx(De,{children:u.jsx(Me,{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(Oe,{})]})}),u.jsx($e,{control:a,name:"password",render:({field:m})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a,name:"confirmPassword",render:({field:m})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...m})}),u.jsx(Oe,{})]})}),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(Ze,{className:"m-auto text-sm hover:text-blue-300",to:"/sign-in",search:{me:i},children:"Already have an account? Sign in instead."})})]})}const Hye=async({email:e})=>{const{data:t}=await Gt.post("/ResendVerificationEmail/",{email:e});return t};function XH(){return ct({mutationFn:e=>Hye(e)})}const qye=async e=>{const{data:t}=await Gt.put("/VerifyEmail/",{token:e.toString()});return t};function Kye(){return ct({mutationFn:e=>qye(e)})}const Gye=Dt({email:Sf});function Zye(){const e=En(),{mutate:t,isPending:n}=XH(),r=on({resolver:mn(Gye),defaultValues:{email:""}}),i=r.watch("email"),{setFocus:o,control:a,handleSubmit:c}=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(an,{...r,children:[u.jsx("p",{className:"text-sm py-2",children:"Please Enter an Email"}),u.jsxs("form",{onSubmit:c(d),className:"my-4",children:[u.jsx($e,{control:a,name:"email",render:({field:f})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"Email"}),u.jsx(De,{children:u.jsx(Me,{disabled:n,type:"email",className:"bg-purple-400 border-purple-400 dark:bg-black dark:border-black",...f})}),u.jsx(Oe,{})]})}),u.jsx(be,{type:"submit",variant:"submit",disabled:n,className:"w-full my-2 rounded-full",children:"Send Verification Email"})]})]})}function Yye(){const{token:e}=Er({strict:!1}),t=En(),{mutate:n,isPending:r}=Kye(),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(Zye,{})]})}function Wye(){const{email:e}=Er({strict:!1}),{mutate:t,isPending:n}=XH(),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(Ze,{className:"text-sm hover:text-blue-300",to:"/sign-in",search:{me:e},children:"I did it, let me sign in!"}),u.jsx(Ze,{className:"text-sm opacity-50 hover:text-blue-300",to:void 0,onClick:r,disabled:n,children:"Send me another code, please."})]})]})}const Dl=rt({getParentRoute:()=>tx,id:"_authLayout",component:Nfe}),Xye=rt({getParentRoute:()=>Dl,path:"sign-in",component:Lye,beforeLoad:({context:e,location:t})=>{const n=e.authentication[An]?.user;if(n){const r=t?.search,i=qc(n);throw Vc({to:r?.redirect?.startsWith("/")?r.redirect:i})}}}),Jye=rt({getParentRoute:()=>tx,path:"sign-in",component:JR,beforeLoad:({context:e,location:t})=>{if(e.authentication[An]?.user){const n=t?.search;throw Vc({to:n?.redirect?.startsWith("/")?n.redirect:ya})}}}),Qye=rt({getParentRoute:()=>Dl,path:"sign-up",component:Bye}),ebe=rt({getParentRoute:()=>Dl,path:"forgot-password",component:Tye}),tbe=rt({getParentRoute:()=>Dl,path:"verify-email",component:Yye}),nbe=rt({getParentRoute:()=>Dl,path:"verifying",component:Wye}),rbe=rt({getParentRoute:()=>Dl,path:"check-oauth",component:Afe}),ibe=rt({getParentRoute:()=>Dl,path:"reset-password",component:$ye});Dl.addChildren([Xye,Qye,rbe,ebe,tbe,nbe,ibe]);const obe=[Jye];function gs({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(mx,{}),e]})})}function JH(e){if(YC(e)||WC(e))return"warning";if(QH(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 QH(e){switch(e){case"RUNNING":case"UPDATED":return!0;default:return!1}}function Nh(e){return e==="FAILED"}function QR(e){return e==="TERMINATED"}function YC(e){return e==="CLONE_PENDING"}function WC(e){switch(e){case"PROVISIONING":case"CLONING":case"CLONE_READY":case"UPDATING_HDB_NODES":case"UPDATING":return!0;default:return!1}}var r1="focusScope.autoFocusOnMount",i1="focusScope.autoFocusOnUnmount",L2={bubbles:!1,cancelable:!0},abe="FocusScope",h0=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[c,d]=b.useState(null),f=In(i),m=In(o),h=b.useRef(null),v=ft(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||!c)return;const R=j.target;c.contains(R)?h.current=R:Gs(h.current,{select:!0})},C=function(j){if(y.paused||!c)return;const R=j.relatedTarget;R!==null&&(c.contains(R)||Gs(h.current,{select:!0}))},k=function(j){if(document.activeElement===document.body)for(const T of j)T.removedNodes.length>0&&Gs(c)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[r,c,y.paused]),b.useEffect(()=>{if(c){U2.add(y);const S=document.activeElement;if(!c.contains(S)){const k=new CustomEvent(r1,L2);c.addEventListener(r1,f),c.dispatchEvent(k),k.defaultPrevented||(sbe(fbe(e8(c)),{select:!0}),document.activeElement===S&&Gs(c))}return()=>{c.removeEventListener(r1,f),setTimeout(()=>{const k=new CustomEvent(i1,L2);c.addEventListener(i1,m),c.dispatchEvent(k),k.defaultPrevented||Gs(S??document.body,{select:!0}),c.removeEventListener(i1,m),U2.remove(y)},0)}}},[c,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,R]=lbe(E);j&&R?!S.shiftKey&&k===R?(S.preventDefault(),n&&Gs(j,{select:!0})):S.shiftKey&&k===j&&(S.preventDefault(),n&&Gs(R,{select:!0})):k===E&&S.preventDefault()}},[n,r,y.paused]);return u.jsx(Ye.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});h0.displayName=abe;function sbe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gs(r,{select:t}),document.activeElement!==n)return}function lbe(e){const t=e8(e),n=F2(t,e),r=F2(t.reverse(),e);return[n,r]}function e8(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 F2(e,t){for(const n of e)if(!cbe(n,{upTo:t}))return n}function cbe(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 ube(e){return e instanceof HTMLInputElement&&"select"in e}function Gs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ube(e)&&t&&e.select()}}var U2=dbe();function dbe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=V2(e,t),e.unshift(t)},remove(t){e=V2(e,t),e[0]?.resume()}}}function V2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fbe(e){return e.filter(t=>t.tagName!=="A")}var o1=0;function eI(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??B2()),document.body.insertAdjacentElement("beforeend",e[1]??B2()),o1++,()=>{o1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),o1--}},[])}function B2(){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 XC=function(e,t){return XC=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])},XC(e,t)};function C2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");XC(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var la=function(){return la=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},la.apply(this,arguments)};function t8(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 eu(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 c(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(c,d)}f((r=r.apply(e,t||[])).next())})}function pbe(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 cy="right-scroll-bar-position",uy="width-before-scroll-bar",mbe="with-scroll-bars-hidden",hbe="--removed-body-scroll-bar-size";function a1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gbe(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 vbe=typeof window<"u"?b.useLayoutEffect:b.useEffect,H2=new WeakMap;function ybe(e,t){var n=gbe(null,function(r){return e.forEach(function(i){return a1(i,r)})});return vbe(function(){var r=H2.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(c){o.has(c)||a1(c,null)}),o.forEach(function(c){i.has(c)||a1(c,a)})}H2.set(n,e)},[e]),n}function bbe(e){return e}function xbe(e,t){t===void 0&&(t=bbe);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(c){return c!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var c=n;n=[],c.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 wbe(e){e===void 0&&(e={});var t=xbe(null);return t.options=la({async:!0,ssr:!1},e),t}var n8=function(e){var t=e.sideCar,n=t8(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,la({},n))};n8.isSideCarExport=!0;function Sbe(e,t){return e.useMedium(t),n8}var r8=wbe(),s1=function(){},g0=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:s1,onWheelCapture:s1,onTouchMoveCapture:s1}),i=r[0],o=r[1],a=e.forwardProps,c=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,R=t8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=v,N=ybe([n,t]),O=la(la({},R),i);return b.createElement(b.Fragment,null,m&&b.createElement(T,{sideCar:r8,removeScrollBar:f,shards:h,noRelative:y,noIsolation:x,inert:S,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:j}),a?b.cloneElement(b.Children.only(c),la(la({},O),{ref:N})):b.createElement(E,la({},O,{className:d,ref:N}),c))});g0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};g0.classNames={fullWidth:uy,zeroRight:cy};var _be=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Cbe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_be();return t&&e.setAttribute("nonce",t),e}function kbe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ebe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jbe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Cbe())&&(kbe(t,n),Ebe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Rbe=function(){var e=jbe();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},i8=function(){var e=Rbe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Ibe={left:0,top:0,right:0,gap:0},l1=function(e){return parseInt(e||"",10)||0},Nbe=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[l1(n),l1(r),l1(i)]},Tbe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ibe;var t=Nbe(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])}},Obe=i8(),Sd="data-scroll-locked",Abe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
69
+ .`.concat(mbe,` {
70
+ overflow: hidden `).concat(r,`;
71
+ padding-right: `).concat(c,"px ").concat(r,`;
72
+ }
73
+ body[`).concat(Sd,`] {
74
+ overflow: hidden `).concat(r,`;
75
+ overscroll-behavior: contain;
76
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
77
+ padding-left: `.concat(i,`px;
78
+ padding-top: `).concat(o,`px;
79
+ padding-right: `).concat(a,`px;
80
+ margin-left:0;
81
+ margin-top:0;
82
+ margin-right: `).concat(c,"px ").concat(r,`;
83
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
84
+ }
85
+
86
+ .`).concat(cy,` {
87
+ right: `).concat(c,"px ").concat(r,`;
88
+ }
89
+
90
+ .`).concat(uy,` {
91
+ margin-right: `).concat(c,"px ").concat(r,`;
92
+ }
93
+
94
+ .`).concat(cy," .").concat(cy,` {
95
+ right: 0 `).concat(r,`;
96
+ }
97
+
98
+ .`).concat(uy," .").concat(uy,` {
99
+ margin-right: 0 `).concat(r,`;
100
+ }
101
+
102
+ body[`).concat(Sd,`] {
103
+ `).concat(hbe,": ").concat(c,`px;
104
+ }
105
+ `)},q2=function(){var e=parseInt(document.body.getAttribute(Sd)||"0",10);return isFinite(e)?e:0},Dbe=function(){b.useEffect(function(){return document.body.setAttribute(Sd,(q2()+1).toString()),function(){var e=q2()-1;e<=0?document.body.removeAttribute(Sd):document.body.setAttribute(Sd,e.toString())}},[])},$be=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Dbe();var o=b.useMemo(function(){return Tbe(i)},[i]);return b.createElement(Obe,{styles:Abe(o,!t,i,n?"":"!important")})},JC=!1;if(typeof window<"u")try{var Ev=Object.defineProperty({},"passive",{get:function(){return JC=!0,!0}});window.addEventListener("test",Ev,Ev),window.removeEventListener("test",Ev,Ev)}catch{JC=!1}var Qu=JC?{passive:!1}:!1,Pbe=function(e){return e.tagName==="TEXTAREA"},o8=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Pbe(e)&&n[t]==="visible")},Mbe=function(e){return o8(e,"overflowY")},zbe=function(e){return o8(e,"overflowX")},K2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=a8(e,r);if(i){var o=s8(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lbe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Fbe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},a8=function(e,t){return e==="v"?Mbe(t):zbe(t)},s8=function(e,t){return e==="v"?Lbe(t):Fbe(t)},Ube=function(e,t){return e==="h"&&t==="rtl"?-1:1},Vbe=function(e,t,n,r,i){var o=Ube(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,d=t.contains(c),f=!1,m=a>0,h=0,v=0;do{if(!c)break;var y=s8(e,c),x=y[0],S=y[1],C=y[2],k=S-C-o*x;(x||k)&&a8(e,c)&&(h+=k,v+=x);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(m&&Math.abs(h)<1||!m&&Math.abs(v)<1)&&(f=!0),f},jv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},G2=function(e){return[e.deltaX,e.deltaY]},Z2=function(e){return e&&"current"in e?e.current:e},Bbe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hbe=function(e){return`
106
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
107
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
108
+ `)},qbe=0,ed=[];function Kbe(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(qbe++)[0],o=b.useState(i8)[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=pbe([e.lockRef.current],(e.shards||[]).map(Z2),!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 c=b.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!a.current.allowPinchZoom;var k=jv(S),E=n.current,j="deltaX"in S?S.deltaX:E[0]-k[0],R="deltaY"in S?S.deltaY:E[1]-k[1],T,N=S.target,O=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&O==="h"&&N.type==="range")return!1;var M=K2(O,N);if(!M)return!0;if(M?T=O:(T=O==="v"?"h":"v",M=K2(O,N)),!M)return!1;if(!r.current&&"changedTouches"in S&&(j||R)&&(r.current=T),!T)return!0;var L=r.current||T;return Vbe(L,C,S,L==="h"?j:R)},[]),d=b.useCallback(function(S){var C=S;if(!(!ed.length||ed[ed.length-1]!==o)){var k="deltaY"in C?G2(C):jv(C),E=t.current.filter(function(T){return T.name===C.type&&(T.target===C.target||C.target===T.shadowParent)&&Bbe(T.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var j=(a.current.shards||[]).map(Z2).filter(Boolean).filter(function(T){return T.contains(C.target)}),R=j.length>0?c(C,j[0]):!a.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),f=b.useCallback(function(S,C,k,E){var j={name:S,delta:C,target:k,should:E,shadowParent:Gbe(k)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(R){return R!==j})},1)},[]),m=b.useCallback(function(S){n.current=jv(S),r.current=void 0},[]),h=b.useCallback(function(S){f(S.type,G2(S),S.target,c(S,e.lockRef.current))},[]),v=b.useCallback(function(S){f(S.type,jv(S),S.target,c(S,e.lockRef.current))},[]);b.useEffect(function(){return ed.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",d,Qu),document.addEventListener("touchmove",d,Qu),document.addEventListener("touchstart",m,Qu),function(){ed=ed.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,Qu),document.removeEventListener("touchmove",d,Qu),document.removeEventListener("touchstart",m,Qu)}},[]);var y=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(o,{styles:Hbe(i)}):null,y?b.createElement($be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gbe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zbe=Sbe(r8,Kbe);var v0=b.forwardRef(function(e,t){return b.createElement(g0,la({},e,{ref:t,sideCar:Zbe}))});v0.classNames=g0.classNames;var Ybe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},td=new WeakMap,Rv=new WeakMap,Iv={},c1=0,l8=function(e){return e&&(e.host||l8(e.parentNode))},Wbe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=l8(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})},Xbe=function(e,t,n,r){var i=Wbe(t,Array.isArray(e)?e:[e]);Iv[n]||(Iv[n]=new WeakMap);var o=Iv[n],a=[],c=new Set,d=new Set(i),f=function(h){!h||c.has(h)||(c.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(c.has(v))m(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",S=(td.get(v)||0)+1,C=(o.get(v)||0)+1;td.set(v,S),o.set(v,C),a.push(v),S===1&&x&&Rv.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),c.clear(),c1++,function(){a.forEach(function(h){var v=td.get(h)-1,y=o.get(h)-1;td.set(h,v),o.set(h,y),v||(Rv.has(h)||h.removeAttribute(r),Rv.delete(h)),y||h.removeAttribute(n)}),c1--,c1||(td=new WeakMap,td=new WeakMap,Rv=new WeakMap,Iv={})}},tI=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Ybe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Xbe(r,i,n,"aria-hidden")):function(){return null}},y0="Dialog",[c8]=Xi(y0),[Jbe,Jo]=c8(y0),u8=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=b.useRef(null),d=b.useRef(null),[f,m]=qo({prop:r,defaultProp:i??!1,onChange:o,caller:y0});return u.jsx(Jbe,{scope:t,triggerRef:c,contentRef:d,contentId:Fi(),titleId:Fi(),descriptionId:Fi(),open:f,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(h=>!h),[m]),modal:a,children:n})};u8.displayName=y0;var d8="DialogTrigger",f8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jo(d8,n),o=ft(t,i.triggerRef);return u.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":iI(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});f8.displayName=d8;var nI="DialogPortal",[Qbe,p8]=c8(nI,{forceMount:void 0}),m8=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Jo(nI,t);return u.jsx(Qbe,{scope:t,forceMount:n,children:b.Children.map(r,a=>u.jsx(ir,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:a})}))})};m8.displayName=nI;var Yy="DialogOverlay",h8=b.forwardRef((e,t)=>{const n=p8(Yy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jo(Yy,e.__scopeDialog);return o.modal?u.jsx(ir,{present:r||o.open,children:u.jsx(txe,{...i,ref:t})}):null});h8.displayName=Yy;var exe=Md("DialogOverlay.RemoveScroll"),txe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jo(Yy,n);return u.jsx(v0,{as:exe,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ye.div,{"data-state":iI(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",g8=b.forwardRef((e,t)=>{const n=p8(Mc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jo(Mc,e.__scopeDialog);return u.jsx(ir,{present:r||o.open,children:o.modal?u.jsx(nxe,{...i,ref:t}):u.jsx(rxe,{...i,ref:t})})});g8.displayName=Mc;var nxe=b.forwardRef((e,t)=>{const n=Jo(Mc,e.__scopeDialog),r=b.useRef(null),i=ft(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return tI(o)},[]),u.jsx(v8,{...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,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),rxe=b.forwardRef((e,t)=>{const n=Jo(Mc,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return u.jsx(v8,{...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()}})}),v8=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,c=Jo(Mc,n),d=b.useRef(null),f=ft(t,d);return eI(),u.jsxs(u.Fragment,{children:[u.jsx(h0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(mf,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":iI(c.open),...a,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(ixe,{titleId:c.titleId}),u.jsx(axe,{contentRef:d,descriptionId:c.descriptionId})]})]})}),rI="DialogTitle",y8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jo(rI,n);return u.jsx(Ye.h2,{id:i.titleId,...r,ref:t})});y8.displayName=rI;var b8="DialogDescription",x8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jo(b8,n);return u.jsx(Ye.p,{id:i.descriptionId,...r,ref:t})});x8.displayName=b8;var w8="DialogClose",S8=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jo(w8,n);return u.jsx(Ye.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});S8.displayName=w8;function iI(e){return e?"open":"closed"}var _8="DialogTitleWarning",[k2e,C8]=kde(_8,{contentName:Mc,titleName:rI,docsSlug:"dialog"}),ixe=({titleId:e})=>{const t=C8(_8),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
109
+
110
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
111
+
112
+ 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},oxe="DialogDescriptionWarning",axe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${C8(oxe).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},sxe=u8,lxe=f8,cxe=m8,uxe=h8,dxe=g8,fxe=y8,pxe=x8,mxe=S8;function Fn({...e}){return u.jsx(sxe,{"data-slot":"dialog",...e})}function k8({...e}){return u.jsx(lxe,{"data-slot":"dialog-trigger",...e})}function hxe({...e}){return u.jsx(cxe,{"data-slot":"dialog-portal",...e})}function gxe({className:e,...t}){return u.jsx(uxe,{"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 Un({className:e,children:t,...n}){return u.jsxs(hxe,{"data-slot":"dialog-portal",children:[u.jsx(gxe,{}),u.jsxs(dxe,{"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(mxe,{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(D4,{className:"text-white"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gr({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 Zn({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 $n({className:e,...t}){return u.jsx(fxe,{"data-slot":"dialog-title",className:Ue("text-lg leading-none text-white font-semibold",e),...t})}function kr({className:e,...t}){return u.jsx(pxe,{"data-slot":"dialog-description",className:Ue("text-muted-foreground text-sm",e),...t})}function b0({typeOfThingBeingDeleted:e,nameOfThingBeingDeleted:t,isModalOpen:n,hideDataLossWarning:r,setIsModalOpen:i,deletionConfirmed:o,deletionPending:a,trigger:c,presentParticiple:d="Deleting",transitiveVerb:f="Delete"}){return u.jsxs(Fn,{open:n,onOpenChange:i,children:[c&&u.jsx(k8,{asChild:!0,children:c}),u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsxs(gr,{children:[u.jsxs($n,{children:["Are you sure you want to ",f.toLowerCase()," this ",e,"?"]}),u.jsx(kr,{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(vne,{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(Zn,{children:u.jsxs("div",{className:"flex justify-center space-x-5",children:[u.jsxs(be,{className:"rounded-full",onClick:()=>i(!1),children:[u.jsx(Oc,{})," Cancel"]}),u.jsxs(be,{variant:"destructive",className:"rounded-full",onClick:o,disabled:a,children:[u.jsx(Ca,{})," ",f]})]})})]})]})}function Zo({className:e,variant:t,asChild:n=!1,...r}){const i=n?rE:"span";return u.jsx(i,{"data-slot":"badge",className:Ue(aU({variant:t}),e),...r})}var u1="rovingFocusGroup.onEntryFocus",vxe={bubbles:!1,cancelable:!0},Th="RovingFocusGroup",[QC,E8,yxe]=Qm(Th),[bxe,_f]=Xi(Th,[yxe]),[xxe,wxe]=bxe(Th),j8=b.forwardRef((e,t)=>u.jsx(QC.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(QC.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Sxe,{...e,ref:t})})}));j8.displayName=Th;var Sxe=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,v=b.useRef(null),y=ft(t,v),x=Wc(o),[S,C]=qo({prop:a,defaultProp:c??null,onChange:d,caller:Th}),[k,E]=b.useState(!1),j=In(f),R=E8(n),T=b.useRef(!1),[N,O]=b.useState(0);return b.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(u1,j),()=>M.removeEventListener(u1,j)},[j]),u.jsx(xxe,{scope:n,orientation:r,dir:x,loop:i,currentTabStopId:S,onItemFocus:b.useCallback(M=>C(M),[C]),onItemShiftTab:b.useCallback(()=>E(!0),[]),onFocusableItemAdd:b.useCallback(()=>O(M=>M+1),[]),onFocusableItemRemove:b.useCallback(()=>O(M=>M-1),[]),children:u.jsx(Ye.div,{tabIndex:k||N===0?-1:0,"data-orientation":r,...h,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{T.current=!0}),onFocus:Re(e.onFocus,M=>{const L=!T.current;if(M.target===M.currentTarget&&L&&!k){const K=new CustomEvent(u1,vxe);if(M.currentTarget.dispatchEvent(K),!K.defaultPrevented){const ee=R().filter(z=>z.focusable),q=ee.find(z=>z.active),Y=ee.find(z=>z.id===S),H=[q,Y,...ee].filter(Boolean).map(z=>z.ref.current);N8(H,m)}}T.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),R8="RovingFocusGroupItem",I8=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...c}=e,d=Fi(),f=o||d,m=wxe(R8,n),h=m.currentTabStopId===f,v=E8(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:S}=m;return b.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),u.jsx(QC.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:u.jsx(Ye.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...c,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=kxe(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(R=>R.focusable).map(R=>R.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const R=j.indexOf(C.currentTarget);j=m.loop?Exe(j,R+1):j.slice(R+1)}setTimeout(()=>N8(j))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:S!=null}):a})})});I8.displayName=R8;var _xe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cxe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kxe(e,t,n){const r=Cxe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _xe[r]}function N8(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Exe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var oI=j8,aI=I8,ek=["Enter"," "],jxe=["ArrowDown","PageUp","Home"],T8=["ArrowUp","PageDown","End"],Rxe=[...jxe,...T8],Ixe={ltr:[...ek,"ArrowRight"],rtl:[...ek,"ArrowLeft"]},Nxe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Oh="Menu",[Nm,Txe,Oxe]=Qm(Oh),[tu,O8]=Xi(Oh,[Oxe,bf,_f]),x0=bf(),A8=_f(),[Axe,nu]=tu(Oh),[Dxe,Ah]=tu(Oh),D8=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,c=x0(t),[d,f]=b.useState(null),m=b.useRef(!1),h=In(o),v=Wc(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(GE,{...c,children:u.jsx(Axe,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:u.jsx(Dxe,{scope:t,onClose:b.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:v,modal:a,children:r})})})};D8.displayName=Oh;var $xe="MenuAnchor",sI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=x0(n);return u.jsx(ZE,{...i,...r,ref:t})});sI.displayName=$xe;var lI="MenuPortal",[Pxe,$8]=tu(lI,{forceMount:void 0}),P8=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=nu(lI,t);return u.jsx(Pxe,{scope:t,forceMount:n,children:u.jsx(ir,{present:n||o.open,children:u.jsx(nh,{asChild:!0,container:i,children:r})})})};P8.displayName=lI;var ko="MenuContent",[Mxe,cI]=tu(ko),M8=b.forwardRef((e,t)=>{const n=$8(ko,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=nu(ko,e.__scopeMenu),a=Ah(ko,e.__scopeMenu);return u.jsx(Nm.Provider,{scope:e.__scopeMenu,children:u.jsx(ir,{present:r||o.open,children:u.jsx(Nm.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(zxe,{...i,ref:t}):u.jsx(Lxe,{...i,ref:t})})})})}),zxe=b.forwardRef((e,t)=>{const n=nu(ko,e.__scopeMenu),r=b.useRef(null),i=ft(t,r);return b.useEffect(()=>{const o=r.current;if(o)return tI(o)},[]),u.jsx(uI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Lxe=b.forwardRef((e,t)=>{const n=nu(ko,e.__scopeMenu);return u.jsx(uI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fxe=Md("MenuContent.ScrollLock"),uI=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,disableOutsideScroll:x,...S}=e,C=nu(ko,n),k=Ah(ko,n),E=x0(n),j=A8(n),R=Txe(n),[T,N]=b.useState(null),O=b.useRef(null),M=ft(t,O,C.onContentChange),L=b.useRef(0),K=b.useRef(""),ee=b.useRef(0),q=b.useRef(null),Y=b.useRef("right"),U=b.useRef(0),H=x?v0:b.Fragment,z=x?{as:Fxe,allowPinchZoom:!0}:void 0,W=te=>{const D=K.current+te,$=R().filter(B=>!B.disabled),V=document.activeElement,A=$.find(B=>B.ref.current===V)?.textValue,J=$.map(B=>B.textValue),fe=Jxe(J,D,A),ge=$.find(B=>B.textValue===fe)?.ref.current;(function B(se){K.current=se,window.clearTimeout(L.current),se!==""&&(L.current=window.setTimeout(()=>B(""),1e3))})(D),ge&&setTimeout(()=>ge.focus())};b.useEffect(()=>()=>window.clearTimeout(L.current),[]),eI();const F=b.useCallback(te=>Y.current===q.current?.side&&e0e(te,q.current?.area),[]);return u.jsx(Mxe,{scope:n,searchRef:K,onItemEnter:b.useCallback(te=>{F(te)&&te.preventDefault()},[F]),onItemLeave:b.useCallback(te=>{F(te)||(O.current?.focus(),N(null))},[F]),onTriggerLeave:b.useCallback(te=>{F(te)&&te.preventDefault()},[F]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:b.useCallback(te=>{q.current=te},[]),children:u.jsx(H,{...z,children:u.jsx(h0,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,te=>{te.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(mf,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:v,onDismiss:y,children:u.jsx(oI,{asChild:!0,...j,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:N,onEntryFocus:Re(d,te=>{k.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(YE,{role:"menu","aria-orientation":"vertical","data-state":Q8(C.open),"data-radix-menu-content":"",dir:k.dir,...E,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,te=>{const $=te.target.closest("[data-radix-menu-content]")===te.currentTarget,V=te.ctrlKey||te.altKey||te.metaKey,A=te.key.length===1;$&&(te.key==="Tab"&&te.preventDefault(),!V&&A&&W(te.key));const J=O.current;if(te.target!==J||!Rxe.includes(te.key))return;te.preventDefault();const ge=R().filter(B=>!B.disabled).map(B=>B.ref.current);T8.includes(te.key)&&ge.reverse(),Wxe(ge)}),onBlur:Re(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(L.current),K.current="")}),onPointerMove:Re(e.onPointerMove,Tm(te=>{const D=te.target,$=U.current!==te.clientX;if(te.currentTarget.contains(D)&&$){const V=te.clientX>U.current?"right":"left";Y.current=V,U.current=te.clientX}}))})})})})})})});M8.displayName=ko;var Uxe="MenuGroup",dI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{role:"group",...r,ref:t})});dI.displayName=Uxe;var Vxe="MenuLabel",z8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{...r,ref:t})});z8.displayName=Vxe;var Wy="MenuItem",Y2="menu.itemSelect",w0=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=b.useRef(null),a=Ah(Wy,e.__scopeMenu),c=cI(Wy,e.__scopeMenu),d=ft(t,o),f=b.useRef(!1),m=()=>{const h=o.current;if(!n&&h){const v=new CustomEvent(Y2,{bubbles:!0,cancelable:!0});h.addEventListener(Y2,y=>r?.(y),{once:!0}),Ty(h,v),v.defaultPrevented?f.current=!1:a.onClose()}};return u.jsx(L8,{...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=c.searchRef.current!=="";n||v&&h.key===" "||ek.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});w0.displayName=Wy;var L8=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=cI(Wy,n),c=A8(n),d=b.useRef(null),f=ft(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(Nm.ItemSlot,{scope:n,disabled:r,textValue:i??v,children:u.jsx(aI,{asChild:!0,...c,focusable:!r,children:u.jsx(Ye.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,Tm(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Tm(x=>a.onItemLeave(x))),onFocus:Re(e.onFocus,()=>h(!0)),onBlur:Re(e.onBlur,()=>h(!1))})})})}),Bxe="MenuCheckboxItem",F8=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(q8,{scope:e.__scopeMenu,checked:n,children:u.jsx(w0,{role:"menuitemcheckbox","aria-checked":Xy(n)?"mixed":n,...i,ref:t,"data-state":pI(n),onSelect:Re(i.onSelect,()=>r?.(Xy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});F8.displayName=Bxe;var U8="MenuRadioGroup",[Hxe,qxe]=tu(U8,{value:void 0,onValueChange:()=>{}}),V8=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=In(r);return u.jsx(Hxe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(dI,{...i,ref:t})})});V8.displayName=U8;var B8="MenuRadioItem",H8=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=qxe(B8,e.__scopeMenu),o=n===i.value;return u.jsx(q8,{scope:e.__scopeMenu,checked:o,children:u.jsx(w0,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":pI(o),onSelect:Re(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});H8.displayName=B8;var fI="MenuItemIndicator",[q8,Kxe]=tu(fI,{checked:!1}),K8=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=Kxe(fI,n);return u.jsx(ir,{present:r||Xy(o.checked)||o.checked===!0,children:u.jsx(Ye.span,{...i,ref:t,"data-state":pI(o.checked)})})});K8.displayName=fI;var Gxe="MenuSeparator",G8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});G8.displayName=Gxe;var Zxe="MenuArrow",Z8=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=x0(n);return u.jsx(WE,{...i,...r,ref:t})});Z8.displayName=Zxe;var Yxe="MenuSub",[E2e,Y8]=tu(Yxe),Wp="MenuSubTrigger",W8=b.forwardRef((e,t)=>{const n=nu(Wp,e.__scopeMenu),r=Ah(Wp,e.__scopeMenu),i=Y8(Wp,e.__scopeMenu),o=cI(Wp,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:c,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=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(sI,{asChild:!0,...f,children:u.jsx(L8,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Q8(n.open),...e,ref:lf(t,i.onTriggerChange),onClick:h=>{e.onClick?.(h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Tm(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,Tm(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(c.current),c.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===" "||Ixe[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});W8.displayName=Wp;var X8="MenuSubContent",J8=b.forwardRef((e,t)=>{const n=$8(ko,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=nu(ko,e.__scopeMenu),a=Ah(ko,e.__scopeMenu),c=Y8(X8,e.__scopeMenu),d=b.useRef(null),f=ft(t,d);return u.jsx(Nm.Provider,{scope:e.__scopeMenu,children:u.jsx(ir,{present:r||o.open,children:u.jsx(Nm.Slot,{scope:e.__scopeMenu,children:u.jsx(uI,{id:c.contentId,"aria-labelledby":c.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!==c.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=Nxe[a.dir].includes(m.key);h&&v&&(o.onOpenChange(!1),c.trigger?.focus(),m.preventDefault())})})})})})});J8.displayName=X8;function Q8(e){return e?"open":"closed"}function Xy(e){return e==="indeterminate"}function pI(e){return Xy(e)?"indeterminate":e?"checked":"unchecked"}function Wxe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Xxe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Jxe(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=Xxe(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 Qxe(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 c=t[o],d=t[a],f=c.x,m=c.y,h=d.x,v=d.y;m>r!=v>r&&n<(h-f)*(r-m)/(v-m)+f&&(i=!i)}return i}function e0e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Qxe(n,t)}function Tm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var t0e=D8,n0e=sI,r0e=P8,i0e=M8,o0e=dI,a0e=z8,s0e=w0,l0e=F8,c0e=V8,u0e=H8,d0e=K8,f0e=G8,p0e=Z8,m0e=W8,h0e=J8,S0="DropdownMenu",[g0e]=Xi(S0,[O8]),Qr=O8(),[v0e,e9]=g0e(S0),t9=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,d=Qr(t),f=b.useRef(null),[m,h]=qo({prop:i,defaultProp:o??!1,onChange:a,caller:S0});return u.jsx(v0e,{scope:t,triggerId:Fi(),triggerRef:f,contentId:Fi(),open:m,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(v=>!v),[h]),modal:c,children:u.jsx(t0e,{...d,open:m,onOpenChange:h,dir:r,modal:c,children:n})})};t9.displayName=S0;var n9="DropdownMenuTrigger",r9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=e9(n9,n),a=Qr(n);return u.jsx(n0e,{asChild:!0,...a,children:u.jsx(Ye.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:lf(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:Re(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});r9.displayName=n9;var y0e="DropdownMenuPortal",i9=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return u.jsx(r0e,{...r,...n})};i9.displayName=y0e;var o9="DropdownMenuContent",a9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=e9(o9,n),o=Qr(n),a=b.useRef(!1);return u.jsx(i0e,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,c=>{a.current||i.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,c=>{const d=c.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)"}})});a9.displayName=o9;var b0e="DropdownMenuGroup",x0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(o0e,{...i,...r,ref:t})});x0e.displayName=b0e;var w0e="DropdownMenuLabel",s9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(a0e,{...i,...r,ref:t})});s9.displayName=w0e;var S0e="DropdownMenuItem",l9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(s0e,{...i,...r,ref:t})});l9.displayName=S0e;var _0e="DropdownMenuCheckboxItem",c9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(l0e,{...i,...r,ref:t})});c9.displayName=_0e;var C0e="DropdownMenuRadioGroup",k0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(c0e,{...i,...r,ref:t})});k0e.displayName=C0e;var E0e="DropdownMenuRadioItem",j0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(u0e,{...i,...r,ref:t})});j0e.displayName=E0e;var R0e="DropdownMenuItemIndicator",u9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(d0e,{...i,...r,ref:t})});u9.displayName=R0e;var I0e="DropdownMenuSeparator",d9=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(f0e,{...i,...r,ref:t})});d9.displayName=I0e;var N0e="DropdownMenuArrow",T0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(p0e,{...i,...r,ref:t})});T0e.displayName=N0e;var O0e="DropdownMenuSubTrigger",A0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(m0e,{...i,...r,ref:t})});A0e.displayName=O0e;var D0e="DropdownMenuSubContent",$0e=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return u.jsx(h0e,{...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)"}})});$0e.displayName=D0e;var P0e=t9,M0e=r9,z0e=i9,L0e=a9,F0e=s9,U0e=l9,V0e=c9,B0e=u9,H0e=d9;function Dh({...e}){return u.jsx(P0e,{"data-slot":"dropdown-menu",...e})}function $h({...e}){return u.jsx(M0e,{"data-slot":"dropdown-menu-trigger",...e})}function Ph({className:e,sideOffset:t=4,...n}){return u.jsx(z0e,{children:u.jsx(L0e,{"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 Sr({className:e,inset:t,variant:n="default",...r}){return u.jsx(U0e,{"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 q0e({className:e,children:t,checked:n,...r}){return u.jsxs(V0e,{"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(B0e,{children:u.jsx(iE,{className:"size-4"})})}),t]})}function Jy({className:e,inset:t,...n}){return u.jsx(F0e,{"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 Qy({className:e,...t}){return u.jsx(H0e,{"data-slot":"dropdown-menu-separator",className:Ue("bg-grey-700 -mx-1 my-1 h-px",e),...t})}function mI(e){return!!e?.plans?.[0]?.planId?.startsWith("self-hosted")}function hI({cluster:e}){const t=fs(e.id),{view:n,update:r}=ix(e.organizationId,e.id),o=!Et.checkForFabricConnect(e.id)&&!!t.user;if(n){if(!e.fqdn)return u.jsx(Ze,{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(vi,{className:"inline-block"})]})});if(e.resetPassword)return r?u.jsx(Ze,{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(vi,{className:"inline-block"})]})}):u.jsx("span",{className:"py-2 text-nowrap",children:"Pending Owner Setup"});if(!t.isLoading)return o?u.jsx(Ze,{to:`/${e.organizationId}/${e.id}${ya}`,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(vi,{className:"inline-block"})]})}):r&&!mI(e)?u.jsx(Ze,{to:`/${e.organizationId}/${e.id}${ya}`,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(vi,{className:"inline-block"})]})}):u.jsx(Ze,{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(vi,{className:"inline-block"})]})})}}function K0e(e,t){const n=[];if(e)for(const r of e)n.push(r[t]);return n}function Om({cluster:e,forceProgressBarVisible:t}){const[n,r]=b.useState(t||!1),{data:i}=Pt(Tl(n&&e.id,2e3));b.useEffect(function(){(YC(e.status)||WC(e.status))&&r(!0)},[n,e.status,i?.instances]);const o=b.useMemo(()=>{const a=K0e(i?.plans??[],"planId"),c=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 c){const E=k.status;!E||QR(E)||(YC(E)?(d+=1,f[E]=`${d} ${bo(E)}`):WC(E)?(m+=1,h[E]=`${m} ${bo(E)}`):Nh(E)?(x+=1,S[E]=`${x} ${bo(E)}`):!k.planId||!a.includes(k.planId)?(m+=1,h.DRAINING_TRAFFIC=`${m} ${bo("Draining Traffic")}`):QH(E)&&(v+=1,y[E]=`${v} ${bo(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 f9(e){const{data:t}=await Gt.delete(`/Cluster/${e}`,{timeout:0});return t}function G0e(){return ct({mutationFn:e=>f9(e)})}function p9(...e){return b.useMemo(()=>e.map(t=>(()=>{navigator.clipboard.writeText(t),we.info("Copied to clipboard!",{icon:u.jsx(Yee,{}),duration:1e3})})),e)}function Mh(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 Z0e(e,t){return Mh(localStorage.getItem(e))??t}function Y0e(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}function Cf(e,t){const n=b.useState(Z0e(e,t)),[r]=n;return b.useEffect(()=>Y0e(e,r),[e,r]),n}var ru=(e=>(e.SavedClusterState="SavedClusterState",e))(ru||{});function W0e({cluster:e}){const t=xn(),n=rr(),r=b.useMemo(()=>Zk(e),[e]),i=eh(r),o=fs(e.id),[,a]=Cf(ru.SavedClusterState,null),{view:c,update:d,remove:f,create:m}=ix(e.organizationId,e.id),{mutate:h,isPending:v}=G0e(),[y,x]=b.useState(!1),[S,C]=b.useState(!1),k=b.useMemo(()=>e.status&&bx.includes(e.status),[e.status]),E=mI(e),j=Et.checkForFabricConnect(e.id),R=!j&&!!o.user,T=b.useMemo(()=>e.status&&sj.includes(e.status),[e.status]),N=b.useMemo(()=>e.status&&Nh(e.status),[e.status]),O=b.useCallback(async()=>{x(!0);const U=await lj(e.id).catch(H=>(console.error("Failed to lookup cluster details, proceeding without checking instances.",H),null));if(await Bm({entityId:e.id,instanceClient:i}),U?.instances?.length)for(const H of U.instances)Et.setUserForEntity(H,null);Et.setUserForEntity(e,null)},[e,i]),M=b.useCallback(()=>{a(e),t.navigate({to:`/${e.organizationId}/new-cluster`})},[e,t,a]),L=b.useCallback(()=>C(!0),[]),K=b.useCallback(()=>{const U=e.organizationId;h(e.id,{onSuccess:async()=>{await n.invalidateQueries({queryKey:[U],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,q]=p9(`${e.fqdn}`,`https://${e.fqdn}`),Y=[k&&d&&!o.isLoading&&(!R||j)&&u.jsx(Ze,{to:`${e.id}/sign-in`,disabled:y,children:u.jsx(Sr,{children:"Direct Sign In"})},"sign-in"),k&&d&&u.jsx(Ze,{to:`${e.id}/edit`,disabled:y,children:u.jsx(Sr,{children:"Edit"})},"edit"),k&&c&&u.jsx(Ze,{to:`${e.id}/instances`,disabled:y,children:u.jsx(Sr,{children:"Instances"})},"instances"),k&&c&&e.fqdn&&u.jsx(Sr,{onClick:ee,disabled:y,children:"Copy Host Name"},"copy-host-name"),k&&c&&e.fqdn&&u.jsx(Sr,{onClick:q,disabled:y,children:"Copy API URL"},"copy-api-url"),k&&c&&!!r&&!o.isLoading&&R&&u.jsx(Sr,{onClick:O,disabled:y,children:"Direct Sign Out"},"direct-sign-out"),N&&m&&u.jsx(Sr,{className:"focus:bg-green/70 focus:text-white",onClick:M,children:"Try Again"},"try-again"),!T&&f&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:L,children:E?"Remove":"Terminate"},"remove")].filter(Xo);return u.jsxs(Tc,{className:"relative h-full justify-between",children:[u.jsxs(jl,{children:[u.jsxs(Hc,{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(_4,{onClick:ee,size:16,className:"cursor-pointer"}),u.jsx("span",{className:"grow"})]}):u.jsx("span",{children:"Self-Hosted"}),!T&&u.jsxs(Dh,{children:[u.jsx($h,{children:u.jsx(oE,{"aria-label":"Cluster options"})}),u.jsxs(Ph,{children:[!N&&u.jsxs(u.Fragment,{children:[u.jsx(Jy,{className:"text-gray-600 text-xs",children:"Plans"}),e.plans?.map(U=>u.jsxs(Jy,{children:[U.planId," / ",U.regionId,u.jsx("br",{}),"Auto Renewal ",u.jsx(Zo,{variant:"success",children:"ON"})]},U.planId+U.regionId)),Y.length>0&&u.jsx(Qy,{})]}),...Y]})]})]}),u.jsx(Rl,{children:u.jsx("h2",{children:e.name})})]}),u.jsxs(ps,{className:"flex items-center justify-between gap-2",children:[u.jsx(Om,{cluster:e}),k&&c&&u.jsx(hI,{cluster:e}),N&&e.status&&u.jsxs(u.Fragment,{children:[u.jsx(Zo,{variant:JH(e.status),children:bo(e.status)}),u.jsx("span",{className:"text-xs",children:'Click "..." to choose how to proceed.'})]})]}),u.jsx(b0,{typeOfThingBeingDeleted:"cluster",transitiveVerb:E?"Remove":"Terminate",presentParticiple:E?"Removing":"Terminating",nameOfThingBeingDeleted:e.name,isModalOpen:S,hideDataLossWarning:E,setIsModalOpen:U=>C(U),deletionConfirmed:K,deletionPending:v})]})}function _l({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 eo({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 Nv({children:e}){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),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 X0e(e){const{data:t}=await Gt.get("/Plan/",{params:{organizationId:e}});return t}function J0e(e){return{queryKey:[e,"instancePlan"],queryFn:()=>X0e(e),retry:!1}}async function Q0e({organizationId:e,availableHosts:t}={}){const{data:n}=await Gt.get("/Region/",{params:{availableHosts:t,organizationId:e}});return n}function W2({organizationId:e,availableHosts:t}={}){return{queryKey:[e,"regionLocations",t],queryFn:()=>Q0e({organizationId:e,availableHosts:t}),retry:!1}}function tk(e){return(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1}function X2(e){const t=e.split(".").map(Number);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0}function J2(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 m9(e,t){return e.instanceFqdn===t.instanceFqdn?e.operationsApiPort-t.operationsApiPort:J2(e.instanceFqdn)&&J2(t.instanceFqdn)?X2(e.instanceFqdn)-X2(t.instanceFqdn):e.instanceFqdn>t.instanceFqdn?1:-1}function ewe(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 kf(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 nk(e,t,n){const r=ewe(e,t),i={};for(const o in r)i[o]=kf(r[o],n);return i}function Am({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:_i("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:_i("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 twe({duration:e,message:t,lateMessage:n}){const r=b.useRef(0),i=b.useRef(0),[o,a]=b.useState(!1),c=5,[d,f]=b.useState(`${c}%`),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(c,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(Am,{width:d,animated:!1})]})}async function nwe(e){const{data:t}=await Gt.post("/Cluster/",e,{timeout:0});return t}function rwe(){return ct({mutationFn:e=>nwe(e)})}async function iwe(e){const{data:t}=await Gt.put(`/Cluster/${e.id}`,{regionPlans:e.regionPlans},{timeout:0});return t}function owe(){return ct({mutationFn:e=>iwe(e)})}async function h9(e){const{data:t}=await Gt.get(`/Organization/${e}`);return t}function iu(e){return{queryKey:[e],queryFn:()=>h9(e),retry:!1,refetchInterval:1e4}}function g9(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,c=t-o-a;if(c>0)return r[0]=r[0].slice(0,c),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 awe(e,t,n="-"){const r=t.split(n)[0];return e.findIndex(i=>i.startsWith(r))!==-1}function _0(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/-+/g,"-").replace(/^-+|-+$/g,"")}async function swe(e){await Gt.put("/Payment/",e)}function lwe(){return ct({mutationFn:e=>swe(e)})}function v9(e){const{mutate:t}=lwe();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 cwe=b.createContext(null);function uwe(){return b.useContext(cwe)}var d1={exports:{}},f1,Q2;function dwe(){if(Q2)return f1;Q2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return f1=e,f1}var p1,eP;function fwe(){if(eP)return p1;eP=1;var e=dwe();function t(){}function n(){}return n.resetWarningCache=t,p1=function(){function r(a,c,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},p1}var tP;function pwe(){return tP||(tP=1,d1.exports=fwe()()),d1.exports}var mwe=pwe();const Qe=ef(mwe);function nP(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 rP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nP(Object(n),!0).forEach(function(r){y9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dy(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dy=function(t){return typeof t}:dy=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dy(e)}function y9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hwe(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 gwe(e,t){if(e==null)return{};var n=hwe(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 vwe(e,t){return ywe(e)||bwe(e,t)||xwe(e,t)||wwe()}function ywe(e){if(Array.isArray(e))return e}function bwe(e,t){var n=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(n!=null){var r=[],i=!0,o=!1,a,c;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,c=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw c}}return r}}function xwe(e,t){if(e){if(typeof e=="string")return iP(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 iP(e,t)}}function iP(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 wwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Hr=function(t,n,r){var i=!!r,o=Q.useRef(r);Q.useEffect(function(){o.current=r},[r]),Q.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])},Swe=function(t){var n=Q.useRef(t);return Q.useEffect(function(){n.current=t},[t]),n.current},eb=function(t){return t!==null&&dy(t)==="object"},oP="[object Object]",_we=function e(t,n){if(!eb(t)||!eb(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)===oP,a=Object.prototype.toString.call(n)===oP;if(o!==a)return!1;if(!o&&!r)return t===n;var c=Object.keys(t),d=Object.keys(n);if(c.length!==d.length)return!1;for(var f={},m=0;m<c.length;m+=1)f[c[m]]=!0;for(var h=0;h<d.length;h+=1)f[d[h]]=!0;var v=Object.keys(f);if(v.length!==c.length)return!1;var y=t,x=n,S=function(k){return e(y[k],x[k])};return v.every(S)},Cwe=function(t,n,r){return eb(t)?Object.keys(t).reduce(function(i,o){var a=!eb(n)||!_we(t[o],n[o]);return r.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),i):a?rP(rP({},i||{}),{},y9({},o,t[o])):i},null):null},gI=Q.createContext(null);gI.displayName="ElementsContext";var b9=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 kwe=function(t){var n=Q.useContext(gI);return b9(n,t)},Ewe=function(){var t=kwe("calls useElements()"),n=t.elements;return n};Qe.func.isRequired;var x9=Q.createContext(null);x9.displayName="CheckoutContext";Qe.any,Qe.shape({clientSecret:Qe.oneOfType([Qe.string,Qe.instanceOf(Promise)]).isRequired,elementsOptions:Qe.object}).isRequired;var rk=function(t){var n=Q.useContext(x9),r=Q.useContext(gI);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 b9(r,t)},jwe=["mode"],Rwe=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},Ci=function(t,n){var r="".concat(Rwe(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,R=d.onLoaderStart,T=d.onNetworksChange,N=d.onConfirm,O=d.onCancel,M=d.onShippingAddressChange,L=d.onShippingRateChange,K=d.onSavedPaymentMethodRemove,ee=d.onSavedPaymentMethodUpdate,q=rk("mounts <".concat(r,">")),Y="elements"in q?q.elements:null,U="checkoutState"in q?q.checkoutState:null,H=U?.type==="success"||U?.type==="loading"?U.sdk:null,z=Q.useState(null),W=vwe(z,2),F=W[0],te=W[1],D=Q.useRef(null),$=Q.useRef(null);Hr(F,"blur",y),Hr(F,"focus",x),Hr(F,"escape",k),Hr(F,"click",E),Hr(F,"loaderror",j),Hr(F,"loaderstart",R),Hr(F,"networkschange",T),Hr(F,"confirm",N),Hr(F,"cancel",O),Hr(F,"shippingaddresschange",M),Hr(F,"shippingratechange",L),Hr(F,"savedpaymentmethodremove",K),Hr(F,"savedpaymentmethodupdate",ee),Hr(F,"change",C);var V;S&&(t==="expressCheckout"?V=S:V=function(){S(F)}),Hr(F,"ready",V),Q.useLayoutEffect(function(){if(D.current===null&&$.current!==null&&(Y||H)){var J=null;if(H)switch(t){case"paymentForm":J=H.createPaymentFormElement();break;case"payment":J=H.createPaymentElement(v);break;case"address":if("mode"in v){var fe=v.mode,ge=gwe(v,jwe);if(fe==="shipping")J=H.createShippingAddressElement(ge);else if(fe==="billing")J=H.createBillingAddressElement(ge);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":J=H.createExpressCheckoutElement(v);break;case"currencySelector":J=H.createCurrencySelectorElement();break;case"taxId":J=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 Y&&(J=Y.create(t,v));D.current=J,te(J),J&&J.mount($.current)}},[Y,H,v]);var A=Swe(v);return Q.useEffect(function(){if(D.current){var J=Cwe(v,A,["paymentRequest"]);J&&"update"in D.current&&D.current.update(J)}},[v,A]),Q.useLayoutEffect(function(){return function(){if(D.current&&typeof D.current.destroy=="function")try{D.current.destroy(),D.current=null}catch{}}},[]),Q.createElement("div",{id:f,className:m,ref:$})},o=function(d){rk("mounts <".concat(r,">"));var f=d.id,m=d.className;return Q.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},ki=typeof window>"u",Iwe=Q.createContext(null);Iwe.displayName="EmbeddedCheckoutProviderContext";var w9=function(){var t=rk("calls useStripe()"),n=t.stripe;return n};Ci("auBankAccount",ki);Ci("card",ki);Ci("cardNumber",ki);Ci("cardExpiry",ki);Ci("cardCvc",ki);Ci("iban",ki);var Nwe=Ci("payment",ki);Ci("expressCheckout",ki);Ci("paymentRequestButton",ki);Ci("linkAuthentication",ki);var Twe=Ci("address",ki);Ci("shippingAddress",ki);Ci("paymentMethodMessaging",ki);Ci("taxId",ki);function Owe({hasExistingBilling:e,onPaymentAdded:t,onSaveStateForBillingRedirect:n}){const{organizationId:r}=it({strict:!1}),i=w9(),o=uwe(),a=Ewe(),[c,d]=b.useState(!1),f=v9(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(Nwe,{}),u.jsx(Twe,{options:{mode:"billing"}}),u.jsxs("div",{className:"mt-4 flex gap-8 items-center",children:[u.jsxs(be,{disabled:!i||!a||c,variant:"submit",className:"rounded-full",children:[u.jsx(jo,{})," 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 Awe="clover",S9="https://js.stripe.com",Dwe="".concat(S9,"/").concat(Awe,"/stripe.js"),$we=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Pwe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var Mwe=function(t){return $we.test(t)||Pwe.test(t)},zwe=function(){for(var t=document.querySelectorAll('script[src^="'.concat(S9,'"]')),n=0;n<t.length;n++){var r=t[n];if(Mwe(r.src))return r}return null},aP=function(t){var n="",r=document.createElement("script");r.src="".concat(Dwe).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},Mp=null,Tv=null,Ov=null,Lwe=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Fwe=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Uwe=function(t){return Mp!==null?Mp:(Mp=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=zwe();if(!(i&&t)){if(!i)i=aP(t);else if(i&&Ov!==null&&Tv!==null){var o;i.removeEventListener("load",Ov),i.removeEventListener("error",Tv),(o=i.parentNode)===null||o===void 0||o.removeChild(i),i=aP(t)}}Ov=Fwe(n,r),Tv=Lwe(r),i.addEventListener("load",Ov),i.addEventListener("error",Tv)}catch(a){r(a);return}}),Mp.catch(function(n){return Mp=null,Promise.reject(n)}))},zp,Vwe=function(){return zp||(zp=Uwe(null).catch(function(t){return zp=null,Promise.reject(t)}),zp)};Promise.resolve().then(function(){return Vwe()}).catch(function(e){console.warn(e)});async function Bwe(e){const{data:t}=await Gt.post("/StripeAccount/",e);return t}function Hwe(){return ct({mutationFn:e=>Bwe(e)})}async function qwe(e){const{data:t}=await Gt.post("/Payment/",{organizationId:e.organizationId});return t}function Kwe(){return ct({mutationFn:e=>qwe(e)})}function Gwe(e){const{enabled:t,existingStripeId:n,organizationId:r}=e,{mutate:i}=Hwe(),{mutate:o}=Kwe(),[a,c]=b.useState(void 0),d=b.useCallback(f=>{c(f.clientSecret)},[]);return b.useEffect(()=>{},[i,t,n,o,d,r]),a}function _9({children:e}){const{organizationId:t}=it({strict:!1}),{data:n}=Pt(iu(t)),r=Gwe({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 Zwe({onPaymentAdded:e,onSaveStateForBillingRedirect:t}){const{organizationId:n}=it({strict:!1}),{data:r}=Pt(iu(n)),i=r?.billing,o=i?.paymentMethod;return u.jsxs(_9,{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(Owe,{hasExistingBilling:!!i,onSaveStateForBillingRedirect:t,onPaymentAdded:e})]})}var pa=(e=>(e.PASS="pass",e.FAIL="fail",e.PENDING="pending",e.ERROR="error",e))(pa||{});function Ywe(e){switch(e){case pa.PASS:return"success";case pa.FAIL:case pa.ERROR:return"destructive";case pa.PENDING:default:return"default"}}function Wwe(e){switch(e){case pa.PASS:return"READY";case pa.FAIL:case pa.ERROR:case pa.PENDING:default:return e.toUpperCase()}}function Xwe(e,t){const n=String(e).padStart(2,"0"),r=String(t%100).padStart(2,"0");return`${n}/${r}`}function C9(e){const{onSaveStateForBillingRedirect:t,onReplacingPaymentMethod:n}=e??{},{organizationId:r}=it({strict:!1}),{update:i}=rx(r),{data:o,refetch:a}=Pt(iu(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==="ENTERPRISE"?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(_l,{}),", 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 ",Xwe(d.expMonth,d.expYear),")"]}):null,d.status?u.jsxs(u.Fragment,{children:["—"," ",u.jsx(Zo,{variant:Ywe(d.status),children:Wwe(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(Zwe,{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 Hn(e){return e!==void 0&&e>0}function Jwe({clusterId:e,isPending:t,onGoBackToDetails:n,onSaveStateForBillingRedirect:r,onSubmit:i,organizationId:o,selectedPlan:a}){const{data:c}=Pt(iu(o)),d=c?.billing,f=c?.type==="ENTERPRISE",m=f||d?.paymentMethod?.status===pa.PASS,[h,v]=b.useState(!1),y=Hn(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(Oc,{})," 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(vi,{})]})]})});if(f)return u.jsxs(u.Fragment,{children:[u.jsxs("ul",{className:"list-disc ml-6",children:[u.jsx("li",{children:"Your organization’s enterprise agreement with Harper can adjust the retail price you see on this page."}),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(_l,{overEmail:!0}),", we are here to help."]})]}),x]});const S=y&&`, or ${Zr(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(_l,{overEmail:!0}),", we are here to help."]})]}),u.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Payment method:"}),u.jsx(C9,{onSaveStateForBillingRedirect:r,onReplacingPaymentMethod:v}),x]})}function Dr({className:e}={}){const t=b.useMemo(()=>_i("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 ik(e,[t,n]){return Math.min(n,Math.max(t,e))}var Qwe=[" ","Enter","ArrowUp","ArrowDown"],eSe=[" ","Enter"],zc="Select",[C0,k0,tSe]=Qm(zc),[Ef]=Xi(zc,[tSe,bf]),E0=bf(),[nSe,$l]=Ef(zc),[rSe,iSe]=Ef(zc),k9=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:c,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:v,required:y,form:x}=e,S=E0(t),[C,k]=b.useState(null),[E,j]=b.useState(null),[R,T]=b.useState(!1),N=Wc(f),[O,M]=qo({prop:r,defaultProp:i??!1,onChange:o,caller:zc}),[L,K]=qo({prop:a,defaultProp:c,onChange:d,caller:zc}),ee=b.useRef(null),q=C?x||!!C.closest("form"):!0,[Y,U]=b.useState(new Set),H=Array.from(Y).map(z=>z.props.value).join(";");return u.jsx(GE,{...S,children:u.jsxs(nSe,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:T,contentId:Fi(),value:L,onValueChange:K,open:O,onOpenChange:M,dir:N,triggerPointerDownPosRef:ee,disabled:v,children:[u.jsx(C0.Provider,{scope:t,children:u.jsx(rSe,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(z=>{U(W=>new Set(W).add(z))},[]),onNativeOptionRemove:b.useCallback(z=>{U(W=>{const F=new Set(W);return F.delete(z),F})},[]),children:n})}),q?u.jsxs(Y9,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:h,value:L,onChange:z=>K(z.target.value),disabled:v,form:x,children:[L===void 0?u.jsx("option",{value:""}):null,Array.from(Y)]},H):null]})})};k9.displayName=zc;var E9="SelectTrigger",j9=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=E0(n),a=$l(E9,n),c=a.disabled||r,d=ft(t,a.onTriggerChange),f=k0(n),m=b.useRef("touch"),[h,v,y]=X9(S=>{const C=f().filter(j=>!j.disabled),k=C.find(j=>j.value===a.value),E=J9(C,S,k);E!==void 0&&a.onValueChange(E.value)}),x=S=>{c||(a.onOpenChange(!0),y()),S&&(a.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return u.jsx(ZE,{asChild:!0,...o,children:u.jsx(Ye.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:c,"data-disabled":c?"":void 0,"data-placeholder":W9(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===" ")&&Qwe.includes(S.key)&&(x(),S.preventDefault())})})})});j9.displayName=E9;var R9="SelectValue",I9=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...c}=e,d=$l(R9,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,h=ft(t,d.onValueNodeChange);return nr(()=>{f(m)},[f,m]),u.jsx(Ye.span,{...c,ref:h,style:{pointerEvents:"none"},children:W9(d.value)?u.jsx(u.Fragment,{children:a}):o})});I9.displayName=R9;var oSe="SelectIcon",N9=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(Ye.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});N9.displayName=oSe;var aSe="SelectPortal",T9=e=>u.jsx(nh,{asChild:!0,...e});T9.displayName=aSe;var Lc="SelectContent",O9=b.forwardRef((e,t)=>{const n=$l(Lc,e.__scopeSelect),[r,i]=b.useState();if(nr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?of.createPortal(u.jsx(A9,{scope:e.__scopeSelect,children:u.jsx(C0.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(D9,{...e,ref:t})});O9.displayName=Lc;var Po=10,[A9,Pl]=Ef(Lc),sSe="SelectContentImpl",lSe=Md("SelectContent.RemoveScroll"),D9=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C,...k}=e,E=$l(Lc,n),[j,R]=b.useState(null),[T,N]=b.useState(null),O=ft(t,B=>R(B)),[M,L]=b.useState(null),[K,ee]=b.useState(null),q=k0(n),[Y,U]=b.useState(!1),H=b.useRef(!1);b.useEffect(()=>{if(j)return tI(j)},[j]),eI();const z=b.useCallback(B=>{const[se,..._e]=q().map(Le=>Le.ref.current),[Ie]=_e.slice(-1),Fe=document.activeElement;for(const Le of B)if(Le===Fe||(Le?.scrollIntoView({block:"nearest"}),Le===se&&T&&(T.scrollTop=0),Le===Ie&&T&&(T.scrollTop=T.scrollHeight),Le?.focus(),document.activeElement!==Fe))return},[q,T]),W=b.useCallback(()=>z([M,j]),[z,M,j]);b.useEffect(()=>{Y&&W()},[Y,W]);const{onOpenChange:F,triggerPointerDownPosRef:te}=E;b.useEffect(()=>{if(j){let B={x:0,y:0};const se=Ie=>{B={x:Math.abs(Math.round(Ie.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(Ie.pageY)-(te.current?.y??0))}},_e=Ie=>{B.x<=10&&B.y<=10?Ie.preventDefault():j.contains(Ie.target)||F(!1),document.removeEventListener("pointermove",se),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",_e,{capture:!0})}}},[j,F,te]),b.useEffect(()=>{const B=()=>F(!1);return window.addEventListener("blur",B),window.addEventListener("resize",B),()=>{window.removeEventListener("blur",B),window.removeEventListener("resize",B)}},[F]);const[D,$]=X9(B=>{const se=q().filter(Fe=>!Fe.disabled),_e=se.find(Fe=>Fe.ref.current===document.activeElement),Ie=J9(se,B,_e);Ie&&setTimeout(()=>Ie.ref.current.focus())}),V=b.useCallback((B,se,_e)=>{const Ie=!H.current&&!_e;(E.value!==void 0&&E.value===se||Ie)&&(L(B),Ie&&(H.current=!0))},[E.value]),A=b.useCallback(()=>j?.focus(),[j]),J=b.useCallback((B,se,_e)=>{const Ie=!H.current&&!_e;(E.value!==void 0&&E.value===se||Ie)&&ee(B)},[E.value]),fe=r==="popper"?ok:$9,ge=fe===ok?{side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:v,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return u.jsx(A9,{scope:n,content:j,viewport:T,onViewportChange:N,itemRefCallback:V,selectedItem:M,onItemLeave:A,itemTextRefCallback:J,focusSelectedItem:W,selectedItemText:K,position:r,isPositioned:Y,searchRef:D,children:u.jsx(v0,{as:lSe,allowPinchZoom:!0,children:u.jsx(h0,{asChild:!0,trapped:E.open,onMountAutoFocus:B=>{B.preventDefault()},onUnmountAutoFocus:Re(i,B=>{E.trigger?.focus({preventScroll:!0}),B.preventDefault()}),children:u.jsx(mf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:B=>B.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:u.jsx(fe,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:B=>B.preventDefault(),...k,...ge,onPlaced:()=>U(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,B=>{const se=B.ctrlKey||B.altKey||B.metaKey;if(B.key==="Tab"&&B.preventDefault(),!se&&B.key.length===1&&$(B.key),["ArrowUp","ArrowDown","Home","End"].includes(B.key)){let Ie=q().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(B.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(B.key)){const Fe=B.target,Le=Ie.indexOf(Fe);Ie=Ie.slice(Le+1)}setTimeout(()=>z(Ie)),B.preventDefault()}})})})})})})});D9.displayName=sSe;var cSe="SelectItemAlignedPosition",$9=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=$l(Lc,n),a=Pl(Lc,n),[c,d]=b.useState(null),[f,m]=b.useState(null),h=ft(t,O=>m(O)),v=k0(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&&c&&f&&S&&C&&k){const O=o.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),K=k.getBoundingClientRect();if(o.dir!=="rtl"){const Fe=K.left-M.left,Le=L.left-Fe,We=O.left-Le,gt=O.width+We,Qt=Math.max(gt,M.width),Tn=window.innerWidth-Po,sn=ik(Le,[Po,Math.max(Po,Tn-Qt)]);c.style.minWidth=gt+"px",c.style.left=sn+"px"}else{const Fe=M.right-K.right,Le=window.innerWidth-L.right-Fe,We=window.innerWidth-O.right-Le,gt=O.width+We,Qt=Math.max(gt,M.width),Tn=window.innerWidth-Po,sn=ik(Le,[Po,Math.max(Po,Tn-Qt)]);c.style.minWidth=gt+"px",c.style.right=sn+"px"}const ee=v(),q=window.innerHeight-Po*2,Y=S.scrollHeight,U=window.getComputedStyle(f),H=parseInt(U.borderTopWidth,10),z=parseInt(U.paddingTop,10),W=parseInt(U.borderBottomWidth,10),F=parseInt(U.paddingBottom,10),te=H+z+Y+F+W,D=Math.min(C.offsetHeight*5,te),$=window.getComputedStyle(S),V=parseInt($.paddingTop,10),A=parseInt($.paddingBottom,10),J=O.top+O.height/2-Po,fe=q-J,ge=C.offsetHeight/2,B=C.offsetTop+ge,se=H+z+B,_e=te-se;if(se<=J){const Fe=ee.length>0&&C===ee[ee.length-1].ref.current;c.style.bottom="0px";const Le=f.clientHeight-S.offsetTop-S.offsetHeight,We=Math.max(fe,ge+(Fe?A:0)+Le+W),gt=se+We;c.style.height=gt+"px"}else{const Fe=ee.length>0&&C===ee[0].ref.current;c.style.top="0px";const We=Math.max(J,H+S.offsetTop+(Fe?V:0)+ge)+_e;c.style.height=We+"px",S.scrollTop=se-J+S.offsetTop}c.style.margin=`${Po}px 0`,c.style.minHeight=D+"px",c.style.maxHeight=q+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[v,o.trigger,o.valueNode,c,f,S,C,k,o.dir,r]);nr(()=>j(),[j]);const[R,T]=b.useState();nr(()=>{f&&T(window.getComputedStyle(f).zIndex)},[f]);const N=b.useCallback(O=>{O&&x.current===!0&&(j(),E?.(),x.current=!1)},[j,E]);return u.jsx(dSe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:N,children:u.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:u.jsx(Ye.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});$9.displayName=cSe;var uSe="SelectPopperPosition",ok=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Po,...o}=e,a=E0(n);return u.jsx(YE,{...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)"}})});ok.displayName=uSe;var[dSe,vI]=Ef(Lc,{}),ak="SelectViewport",P9=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Pl(ak,n),a=vI(ak,n),c=ft(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(C0.Slot,{scope:n,children:u.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,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-Po*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),R=E-j;h.style.height=j+"px",h.style.bottom==="0px"&&(m.scrollTop=R>0?R:0,h.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});P9.displayName=ak;var M9="SelectGroup",[fSe,pSe]=Ef(M9),z9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Fi();return u.jsx(fSe,{scope:n,id:i,children:u.jsx(Ye.div,{role:"group","aria-labelledby":i,...r,ref:t})})});z9.displayName=M9;var L9="SelectLabel",F9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pSe(L9,n);return u.jsx(Ye.div,{id:i.id,...r,ref:t})});F9.displayName=L9;var tb="SelectItem",[mSe,U9]=Ef(tb),V9=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,c=$l(tb,n),d=Pl(tb,n),f=c.value===r,[m,h]=b.useState(o??""),[v,y]=b.useState(!1),x=ft(t,E=>d.itemRefCallback?.(E,r,i)),S=Fi(),C=b.useRef("touch"),k=()=>{i||(c.onValueChange(r),c.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(mSe,{scope:n,value:r,disabled:i,textId:S,isSelected:f,onItemTextChange:b.useCallback(E=>{h(j=>j||(E?.textContent??"").trim())},[]),children:u.jsx(C0.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:u.jsx(Ye.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===" "||(eSe.includes(E.key)&&k(),E.key===" "&&E.preventDefault())})})})})});V9.displayName=tb;var Xp="SelectItemText",B9=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=$l(Xp,n),c=Pl(Xp,n),d=U9(Xp,n),f=iSe(Xp,n),[m,h]=b.useState(null),v=ft(t,k=>h(k),d.onItemTextChange,k=>c.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 nr(()=>(S(x),()=>C(x)),[S,C,x]),u.jsxs(u.Fragment,{children:[u.jsx(Ye.span,{id:d.textId,...o,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren?of.createPortal(o.children,a.valueNode):null]})});B9.displayName=Xp;var H9="SelectItemIndicator",q9=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return U9(H9,n).isSelected?u.jsx(Ye.span,{"aria-hidden":!0,...r,ref:t}):null});q9.displayName=H9;var sk="SelectScrollUpButton",K9=b.forwardRef((e,t)=>{const n=Pl(sk,e.__scopeSelect),r=vI(sk,e.__scopeSelect),[i,o]=b.useState(!1),a=ft(t,r.onScrollButtonChange);return nr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?u.jsx(Z9,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});K9.displayName=sk;var lk="SelectScrollDownButton",G9=b.forwardRef((e,t)=>{const n=Pl(lk,e.__scopeSelect),r=vI(lk,e.__scopeSelect),[i,o]=b.useState(!1),a=ft(t,r.onScrollButtonChange);return nr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;o(m)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?u.jsx(Z9,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});G9.displayName=lk;var Z9=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Pl("SelectScrollButton",n),a=b.useRef(null),c=k0(n),d=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>d(),[d]),nr(()=>{c().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),u.jsx(Ye.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()})})}),hSe="SelectSeparator",gSe=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Ye.div,{"aria-hidden":!0,...r,ref:t})});gSe.displayName=hSe;var ck="SelectArrow",vSe=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=E0(n),o=$l(ck,n),a=Pl(ck,n);return o.open&&a.position==="popper"?u.jsx(WE,{...i,...r,ref:t}):null});vSe.displayName=ck;var ySe="SelectBubbleInput",Y9=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=b.useRef(null),o=ft(r,i),a=RE(t);return b.useEffect(()=>{const c=i.current;if(!c)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(c,t),c.dispatchEvent(h)}},[a,t]),u.jsx(Ye.select,{...n,style:{...FF,...n.style},ref:o,defaultValue:t})});Y9.displayName=ySe;function W9(e){return e===""||e===void 0}function X9(e){const t=In(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(a=>{const c=n.current+a;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function J9(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=bSe(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 bSe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xSe=k9,wSe=j9,SSe=I9,_Se=N9,CSe=T9,kSe=O9,ESe=P9,jSe=z9,RSe=F9,ISe=V9,NSe=B9,TSe=q9,OSe=K9,ASe=G9;function qi({...e}){return u.jsx(xSe,{"data-slot":"select",...e})}function Yo({...e}){return u.jsx(jSe,{"data-slot":"select-group",...e})}function Ki({...e}){return u.jsx(SSe,{"data-slot":"select-value",...e})}function Gi({className:e,children:t,...n}){return u.jsxs(wSe,{"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(_Se,{asChild:!0,children:u.jsx(x4,{className:"opacity-50 size-4"})})]})}function Zi({className:e,children:t,position:n="popper",...r}){return u.jsx(CSe,{children:u.jsxs(kSe,{"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(DSe,{}),u.jsx(ESe,{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($Se,{})]})})}function yI({className:e,...t}){return u.jsx(RSe,{"data-slot":"select-label",className:Ue("px-2 py-1.5 text-sm font-medium",e),...t})}function At({className:e,children:t,...n}){return u.jsxs(ISe,{"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(NSe,{children:t}),u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(TSe,{children:u.jsx(iE,{className:"size-4"})})})]})}function DSe({className:e,...t}){return u.jsx(OSe,{"data-slot":"select-scroll-up-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Hee,{className:"size-4"})})}function $Se({className:e,...t}){return u.jsx(ASe,{"data-slot":"select-scroll-down-button",className:Ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(x4,{className:"size-4"})})}const sP=new RegExp(/^\d+/);function PSe(e,t){const n=parseInt(e.match(sP)?.[0]||"0",10),r=parseInt(t.match(sP)?.[0]||"0",10);return n===r?0:n>r?1:-1}const Q9=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],eq=["secs","mins","hrs"],nb={bytes:1e3,secs:60};function MSe(e,t,n){let r,i;switch(t){case"bytes":{r=Q9,i=nb.bytes;break}case"secs":{r=eq,i=nb.secs;break}default:return e}const o=r.indexOf(n);if(o===-1)return e;const a=i**o;return e/a}function zSe(e,t){let n,r;switch(e){case"bytes":n=Q9,r=nb.bytes;break;case"secs":n=eq,r=nb.secs;break;default:return e}let i=0;for(;t>=r&&i<n.length-1;)t/=r,i++;return n[i]}function Mo(e,t=1){const n=e*t,r=zSe("bytes",n),i=MSe(n,"bytes",r);return`${new Intl.NumberFormat().format(Math.round(i))} ${r}`}function fy(e){return new Intl.NumberFormat().format(e)}const lP=["K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","Dc"];function fo(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<lP.length-1);return`${fy(Math.round(n))} ${lP[r]}`}function LSe({planLimits:e,resourcesPerInstance:t,selectedRegion:n}){const[r,i]=b.useState(!1),o=b.useCallback(()=>{i(!r)},[r,i]),a=Hn(e?.expirationMonths)&&e.expirationMonths<1e3&&e.expirationMonths,c=n?.purchasedBlockMultiplier??1,d=b.useMemo(()=>e?[Hn(e.totalReadCount)&&{label:"Total Reads",value:`${fo(e.totalReadCount*c)} reads`},Hn(e.totalReadsBytes)&&{label:"Total Read Transfer",value:`${Mo(e.totalReadsBytes*c)}`},Hn(e.readsPerMinuteCount)&&{label:"Read Rate",value:`${fo(e.readsPerMinuteCount*60*c)}/min`},Hn(e.readsPerMinuteBytes)&&{label:"Read Bandwidth",value:`${Mo(e.readsPerMinuteBytes*60*c)}/min`},Hn(e.totalWriteCount)&&{label:"Total Writes",value:`${fo(e.totalWriteCount)} reads`},Hn(e.totalWritesBytes)&&{label:"Total Write Transfer",value:`${Mo(e.totalWritesBytes)}`},Hn(e.writesPerMinuteCount)&&{label:"Write Rate",value:`${fo(e.writesPerMinuteCount*60)}/min`},Hn(e.writesPerMinuteBytes)&&{label:"Write Bandwidth",value:`${Mo(e.writesPerMinuteBytes*60)}/min`},Hn(e.totalRealTimeMessageDeliveries)&&{label:"Total Real-Time Messages",value:`${fo(e.totalRealTimeMessageDeliveries*c)} messages`},Hn(e.totalRealTimeMessageDeliveryBytes)&&{label:"Total Real-Time Message Transfer",value:`${Mo(e.totalRealTimeMessageDeliveryBytes*c)}`},Hn(e.realTimeMessageDeliveriesPerMinute)&&{label:"Real-Time Message Rate",value:`${fo(e.realTimeMessageDeliveriesPerMinute*60*c)}/min`},Hn(e.realTimeMessageDeliveryBytesPerMinute)&&{label:"Real-Time Message Bandwidth",value:`${Mo(e.realTimeMessageDeliveryBytesPerMinute*60*c)}/min`},Hn(e.tlsHandshakes)&&{label:"TLS Handshakes",value:`${fo(e.tlsHandshakes*60*c)}`},Hn(e.applicationComputeHours)&&{label:"Application Compute Hours",value:`${fo(e.applicationComputeHours*60*c)}`},t&&Hn(t.storageGb)&&{label:"Storage",value:`${Mo(t.storageGb*1e9)}`},a&&{label:"Expiration",value:Zr(a,"month","months")}].filter(Xo):[],[a,e,t,c]);return e?Hn(e.totalReadCount)?u.jsxs(Ne,{className:"basis-full",children:[u.jsxs(Te,{onClick:o,children:["Purchasing usage block for ",Hn(e.readsPerMinuteCount)?`${fo(e.readsPerMinuteCount*c)} reads/min & `:"",fo(e.totalReadCount*c)," total reads ",Hn(e.readsPerMinuteCount)?"in "+(n?.region??"")+" region":"per server",",",u.jsx("br",{className:"hidden sm:block"}),Hn(e.writesPerMinuteCount)?` ${fo(e.writesPerMinuteCount)} writes/min & `:" ",fo(e.totalWriteCount)," ","total writes",a&&`, for ${Zr(a,"month","months")}`,". Beta pricing subject to change",u.jsx("br",{className:"block sm:hidden"}),u.jsxs(be,{type:"button",variant:"link",className:"text-white",children:["Learn More ",r?u.jsx(Db,{}):u.jsx(vi,{})]})]}),u.jsx(De,{children:u.jsxs("dl",{className:Ue("divide-y divide-black overflow-hidden transition-[max-height] duration-200 ease-in",r?"max-h-fit":"max-h-0"),children:["This plan licenses Harper for the usage limits below, for the price listed above. The usage license expires"," ",a&&`in ${Zr(a,"month","months")} or `,"when any usage limit is reached. New usage blocks are automatically purchased/billed as blocks are consumed.",d.map((f,m)=>u.jsxs("div",{className:Ue("px-4 py-1 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-3",m%2===0&&"bg-gray-700"),children:[u.jsx("dt",{className:"text-sm/6 font-medium text-gray-300",children:f.label}),u.jsx("dd",{className:"mt-1 text-sm/6 sm:col-span-2 sm:mt-0",children:f.value})]},f.label))]})}),u.jsx(Oe,{})]}):"This plan has no usage limits.":""}function FSe({control:e,fieldArray:t,form:n,index:r,regionNameToLatencyToRegion:i,selectedPlan:o}){const a=b.useMemo(()=>Object.keys(i).sort(),[i]),c=n.watch("deploymentDescription")?.startsWith("Dedicated"),d=n.watch(`regionPlans.${r}.regionName`),f=n.watch(`regionPlans.${r}.latencyDescription`),m=b.useMemo(()=>Object.keys(i[d]||{}).sort(PSe).reverse(),[i,d]);b.useEffect(function(){if(d&&m?.length&&!m?.includes(f)){const y=f?.split(" ")[0].toLowerCase(),x=m.find(S=>y?S.split(" ")[0].toLowerCase()===y:!0)||m[0];n.setValue(`regionPlans.${r}.latencyDescription`,x),n.trigger()}},[m,n,r,f,d]);const h=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:v})=>u.jsxs(Ne,{className:"flex-1",children:[u.jsxs(Te,{children:["Region ",t.fields.length>1?r+1:""]}),u.jsx(De,{children:u.jsxs(qi,{onValueChange:y=>{v.onChange(y),n.trigger()},...v,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Region"})}),u.jsx(Zi,{children:u.jsx(Yo,{children:a.map(y=>u.jsx(At,{value:y,children:y},y))})})]})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e,name:`regionPlans.${r}.latencyDescription`,render:({field:v})=>u.jsxs(Ne,{className:"flex-1",children:[u.jsxs(Te,{children:["Estimated ",c?"P95":"P90"," Latency, Distribution"]}),u.jsx(De,{children:u.jsxs(qi,{onValueChange:y=>{v.onChange(y),n.trigger()},...v,disabled:!m?.length,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Latency Tier"})}),u.jsx(Zi,{children:u.jsx(Yo,{children:m.map(y=>u.jsx(At,{value:y,children:y},y))})})]})}),u.jsx(Oe,{})]})}),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:h,children:[u.jsx(Ca,{})," ",u.jsx("span",{className:"sr-only",children:"Remove"})]})}),u.jsx(LSe,{planLimits:o?.planLimits,resourcesPerInstance:o?.resourcesPerInstance,selectedRegion:i[d]?.[f]})]})}function USe({form:e,regionLocations:t,regionNameToLatencyToRegion:n,selectedPlan:r,totalPrice:i}){const o=e.watch("regionPlans"),a=aj({control:e.control,name:"regionPlans"}),c=b.useMemo(()=>{const f=o.map(m=>n?.[m.regionName]?.[m.latencyDescription]?.region);return i?t?.find(m=>!f.includes(m.region)):null},[t,n,o,i]),d=b.useCallback(()=>{c&&(a.append({regionName:c.region,latencyDescription:c.latencyDescription}),e.trigger())},[e,c,a]);return t?.length?u.jsxs(u.Fragment,{children:[a.fields.map((f,m)=>u.jsx(FSe,{control:e.control,fieldArray:a,form:e,index:m,regionNameToLatencyToRegion:n,selectedPlan:r},f.id)),c&&u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsxs(be,{type:"button",variant:"positiveOutline",className:"rounded-full",onClick:d,children:[u.jsx(Xr,{}),"Add Additional Region Usage"]})})]}):u.jsx("div",{className:"md:col-span-6 col-span-3",children:u.jsx(Ey,{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(_l,{}),"."]})}})})}const tq=0,nq=65535;function VSe({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(Ne,{children:[u.jsxs(Te,{children:["Instance ",t.fields.length>1?r+1:""]}),u.jsx(De,{children:u.jsxs(qi,{...o,onValueChange:a=>{o.onChange(a),n.trigger()},children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"https://"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"true",children:"https://"}),u.jsx(At,{value:"false",children:"http://"})]})})]})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e,name:`instances.${r}.fqdn`,render:({field:o})=>u.jsxs(Ne,{className:"flex-3",children:[u.jsx(Te,{children:"Host Name"}),u.jsx(De,{children:u.jsx(Me,{...o,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e,name:`instances.${r}.port`,render:({field:o})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Operations API Port"}),u.jsx(De,{children:u.jsx(Me,{...o,type:"number",min:tq,max:nq,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:String(Ed),onChange:a=>{o.onChange(a.target.value?parseInt(a.target.value,10):void 0),n.trigger()}})}),u.jsx(Oe,{})]})}),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 BSe({form:e}){const t=aj({control:e.control,name:"instances"}),n=b.useCallback(()=>{t.append({secure:"true",fqdn:"",port:Ed})},[t]);return u.jsxs(u.Fragment,{children:[t.fields.map((r,i)=>u.jsx(VSe,{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(Xr,{}),"Add Instance"]})})]})}const cP=/(^$|^(?: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,rb=Dt({clusterName:nt().nonempty("Please enter a cluster name.").max(255,"Cluster name cannot be longer than 255 characters long."),abbreviatedName:nt().max(20,"Must be at most 20 characters long.").regex(/^[a-zA-Z0-9-]*$/,"Can only contain letters, numbers and dashes").optional(),fqdn:nt().regex(cP,"Please enter a valid host name without the port or any path.").optional(),deploymentDescription:nt().nonempty("Please select a deployment tier."),performanceDescription:nt().nonempty("Please select a performance tier."),regionPlans:cs(Dt({regionName:nt().nonempty("Please select a region."),latencyDescription:nt().nonempty("Please select a latency tier.")})).max(50,{error:"A maximum of 50 regions can be selected for each cluster. "}),instances:cs(Dt({secure:Al(["true","false"]),fqdn:nt().nonempty("Please enter the host name of your instance.").regex(cP,"Please enter a valid host name without the port or any path."),port:i0().min(tq,"Positive thinking only, please.").max(nq,"That port number is too high.").optional()})).max(100,{error:"A maximum of 100 instances can be added to each cluster."}),skipToBilling:Yt().optional(),sourceClusterId:nt().optional()}),uP={Colocated:"Shared infrastructure for optimized value",Dedicated:"Dedicated infrastructure for consistent performance","Self-Hosted":"Your own infrastructure"};function HSe({calculatedNames:e,clusterId:t,deploymentToPerformanceToPlan:n,form:r,isPending:i,regionLocations:o,regionNameToLatencyToRegion:a,selectedDeployment:c,selectedPerformance:d,selectedPlan:f,totalPrice:m}){const{isDirty:h,isValid:v}=nj(),y=b.useMemo(()=>Object.keys(n[c]||{}).map(C=>{const k=C.slice(0,-1).split("(");if(k.length>1)return{performanceTier:C,name:k[0],description:k[1]};const E=C.split(" for ");return E.length>1?{performanceTier:C,name:E[0],description:"For "+E[1]}:{performanceTier:C,name:C,description:""}}),[n,c]),x=b.useMemo(()=>Object.keys(n).sort(),[n]);b.useEffect(function(){y?.length&&!y.find(k=>k.performanceTier===d)&&(r.setValue("performanceDescription",y[0].performanceTier),r.trigger())},[c,d,y,r]);const S=c==="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:C})=>u.jsxs(Ne,{className:"col-span-3 md:col-span-6",children:[u.jsx(Te,{className:"pb-1",children:"Cluster Name"}),u.jsx(De,{children:u.jsx(Me,{autoFocus:!0,type:"text",maxLength:rb.shape.clusterName.maxLength,autoCapitalize:"words",disabled:!!t,...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"deploymentDescription",render:({field:C})=>u.jsxs(Ne,{className:"col-span-3",children:[u.jsx(Te,{className:"pb-1",children:"Harper Deployment"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...C,disabled:!!t,onValueChange:k=>{C.onChange(k),r.trigger()},children:[u.jsx(Gi,{className:"w-full h-auto",children:u.jsx(Ki,{placeholder:"Choose Tier"})}),u.jsx(Zi,{children:u.jsx(Yo,{children:x.map(k=>u.jsxs(At,{value:k,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:k}),uP[k]&&u.jsx("dd",{className:"font-light",children:uP[k]})]},k))})})]})})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"performanceDescription",render:({field:C})=>u.jsxs(Ne,{className:"col-span-3",children:[u.jsxs(Te,{className:"pb-1",children:[c.startsWith("Self")?"Support":"Performance"," & Usage"]}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...C,onValueChange:k=>{C.onChange(k),r.trigger()},disabled:!y?.length,children:[u.jsx(Gi,{className:"w-full h-auto",children:u.jsx(Ki,{placeholder:"Choose Tier"})}),u.jsx(Zi,{children:u.jsx(Yo,{children:y.map(k=>u.jsxs(At,{value:k.performanceTier,children:[u.jsx("dt",{className:"text-left font-bold text-sm/6",children:k.name}),k.description&&u.jsx("dd",{className:"font-light",children:k.description})]},k.name))})})]})})}),u.jsx(Oe,{})]})}),S?u.jsx(u.Fragment,{children:u.jsx($e,{control:r.control,name:"fqdn",render:({field:C})=>u.jsxs(Ne,{className:"md:col-span-6 col-span-3",children:[u.jsx(Te,{className:"pb-1",children:"Optional Cluster Load Balancer Host Name"}),u.jsx(De,{children:u.jsx(Me,{...C,type:"text",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"example.your-company.com",disabled:!!t})}),u.jsx(Oe,{})]})})}):u.jsxs(u.Fragment,{children:[u.jsx($e,{control:r.control,name:"abbreviatedName",render:({field:C})=>u.jsxs(Ne,{className:"col-span-3",children:[u.jsx(Te,{className:"pb-1",children:"Host Name"}),u.jsx(De,{children:u.jsx(Me,{...C,type:"text",maxLength:rb.shape.abbreviatedName.unwrap().maxLength,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:e.suggestedAbbreviatedName,disabled:!!t})}),u.jsx(Oe,{})]})}),u.jsxs(Ne,{className:"col-span-3 ",children:[u.jsx(Te,{className:"pb-1",children:"Full Host Name"}),u.jsx(De,{children:u.jsx("span",{children:e.fullHostName})}),u.jsx(Oe,{})]})]}),S?u.jsx(BSe,{form:r}):u.jsx(USe,{form:r,regionLocations:o,regionNameToLatencyToRegion:a,selectedPlan:f,totalPrice:m})]}),u.jsx(Zn,{className:"mt-3 mb-12",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:i||t&&!h||!v,children:[m>0?"Confirm Payment Details":t?"Edit Cluster":"Create New Cluster",u.jsx(vi,{})]})})]})}function rq(e){const{fqdn:t}=e;let{secure:n,port:r}=e;return r||(r=Ed),r===443&&n==="false"&&(n="true"),r===80&&n==="true"&&(n="false"),`${n==="true"?"https":"http"}://${t}${r===443||r===80?"":":"+r}`.toLowerCase()}function iq(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(c=>i.includes(c.id)):t,a=o.find(c=>c.region==="US")||o[0];if(a)return{deploymentDescription:r.deploymentDescription,performanceDescription:r.performanceDescription,regionPlans:[{regionName:a.region,latencyDescription:a.latencyDescription}]}}return null}function qSe(e,t,n){if(t&&n){const r=e.getValues();if(!r.deploymentDescription||!r.performanceDescription||!r.regionPlans.length){const i=iq(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 KSe({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(GSe,{type:r.type,value:r.value},i))})}function GSe({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 ZSe({alreadyUsingFree:e,clusterId:t,defaultValues:n,deploymentToPerformanceToPlan:r,organization:i,organizationId:o,planTypes:a,regionLocationsColocated:c,regionLocationsDedicated:d,setSavedClusterState:f,startOffOnBilling:m}){const h=En(),v=xn(),y=rr(),{mutate:x,isPending:S}=rwe(),{mutate:C,isPending:k}=owe(),[E,j]=b.useState(m),R=b.useMemo(()=>nk(c?.sort(tk("latencyDescription"))||[],"region","latencyDescription"),[c]),T=b.useMemo(()=>nk(d?.sort(tk("latencyDescription"))||[],"region","latencyDescription"),[d]),N=b.useCallback((B,se)=>{const _e=new Set,Ie=r?.[B.deploymentDescription]?.[B.performanceDescription];if(B.deploymentDescription==="Self-Hosted")for(let Le=0;Le<B.instances.length;Le++){const We=rq(B.instances[Le]);_e.has(We)?se.addIssue({code:"custom",path:[`instances.${Le}.fqdn`],message:"Every instance url must be unique!"}):_e.add(We)}else{Ie?.priceUsd===0&&e&&se.addIssue({code:"custom",path:["performanceDescription"],message:"Only one free cluster is allowed per organization."});const Le=Ie?.deploymentDescription!=="Dedicated"?R:T;for(let We=0;We<B.regionPlans.length;We++){const gt=B.regionPlans[We],Qt=Le[gt.regionName]?.[gt.latencyDescription];_e.has(gt.regionName)?se.addIssue({code:"custom",path:[`regionPlans.${We}.regionName`],message:"You can only select a region once!"}):_e.add(gt.regionName),Ie?.allowedRegionIds?.length&&Qt?.id&&(Ie.allowedRegionIds.includes(Qt.id)?We>=1&&se.addIssue({code:"custom",path:[`regionPlans.${We}.regionName`],message:"You can only select one region with this performance tier!"}):awe(Ie.allowedRegionIds,Qt.id)?se.addIssue({code:"custom",path:[`regionPlans.${We}.latencyDescription`],message:"This latency is not available with the selected performance tier!"}):se.addIssue({code:"custom",path:[`regionPlans.${We}.regionName`],message:"This region is not available with the selected performance tier!"}))}}},[e,R,T,r]),O=on({mode:"onChange",resolver:mn(rb.superRefine(N)),defaultValues:n}),[M,L]=b.useState(!0);b.useEffect(()=>{M&&n&&(f(null),L(!1))},[n,M,f]);const K=O.watch("clusterName"),ee=O.watch("abbreviatedName"),q=O.watch("deploymentDescription"),Y=O.watch("performanceDescription"),U=O.watch("regionPlans"),H=O.watch("instances"),z=q!=="Dedicated"?R:T,W=q!=="Dedicated"?c:d;b.useEffect(function(){const se=O.getValues(),_e=q==="Self-Hosted";q&&(_e?(se.abbreviatedName&&O.setValue("abbreviatedName",""),se.regionPlans.length&&O.setValue("regionPlans",[]),se.instances.length||O.setValue("instances",[{secure:"true",fqdn:"",port:Ed}])):(se.fqdn&&O.setValue("fqdn",""),se.instances.length&&O.setValue("instances",[]),se.regionPlans.length||qSe(O,a,W)))},[O,a,W,q]);const F=b.useMemo(()=>{const B=g9(_0(K),rb.shape.abbreviatedName.unwrap().maxLength);return{suggestedAbbreviatedName:B,fullHostName:`${ee||B}.${i.subdomain||"your-org"}.harperfabric.com`}},[K,ee,i]),te=b.useMemo(()=>r?.[q]?.[Y],[r,q,Y]);b.useEffect(function(){const se=te?.allowedRegionIds;if(se?.length&&U?.length===1){const _e=U[0],Ie=z?.[_e.regionName]?.[_e.latencyDescription];if(!se.includes(Ie?.id)){const Fe=W?.filter(We=>se.includes(We.id)),Le=Fe?.find(We=>We.region==="US")||Fe?.[0];Le&&(O.setValue("regionPlans.0.regionName",Le.region),O.setValue("regionPlans.0.latencyDescription",Le.latencyDescription),O.trigger())}}},[te,U,O,z,W]),b.useEffect(function(){if(!(q==="Self-Hosted")&&Object.keys(z).length&&U.length)for(let _e=0;_e<U.length;_e++){const Ie=U[_e];z[Ie.regionName]||O.setValue(`regionPlans.${_e}.regionName`,"")}},[O,z,q,U]);const D=te?.priceUsd?q==="Self-Hosted"?H.length*te.priceUsd:U.reduce((B,se)=>{const _e=z?.[se.regionName]?.[se.latencyDescription];return B+(_e?te.priceUsd*_e.instanceCount/2:0)},0):0,$=b.useCallback(({creating:B,deploymentDescription:se})=>we.message(B?"Creating Cluster":"Updating Cluster",{description:u.jsx(twe,{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}),[]),V=b.useCallback(async({clusterId:B,sourceClusterId:se,creating:_e,toastId:Ie,isSelfManaged:Fe})=>{if(se){const We=(await h9(o)).clusters?.find(gt=>gt.id===se);Nh(We?.status)&&await f9(se)}y.invalidateQueries({queryKey:[o],refetchType:"active"}),_e||y.invalidateQueries({queryKey:[B],refetchType:"active"}),v.invalidate(),h(Fe?{to:`/${o}/${B}/instances`}:_e?{to:`/${o}/${B}/starting-up`}:{to:`/${o}/${B}/scaling`}),O.reset(),we.success(_e?"Cluster Created":"Cluster Updated",{id:Ie,description:Fe?void 0:_e?"It is being provisioned now.":"The updates are being provisioned now.",duration:5e3})},[y,v,h,o,O]),A=b.useCallback(async()=>{const B=O.getValues(),se=[],_e=r[B.deploymentDescription][B.performanceDescription],Ie=B.deploymentDescription==="Self-Hosted";if(Ie)for(const We of B.instances)se.push({autoRenew:!0,instanceFqdn:We.fqdn,operationsApiPort:We.port||Ed,operationsApiSecure:We.secure==="true",planId:_e.id});else for(const We of B.regionPlans){const gt=z[We.regionName][We.latencyDescription];se.push({autoRenew:!0,planId:_e.id,regionId:gt.id})}f(null);const Fe=$({creating:!t,deploymentDescription:B.deploymentDescription}),Le=()=>we.dismiss(Fe);t?C({id:t,regionPlans:se},{onSuccess:We=>V({clusterId:We.id,sourceClusterId:B.sourceClusterId,isSelfManaged:Ie,creating:!1,toastId:Fe}),onError:Le}):x({abbreviatedName:Ie?void 0:B.abbreviatedName||F.suggestedAbbreviatedName,autoRenew:!0,fqdn:Ie&&B.fqdn||void 0,name:B.clusterName,organizationId:o,regionPlans:se},{onSuccess:We=>V({clusterId:We.id,sourceClusterId:B.sourceClusterId,isSelfManaged:Ie,creating:!0,toastId:Fe}),onError:Le})},[F.suggestedAbbreviatedName,t,r,O,V,$,o,z,f,C,x]),J=b.useCallback(()=>{if(D>0){j(!0);return}return A()},[A,D]),fe=b.useCallback(B=>{f(B?{clusterId:t,...O.getValues(),skipToBilling:!0}:null)},[t,O,f]),ge=b.useCallback(()=>{j(!1)},[]);return u.jsxs(u.Fragment,{children:[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(KSe,{price:D})})]}),u.jsx(an,{...O,children:E?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(Jwe,{clusterId:t,isPending:S||k,onGoBackToDetails:ge,onSaveStateForBillingRedirect:fe,onSubmit:A,organizationId:o,selectedPlan:te})]}):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:O.handleSubmit(J),children:u.jsx(HSe,{calculatedNames:F,clusterId:t,deploymentToPerformanceToPlan:r,form:O,isPending:S||k,regionLocations:W,regionNameToLatencyToRegion:z,selectedDeployment:q,selectedPerformance:Y,selectedPlan:te,totalPrice:D})})]})})]})}function dP(e){return e?.clusterName!==void 0}function bI(){const{organizationId:e,clusterId:t}=it({strict:!1}),{create:n,update:r}=ix(e),{organization:i,cluster:o}=qm({strict:!1}),[a,c]=Cf(ru.SavedClusterState,null),{data:d}=Pt(J0e(e)),{data:f}=Pt(W2({availableHosts:!0,organizationId:e})),{data:m}=Pt(W2({organizationId:e})),h=b.useMemo(()=>{for(const S of i?.clusters??[])if(S.id!==o?.id&&d&&!QR(S.status)&&!Nh(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(()=>nk(d?.sort(tk("priceUsd"))||[],"deploymentDescription","performanceDescription"),[d]),y=b.useMemo(()=>{if(!d||!f||!m||t&&!o)return null;let S=o;if(a){if(dP(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(N=>N.id===o?.plans?.[0].planId),k=[],E=[],j=C?.deploymentDescription!=="Dedicated"?f:m,R=iq(d,j,h);let T=!1;if(S){if(S.plans){for(const N of S.plans)if(N.regionId){const O=j.find(M=>M.id===N.regionId);O&&k.push({regionName:O.region,latencyDescription:O.latencyDescription})}}if(!k.length&&S.instances){const N=S.instances.filter(O=>O.status&&!sj.includes(O.status)).sort(m9);for(const O of N)T=!0,E.push({fqdn:O.instanceFqdn,port:O.operationsApiPort,secure:O.operationsApiSecure?"true":"false"})}}else R&&k.push(...R.regionPlans);return!T&&!k.length&&k.push({regionName:"",latencyDescription:""}),{sourceClusterId:S?.id,autoRenew:S?.plans?.[0]?.autoRenew??!0,clusterName:S?.name??"",abbreviatedName:S?.abbreviatedName??"",deploymentDescription:C?.deploymentDescription??R?.deploymentDescription??"",performanceDescription:C?.performanceDescription??R?.performanceDescription??"",fqdn:T?S?.fqdn??"":"",instances:E,regionPlans:k}},[h,o,t,d,f,m,a]);return!y||!i||!d||!f||!m?u.jsx(Nv,{children:u.jsx(eo,{centered:!0,text:"Loading..."})}):(o?.id?!r:!n)?u.jsx(Nv,{children:u.jsx(Ey,{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(Nv,{children:u.jsx(Ey,{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(_l,{}),"."]})}})}):u.jsx(Nv,{children:u.jsx(ZSe,{alreadyUsingFree:h,clusterId:t,defaultValues:y,deploymentToPerformanceToPlan:v,organization:i,organizationId:e,planTypes:d,regionLocationsColocated:f,regionLocationsDedicated:m,setSavedClusterState:c,startOffOnBilling:dP(a)&&a.skipToBilling===!0})})}const uk={FAILED:0,UPDATING:1,PROVISIONING:2,RUNNING:3,TERMINATED:4},Av=uk.RUNNING;function YSe(e,t){if(e.status===t.status)return e.name.localeCompare(t.name);const n=e.status?uk[e.status]??Av:Av,r=t.status?uk[t.status]??Av:Av;return n-r}function oq(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 WSe(){const{organizationId:e}=it({strict:!1}),{create:t}=ix(e),{data:n,isSuccess:r}=Wi(iu(e)),[i]=Cf(ru.SavedClusterState,null),[o,a]=b.useState(""),c=b.useCallback(()=>a(""),[]),d=b.useCallback(h=>{a(h.currentTarget.value?.toLowerCase()||"")},[]),f=b.useMemo(()=>n?.clusters?.slice().filter(h=>!QR(h.status)).sort(YSe)||[],[n?.clusters]),m=b.useMemo(()=>f.filter(oq(["id","name"],o))||[],[o,f]);return n&&f.length===0&&t?u.jsx(bI,{}):i?u.jsx(_c,{to:`/${e}/new-cluster`}):u.jsxs(u.Fragment,{children:[u.jsx(gs,{children:r?u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(Me,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:o,onChange:d}),t&&u.jsx(Ze,{to:"new-cluster",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Xr,{})," ",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(W0e,{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:c,children:"Clear Filters"})]})]})})]})}function aq(){const e=URL.parse(location.href);return e?.hash?e.hash.startsWith("#/")?e.hash.slice(1):e.hash:"/"}function sq(){return"/#"+aq()}function XSe(){const{organizationId:e}=it({strict:!1}),t=En(),r=new URLSearchParams(window.location.search).get("setup_intent_client_secret"),{setup_intent_client_secret:i}=Er({strict:!1}),[o]=Cf(ru.SavedClusterState,null),a=r||i,c=w9(),d=v9(e),f=b.useCallback(()=>{const m=o?o.clusterId?`../../${o.clusterId}/edit`:"../../new-cluster":"../";window.history.replaceState(null,"",sq()),t({search:void 0,to:m})},[t,o]);return b.useEffect(()=>{!c||!a||!d||!e||!f||(async function(){try{const{setupIntent:m}=await c.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,c]),u.jsx(eo,{centered:!0})}function JSe(){return u.jsx(_9,{children:u.jsx(XSe,{})})}function lr({clusterId:e,instanceId:t,organizationId:n},r){return"/"+[n,e,t&&"instance",t,r].filter(Xo).join("/")}const om="flex items-center p-2 rounded-lg group",ib={className:"text-white hover:bg-gray-700"},ob={className:"text-black bg-white pointer-events-none cursor-default"};function QSe(){const{organizationId:e}=it({strict:!1}),{update:t}=rx(e);return t?u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),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(e_e,{}),u.jsx(t_e,{})]}),u.jsx("section",{className:"col-span-1 text-white md:col-span-8 lg:col-span-9",children:u.jsx(kl,{})})]})})]}):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 e_e(){const e=it({strict:!1});return u.jsxs("div",{className:"hidden md:block",children:[u.jsxs("span",{className:om,children:[u.jsx(ene,{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(Ze,{to:lr(e,"billing"),className:om,activeOptions:{exact:!0},inactiveProps:ib,activeProps:ob,children:[u.jsx(C4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"billing/invoices"),className:om,inactiveProps:ib,activeProps:ob,children:[u.jsx(T4,{className:"inline-block"}),u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})]})}function t_e(){const e=it({strict:!1});return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2",children:[u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"billing"),className:om,activeOptions:{exact:!0},inactiveProps:ib,activeProps:ob,children:[u.jsx(C4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Payment Method"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"billing/invoices"),className:om,inactiveProps:ib,activeProps:ob,children:[u.jsx(T4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Invoices & Payments"})]})})]})}function j0(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function tl(e,t){return typeof e=="function"?e(t):e}function Yi(e,t){return n=>{t.setState(r=>({...r,[e]:tl(n,r[e])}))}}function R0(e){return e instanceof Function}function n_e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function r_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 c=e(o);if(!(c.length!==r.length||c.some((m,h)=>r[h]!==m)))return i;r=c;let f;if(n.key&&n.debug&&(f=Date.now()),i=t(...c),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`,`
114
+ font-size: .6rem;
115
+ font-weight: bold;
116
+ 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 i_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,c,d,f)=>({table:a,column:c,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 o_e(e,t,n,r){var i,o;const c={...e._getDefaultColumnDef(),...t},d=c.accessorKey;let f=(i=(o=c.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?i:typeof c.header=="string"?c.header:void 0,m;if(c.accessorFn?m=c.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[c.accessorKey]),!f)throw new Error;let h={id:`${String(f)}`,accessorFn:m,parent:r,depth:n,columnDef:c,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 Ir="debugHeaders";function fP(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=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const a_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 c=(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 Dv(t,[...c,...f,...d],e)},at(e.options,Ir)),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))),Dv(t,n,e,"center")),at(e.options,Ir)),e.getLeftHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return Dv(t,o,e,"left")},at(e.options,Ir)),e.getRightHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?i:[];return Dv(t,o,e,"right")},at(e.options,Ir)),e.getFooterGroups=ot(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Ir)),e.getLeftFooterGroups=ot(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Ir)),e.getCenterFooterGroups=ot(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Ir)),e.getRightFooterGroups=ot(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Ir)),e.getFlatHeaders=ot(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ir)),e.getLeftFlatHeaders=ot(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ir)),e.getCenterFlatHeaders=ot(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ir)),e.getRightFlatHeaders=ot(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ir)),e.getCenterLeafHeaders=ot(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ir)),e.getLeftLeafHeaders=ot(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ir)),e.getRightLeafHeaders=ot(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ir)),e.getLeafHeaders=ot(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,c,d,f;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(m=>m.getLeafHeaders()).flat()},at(e.options,Ir))}};function Dv(e,t,n,r){var i,o;let a=0;const c=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&&c(x.columns,y+1)},0)};c(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,R=!1;if(E&&C.column.parent?j=C.column.parent:(j=C.column,R=!0),k&&k?.column===j)k.subHeaders.push(C);else{const T=fP(n,j,{id:[r,y,j.id,C?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${S.filter(N=>N.column===j).length}`:void 0,depth:y,index:S.length});T.subHeaders.push(C),S.push(T)}x.headers.push(C),C.headerGroup=x}),d.push(x),y>0&&f(S,y-1)},m=t.map((v,y)=>fP(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:R,rowSpan:T}=j;S+=R,k.push(T)})):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 s_e=(e,t,n,r,i,o,a)=>{let c={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return c._valuesCache[d]=f.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=f.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=c.getValue(d))!=null?f:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>r_e(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],f=c;for(;;){const m=f.getParentRow();if(!m)break;d.push(m),f=m}return d.reverse()},getAllCells:ot(()=>[e.getAllLeafColumns()],d=>d.map(f=>i_e(e,c,f,f.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:ot(()=>[c.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(c,e)}return c},l_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()}}},lq=(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))};lq.autoRemove=e=>Vo(e);const cq=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};cq.autoRemove=e=>Vo(e);const uq=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};uq.autoRemove=e=>Vo(e);const dq=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};dq.autoRemove=e=>Vo(e);const fq=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});fq.autoRemove=e=>Vo(e)||!(e!=null&&e.length);const pq=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});pq.autoRemove=e=>Vo(e)||!(e!=null&&e.length);const mq=(e,t,n)=>e.getValue(t)===n;mq.autoRemove=e=>Vo(e);const hq=(e,t,n)=>e.getValue(t)==n;hq.autoRemove=e=>Vo(e);const xI=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};xI.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 c=o;o=a,a=c}return[o,a]};xI.autoRemove=e=>Vo(e)||Vo(e[0])&&Vo(e[1]);const Ya={includesString:lq,includesStringSensitive:cq,equalsString:uq,arrIncludes:dq,arrIncludesAll:fq,arrIncludesSome:pq,equals:mq,weakEquals:hq,inNumberRange:xI};function Vo(e){return e==null||e===""}const c_e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Yi("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"?Ya.includesString:typeof r=="number"?Ya.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ya.equals:Array.isArray(r)?Ya.arrIncludes:Ya.weakEquals},e.getFilterFn=()=>{var n,r;return R0(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:Ya[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=tl(n,o?o.value:void 0);if(pP(i,a,e)){var c;return(c=r?.filter(m=>m.id!==e.id))!=null?c:[]}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=tl(t,i))==null?void 0:o.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(pP(d,a.value,c))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 pP(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const u_e=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),d_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},f_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},p_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]},m_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},h_e=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!n_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},g_e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),v_e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,y_e=(e,t)=>t.length,m1={sum:u_e,min:d_e,max:f_e,extent:p_e,mean:m_e,median:h_e,unique:g_e,uniqueCount:v_e,count:y_e},b_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:Yi("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 m1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return m1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return R0(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:m1[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 x_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 w_e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Yi("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ot(n=>[am(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=am(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=am(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],c=[...i];for(;c.length&&a.length;){const d=a.shift(),f=c.findIndex(m=>m.id===d);f>-1&&o.push(c.splice(f,1)[0])}o=[...o,...c]}return x_e(o,n,r)},at(e.options,"debugTable"))}},h1=()=>({left:[],right:[]}),S_e={getInitialState:e=>({columnPinning:h1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Yi("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 c,d;return{left:((c=i?.left)!=null?c:[]).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(c=>c.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(c=>r?.includes(c)),a=n.some(c=>i?.includes(c));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?h1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:h1())},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 __e(e){return e||(typeof document<"u"?document:null)}const $v={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},g1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),C_e={getDefaultColumnDef:()=>$v,getInitialState:e=>({columnSizing:{},columnSizingInfo:g1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Yi("columnSizing",e),onColumnSizingInfoChange:Yi("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:$v.minSize,(r=o??e.columnDef.size)!=null?r:$v.size),(i=e.columnDef.maxSize)!=null?i:$v.maxSize)},e.getStart=ot(n=>[n,am(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,am(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(),v1(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),c=e?e.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[r.id,r.getSize()]],d=v1(o)?Math.round(o.touches[0].clientX):o.clientX,f={},m=(k,E)=>{typeof E=="number"&&(t.setColumnSizingInfo(j=>{var R,T;const N=t.options.columnResizeDirection==="rtl"?-1:1,O=(E-((R=j?.startOffset)!=null?R:0))*N,M=Math.max(O/((T=j?.startSize)!=null?T:0),-.999999);return j.columnSizingStart.forEach(L=>{let[K,ee]=L;f[K]=Math.round(Math.max(ee+ee*M,0)*100)/100}),{...j,deltaOffset:O,deltaPercentage:M}}),(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=__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=k_e()?{passive:!1}:!1;v1(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:c,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?g1():(n=e.initialState.columnSizingInfo)!=null?n:g1())},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 Pv=null;function k_e(){if(typeof Pv=="boolean")return Pv;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 Pv=e,Pv}function v1(e){return e.type==="touchstart"}const E_e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Yi("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 am(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const j_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()}}},R_e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Yi("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=()=>Ya.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return R0(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ya[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},I_e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Yi("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(c=>{a[c]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:c,...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()}}}},dk=0,fk=10,y1=()=>({pageIndex:dk,pageSize:fk}),N_e={getInitialState:e=>({...e,pagination:{...y1(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Yi("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=>tl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?y1():(i=e.initialState.pagination)!=null?i:y1())},e.setPageIndex=r=>{e.setPagination(i=>{let o=tl(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?dk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:dk)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?fk:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:fk)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,tl(r,i.pageSize)),a=i.pageSize*i.pageIndex,c=Math.floor(a/o);return{...i,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=tl(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}}},b1=()=>({top:[],bottom:[]}),T_e={getInitialState:e=>({rowPinning:b1(),...e}),getDefaultOptions:e=>({onRowPinningChange:Yi("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}):[],c=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=>!(c!=null&&c.has(S))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)]}}if(n==="top"){var y,x;return{top:[...((y=d?.top)!=null?y:[]).filter(S=>!(c!=null&&c.has(S))),...Array.from(c)],bottom:((x=d?.bottom)!=null?x:[]).filter(S=>!(c!=null&&c.has(S)))}}return{top:((f=d?.top)!=null?f:[]).filter(S=>!(c!=null&&c.has(S))),bottom:((m=d?.bottom)!=null?m:[]).filter(S=>!(c!=null&&c.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(c=>r?.includes(c)),a=n.some(c=>i?.includes(c));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:c}=a;return c});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?b1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:b1())},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 c=e.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>t.find(c=>c.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"))}},O_e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Yi("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=>{pk(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?x1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?x1(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?x1(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 c={...o};return pk(c,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return wI(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return mk(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return mk(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)}}}},pk=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>pk(e,c.id,n,r,i))};function x1(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,c){return a.map(d=>{var f;const m=wI(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 wI(e,t){var n;return(n=t[e.id])!=null?n:!1}function mk(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()&&(wI(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const c=mk(a,t);c==="all"?o=!0:(c==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const hk=/([0-9]+)/gm,A_e=(e,t,n)=>gq(Cl(e.getValue(n)).toLowerCase(),Cl(t.getValue(n)).toLowerCase()),D_e=(e,t,n)=>gq(Cl(e.getValue(n)),Cl(t.getValue(n))),$_e=(e,t,n)=>SI(Cl(e.getValue(n)).toLowerCase(),Cl(t.getValue(n)).toLowerCase()),P_e=(e,t,n)=>SI(Cl(e.getValue(n)),Cl(t.getValue(n))),M_e=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},z_e=(e,t,n)=>SI(e.getValue(n),t.getValue(n));function SI(e,t){return e===t?0:e>t?1:-1}function Cl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function gq(e,t){const n=e.split(hk).filter(Boolean),r=t.split(hk).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),c=parseInt(o,10),d=[a,c].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>c)return 1;if(c>a)return-1}return n.length-r.length}const Lp={alphanumeric:A_e,alphanumericCaseSensitive:D_e,text:$_e,textCaseSensitive:P_e,datetime:M_e,basic:z_e},L_e={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Yi("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 Lp.datetime;if(typeof o=="string"&&(r=!0,o.split(hk).length>1))return Lp.alphanumeric}return r?Lp.text:Lp.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 R0(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:Lp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const c=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?c?m="toggle":m="add":a!=null&&a.length&&d!==a.length-1?m="replace":c?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())}},F_e=[a_e,E_e,w_e,S_e,l_e,c_e,j_e,R_e,L_e,b_e,I_e,N_e,T_e,O_e,C_e];function U_e(e){var t,n;const r=[...F_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=tl(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=o_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 I0(){return e=>ot(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const c=[];for(let f=0;f<i.length;f++){const m=s_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,c.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 c};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function V_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 B_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:c,rowsById:d}=r;const f=i*o,m=f+i;a=a.slice(f,m);let h;t.options.paginateExpandedRows?h={rows:a,flatRows:c,rowsById:d}:h=V_e({rows:a,flatRows:c,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 H_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 c=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),R=h.getValue(x.id),T=j===void 0,N=R===void 0;if(T||N){if(C==="first")return T?-1:1;if(C==="last")return T?1:-1;E=T&&N?0:T?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=c(m.subRows))}),f};return{rows:c(n.rows),flatRows:i,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Fc(e,t){return e?q_e(e)?b.createElement(e,t):e:null}function q_e(e){return K_e(e)||typeof e=="function"||G_e(e)}function K_e(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function G_e(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function N0(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=b.useState(()=>({current:U_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 T0({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 zh({className:e,...t}){return u.jsx("thead",{"data-slot":"table-header",className:Ue("[&_tr]:border-b",e),...t})}function O0({className:e,...t}){return u.jsx("tbody",{"data-slot":"table-body",className:Ue("[&_tr:last-child]:border-0",e),...t})}function Vi({className:e,...t}){return u.jsx("tr",{"data-slot":"table-row",className:Ue("border-b border-grey-700 transition-colors",e),...t})}function _I({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 vq({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:Fc(e.column.columnDef.header,e.getContext()),c=b.useCallback(()=>{e.column.resetSize()},[e]);return u.jsx(_I,{...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(Oee,{}):e.column.getIsSorted()==="desc"?u.jsx(Db,{}):u.jsx(Nee,{className:"text-gray-600"})]}):a,o&&u.jsx(be,{type:"button",variant:"ghost",className:"cursor-col-resize",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),onDoubleClick:c,style:{transform:e.column.getIsResizing()?`translateX(${e.getContext().table.getState().columnSizingInfo.deltaOffset}px)`:""},children:u.jsx(Ete,{})})]})})}function us({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 jf({columns:e,data:t,isFetching:n,onRowClick:r,onColumnClick:i,sortingState:o,children:a}){const c=N0({data:t,columns:e,getCoreRowModel:I0(),getSortedRowModel:H_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(T0,{containerClassName:"rounded-md bg-black-dark",children:[u.jsx(zh,{children:c.getHeaderGroups().map(d=>u.jsx(Vi,{className:"border-none",children:d.headers.map(f=>u.jsx(vq,{header:f,onColumnClick:i},f.id))},d.id))}),u.jsx(O0,{className:"bg-black border border-grey-700",children:c.getRowModel().rows?.length?c.getRowModel().rows.map(d=>u.jsx(Vi,{"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(us,{className:"py-2 px-2 overflow-x-hidden max-w-32 text-ellipsis whitespace-nowrap",children:Fc(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:n?u.jsx("div",{children:u.jsx(eo,{className:"p-12"})}):u.jsx("span",{children:"No results."})})})})]})]})}function Z_e(e){switch(e){case"paid":return"success";case"void":case"uncollectible":return"destructive";default:return"default"}}function w1(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e)}function Ec(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 Y_e=[{header:"Invoice Id",accessorKey:"id",enableSorting:!1},{header:"Status",accessorKey:"status",enableSorting:!1,cell:({cell:e})=>u.jsx(Zo,{variant:Z_e(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?Ec(r,t):[t?Ec(r,t):"-",n?Ec(i,n):"-"].join(" to ")}},{header:"Amount Due",accessorKey:"amountDue",enableSorting:!1,cell:({cell:e})=>w1(e.getValue()?e.getValue()/100:0)},{header:"Amount Paid",accessorKey:"amountPaid",enableSorting:!1,cell:({cell:e})=>w1(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} @ ${w1(r.amount/100)}`);return n.join(`
117
+ `)}}];function Ml(e){return b.useCallback(async()=>{const t=we.loading("Refreshing..."),n=Date.now();await e(),Date.now()-n<500&&await Uc(500),we.dismiss(t),we.success("Refreshed!")},[e])}async function W_e(e){const{data:t}=await Gt.get(`/Invoice/${e}`);return t}function X_e(e,t){return{queryKey:[e,"invoices"],queryFn:()=>W_e(e),retry:!1,enabled:!!e,refetchInterval:void 0}}function J_e(){const{organizationId:e}=it({strict:!1}),{data:t}=Pt(iu(e)),{data:n,refetch:r,isLoading:i,isFetching:o,isRefetching:a}=Pt(X_e(t?.type!=="ENTERPRISE"&&t?.id)),c=Ml(r);return t?.type==="ENTERPRISE"?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(_l,{}),", we would love to talk!"]}):i?u.jsx(eo,{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(_l,{overEmail:!0}),", we would love to talk!"]}):u.jsx(jf,{data:n,columns:Y_e,children:u.jsxs(be,{variant:"defaultOutline",onClick:c,accessKey:"r",disabled:o||a,children:[u.jsx(ba,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]})})}function Q_e(e){const t=rt({getParentRoute:()=>e,path:"billing",component:QSe}),n=rt({getParentRoute:()=>t,path:"/",component:C9}),r=rt({getParentRoute:()=>t,path:"invoices",component:J_e}),i=rt({getParentRoute:()=>t,path:"confirm",component:JSe});return t.addChildren([n,r,i])}async function e1e(e){const{data:t}=await Gt.get(`/OrganizationRole/${e}`);return t}function A0(e){return{queryKey:[e,"roles"],queryFn:()=>e1e(e),retry:!1,refetchInterval:10*1e3}}const t1e=j0(),n1e=[{header:"Role Name",accessorKey:"roleName",enableSorting:!1},t1e.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 r1e(e){const{data:t}=await Gt.post("/Role/",e);return t}function i1e(){return ct({mutationFn:r1e})}const yq=Dt({name:nt().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:Yt(),delete:Yt()});Dt({roles:Dt({create:Yt(),delete:Yt(),update:Yt(),view:Yt()}),clusters:Dt({create:Yt(),delete:Yt(),update:Yt(),view:Yt(),resources:cs(Dt({id:nt(),delete:Yt(),update:Yt(),view:Yt(),instances:Dt({create:Yt(),delete:Yt(),update:Yt(),view:Yt()})}))})});function o1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mP(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 hP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mP(Object(n),!0).forEach(function(r){o1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a1e(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 s1e(e,t){if(e==null)return{};var n=a1e(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 l1e(e,t){return c1e(e)||u1e(e,t)||d1e(e,t)||f1e()}function c1e(e){if(Array.isArray(e))return e}function u1e(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](),c;!(r=(c=a.next()).done)&&(n.push(c.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 d1e(e,t){if(e){if(typeof e=="string")return gP(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 gP(e,t)}}function gP(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 f1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
118
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vP(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 yP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vP(Object(n),!0).forEach(function(r){p1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m1e(){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 Jp(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,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(i,c))}}}function ab(e){return{}.toString.call(e).includes("Object")}function h1e(e){return!Object.keys(e).length}function Dm(e){return typeof e=="function"}function g1e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function v1e(e,t){return ab(t)||fl("changeType"),Object.keys(t).some(function(n){return!g1e(e,n)})&&fl("changeField"),t}function y1e(e){Dm(e)||fl("selectorType")}function b1e(e){Dm(e)||ab(e)||fl("handlerType"),ab(e)&&Object.values(e).some(function(t){return!Dm(t)})&&fl("handlersType")}function x1e(e){e||fl("initialIsRequired"),ab(e)||fl("initialType"),h1e(e)&&fl("initialContent")}function w1e(e,t){throw new Error(e[t]||e.default)}var S1e={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"},fl=Jp(w1e)(S1e),Mv={changes:v1e,selector:y1e,handler:b1e,initial:x1e};function _1e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mv.initial(e),Mv.handler(t);var n={current:e},r=Jp(E1e)(n,t),i=Jp(k1e)(n),o=Jp(Mv.changes)(e),a=Jp(C1e)(n);function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(m){return m};return Mv.selector(f),f(n.current)}function d(f){m1e(r,i,o,a)(f)}return[c,d]}function C1e(e,t){return Dm(t)?t(e.current):t}function k1e(e,t){return e.current=yP(yP({},e.current),t),t}function E1e(e,t,n){return Dm(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 j1e={create:_1e},R1e={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function I1e(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,c=new Array(a),d=0;d<a;d++)c[d]=arguments[d];return t.apply(n,[].concat(i,c))}}}function N1e(e){return{}.toString.call(e).includes("Object")}function T1e(e){return e||bP("configIsRequired"),N1e(e)||bP("configType"),e.urls?(O1e(),{paths:{vs:e.urls.monacoBase}}):e}function O1e(){console.warn(bq.deprecation)}function A1e(e,t){throw new Error(e[t]||e.default)}var bq={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!
119
+ You are using deprecated way of configuration.
120
+
121
+ Instead of using
122
+ monaco.config({ urls: { monacoBase: '...' } })
123
+ use
124
+ monaco.config({ paths: { vs: '...' } })
125
+
126
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
127
+ `},bP=I1e(A1e)(bq),D1e={config:T1e},$1e=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 xq(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],xq(e[n],t[n]))}),hP(hP({},e),t)}var P1e={type:"cancelation",msg:"operation is manually canceled"};function S1(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(P1e):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var M1e=j1e.create({config:R1e,isInitialized:!1,resolve:null,reject:null,monaco:null}),wq=l1e(M1e,2),Lh=wq[0],D0=wq[1];function z1e(e){var t=D1e.config(e),n=t.monaco,r=s1e(t,["monaco"]);D0(function(i){return{config:xq(i.config,r),monaco:n}})}function L1e(){var e=Lh(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(D0({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),S1(_1);if(window.monaco&&window.monaco.editor)return Sq(window.monaco),e.resolve(window.monaco),S1(_1);$1e(F1e,V1e)(B1e)}return S1(_1)}function F1e(e){return document.body.appendChild(e)}function U1e(e){var t=document.createElement("script");return e&&(t.src=e),t}function V1e(e){var t=Lh(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=U1e("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function B1e(){var e=Lh(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){Sq(n),e.resolve(n)},function(n){e.reject(n)})}function Sq(e){Lh().monaco||D0({monaco:e})}function H1e(){return Lh(function(e){var t=e.monaco;return t})}var _1=new Promise(function(e,t){return D0({resolve:e,reject:t})}),_q={config:z1e,init:L1e,__getMonacoInstance:H1e},q1e={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},C1=q1e,K1e={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},G1e=K1e;function Z1e({children:e}){return Q.createElement("div",{style:G1e.container},e)}var Y1e=Z1e,W1e=Y1e;function X1e({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return Q.createElement("section",{style:{...C1.wrapper,width:e,height:t},...a},!n&&Q.createElement(W1e,null,r),Q.createElement("div",{ref:i,style:{...C1.fullWidth,...!n&&C1.hide},className:o}))}var J1e=X1e,Cq=b.memo(J1e);function Q1e(e){b.useEffect(e,[])}var kq=Q1e;function eCe(e,t,n=!0){let r=b.useRef(!0);b.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Pi=eCe;function sm(){}function pd(e,t,n,r){return tCe(e,r)||nCe(e,t,n,r)}function tCe(e,t){return e.editor.getModel(Eq(e,t))}function nCe(e,t,n,r){return e.editor.createModel(t,n,r?Eq(e,r):void 0)}function Eq(e,t){return e.Uri.parse(t)}function rCe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:m="Loading...",options:h={},height:v="100%",width:y="100%",className:x,wrapperProps:S={},beforeMount:C=sm,onMount:k=sm}){let[E,j]=b.useState(!1),[R,T]=b.useState(!0),N=b.useRef(null),O=b.useRef(null),M=b.useRef(null),L=b.useRef(k),K=b.useRef(C),ee=b.useRef(!1);kq(()=>{let H=_q.init();return H.then(z=>(O.current=z)&&T(!1)).catch(z=>z?.type!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>N.current?U():H.cancel()}),Pi(()=>{if(N.current&&O.current){let H=N.current.getOriginalEditor(),z=pd(O.current,e||"",r||n||"text",o||"");z!==H.getModel()&&H.setModel(z)}},[o],E),Pi(()=>{if(N.current&&O.current){let H=N.current.getModifiedEditor(),z=pd(O.current,t||"",i||n||"text",a||"");z!==H.getModel()&&H.setModel(z)}},[a],E),Pi(()=>{let H=N.current.getModifiedEditor();H.getOption(O.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],E),Pi(()=>{N.current?.getModel()?.original.setValue(e||"")},[e],E),Pi(()=>{let{original:H,modified:z}=N.current.getModel();O.current.editor.setModelLanguage(H,r||n||"text"),O.current.editor.setModelLanguage(z,i||n||"text")},[n,r,i],E),Pi(()=>{O.current?.editor.setTheme(f)},[f],E),Pi(()=>{N.current?.updateOptions(h)},[h],E);let q=b.useCallback(()=>{if(!O.current)return;K.current(O.current);let H=pd(O.current,e||"",r||n||"text",o||""),z=pd(O.current,t||"",i||n||"text",a||"");N.current?.setModel({original:H,modified:z})},[n,t,i,e,r,o,a]),Y=b.useCallback(()=>{!ee.current&&M.current&&(N.current=O.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...h}),q(),O.current?.editor.setTheme(f),j(!0),ee.current=!0)},[h,f,q]);b.useEffect(()=>{E&&L.current(N.current,O.current)},[E]),b.useEffect(()=>{!R&&!E&&Y()},[R,E,Y]);function U(){let H=N.current?.getModel();c||H?.original?.dispose(),d||H?.modified?.dispose(),N.current?.dispose()}return Q.createElement(Cq,{width:y,height:v,isEditorReady:E,loading:m,_ref:M,className:x,wrapperProps:S})}var iCe=rCe;b.memo(iCe);function oCe(e){let t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}var aCe=oCe,zv=new Map;function sCe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,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=sm,onMount:E=sm,onChange:j,onValidate:R=sm}){let[T,N]=b.useState(!1),[O,M]=b.useState(!0),L=b.useRef(null),K=b.useRef(null),ee=b.useRef(null),q=b.useRef(E),Y=b.useRef(k),U=b.useRef(),H=b.useRef(r),z=aCe(o),W=b.useRef(!1),F=b.useRef(!1);kq(()=>{let $=_q.init();return $.then(V=>(L.current=V)&&M(!1)).catch(V=>V?.type!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>K.current?D():$.cancel()}),Pi(()=>{let $=pd(L.current,e||r||"",t||i||"",o||n||"");$!==K.current?.getModel()&&(h&&zv.set(z,K.current?.saveViewState()),K.current?.setModel($),h&&K.current?.restoreViewState(zv.get(o)))},[o],T),Pi(()=>{K.current?.updateOptions(f)},[f],T),Pi(()=>{!K.current||r===void 0||(K.current.getOption(L.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(F.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),F.current=!1))},[r],T),Pi(()=>{let $=K.current?.getModel();$&&i&&L.current?.editor.setModelLanguage($,i)},[i],T),Pi(()=>{c!==void 0&&K.current?.revealLine(c)},[c],T),Pi(()=>{L.current?.editor.setTheme(a)},[a],T);let te=b.useCallback(()=>{if(!(!ee.current||!L.current)&&!W.current){Y.current(L.current);let $=o||n,V=pd(L.current,r||e||"",t||i||"",$||"");K.current=L.current?.editor.create(ee.current,{model:V,automaticLayout:!0,...f},m),h&&K.current.restoreViewState(zv.get($)),L.current.editor.setTheme(a),c!==void 0&&K.current.revealLine(c),N(!0),W.current=!0}},[e,t,n,r,i,o,f,m,h,a,c]);b.useEffect(()=>{T&&q.current(K.current,L.current)},[T]),b.useEffect(()=>{!O&&!T&&te()},[O,T,te]),H.current=r,b.useEffect(()=>{T&&j&&(U.current?.dispose(),U.current=K.current?.onDidChangeModelContent($=>{F.current||j(K.current.getValue(),$)}))},[T,j]),b.useEffect(()=>{if(T){let $=L.current.editor.onDidChangeMarkers(V=>{let A=K.current.getModel()?.uri;if(A&&V.find(J=>J.path===A.path)){let J=L.current.editor.getModelMarkers({resource:A});R?.(J)}});return()=>{$?.dispose()}}return()=>{}},[T,R]);function D(){U.current?.dispose(),v?h&&zv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return Q.createElement(Cq,{width:y,height:x,isEditorReady:T,loading:d,_ref:ee,className:S,wrapperProps:C})}var lCe=sCe,Fh=b.memo(lCe),$0=Fh;const xP={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function cCe({isModalOpen:e,setIsModalOpen:t}){const n=rr(),{organizationId:r}=it({strict:!1}),[i,o]=b.useState(!0),[a,c]=b.useState(JSON.stringify(xP,null,2)),{mutate:d,isPending:f}=i1e(),m=on({resolver:mn(yq),defaultValues:{name:"",update:!1,delete:!1}}),h=b.useCallback(y=>{o(y.length===0)},[o]),v=b.useCallback(async y=>{const x=Mh(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(Fn,{onOpenChange:t,open:e,children:u.jsxs(Un,{children:[u.jsx($n,{children:"Add New Organization Role"}),u.jsx(kr,{children:"Set the new organization role permissions."}),u.jsx(an,{...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(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"update",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m.control,name:"delete",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(xP,null,2)})}),u.jsx(Zn,{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 uCe({roleId:e}){const{data:t}=await Gt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function dCe(){return ct({mutationFn:({roleId:e})=>uCe({roleId:e})})}async function fCe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Gt.put(`/Role/${e}`,t);return n}function pCe(){return ct({mutationFn:({roleId:e,updatedRoleInfo:t})=>fCe({roleId:e,updatedRoleInfo:t})})}function mCe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>hCe(t),refetchInterval:10*1e3}}async function hCe(e){const{data:t}=await Gt.get(`/Role/${e}`);return t}function gCe({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n}){return u.jsxs(u.Fragment,{children:[u.jsx($n,{children:"Confirm Role Deletion"}),u.jsx(kr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(Zn,{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 vCe({data:e,isModalOpen:t,closeModal:n}){const r=rr(),{data:i}=Wi(mCe({roleId:e.id,organizationId:e.organizationId})),o=El(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=hf(e.organizationId),{mutate:f,isPending:m}=pCe(),{mutate:h,isPending:v}=dCe(),[y,x]=b.useState(!1),S=on({resolver:mn(yq),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:M=>{we.error("Error",{description:`Failed to delete role: ${M instanceof Error?M.message:String(M)}.`,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}})},[e.id,h,S,n]),[k,E]=b.useState(!0),[j,R]=b.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),T=b.useCallback(M=>{E(M.length===0)},[E]),N=b.useCallback(async M=>{if(!c)return;const L=Mh(j);if(!L)return;const K={...M,...L,organizationId:e.organizationId};j&&k&&f({roleId:e.id,updatedRoleInfo:K},{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,c,j,f]),O=b.useCallback(()=>n(!1),[n]);return u.jsx(Fn,{onOpenChange:O,open:t,children:u.jsx(Un,{children:y?u.jsx(gCe,{onRoleDeleteClick:C,setIsConfirmingRoleDeletion:x,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs($n,{children:[a||!c?"View":"Edit",' Organization Role "',e.roleName,'"']}),u.jsx(an,{...S,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:S.handleSubmit(N),children:[u.jsx($e,{control:S.control,name:"name",render:({field:M})=>u.jsxs(Ne,{className:"col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Role Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"",...M,disabled:!0,readOnly:!0})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"update",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Update Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:S.control,name:"delete",render:({field:M})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:M.value,onChange:L=>M.onChange(L.target.checked)})}),u.jsx(Oe,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(Fh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:T,onChange:M=>{M&&R(M)},options:a||!c?{readOnly:!0}:void 0,defaultValue:j})}),!a&&(d||c)&&u.jsx(Zn,{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"}),c&&u.jsx(be,{variant:"submit",className:"rounded-full",disabled:!k||m||!S.formState.isValid||!S.formState.isDirty,children:"Save Changes"})]})})]})})]})})})}function jq(){const e=En(),t=rr(),{organizationId:n,orgRoleId:r}=it({strict:!1}),{create:i}=hf(n),{data:o,refetch:a,isFetching:c,isRefetching:d}=Wi(A0(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 R=[r?"..":"",E].filter(Boolean);await e({to:R.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=Ml(a);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),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(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:o,columns:n1e,onRowClick:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:c||d,children:[u.jsx(ba,{}),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(Xr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),i&&u.jsx(cCe,{isModalOpen:h,setIsModalOpen:v}),m&&u.jsx(vCe,{data:f,isModalOpen:m,closeModal:C})]})})]})}const yCe=j0(),bCe=[{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},yCe.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}],xCe=Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function wCe(e){const{data:t}=await Gt.post("/OrganizationRole/",e);return t}function Rq(){return ct({mutationFn:e=>wCe(e)})}Sl.object({email:Sf.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Sl.string().nonempty({error:"Please select a role."})});async function SCe(e){const{data:t}=await Gt.post("/UserInvite/",e);return t}function _Ce(){return ct({mutationFn:e=>SCe(e)})}function CCe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=it({strict:!1}),{data:i}=Wi(A0(r)),[o,a]=b.useState(!1),c=on({resolver:mn(xCe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=Rq(),{mutate:m,isPending:h}=_Ce(),v=b.useCallback(async y=>{y&&(o?m:d)(y,{onSuccess:()=>{const x=y.roleId;c.reset(),c.setValue("roleId",x),t(),we.success("User invited successfully!"),n(!1),a(!1)},onError:x=>{x?.status===404&&a(!0)}})},[d,c,m,t,n,o]);return u.jsx(Fn,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(gr,{children:u.jsx($n,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Email"}),u.jsx(De,{children:u.jsx(Me,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Roles"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...y,onValueChange:x=>y.onChange(x),children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Role"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(yI,{children:"Role"}),i?.map(x=>u.jsx(At,{value:x.id,children:x.roleName},x.id))]})})]})})}),u.jsx(Oe,{})]})}),o&&u.jsxs(kr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(Ute,{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(Zn,{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(jo,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function kCe({roleId:e,userId:t}){const{data:n}=await Gt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function ECe(){return ct({mutationFn:({roleId:e,userId:t})=>kCe({roleId:e,userId:t})})}function Iq(e){const[t,n]=b.useState(e||!1),r=b.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function jCe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=Rq(),{mutate:d,isPending:f}=ECe(),m=!!i[r.roleName],[h,v]=b.useState(m),[y,x]=Iq(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(ah,{className:"flex",children:[u.jsx(Me,{type:"checkbox",className:"w-6",disabled:t||c||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 RCe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=it({strict:!1}),o=El(),{update:a,remove:c}=hf(i),d=o.user?.email===t.email,{data:f}=Wi(A0(i)),m=b.useMemo(()=>t.roles?kf(t.roles,"roleName"):{},[t]),[h,v]=b.useState(!1);return u.jsx(Fn,{onOpenChange:h?r:e,open:n,children:u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsx(gr,{children:u.jsxs($n,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(kr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(jCe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:m,setChangesMade:v},y.id))]})})}function ICe(e,t){return e.email>t.email?1:-1}function Nq(){const e=En(),{organizationId:t,orgUserId:n}=it({strict:!1}),{update:r}=hf(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=Wi(A0(t)),d=b.useMemo(()=>{const N={};for(const O of i)if(O.users)for(const M of O.users)N[M.id]||(N[M.id]={...M,roles:[]}),N[M.id].roles.push(O);return Object.values(N).sort(ICe)},[i]),f=b.useMemo(()=>d?.find(N=>N.id===n),[d,n]),m=b.useCallback(N=>{const O=[n?"..":"",N].filter(Boolean);e({to:O.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(N=>{m(N.original.id)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{o(),m(void 0)},[m,o]),T=Ml(o);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),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(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:d,isFetching:a||c,columns:bCe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:T,accessKey:"r",disabled:a||c,children:[u.jsx(ba,{})," ",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(Xr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(CCe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(RCe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:R})]})})]})}function NCe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=rx(n),c=a,{view:d}=hf(n),f=b.useCallback(()=>{t(e)},[t,e]);return u.jsxs(Tc,{className:"relative h-full justify-between",children:[u.jsxs(jl,{children:[u.jsxs(Hc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Dh,{children:[u.jsx($h,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(oE,{"aria-label":"Options"})}),u.jsxs(Ph,{children:[u.jsx(Jy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(Qy,{}),u.jsx(Ze,{to:`${n}`,children:u.jsx(Sr,{children:"Clusters"})}),d&&u.jsx(Ze,{to:`${n}/roles`,children:u.jsx(Sr,{children:"Roles"})}),d&&u.jsx(Ze,{to:`${n}/users`,children:u.jsx(Sr,{children:"Users"})}),c&&u.jsx(Ze,{to:`${n}/billing`,children:u.jsx(Sr,{children:"Billing"})}),u.jsx(Qy,{}),o&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(Rl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(ps,{className:"flex justify-between",children:[u.jsx(Zo,{children:bo(i)}),u.jsx(Ze,{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(vi,{className:"inline-block"})]})})]})]})}async function TCe(e){const{data:t}=await Gt.delete(`/Organization/${e}`);return t}function OCe(){return ct({mutationFn:e=>TCe(e)})}async function ACe(e){const{data:t}=await Gt.post("/Organization/",{...e});return t}function DCe(){return ct({mutationFn:e=>ACe(e)})}const Lv=Dt({name:nt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:nt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function $Ce(){const{user:e}=El(),t=En(),n=on({resolver:mn(Lv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;b.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=b.useMemo(()=>{const y=g9(_0(a),Lv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:m}=DCe(),h=rr(),v=b.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:x=>{h.invalidateQueries({queryKey:Rb,refetchType:"active"}),Et.reloadUser(An),t({to:`/${x.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(an,{...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(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Subdomain"}),u.jsx(De,{children:u.jsx(Me,{type:"text",maxLength:Lv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(Oe,{})]})}),u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Full Host Name"}),u.jsx(De,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(Oe,{})]}),u.jsx(Zn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:m,children:["Create New Organization ",u.jsx(vi,{})]})})]})})})}function Tq(){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("section",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx($Ce,{})})]})}function PCe(){const e=rr(),{data:t}=Wi(IX()),{mutate:n,isPending:r}=OCe(),[i,o]=b.useState(!1),[a,c]=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,R)=>({organizationId:j,organizationName:k[R].organizationName,roleName:k[R].role})).filter(oq(["organizationId","organizationName"],d)).sort((j,R)=>(j.organizationName||"")>(R.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=>{c(C),o(!0)},[]),{createCluster:S}=Er({strict:!1});return h.length===1&&!d.length&&S?u.jsx(_c,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(Tq,{}):u.jsxs(u.Fragment,{children:[u.jsx(gs,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(Me,{placeholder:"Filter by name",className:"inline-block w-full text-xs",value:d,onChange:v}),u.jsx(Ze,{to:"/new-org",children:u.jsxs(be,{variant:"positive",accessKey:"n",children:[u.jsx(Xr,{}),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(NCe,{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(b0,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function MCe(){const{isLoading:e}=Bc(),{createCluster:t}=Er({strict:!1}),[,n]=Cf(ru.SavedClusterState,null);return b.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(eo,{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(uU,{})}),u.jsx("main",{children:u.jsx(kl,{})})]})}const zCe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function Oq(){const e=aq();return!zCe.includes(e)&&{redirect:e}}const P0=rt({getParentRoute:()=>tx,id:"_dashboardLayout",component:MCe,beforeLoad:({context:e})=>{const t=e.authentication[An];if(t&&!t.isLoading&&!t.user)throw Vc({to:"/sign-in",search:Oq()})}}),CI=rt({getParentRoute:()=>P0,id:"_orgsLayout"});rt({getParentRoute:()=>CI,path:"/",component:PCe});rt({getParentRoute:()=>CI,path:"/new-org",component:Tq});const ou=rt({getParentRoute:()=>CI,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(iu(e.params.organizationId))})}),LCe=rt({getParentRoute:()=>ou,path:"/roles",component:jq}),FCe=rt({getParentRoute:()=>ou,path:"/roles/$orgRoleId",component:jq}),UCe=rt({getParentRoute:()=>ou,path:"/users",component:Nq}),VCe=rt({getParentRoute:()=>ou,path:"/users/$orgUserId",component:Nq});Q_e(ou);const Aq=rt({getParentRoute:()=>ou,id:"_clusterLayout"});rt({getParentRoute:()=>Aq,path:"/",component:WSe});rt({getParentRoute:()=>ou,path:"/new-cluster",component:bI});rt({getParentRoute:()=>ds,path:"/edit",component:bI});function BCe(){return u.jsx(kl,{})}const ds=rt({getParentRoute:()=>Aq,path:"$clusterId",component:BCe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Tl(t.clusterId))})}),md=Dt({username:XR,role:nt().nonempty({error:"Please select a role."}),password:Ih.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:nt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});async function HCe(e){await Gt.patch(`/ResetPasswordUpdater/${e}`)}async function Dq(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function qCe(){return ct({mutationFn:Dq})}async function $q({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 KCe(){return ct({mutationFn:$q})}async function Pq({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function GCe(){return ct({mutationFn:Pq})}async function ZCe({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 c=await VC({username:t,password:i,instanceClient:a,entityId:e});return c.instanceClient&&(a=c.instanceClient),n===Y1?await $q({username:n,password:r,instanceClient:a}):(await Dq({username:n,password:r,role:"super_user",active:!0,instanceClient:a}),await Pq({username:Y1,instanceClient:a}),await VC({username:n,password:r,instanceClient:a,entityId:e})),await HCe(e),c}catch(c){throw await Bm({entityId:e,instanceClient:a}),c}}function YCe(){return ct({mutationFn:ZCe})}function WCe(){const{user:e}=El(),{clusterId:t}=it({strict:!1}),{data:n}=Pt(Tl(t,!0)),r=En(),i=b.useMemo(()=>Zk(n),[n]),o=eh(i),{redirect:a}=Er({strict:!1}),c=xn(),d=on({resolver:mn(md),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}=YCe(),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:Y1,desiredUsername:C.username},{onSuccess:async({message:k,user:E})=>{we.success(k),Et.setUserForEntity(n,E),c.invalidate(),await r({to:a?.startsWith("/")?a:zk})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(_c,{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(mx,{})}),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(an,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:m,name:"username",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Username"}),u.jsx(De,{children:u.jsx(Me,{autoComplete:"username",type:"text",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"password",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:m,name:"confirmPassword",render:({field:C})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",...C})}),u.jsx(Oe,{})]})}),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(kee,{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 XCe({columns:e,data:t}){const n=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(T0,{children:[u.jsx(zh,{children:n.getHeaderGroups().map(r=>u.jsx(Vi,{className:"border-none",children:r.headers.map(i=>u.jsx(_I,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:Fc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(O0,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Vi,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(us,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:Fc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function JCe(){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 QCe({isSelfManaged:e,instance:t}){const{user:n,isLoading:r}=fs(t.id),i=b.useMemo(()=>Yk(t),[t]),o=eh(i),{update:a}=Efe(),c=Et.checkForFabricConnect(t.id),d=b.useCallback(async()=>{await Bm({instanceClient:o,entityId:t.id}),Et.setUserForEntity(t,null)},[t,o]);return r||!["CLONE_READY","RUNNING","UPDATED"].includes(t.status)?u.jsx(R4,{className:"animate-spin",color:"gray"}):!n||c?u.jsxs("span",{className:"flex gap-4",children:[a&&!e&&u.jsx(Ze,{to:`../instance/${t.id}${ya}`,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(Ze,{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(Ze,{to:`../instance/${t.id}${ya}`,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 eke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,!0)),r=mI(t),i=b.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(QCe,{isSelfManaged:r,instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>rq({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 c=a.getValue();return u.jsx(Zo,{variant:JH(c),children:bo(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Mo(c,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 c=a.getValue();return Mo(c,Math.pow(1024,2))}}].filter(Xo),[r]),o=b.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!sj.includes(a.status)).sort(m9):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(Tc,{className:"p-0 mt-4 min-h-96",children:u.jsx(ps,{className:"p-0 min-h-96",children:n?u.jsx(Dr,{}):o.length?u.jsx(XCe,{data:o,columns:i}):u.jsx(JCe,{})})})})]})}function yc({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(gs,{}),u.jsx("div",{className:_i("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function tke(){const{clusterId:e}=it({strict:!1}),{data:t,isLoading:n}=Pt(Tl(e,2e3)),r=t?.status,i=b.useMemo(()=>r&&bx.includes(r),[r]);return n||!t?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):i?u.jsx(yc,{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(Om,{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(hI,{cluster:t})})]})}):u.jsx(yc,{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(Om,{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 nke(){const e=xn(),{clusterId:t}=it({strict:!1}),{data:n,isLoading:r}=Pt(Tl(t,2e3)),i=n?.status,o=b.useMemo(()=>i&&bx.includes(i),[i]),a=Nh(i),[,c]=Cf(ru.SavedClusterState,null),d=b.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(yc,{className:"flex justify-center",children:u.jsx(Dr,{})}):a?u.jsx(yc,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(Xee,{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(_l,{})," if you want more help."]}),u.jsx(be,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(yc,{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(Om,{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(hI,{cluster:n})})]})}):u.jsx(yc,{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(Om,{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."]})]})]})})}rt({getParentRoute:()=>ds,path:"instances",component:eke});rt({getParentRoute:()=>ds,path:"starting-up",component:nke});rt({getParentRoute:()=>ds,path:"scaling",component:tke});rt({getParentRoute:()=>ds,path:"sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{const r=Et.checkForFabricConnect(n.clusterId);if(e.authentication[n.clusterId]?.user&&!r){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"instance/$instanceId/sign-in",component:JR,beforeLoad:({context:e,location:t,params:n})=>{if(!(Et.checkForFabricConnect(n.clusterId)||Et.checkForFabricConnect(n.instanceId))&&e.authentication[n.instanceId]?.user){const i=t?.search;throw Vc({to:i?.redirect?.startsWith("/")?i.redirect:zk})}}});rt({getParentRoute:()=>ds,path:"finish-setup",component:WCe});function rke(e){return rt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Jm(()=>import("./index.lazy-CwPUt0Bc.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}function wP(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 Qp(e,t){const[n,r]=b.useState(t),[i,o]=b.useState(e);return b.useEffect(()=>{wP(n,t)||(r(t),o(e))},[n,t,e]),wP(n,t)?[i,o]:[e,o]}const sd={};function sb(e,t,n){const r=b.useCallback((i,o)=>t(i,o),[n]);b.useEffect(()=>(sd[e]||(sd[e]=[]),sd[e].push(r),function(){const o=sd[e].indexOf(r);o>=0&&sd[e].splice(o,1)}),[e,t,r])}function Uh(e,t,n){const r=sd[e];if(r)for(const i of r)i(t,n)}function Mq(e,t,n){return r=>Uh(e,t,r)}function k1(e,t,n){return b.useCallback(r=>Uh(e,t,r),[e,t,n])}function SP(e,t){return Mh(sessionStorage.getItem(String(e)))??t}function ike(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function _d(e,t){const n=Qp(SP(e,t),[e]),[r,i]=n;return b.useEffect(()=>{ike(e,r),Uh(`Session:${e}`,r)},[e,r]),sb(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),b.useEffect(function(){const a=c=>{c.key===e&&i(SP(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function oke(e,t=!1){const[n,r]=_d(e,t),i=b.useCallback(c=>{c?.preventDefault?.(),r(d=>!d)},[r]),o=b.useCallback(c=>{c?.preventDefault?.(),r(!0)},[r]),a=b.useCallback(c=>{c?.preventDefault?.(),r(!1)},[r]);return b.useMemo(()=>({toggled:n,setToggled:r,toggle:i,toggleOn:o,toggleOff:a}),[i,r,a,o,n])}const zq=b.createContext(null);function zr(){return b.useContext(zq)}async function Lq({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 M0(e){const t=(e||"")?.split(".");return t.length>1?t.slice(-1)[0]:""}function Fq(e){switch(M0(e).toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":case"pneg":case"webp":return!0;default:return!1}}async function Uq({instanceClient:e,file:t,project:n,encoding:r}){const{data:i}=await e.post("/",{operation:"get_component_file",file:t,project:n,encoding:r??(Fq(t)?"base64":"utf8")});return{file:t,project:n,...i}}function ake(e){return{queryKey:Vq(e),queryFn:()=>Uq(e),enabled:!!e.file&&!!e.project,retry:!1}}function Vq(e){return[e.entityId,"get_component_file",e.file,e.project,e.encoding]}async function kI({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 Bq(){return ct({mutationFn:kI})}function Hq(){const{reloadRootEntries:e,setFocusedItem:t,setSelectedItems:n}=zr(),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 c=`Renaming ${Zr(a.length,"File","Files")}`,d={duration:6e4,action:{label:"Cancel",onClick:()=>{o=!0}}};d.id=we.loading(c,{...d,description:u.jsx(Am,{animated:!0,width:"0%"})});const m=a.length*3;let h=0;function v(){h+=1,we.loading(c,{...d,description:u.jsx(Am,{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("/"),R=await Uq({...r,file:C,project:S,encoding:"base64"});if(o||(v(),await kI({...r,file:j,project:E,encoding:"base64",payload:R.message}),o)||(v(),await Lq({...r,file:C,project:S}),o))break;v()}h>=m?we.success(`Renamed ${Zr(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 ske(e,t){return e[t]!==void 0}function qq(e){return t=>ske(t,e)}function zl(e,t){const[n,r]=b.useState({value:t});return sb(e,(i,o)=>r({value:i,trigger:o}),[r]),n}function ei(e,t,n){Uh(e,t,n)}function z0(e,t,n){return r=>ei(e,t,r)}function Wa(e,t,n){return b.useCallback(r=>{ei(e,t,r)},[e,t,n])}const lke={handleGlobal(e,t){if((t.cmd||t.ctrl)&&e==="Delete")return ei("ShowDeleteDirectoryOrFileModal",!0),!0},addEditorAction(e){return{id:"delete-file",label:"Delete File",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Delete],run:z0("ShowDeleteDirectoryOrFileModal",!0)}}},cke={handleGlobal(e,t){if(t.ctrl&&t.alt&&t.shift&&e==="˜")return ei("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:z0("ShowAddDirectoryOrFileModalType","directory")}}},uke={handleGlobal(e,t){if(t.ctrl&&e==="n")return ei("ShowAddDirectoryOrFileModalType","file"),!0},addEditorAction(e){return{id:"new-file",label:"New File",keybindings:[e.KeyMod.WinCtrl|e.KeyCode.KeyN],run:z0("ShowAddDirectoryOrFileModalType","file")}}},dke={handleGlobal(e){if(e==="F2")return ei("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:z0("ShowRenameFileModal",!0)}}},fke={addEditorAction(){return{id:"revert-file",label:"Revert File",run:Mq("RevertChanges",!0)}}},pke={handleGlobal(e,t){if(t.cmd&&e==="s")return Uh("SaveFile",!0),!0},addEditorAction(e){return{id:"save-file",label:"Save Changes",keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],run:Mq("SaveFile",!0)}}},Kq=[lke,cke,uke,dke,fke,pke],mke=Kq.filter(qq("addEditorAction")),hke=Kq.filter(qq("handleGlobal"));function gke(e){const[t,n]=e,r=mke.map(i=>t.addAction(i.addEditorAction(n)));return()=>{for(const i of r)i?.dispose()}}function vke(){b.useEffect(()=>(document.addEventListener("keydown",_P),()=>{document.removeEventListener("keydown",_P)}),[])}function _P(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 hke)if(a.handleGlobal(e.key,o)){e.preventDefault();return}}function yke(e){return e.split("/").pop()}function EI(...e){return e.flat(1).join("/")}var ts;(function(e){e.DoubleClickItemToExpand="double-click-item-to-expand",e.ClickItemToExpand="click-item-to-expand",e.ClickArrowToExpand="click-arrow-to-expand"})(ts||(ts={}));var lb=function(){return lb=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},lb.apply(this,arguments)},bke=function(e,t){return{mode:e.mode,createInteractiveElementProps:function(n,r,i,o){return lb(lb({},t.createInteractiveElementProps(n,r,i,o)),e.createInteractiveElementProps(n,r,i,o))}}},Wd=function(e){return e.ctrlKey||navigator.platform.toUpperCase().indexOf("MAC")>=0&&e.metaKey},xke=(function(){function e(t){this.mode=ts.DoubleClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?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})(),wke=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?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})(),Ske=(function(){function e(t){this.mode=ts.ClickItemToExpand,this.environment=t}return e.prototype.createInteractiveElementProps=function(t,n,r,i){var o=this;return{onClick:function(a){var c=a.detail===0;r.focusItem(),a.shiftKey&&!c?r.selectUpTo(!Wd(a)):Wd(a)&&!c?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})(),CP=function(e,t){switch(e){case ts.DoubleClickItemToExpand:return new xke(t);case ts.ClickItemToExpand:return new wke(t);case ts.ClickArrowToExpand:return new Ske(t);default:throw Error("Unknown interaction mode ".concat(e))}},Gq=b.createContext(null),_ke=function(){return b.useContext(Gq)},Cke=function(e){var t=e.children,n=hn(),r=n.defaultInteractionMode,i=b.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?bke(r,CP(r.extends,n)):r:CP((o=r)!==null&&o!==void 0?o:ts.ClickItemToExpand,n)},[]);return b.createElement(Gq.Provider,{value:i},t)},Zq=function(){var e=hn();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])},Yq=function(){var e=hn();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])},kke=function(){var e=hn(),t=Yq(),n=Zq(),r=b.useCallback(function(i,o,a){var c=t(o,i),d=c.parent,f=c.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,c,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},R={targetType:"between-items",parentItem:k.item,linePosition:"top",childIndex:E,depth:C,treeId:i,linearIndex:y},T={targetType:"between-items",parentItem:k.item,linePosition:"bottom",linearIndex:y+1,childIndex:E+1,depth:C,treeId:i},N=(c=(a=m[y-1])===null||a===void 0?void 0:a.depth)!==null&&c!==void 0?c:-1,O=(f=(d=m[y+1])===null||d===void 0?void 0:d.depth)!==null&&f!==void 0?f:-1,M=C===N,L=C===O-1;!M&&n(R,o)&&h.push(R),n(j,o)&&h.push(j),!L&&n(T,o)&&h.push(T)}}return h},[n,e.items,e.linearItems,t,r])},Fv=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))},cb=function(e,t,n){var r=b.useRef();b.useEffect(function(){if(!r.current)r.current=Fv([],n,!0),e();else{var i=r.current.some(function(o,a){return o!==n[a]});i&&(r.current=Fv([],n,!0),e())}},Fv(Fv([],t,!0),n,!0))},ub=function(){return ub=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},ub.apply(this,arguments)},Wq=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 ub(ub({},n),(i={},i[o]=a,i))},{})},wo=function(){return typeof document<"u"?document:void 0};function Rf(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 db=function(e){var t=b.useRef(e);return t.current=e,t},So=function(e){var t=db(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])},Xq=function(){var e=hn();return So(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})})},Eke=function(e){var t,n=(t=wo())===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},Jq=function(e,t){return e.clientX<=t.left||e.clientX>=t.right||e.clientY<=t.top||e.clientY>=t.bottom},jke=(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 c=Math.max(i-o,this.indentation),d={parentLinearIndex:this.linearIndex,parent:this.targetItem},f,m=i;m>=c;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:c,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(c){return c.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})(),Rke=function(){var e=b.useRef("initial"),t=b.useState(void 0),n=t[0],r=t[1],i=b.useRef(0),o=hn(),a=Yq(),c=So(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=So(function(v,y,x){if(x.current){var S=x.current.getBoundingClientRect();if(!Jq(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],R=o.items[j.item],T=o.renderDepthOffset?Math.max(Math.floor((v.clientX-S.left)/o.renderDepthOffset),0):void 0,N,O=o.canReorderItems?R?.isFolder&&o.canDropOnFolder||o.canDropOnNonFolder?.2:.5:0;return C-.5>=k.length-1?N="bottom":C%1<O?N="top":C%1>1-O&&(N="bottom"),{linearIndex:E,offset:N,indentation:T}}}}),f=So(function(v,y,x){var S=d(v,y,x);if(c(v,y,S))return!n||!o.canDragAndDrop||!S||v.clientX<0||v.clientY<0?"invalid":new jke(o,v,y,S,n,a).getDraggingPosition()}),m=So(function(v,y){r(y),e.current="initial",i.current=Eke(v)}),h=So(function(){r(void 0),e.current="initial",i.current=0});return{initiateDraggingPosition:m,resetDraggingPosition:h,draggingItems:n,getDraggingPosition:f,itemHeight:i}},Qq=b.createContext(null),Ea=function(){return b.useContext(Qq)},Ike=function(e){var t=e.children,n=hn(),r=b.useState(!1),i=r[0],o=r[1],a=b.useState({}),c=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=kke(),C=Rf(),k=Xq(),E=Rke(),j=E.initiateDraggingPosition,R=E.resetDraggingPosition,T=E.draggingItems,N=E.getDraggingPosition,O=E.itemHeight,M=b.useCallback(function(V,A){var J;if(n.activeTreeId&&(!((J=n.viewState[n.activeTreeId])===null||J===void 0)&&J.focusedItem)&&n.linearItems&&A){var fe=n.viewState[n.activeTreeId].focusedItem,ge=S(n.activeTreeId,A),B=ge.findIndex(function(se){return se.targetType==="item"?se.targetItem===fe:se.targetType==="between-items"?n.items[se.parentItem].children[se.childIndex]===fe:!1});h(B?Math.min(B+1,ge.length-1):0)}else h(0)},[n.activeTreeId,n.items,n.linearItems,n.viewState,S]),L=So(function(){o(!1),d({}),h(0),x(void 0),R()});cb(function(){n.activeTreeId&&n.linearItems[n.activeTreeId]&&c[n.activeTreeId]&&M(c[n.activeTreeId],T)},[T,n.activeTreeId,n.linearItems,M,c],[n.activeTreeId]),cb(function(){i&&n.activeTreeId&&x(c[n.activeTreeId][m])},[m,n.activeTreeId,i,c],[m,n.activeTreeId]);var K=Zq(),ee=function(V){var A;T&&!K(V,T)||(x(V),n.setActiveTree(V.treeId),T&&n.activeTreeId!==V.treeId&&((A=n.onSelectItems)===null||A===void 0||A.call(n,T.map(function(J){return J.index}),V.treeId)))},q=So(function(V,A,J){if(T){var fe=N(V,A,J);if(fe){if(fe==="invalid"){x(void 0);return}ee(fe)}}}),Y=So(function(V,A){A.current&&Jq(V,A.current.getBoundingClientRect())&&x(void 0)}),U=So(function(){!T||!y||!n.onDrop||(n.onDrop(T,y),C(function(){var V;(V=n.onFocusItem)===null||V===void 0||V.call(n,T[0],y.treeId),L()}))}),H=b.useCallback(function(V,A){var J=Wq(n.treeIds,function(fe){return S(fe,V)});j(A,V),d(J),n.activeTreeId&&M(J[n.activeTreeId],V)},[n.activeTreeId,n.treeIds,S,j,M]),z=b.useCallback(function(){var V,A,J;if(n.canDragAndDrop&&n.activeTreeId){var fe=(A=(V=n.viewState[n.activeTreeId])===null||V===void 0?void 0:V.selectedItems)!==null&&A!==void 0?A:[(J=n.viewState[n.activeTreeId])===null||J===void 0?void 0:J.focusedItem];if(fe.length===0||fe[0]===void 0)return;var ge=k(n.activeTreeId,fe.map(function(B){return n.items[B]}));if(n.canDrag&&!n.canDrag(ge))return;H(ge,n.activeTreeId),setTimeout(function(){o(!0)})}},[n,k,H]),W=b.useCallback(function(){L()},[L]),F=b.useCallback(function(){U(),L()},[U,L]),te=b.useCallback(function(){h(function(V){return Math.max(0,V-1)})},[]),D=b.useCallback(function(){n.activeTreeId&&h(function(V){return Math.min(c[n.activeTreeId].length-1,V+1)})},[n.activeTreeId,c]),$=b.useMemo(function(){return{onStartDraggingItems:H,startProgrammaticDrag:z,abortProgrammaticDrag:W,completeProgrammaticDrag:F,programmaticDragUp:te,programmaticDragDown:D,draggingItems:T,draggingPosition:y,itemHeight:O.current,isProgrammaticallyDragging:i,onDragOverTreeHandler:q,onDragLeaveContainerHandler:Y,viableDragPositions:c}},[W,F,T,y,i,O,q,Y,H,D,te,z,c]);return b.useEffect(function(){return window.addEventListener("dragend",L),window.addEventListener("drop",U),function(){window.removeEventListener("dragend",L),window.removeEventListener("drop",U)}},[U,L]),b.createElement(Qq.Provider,{value:$},t)},lm=function(){return lm=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},lm.apply(this,arguments)},Nke=function(e,t){var n=hn(),r=Ea();b.useImperativeHandle(e,function(){return lm(lm(lm({},t),n),{treeEnvironmentContext:n,dragAndDropContext:r})})},e7=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()}})},gk=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 c(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(c,d)}f((r=r.apply(e,t||[])).next())})},vk=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:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(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}}},kP=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))},t7=b.createContext(null),Tke=function(){return b.useContext(t7)},n7=function(e,t,n){return gk(void 0,void 0,void 0,function(){var r,i,o,a,c,d,f;return vk(this,function(m){for(r=function(h){e7(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),n7(h,t,n))})},i=0,o=(f=(d=(c=t.current)===null||c===void 0?void 0:c[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]})})},Oke=b.forwardRef(function(e,t){var n=hn(),r=n.onCollapseItem,i=n.items,o=n.trees,a=n.viewState,c=n.onExpandItem,d=n.onFocusItem,f=n.setActiveTree,m=n.onRenameItem,h=n.onSelectItems,v=n.onPrimaryAction,y=n.linearItems,x=Ea(),S=x.abortProgrammaticDrag,C=x.completeProgrammaticDrag,k=x.programmaticDragDown,E=x.programmaticDragUp,j=x.startProgrammaticDrag,R=db(i),T=b.useCallback(function(D,$){r?.(i[D],$)},[i,r]),N=b.useCallback(function(D,$){c?.(i[D],$)},[i,c]),O=b.useCallback(function(D,$,V){V===void 0&&(V=!0),d?.(i[D],$,V)},[i,d]),M=b.useCallback(function(D,$){$===void 0&&($=!0),f(D,$)},[f]),L=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.min($.length-1,V+1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),K=b.useCallback(function(D){var $=y[D],V=$.findIndex(function(fe){var ge,B=fe.item;return B===((ge=a[D])===null||ge===void 0?void 0:ge.focusedItem)}),A=V!==void 0?Math.max(0,V-1):0,J=i[$[A].item];d?.(J,D)},[i,y,d,a]),ee=b.useCallback(function(D,$,V){m?.(i[D],$,V)},[i,m]),q=b.useCallback(function(D,$){h?.(D,$)},[h]),Y=b.useCallback(function(D,$){var V,A;!((A=(V=a[$])===null||V===void 0?void 0:V.expandedItems)===null||A===void 0)&&A.includes(D)?r?.(i[D],$):c?.(i[D],$)},[i,r,c,a]),U=b.useCallback(function(D,$){var V,A,J,fe,ge;!((A=(V=a[$])===null||V===void 0?void 0:V.selectedItems)===null||A===void 0)&&A.includes(D)?h?.((fe=(J=a[$].selectedItems)===null||J===void 0?void 0:J.filter(function(B){return B!==D}))!==null&&fe!==void 0?fe:[],$):h?.(kP(kP([],(ge=a[$].selectedItems)!==null&&ge!==void 0?ge:[],!0),[D],!1),$)},[h,a]),H=b.useCallback(function(D,$){v?.(i[D],$)},[i,v]),z=b.useCallback(function(D,$){return gk(void 0,void 0,void 0,function(){var V,A;return vk(this,function(J){switch(J.label){case 0:return V=$[0],A=$.slice(1),[4,e7(function(){var fe;return!!(!((fe=R.current)===null||fe===void 0)&&fe[V])}).then(function(){var fe=R.current[V];return fe?(c?.(fe,D),A.length>0?z(D,A):Promise.resolve()):Promise.resolve()})];case 1:return J.sent(),[2]}})})},[R,c]),W=b.useCallback(function(D){return gk(void 0,void 0,void 0,function(){return vk(this,function($){switch($.label){case 0:return[4,n7(o[D].rootItem,R,function(V){return c?.(V,D)})];case 1:return $.sent(),[2]}})})},[R,c,o]),F=b.useCallback(function(D){for(var $,V,A=0,J=(V=($=a[D])===null||$===void 0?void 0:$.expandedItems)!==null&&V!==void 0?V:[];A<J.length;A++){var fe=J[A];r?.(i[fe],D)}},[i,r,a]),te=b.useMemo(function(){return{collapseItem:T,expandItem:N,focusItem:O,focusTree:M,moveFocusDown:L,moveFocusUp:K,renameItem:ee,selectItems:q,toggleItemExpandedState:Y,toggleItemSelectStatus:U,invokePrimaryAction:H,expandAll:W,expandSubsequently:z,collapseAll:F,abortProgrammaticDrag:S,completeProgrammaticDrag:C,moveProgrammaticDragPositionDown:k,moveProgrammaticDragPositionUp:E,startProgrammaticDrag:j}},[T,N,O,M,L,K,ee,q,Y,U,H,W,z,F,S,C,k,E,j]);return Nke(t,te),b.createElement(t7.Provider,{value:te},e.children)}),Ake=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=wo())===null||t===void 0?void 0:t.documentElement)===null||n===void 0)&&n.clientHeight))&&o.right<=(window.innerWidth||!!(!((i=(r=wo())===null||r===void 0?void 0:r.documentElement)===null||i===void 0)&&i.clientWidth));a||e.scrollIntoView()}},pi=function(){return pi=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},pi.apply(this,arguments)},qs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return!!n}).join(" ")},Dke=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 Q.createElement(Q.Fragment,null,a>0&&Q.createElement("span",null,r.slice(0,a)),Q.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&Q.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(n){var r=n.item,i=n.context;return Q.createElement("div",pi({className:qs(r.isFolder&&"rct-tree-item-arrow-isFolder",i.isExpanded&&"rct-tree-item-arrow-expanded","rct-tree-item-arrow")},i.arrowProps),r.isFolder&&(i.isExpanded?Q.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"},Q.createElement("g",null,Q.createElement("g",null,Q.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"})))):Q.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"},Q.createElement("g",null,Q.createElement("g",null,Q.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,c=n.context,d=n.arrow,f=c.isRenaming?"div":"button",m=c.isRenaming?void 0:"button";return Q.createElement("li",pi({},c.itemContainerWithChildrenProps,{className:qs("rct-tree-item-li",r.isFolder&&"rct-tree-item-li-isFolder",c.isSelected&&"rct-tree-item-li-selected",c.isExpanded&&"rct-tree-item-li-expanded",c.isFocused&&"rct-tree-item-li-focused",c.isDraggingOver&&"rct-tree-item-li-dragging-over",c.isSearchMatching&&"rct-tree-item-li-search-match")}),Q.createElement("div",pi({},c.itemContainerWithoutChildrenProps,{style:{"--depthOffset":"".concat((i+1)*e,"px")},className:qs("rct-tree-item-title-container",r.isFolder&&"rct-tree-item-title-container-isFolder",c.isSelected&&"rct-tree-item-title-container-selected",c.isExpanded&&"rct-tree-item-title-container-expanded",c.isFocused&&"rct-tree-item-title-container-focused",c.isDraggingOver&&"rct-tree-item-title-container-dragging-over",c.isSearchMatching&&"rct-tree-item-title-container-search-match")}),d,Q.createElement(f,pi({type:m},c.interactiveElementProps,{className:qs("rct-tree-item-button",r.isFolder&&"rct-tree-item-button-isFolder",c.isSelected&&"rct-tree-item-button-selected",c.isExpanded&&"rct-tree-item-button-expanded",c.isFocused&&"rct-tree-item-button-focused",c.isDraggingOver&&"rct-tree-item-button-dragging-over",c.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,c=n.formProps;return Q.createElement("form",pi({},c,{className:"rct-tree-item-renaming-form"}),Q.createElement("input",pi({},r,{ref:i,className:"rct-tree-item-renaming-input"})),Q.createElement("input",pi({},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 Q.createElement("div",{className:qs("rct-tree-root",o.isFocused&&"rct-tree-root-focus",o.isRenaming&&"rct-tree-root-renaming",o.areItemsSelected&&"rct-tree-root-itemsselected",t)},Q.createElement("div",pi({},i,{style:pi({minHeight:"30px"},i.style)}),r))},renderItemsContainer:function(n){var r=n.children,i=n.containerProps;return Q.createElement("ul",pi({},i,{className:"rct-tree-items-container"}),r)},renderDragBetweenLine:function(n){var r=n.draggingPosition,i=n.lineProps;return Q.createElement("div",pi({},i,{style:{left:"".concat(r.depth*e,"px")},className:qs("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 Q.createElement("div",{className:qs("rct-tree-search-input-container")},Q.createElement("span",{className:"rct-tree-input-icon"}),Q.createElement("input",pi({},r,{className:qs("rct-tree-search-input")})))},renderLiveDescriptorContainer:function(n){var r=n.tree,i=n.children;return Q.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}},$ke=function(e){var t=e.renderItem,n=e.renderItemTitle,r=e.renderItemArrow,i=e.renderRenameInput,o=e.renderItemsContainer,a=e.renderTreeContainer,c=e.renderDragBetweenLine,d=e.renderSearchInput,f=e.renderLiveDescriptorContainer,m=e.renderDepthOffset,h=b.useMemo(function(){return Dke(m??10)},[m]),v={renderItem:t,renderItemTitle:n,renderItemArrow:r,renderRenameInput:i,renderItemsContainer:o,renderTreeContainer:a,renderDragBetweenLine:c,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},jI=function(e,t,n,r){var i,o,a;r===void 0&&(r=0);for(var c=[],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];c.push({item:m,depth:r}),h&&h.isFolder&&h.children&&(!((a=t.expandedItems)===null||a===void 0)&&a.includes(m))&&c.push.apply(c,jI(m,t,n,r+1))}return c},uc=function(){return uc=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},uc.apply(this,arguments)},Pke=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},Mke=function(e){var t=e.onExpandItem,n=e.onCollapseItem,r=e.onDrop,i=Pke(e,["onExpandItem","onCollapseItem","onDrop"]),o=b.useState({}),a=o[0],c=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=db(v),j=db(k),R=b.useMemo(function(){return Wq(h,function(U){var H;return jI(a[U].rootItem,(H=k[U])!==null&&H!==void 0?H:{},C)})},[a,C,h,k]),T=b.useCallback(function(U,H,z){var W,F,te,D,$,V,A,J,fe;if(z===void 0&&(z=!0),(y??!0)&&z){var ge=(F=(W=wo())===null||W===void 0?void 0:W.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id="').concat(U.index,'"]')))!==null&&F!==void 0?F:(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(H,'"] [data-rct-item-id]'));((V=($=(D=wo())===null||D===void 0?void 0:D.activeElement)===null||$===void 0?void 0:$.attributes.getNamedItem("data-rct-search-input"))===null||V===void 0?void 0:V.value)!=="true"?(A=ge?.focus)===null||A===void 0||A.call(ge):Ake(ge)}((J=j.current[H])===null||J===void 0?void 0:J.focusedItem)!==U.index&&((fe=E.current)===null||fe===void 0||fe.call(E,U,H))},[y,E,j]),N=b.useCallback(function(U){c(function(H){var z;return uc(uc({},H),(z={},z[U.treeId]=U,z))}),x?.(U)},[x]),O=b.useCallback(function(U){S?.(a[U]),delete a[U],c(a)},[S,a]),M=b.useCallback(function(U,H){n?.(U,H),c(function(z){return z})},[n]),L=b.useCallback(function(U,H){t?.(U,H),c(function(z){return z})},[t]),K=b.useCallback(function(U,H){r?.(U,H),c(function(z){return z})},[r]),ee=b.useCallback(function(U){var H,z,W=(H=wo())===null||H===void 0?void 0:H.querySelector('[data-rct-tree="'.concat(U,'"] [data-rct-item-focus="true"]'));(z=W?.focus)===null||z===void 0||z.call(W)},[]),q=b.useCallback(function(U,H){H===void 0&&(H=!0);var z=function(F){var te,D;H&&(y??!0)&&F&&!(!((D=(te=wo())===null||te===void 0?void 0:te.querySelector('[data-rct-tree="'.concat(F,'"]')))===null||D===void 0)&&D.contains(document.activeElement))&&ee(F)};if(typeof U=="function")m(function(F){var te=U(F);return te!==F&&z(te),te});else{var W=U;m(W),z(W)}},[y,ee]),Y=$ke(i);return uc(uc(uc({},Y),i),{onFocusItem:T,registerTree:N,unregisterTree:O,onExpandItem:L,onCollapseItem:M,onDrop:K,setActiveTree:q,treeIds:h,trees:a,activeTreeId:f,linearItems:R})},r7=b.createContext(null),hn=function(){return b.useContext(r7)},zke=b.forwardRef(function(e,t){var n=Mke(e),r=e.viewState,i=e.onFocusItem;return b.useEffect(function(){for(var o,a,c,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];!(!((c=r[m])===null||c===void 0)&&c.focusedItem)&&n.trees[m]&&v&&i?.(v,m,!1)}},[n.trees,i,e.items,r]),b.createElement(r7.Provider,{value:n},b.createElement(Cke,null,b.createElement(Ike,null,b.createElement(Oke,{ref:t},e.children))))}),Lke=function(e){var t,n=e.treeId,r=Ea(),i=r.draggingPosition,o=r.itemHeight,a=ti().renderers,c=i&&i.targetType==="between-items"&&i.treeId===n;if(!c)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}))},Xd=function(e,t,n){var r=So(n);b.useEffect(function(){return e?(e.addEventListener(t,r),function(){return e.removeEventListener(t,r)}):function(){}},[e,r,t])},Fke=function(e,t,n){var r=b.useState(!1),i=r[0],o=r[1],a=b.useRef(!1),c=Rf();return Xd(e,"focusin",function(){i||(o(!0),t?.()),a.current&&(a.current=!1)}),Xd(e,"focusout",function(){a.current=!0,c(function(){a.current&&!e?.contains(document.activeElement)&&(n?.(),a.current=!1,o(!1))})}),i},Uv=function(e,t,n){Xd(wo(),"keydown",function(r){n&&n&&e.toLowerCase()===r.key.toLowerCase()&&t(r)})},EP={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"]},fb=function(){return fb=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},fb.apply(this,arguments)},i7=function(){var e=hn();return b.useMemo(function(){return e.keyboardBindings?fb(fb({},EP),e.keyboardBindings):EP},[e.keyboardBindings])},Uke=["input","textarea"],mo=function(e,t,n,r){r===void 0&&(r=!1);var i=b.useRef([]),o=i7(),a=Rf(),c=b.useMemo(function(){return o[e].map(function(d){return d.split("+")})},[e,o]);Xd(wo(),"keydown",function(d){var f;if(n!==!1&&!((Uke.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=c.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()}}),Xd(wo(),"keyup",function(d){if(n!==!1){var f=i.current.map(function(h){return h.toLowerCase()}),m=c.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})}})},Vh=function(){var e,t=ti().treeId,n=hn().viewState;return(e=n[t])!==null&&e!==void 0?e:{}},L0=function(e){return hn().linearItems[e]},Vke=function(){var e=ti().treeId,t=hn(),n=t.onFocusItem,r=t.items,i=L0(e),o=Vh();return So(function(a){var c,d=(c=i.findIndex(function(v){return v.item===o.focusedItem}))!==null&&c!==void 0?c: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})},jP=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))},Bke=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},o7=function(e){var t=Vh(),n=ti().treeId,r=L0(n),i=hn().onSelectItems,o=Bke(t.focusedItem);return b.useCallback(function(a,c){var d,f;c===void 0&&(c=!1);var m=a.index,h=function(C,k){var E=jP(jP([],c?[]:C,!0),k.filter(function(j){return c||!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])},RP=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))},Hke=function(){var e,t=hn(),n=ti(),r=n.treeId,i=n.setRenamingItem,o=n.setSearch,a=n.renamingItem,c=L0(r),d=Ea(),f=Vh(),m=Vke(),h=o7("first-selected"),v=t.activeTreeId===r,y=!!a,x=t.disableArrowKeys,S=!x&&v&&!y;Uv("arrowdown",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragDown();else{var k=m(function(E){return E+1});C.shiftKey&&h(k)}},S),Uv("arrowup",function(C){if(C.preventDefault(),d.isProgrammaticallyDragging)d.programmaticDragUp();else{var k=m(function(E){return E-1});C.shiftKey&&h(k)}},S),mo("moveFocusToFirstItem",function(C){C.preventDefault(),m(function(){return 0})},v&&!d.isProgrammaticallyDragging&&!y),mo("moveFocusToLastItem",function(C){C.preventDefault(),m(function(k,E){return E.length-1})},v&&!d.isProgrammaticallyDragging&&!y),Uv("arrowright",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item];if(T.isFolder){if(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index))return k+1;(R=t.onExpandItem)===null||R===void 0||R.call(t,T,r)}return k})},S&&!d.isProgrammaticallyDragging),Uv("arrowleft",function(C){C.preventDefault(),m(function(k,E){var j,R,T=t.items[E[k].item],N=E[k].depth;if(T.isFolder&&(!((j=f.expandedItems)===null||j===void 0)&&j.includes(T.index)))(R=t.onCollapseItem)===null||R===void 0||R.call(t,T,r);else if(N>0){var O=k;for(O;E[O].depth!==N-1;O-=1);return O}return k})},S&&!d.isProgrammaticallyDragging),mo("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),mo("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(R){return R!==f.focusedItem}),r):(E=t.onSelectItems)===null||E===void 0||E.call(t,RP(RP([],(j=f.selectedItems)!==null&&j!==void 0?j:[],!0),[f.focusedItem],!1),r))},v&&!d.isProgrammaticallyDragging&&!y),mo("selectAll",function(C){var k;C.preventDefault(),(k=t.onSelectItems)===null||k===void 0||k.call(t,c.map(function(E){var j=E.item;return j}),r)},v&&!d.isProgrammaticallyDragging&&!y),mo("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),mo("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),mo("startProgrammaticDnd",function(C){C.preventDefault(),d.startProgrammaticDrag()},v&&!y),mo("completeProgrammaticDnd",function(C){C.preventDefault(),d.completeProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y),mo("abortProgrammaticDnd",function(C){C.preventDefault(),d.abortProgrammaticDrag()},v&&d.isProgrammaticallyDragging&&!y)},a7=function(e,t,n){return n.toLowerCase().includes(e.toLowerCase())},qke=function(){var e=hn(),t=e.doesSearchMatchItem,n=e.items,r=e.getItemTitle,i=e.onFocusItem,o=ti(),a=o.search,c=o.treeId,d=L0(c),f=Rf();cb(function(){a&&a.length>0&&f(function(){var m=d.find(function(h){var v=h.item;return(t??a7)(a,n[v],r(n[v]))});m&&i?.(n[m.item],c)})},[t,r,d,n,i,a,c,f],[a])},yk=function(){return yk=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},yk.apply(this,arguments)},Kke=function(e){var t,n=e.containerRef,r=ti(),i=r.search,o=r.setSearch,a=r.treeId,c=r.renderers,d=r.renamingItem,f=hn();Vh();var m=f.activeTreeId===a,h=Rf();qke();var v=function(){var y,x,S;if(o(null),!((y=f.autoFocus)!==null&&y!==void 0)||y){var C=(x=wo())===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 mo("abortSearch",function(){h(function(){v()})},m&&i!==null,!0),Xd(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:c.renderSearchInput({inputProps:yk({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"})})},Gke={introduction:`
128
+ <p>Accessibility guide for tree {treeLabel}.</p>
129
+ <p>
130
+ Navigate the tree with the arrow keys. Common tree hotkeys apply. Further keybindings are available:
131
+ </p>
132
+ <ul>
133
+ <li>{keybinding:primaryAction} to execute primary action on focused item</li>
134
+ <li>{keybinding:renameItem} to start renaming the focused item</li>
135
+ <li>{keybinding:abortRenameItem} to abort renaming an item</li>
136
+ <li>{keybinding:startProgrammaticDnd} to start dragging selected items</li>
137
+ </ul>
138
+ `,renamingItem:`
139
+ <p>Renaming the item {renamingItem}.</p>
140
+ <p>Use the keybinding {keybinding:abortRenameItem} to abort renaming.</p>
141
+ `,searching:`
142
+ <p>Searching</p>
143
+ `,programmaticallyDragging:`
144
+ <p>Dragging items {dragItems}.</p>
145
+ <p>Press the arrow keys to move the drag target.</p>
146
+ <p>Press {keybinding:completeProgrammaticDnd} to drop or {keybinding:abortProgrammaticDnd} to abort.</p>
147
+ `,programmaticallyDraggingTarget:`
148
+ <p>Drop target is {dropTarget}.</p>
149
+ `},Fp=function(e,t,n,r,i){var o=function(a){return t.getItemTitle(t.items[a])};return e.replace(/({[^\s}]+)}/g,function(a){var c,d,f,m=a.slice(1,-1);switch(m){case"treeLabel":return(c=r.treeLabel)!==null&&c!==void 0?c:"";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,"}"))}})},Up=function(e){var t=e.children,n=e.live;return b.createElement("div",{"aria-live":n,dangerouslySetInnerHTML:{__html:t}})},Zke=function(){var e=hn(),t=ti(),n=Ea(),r=i7(),i=b.useMemo(function(){var a;return(a=e.liveDescriptors)!==null&&a!==void 0?a:Gke},[e.liveDescriptors]),o=t.renderers.renderLiveDescriptorContainer;return t.treeInformation.isRenaming?b.createElement(o,{tree:t},b.createElement(Up,{live:"polite"},Fp(i.renamingItem,e,n,t,r))):t.treeInformation.isSearching?b.createElement(o,{tree:t},b.createElement(Up,{live:"polite"},Fp(i.searching,e,n,t,r))):t.treeInformation.isProgrammaticallyDragging?b.createElement(o,{tree:t},b.createElement(Up,{live:"polite"},Fp(i.programmaticallyDragging,e,n,t,r)),b.createElement(Up,{live:"assertive"},Fp(i.programmaticallyDraggingTarget,e,n,t,r))):b.createElement(o,{tree:t},b.createElement(Up,{live:"off"},Fp(i.introduction,e,n,t,r)))},Yke=function(){var e,t=hn();return!((e=t.showLiveDescription)!==null&&e!==void 0)||e?b.createElement(Zke,null):null},bk=function(){return bk=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},bk.apply(this,arguments)},Wke=function(){var e=ti(),t=e.treeId,n=e.rootItem,r=e.renderers,i=e.treeInformation,o=hn(),a=b.useRef(),c=Ea();Hke(),Fke(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(Yke,null),b.createElement(l7,{depth:0,parentId:n},d??[]),b.createElement(Lke,{treeId:t}),b.createElement(Kke,{containerRef:a.current})),m=bk({onDragOver:function(h){h.preventDefault(),c.onDragOverTreeHandler(h,t,a)},onDragLeave:function(h){c.onDragLeaveContainerHandler(h,a)},onMouseDown:function(){return c.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})},Xke=function(e,t,n){var r,i=hn(),o=Ea(),a=(r=i.viewState[e.treeId])===null||r===void 0?void 0:r.selectedItems;return b.useMemo(function(){var c,d;return{isFocused:i.activeTreeId===e.treeId,isRenaming:!!t,areItemsSelected:((c=a?.length)!==null&&c!==void 0?c: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])},cm=function(){return cm=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},cm.apply(this,arguments)},Jke=function(e,t){var n=hn(),r=ti(),i=Ea();b.useImperativeHandle(e,function(){return cm(cm(cm({},t),{treeEnvironmentContext:n,dragAndDropContext:i,treeContext:r}),r.treeInformation)})},Qke=b.createContext(null),eEe=b.forwardRef(function(e,t){hn();var n=ti();Ea();var r=Tke(),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 Jke(t,i),b.createElement(Qke.Provider,{value:i},e.children)}),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)},s7=b.createContext(null),ti=function(){return b.useContext(s7)},tEe=b.forwardRef(function(e,t){var n,r=hn(),i=b.useMemo(function(){return pb(pb({},r),e)},[e,r]),o=b.useState(null),a=o[0],c=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=Xke(e,f,a),x=b.useMemo(function(){return{treeId:e.treeId,rootItem:e.rootItem,treeLabel:e.treeLabel,treeLabelledBy:e.treeLabelledBy,getItemsLinearly:function(){return jI(e.rootItem,v??{},r.items)},treeInformation:y,search:a,setSearch:c,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(s7.Provider,{value:x},b.createElement(eEe,{ref:t},b.createElement(Wke,null)))}),l7=function(e){for(var t=ti(),n=t.renderers,r=t.treeInformation,i=[],o=0,a=e.children;o<a.length;o++){var c=a[o];i.push(Q.createElement(iEe,{key:c,itemIndex:c,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})},Ys=function(){return Ys=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},Ys.apply(this,arguments)},IP=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))},nEe=function(e){var t,n,r,i,o=ti(),a=o.treeId,c=o.search,d=o.renamingItem,f=o.setRenamingItem,m=hn(),h=_ke(),v=Ea(),y=o7("last-focus"),x=e&&m.getItemTitle(e),S=Xq(),C=b.useMemo(function(){var R;return c===null||c.length===0||!e||!x?!1:((R=m.doesSearchMatchItem)!==null&&R!==void 0?R:a7)(c,e,x)},[c,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 R,T,N,O,M,L,K,ee,q;if(e){var Y=m.viewState[a],U=((T=(R=Y?.selectedItems)===null||R===void 0?void 0:R.map(function(B){return m.items[B]}))!==null&&T!==void 0?T:Y?.focusedItem?[m.items[Y?.focusedItem]]:[]).filter(function(B){return!!B}),H=!!U.find(function(B){return B.index===e.index}),z=U&&((O=(N=m.canDrag)===null||N===void 0?void 0:N.call(m,U))!==null&&O!==void 0?O:!0)&&U.map(function(B){var se;return(se=B.canMove)!==null&&se!==void 0?se:!0}).reduce(function(B,se){return B&&se},!0),W=((L=(M=m.canDrag)===null||M===void 0?void 0:M.call(m,[e]))!==null&&L!==void 0?L:!0)&&((K=e.canMove)!==null&&K!==void 0?K:!0),F=m.canDragAndDrop&&(H&&z||!H&&W),te=m.canDragAndDrop&&!!(!((q=(ee=v.viableDragPositions)===null||ee===void 0?void 0:ee[a])===null||q===void 0)&&q.find(function(B){return B.targetType==="item"&&B.targetItem===e.index})),D={primaryAction:function(){var B;(B=m.onPrimaryAction)===null||B===void 0||B.call(m,m.items[e.index],a)},collapseItem:function(){var B;(B=m.onCollapseItem)===null||B===void 0||B.call(m,e,a)},expandItem:function(){var B;(B=m.onExpandItem)===null||B===void 0||B.call(m,e,a)},toggleExpandedState:function(){var B,se;E?(B=m.onCollapseItem)===null||B===void 0||B.call(m,e,a):(se=m.onExpandItem)===null||se===void 0||se.call(m,e,a)},selectItem:function(){var B;(B=m.onSelectItems)===null||B===void 0||B.call(m,[e.index],a)},addToSelectedItems:function(){var B,se;(B=m.onSelectItems)===null||B===void 0||B.call(m,IP(IP([],(se=Y?.selectedItems)!==null&&se!==void 0?se:[],!0),[e.index],!1),a)},unselectItem:function(){var B,se,_e;(B=m.onSelectItems)===null||B===void 0||B.call(m,(_e=(se=Y?.selectedItems)===null||se===void 0?void 0:se.filter(function(Ie){return Ie!==e.index}))!==null&&_e!==void 0?_e:[],a)},selectUpTo:function(B){y(e,B)},startRenamingItem:function(){f(e.index)},stopRenamingItem:function(){f(null)},focusItem:function(B){var se;B===void 0&&(B=!0),(se=m.onFocusItem)===null||se===void 0||se.call(m,e,a,B)},startDragging:function(){var B,se,_e=(B=Y?.selectedItems)!==null&&B!==void 0?B:[];if(_e.includes(e.index)||(_e=[e.index],(se=m.onSelectItems)===null||se===void 0||se.call(m,_e,a)),F){var Ie=S(a,_e.map(function(Fe){return m.items[Fe]}));v.onStartDraggingItems(Ie,a)}}},$={isSelected:k,isExpanded:E,isFocused:Y?.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:F,canDropOn:te},V=Ys(Ys({},h.createInteractiveElementProps(e,a,D,$,Y)),{"data-rct-item-interactive":!0,"data-rct-item-focus":$.isFocused?"true":"false","data-rct-item-id":e.index}),A=Ys({},{"data-rct-item-container":"true"}),J={role:"treeitem","aria-selected":$.isSelected,"aria-expanded":e.isFolder?$.isExpanded?"true":"false":void 0},fe={onClick:function(){e.isFolder&&D.toggleExpandedState(),D.selectItem()},onFocus:function(){D.focusItem()},onDragOver:function(B){B.preventDefault()},"aria-hidden":!0,tabIndex:-1},ge=Y?Object.entries(Y).reduce(function(B,se){var _e=se[0],Ie=se[1];return B[_e]=Array.isArray(Ie)?Ie.includes(e.index):Ie===e.index,B},{}):{};return Ys(Ys(Ys({},D),$),{interactiveElementProps:V,itemContainerWithChildrenProps:J,itemContainerWithoutChildrenProps:A,arrowProps:fe,viewStateFlags:ge})}},[e,m,a,v,k,E,j,C,h,y,f,S])},rEe=function(e){var t=ti(),n=t.renderers,r=t.treeInformation,i=t.setRenamingItem,o=t.treeId,a=hn(),c=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=Rf(!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)})};cb(function(){var j,R,T,N;a.setActiveTree(o),(!((j=a.autoFocus)!==null&&j!==void 0)||j)&&((R=c.current)===null||R===void 0||R.select(),(N=(T=c.current)===null||T===void 0?void 0:T.focus)===null||N===void 0||N.call(T))},[a,o],[]),mo("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:c,submitButtonProps:k,submitButtonRef:d,formProps:E,inputProps:C})},iEe=function(e){var t,n,r,i,o=b.useState(!1),a=o[0],c=o[1],d=ti(),f=d.renderers,m=d.treeInformation,h=d.renamingItem,v=hn(),y=Vh(),x=v.items[e.itemIndex],S=b.useMemo(function(){var N;return(N=y.expandedItems)===null||N===void 0?void 0:N.includes(e.itemIndex)},[e.itemIndex,y.expandedItems]),C=nEe(x);if(x===void 0||C===void 0)return a||(c(!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&&Q.createElement(l7,{depth:e.depth+1,parentId:e.itemIndex},x.children),j=v.getItemTitle(x),R=h===e.itemIndex?Q.createElement(rEe,{itemIndex:e.itemIndex}):f.renderItemTitle({info:m,context:C,title:j,item:x}),T=f.renderItemArrow({info:m,context:C,item:v.items[e.itemIndex]});return(i=f.renderItem({item:v.items[e.itemIndex],depth:e.depth,title:R,arrow:T,context:C,info:m,children:E}))!==null&&i!==void 0?i:null};function _r(e){return!!e?.entries}const E1="__root__",Ws="importedApplications",_o="newApplication";function oEe(e){const t={},n=[],r=[],i=[];for(const o of e)_r(o)?o.package?r.push(o.path):n.push(o.path):i.push(o.path),c7(t,o);return t[E1]={index:E1,isFolder:!0,children:[_o,Ws,...n,...i],data:void 0,canMove:!1,canRename:!1},t[Ws]={index:Ws,isFolder:!0,children:r,data:{name:"Imported Applications",path:Ws,package:Ws,project:"",entries:[]},canMove:!1,canRename:!1},t[_o]={index:_o,isFolder:!1,data:{name:"New Application",path:_o,project:""},canMove:!1,canRename:!1},{items:t,rootId:E1}}function c7(e,t){const n=t.path;if(_r(t)){const r=t,i=[],o=[];for(const a of r.entries)_r(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)c7(e,a)}else e[n]={index:n,isFolder:!1,data:t,canMove:!t.package,canRename:!t.package}}function aEe(){const[e,t]=b.useState(!1),[n,r]=b.useState(void 0),i=b.useCallback(c=>{if(!c.dataTransfer?.types?.includes("Files"))return;const f=c.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!==Ws&&m!==_o&&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(c=>{c&&c.classList.remove("rct-tree-item-title-container-dragging-over")})},[]),a=b.useCallback(c=>{if(!c.dataTransfer?.types?.includes("Files")||c.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:c.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 sEe(e){return new Promise((t,n)=>{const r=new FileReader;r.onabort=n,r.onerror=n,r.onload=t,r.readAsDataURL(e)})}const lEe=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 Jd(e,t,n){const r=cEe(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&NP(r,"path",o),NP(r,"relativePath",o),r}function cEe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=lEe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function NP(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const uEe=[".DS_Store","Thumbs.db"];function dEe(e){return eu(this,void 0,void 0,function*(){return mb(e)&&fEe(e.dataTransfer)?gEe(e.dataTransfer,e.type):pEe(e)?mEe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?hEe(e):[]})}function fEe(e){return mb(e)}function pEe(e){return mb(e)&&mb(e.target)}function mb(e){return typeof e=="object"&&e!==null}function mEe(e){return xk(e.target.files).map(t=>Jd(t))}function hEe(e){return eu(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Jd(n))})}function gEe(e,t){return eu(this,void 0,void 0,function*(){if(e.items){const n=xk(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(vEe));return TP(u7(r))}return TP(xk(e.files).map(n=>Jd(n)))})}function TP(e){return e.filter(t=>uEe.indexOf(t.name)===-1)}function xk(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 vEe(e){if(typeof e.webkitGetAsEntry!="function")return OP(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?d7(t):OP(e,t)}function u7(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?u7(n):[n]],[])}function OP(e,t){return eu(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,Jd(a)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Jd(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function yEe(e){return eu(this,void 0,void 0,function*(){return e.isDirectory?d7(e):bEe(e)})}function d7(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(a=>eu(this,void 0,void 0,function*(){if(a.length){const c=Promise.all(a.map(yEe));i.push(c),o()}else try{const c=yield Promise.all(i);n(c)}catch(c){r(c)}}),a=>{r(a)})}o()})}function bEe(e){return eu(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Jd(r,e.fullPath);t(i)},r=>{n(r)})})})}var Vv={},AP;function xEe(){return AP||(AP=1,Vv.__esModule=!0,Vv.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 c=a.trim().toLowerCase();return c.charAt(0)==="."?r.toLowerCase().endsWith(c):c.endsWith("/*")?o===c.replace(/\/.*$/,""):i===c})}return!0}),Vv}var wEe=xEe();const j1=ef(wEe);function DP(e){return CEe(e)||_Ee(e)||p7(e)||SEe()}function SEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
150
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Ee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CEe(e){if(Array.isArray(e))return wk(e)}function $P(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?$P(Object(n),!0).forEach(function(r){f7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$P(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $m(e,t){return jEe(e)||EEe(e,t)||p7(e,t)||kEe()}function kEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
151
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p7(e,t){if(e){if(typeof e=="string")return wk(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 wk(e,t)}}function wk(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 EEe(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,c;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,c=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw c}}return r}}function jEe(e){if(Array.isArray(e))return e}var REe=typeof j1=="function"?j1:j1.default,IEe="file-invalid-type",NEe="file-too-large",TEe="file-too-small",OEe="too-many-files",AEe=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:IEe,message:"File type must be ".concat(r)}},MP=function(t){return{code:NEe,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},zP=function(t){return{code:TEe,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},DEe={code:OEe,message:"Too many files"};function m7(e,t){var n=e.type==="application/x-moz-file"||REe(e,t);return[n,n?null:AEe(t)]}function h7(e,t,n){if(dc(e.size))if(dc(t)&&dc(n)){if(e.size>n)return[!1,MP(n)];if(e.size<t)return[!1,zP(t)]}else{if(dc(t)&&e.size<t)return[!1,zP(t)];if(dc(n)&&e.size>n)return[!1,MP(n)]}return[!0,null]}function dc(e){return e!=null}function $Ee(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,c=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(d){var f=m7(d,n),m=$m(f,1),h=m[0],v=h7(d,r,i),y=$m(v,1),x=y[0],S=c?c(d):null;return h&&x&&!S})}function hb(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Bv(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 LP(e){e.preventDefault()}function PEe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function MEe(e){return e.indexOf("Edge/")!==-1}function zEe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return PEe(e)||MEe(e)}function aa(){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(c){return!hb(r)&&c&&c.apply(void 0,[r].concat(o)),hb(r)})}}function LEe(){return"showOpenFilePicker"in window}function FEe(e){if(dc(e)){var t=Object.entries(e).filter(function(n){var r=$m(n,2),i=r[0],o=r[1],a=!0;return g7(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(v7))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var i=$m(r,2),o=i[0],a=i[1];return PP(PP({},n),{},f7({},o,a))},{});return[{description:"Files",accept:t}]}return e}function UEe(e){if(dc(e))return Object.entries(e).reduce(function(t,n){var r=$m(n,2),i=r[0],o=r[1];return[].concat(DP(t),[i],DP(o))},[]).filter(function(t){return g7(t)||v7(t)}).join(",")}function VEe(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function BEe(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function g7(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function v7(e){return/^.*\.[\w]+$/.test(e)}var HEe=["children"],qEe=["open"],KEe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],GEe=["refKey","onChange","onClick"];function ZEe(e){return XEe(e)||WEe(e)||y7(e)||YEe()}function YEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
152
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XEe(e){if(Array.isArray(e))return Sk(e)}function R1(e,t){return eje(e)||QEe(e,t)||y7(e,t)||JEe()}function JEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
153
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y7(e,t){if(e){if(typeof e=="string")return Sk(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 Sk(e,t)}}function Sk(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 QEe(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,c;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,c=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw c}}return r}}function eje(e){if(Array.isArray(e))return e}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 On(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){_k(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 _k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gb(e,t){if(e==null)return{};var n=tje(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 tje(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 RI=b.forwardRef(function(e,t){var n=e.children,r=gb(e,HEe),i=x7(r),o=i.open,a=gb(i,qEe);return b.useImperativeHandle(t,function(){return{open:o}},[o]),Q.createElement(b.Fragment,null,n(On(On({},a),{},{open:o})))});RI.displayName="Dropzone";var b7={disabled:!1,getFilesFromEvent:dEe,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};RI.defaultProps=b7;RI.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 Ck={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function x7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=On(On({},b7),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,c=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,R=t.noClick,T=t.noKeyboard,N=t.noDrag,O=t.noDragEventsBubbling,M=t.onError,L=t.validator,K=b.useMemo(function(){return UEe(n)},[n]),ee=b.useMemo(function(){return FEe(n)},[n]),q=b.useMemo(function(){return typeof C=="function"?C:UP},[C]),Y=b.useMemo(function(){return typeof S=="function"?S:UP},[S]),U=b.useRef(null),H=b.useRef(null),z=b.useReducer(nje,Ck),W=R1(z,2),F=W[0],te=W[1],D=F.isFocused,$=F.isFileDialogActive,V=b.useRef(typeof window<"u"&&window.isSecureContext&&k&&LEe()),A=function(){!V.current&&$&&setTimeout(function(){if(H.current){var ue=H.current.files;ue.length||(te({type:"closeDialog"}),Y())}},300)};b.useEffect(function(){return window.addEventListener("focus",A,!1),function(){window.removeEventListener("focus",A,!1)}},[H,$,Y,V]);var J=b.useRef([]),fe=function(ue){U.current&&U.current.contains(ue.target)||(ue.preventDefault(),J.current=[])};b.useEffect(function(){return j&&(document.addEventListener("dragover",LP,!1),document.addEventListener("drop",fe,!1)),function(){j&&(document.removeEventListener("dragover",LP),document.removeEventListener("drop",fe))}},[U,j]),b.useEffect(function(){return!r&&E&&U.current&&U.current.focus(),function(){}},[U,E,r]);var ge=b.useCallback(function(re){M?M(re):console.error(re)},[M]),B=b.useCallback(function(re){re.preventDefault(),re.persist(),G(re),J.current=[].concat(ZEe(J.current),[re.target]),Bv(re)&&Promise.resolve(i(re)).then(function(ue){if(!(hb(re)&&!O)){var X=ue.length,ve=X>0&&$Ee({files:ue,accept:K,minSize:a,maxSize:o,multiple:c,maxFiles:d,validator:L}),Ee=X>0&&!ve;te({isDragAccept:ve,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),f&&f(re)}}).catch(function(ue){return ge(ue)})},[i,f,ge,O,K,a,o,c,d,L]),se=b.useCallback(function(re){re.preventDefault(),re.persist(),G(re);var ue=Bv(re);if(ue&&re.dataTransfer)try{re.dataTransfer.dropEffect="copy"}catch{}return ue&&h&&h(re),!1},[h,O]),_e=b.useCallback(function(re){re.preventDefault(),re.persist(),G(re);var ue=J.current.filter(function(ve){return U.current&&U.current.contains(ve)}),X=ue.indexOf(re.target);X!==-1&&ue.splice(X,1),J.current=ue,!(ue.length>0)&&(te({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Bv(re)&&m&&m(re))},[U,m,O]),Ie=b.useCallback(function(re,ue){var X=[],ve=[];re.forEach(function(Ee){var Ke=m7(Ee,K),et=R1(Ke,2),Vt=et[0],jn=et[1],ln=h7(Ee,a,o),zt=R1(ln,2),wn=zt[0],_t=zt[1],ur=L?L(Ee):null;if(Vt&&wn&&!ur)X.push(Ee);else{var Sn=[jn,_t];ur&&(Sn=Sn.concat(ur)),ve.push({file:Ee,errors:Sn.filter(function(Fr){return Fr})})}}),(!c&&X.length>1||c&&d>=1&&X.length>d)&&(X.forEach(function(Ee){ve.push({file:Ee,errors:[DEe]})}),X.splice(0)),te({acceptedFiles:X,fileRejections:ve,isDragReject:ve.length>0,type:"setFiles"}),v&&v(X,ve,ue),ve.length>0&&x&&x(ve,ue),X.length>0&&y&&y(X,ue)},[te,c,K,a,o,d,v,y,x,L]),Fe=b.useCallback(function(re){re.preventDefault(),re.persist(),G(re),J.current=[],Bv(re)&&Promise.resolve(i(re)).then(function(ue){hb(re)&&!O||Ie(ue,re)}).catch(function(ue){return ge(ue)}),te({type:"reset"})},[i,Ie,ge,O]),Le=b.useCallback(function(){if(V.current){te({type:"openDialog"}),q();var re={multiple:c,types:ee};window.showOpenFilePicker(re).then(function(ue){return i(ue)}).then(function(ue){Ie(ue,null),te({type:"closeDialog"})}).catch(function(ue){VEe(ue)?(Y(ue),te({type:"closeDialog"})):BEe(ue)?(V.current=!1,H.current?(H.current.value=null,H.current.click()):ge(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."))):ge(ue)});return}H.current&&(te({type:"openDialog"}),q(),H.current.value=null,H.current.click())},[te,q,Y,k,Ie,ge,ee,c]),We=b.useCallback(function(re){!U.current||!U.current.isEqualNode(re.target)||(re.key===" "||re.key==="Enter"||re.keyCode===32||re.keyCode===13)&&(re.preventDefault(),Le())},[U,Le]),gt=b.useCallback(function(){te({type:"focus"})},[]),Qt=b.useCallback(function(){te({type:"blur"})},[]),Tn=b.useCallback(function(){R||(zEe()?setTimeout(Le,0):Le())},[R,Le]),sn=function(ue){return r?null:ue},jr=function(ue){return T?null:sn(ue)},Mt=function(ue){return N?null:sn(ue)},G=function(ue){O&&ue.stopPropagation()},ae=b.useMemo(function(){return function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=re.refKey,X=ue===void 0?"ref":ue,ve=re.role,Ee=re.onKeyDown,Ke=re.onFocus,et=re.onBlur,Vt=re.onClick,jn=re.onDragEnter,ln=re.onDragOver,zt=re.onDragLeave,wn=re.onDrop,_t=gb(re,KEe);return On(On(_k({onKeyDown:jr(aa(Ee,We)),onFocus:jr(aa(Ke,gt)),onBlur:jr(aa(et,Qt)),onClick:sn(aa(Vt,Tn)),onDragEnter:Mt(aa(jn,B)),onDragOver:Mt(aa(ln,se)),onDragLeave:Mt(aa(zt,_e)),onDrop:Mt(aa(wn,Fe)),role:typeof ve=="string"&&ve!==""?ve:"presentation"},X,U),!r&&!T?{tabIndex:0}:{}),_t)}},[U,We,gt,Qt,Tn,B,se,_e,Fe,T,N,r]),pe=b.useCallback(function(re){re.stopPropagation()},[]),Ce=b.useMemo(function(){return function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=re.refKey,X=ue===void 0?"ref":ue,ve=re.onChange,Ee=re.onClick,Ke=gb(re,GEe),et=_k({accept:K,multiple:c,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:sn(aa(ve,Fe)),onClick:sn(aa(Ee,pe)),tabIndex:-1},X,H);return On(On({},et),Ke)}},[H,n,c,Fe,r]);return On(On({},F),{},{isFocused:D&&!r,getRootProps:ae,getInputProps:Ce,rootRef:U,inputRef:H,open:sn(Le)})}function nje(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({},Ck),{},{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({},Ck);default:return e}}function UP(){}function rje(){const[e,t]=b.useState(""),{clusterId:n}=it({strict:!1}),{openedEntry:r,restrictPackageModification:i,reloadRootEntries:o,entryExists:a}=zr(),c=!!r&&!r.package&&!i,d=Zt(),{dragging:f,dragTarget:m}=aEe(),v=m?.getAttribute?.("data-rct-item-id")?.split?.("/")?.pop?.(),y=r?.project;let x=!1,S;if(r?.path){const R=r.path.split("/"),T=_r(r);x=c&&(T?R.slice(1):R.slice(1,-1)).join("/"),S=R[R.length-(T?1:2)]}const C=b.useCallback(async(R,T)=>{const N=m?.getAttribute?.("data-rct-item-id")?.split?.("/"),O=N?.length?N[0]:c?y:!1,M=N?.length?N.slice(1).join("/"):c?x:!1;if(O===!1||O===void 0||M===!1||M===void 0)return;const L=[],K=T.slice();for(const F of R){const te=VP(M,F);F.name.startsWith(".")||F.relativePath?.includes("/.")?K.push({file:F,errors:[{message:"Sensitive files and folders starting with . are skipped.",code:"dot-ignored"}]}):a(`${O}/${te}`)?K.push({file:F,errors:[{message:`${te} already exists`,code:"duplicate"}]}):L.push(F)}let ee=!1;const q="uploading-files",Y={label:"Cancel",onClick:()=>{ee=!0}},U={label:"OK",onClick:()=>{}};t(`Uploading ${Zr(L.length,"file","files")}...`);const H=L.reduce((F,te)=>F+te.size,0);let z=0,W=0;for(const F of L){W+=1,we.loading("Upload in progress...",{id:q,descriptionClassName:"whitespace-pre",description:`${W} of ${Zr(L.length,"file","files")}
154
+ ${F.name}
155
+ ${Mo(z)} of ${Mo(H)}`,action:Y});const te=VP(M,F),$=(await sEe(F)).target.result,V="base64,",A=$.indexOf(V);ee?K.push({file:F,errors:[{message:`${te} cancelled`,code:"cancelled"}]}):(await kI({...d,file:te,project:O,encoding:"base64",payload:$.slice(A+V.length)}),z+=F.size)}we.loading("Reloading sidebar...",{id:ee?void 0:q,action:U,description:""}),await o(),K.length===0?R.length>0&&we.success(`Uploaded ${Zr(L.length,"file","files")}!`,{id:q,action:U,description:""}):(console.log(K),we.error(ee?"Cancelled uploads":"Rejected uploads",{id:ee?void 0:q,action:U,descriptionClassName:"whitespace-pre overflow-y-auto",description:K.slice(0,5).map(F=>F.errors.map(te=>te.message).join(`
156
+ `)).join(`
157
+ `)+(K?.length>5?`
158
+ Check the console for the full list.`:"")})),t("")},[m,c,y,x,a,d,o]),k=!!n&&Et.checkForFabricConnect(n),{getRootProps:E,getInputProps:j}=x7({multiple:!0,maxSize:k?gY:hY,onDrop:C});return!c&&!m?f?u.jsxs("div",{className:_i("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:_i("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 VP(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 ije(e){const t=e.data;return t&&"name"in t?t.name:"root"}function Bh(e){const{instanceId:t,clusterId:n}=it({strict:!1}),r=An,[i,o]=_d(`EditorFileContent/${r}}/${e}`,void 0);return b.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}const zn="w-6 pointer-events-none ";function oje({opened:e,pkg:t}){return t?e?u.jsx("i",{className:zn+"fas fa-box-open text-orange-600"}):u.jsx("i",{className:zn+"fas fa-box text-orange-600"}):e?u.jsx("i",{className:zn+"fas fa-folder-open text-orange-400"}):u.jsx("i",{className:zn+"fas fa-folder text-orange-400"})}function aje({extension:e}){switch(e){case"js":return u.jsx("i",{className:zn+"filetype-js fab fa-js text-yellow"});case"jsx":return u.jsx("i",{className:zn+"filetype-jsx fab fa-js text-yellow"});case"cjs":return u.jsx("i",{className:zn+"filetype-cjs fab fa-js text-yellow"});case"yaml":return u.jsx("i",{className:zn+"filetype-yaml fas fa-file"});case"css":return u.jsx("i",{className:zn+"filetype-css fas fa-file text-blue"});case"html":return u.jsx("i",{className:zn+"filetype-unknown far fa-file-alt"});case"json":return u.jsx("i",{className:zn+"filetype-json fas fa-cog"});case"ts":return u.jsx("i",{className:zn+"filetype-ts fas fa-file text-blue"});case"tsx":return u.jsx("i",{className:zn+"filetype-tsx fas fa-file text-blue"});case"png":return u.jsx("i",{className:zn+"filetype-png fas fa-image"});case"jpg":return u.jsx("i",{className:zn+"filetype-jpg fas fa-image"});case"jpeg":return u.jsx("i",{className:zn+"filetype-jpeg fas fa-image"});case"gif":return u.jsx("i",{className:zn+"filetype-gif fas fa-image"});case"svg":return u.jsx("i",{className:zn+"filetype-svg fas fa-file-svg"});case"vue":return u.jsx("i",{className:zn+"filetype-vue fab fa-vuejs text-green"});default:return u.jsx("i",{className:zn+"filetype-unknown far fa-file-alt"})}}function sje(){return u.jsx("i",{className:zn+"fas fa-lock text-gray-400 ml-2 packageIsLocked"})}function lje(){return u.jsx("i",{className:zn+"fas fa-plus text-green"})}function cje({title:e,item:t,context:n}){const{content:r}=Bh(t.data?.path);return u.jsxs(u.Fragment,{children:[t.data?.path===_o?u.jsx(lje,{}):_r(t.data)?u.jsx(oje,{opened:n.isExpanded,pkg:!!t.data?.package||t.data.path===Ws}):u.jsx(aje,{extension:M0(e)}),u.jsxs("span",{className:"text-nowrap pointer-events-none",children:[e,r?"*":""]}),t.data?.package&&u.jsx(sje,{})]})}function uje(){const{rootEntries:e,openedEntry:t,setOpenedEntry:n,focusedItem:r,setFocusedItem:i,expandedItems:o,setExpandedItems:a,selectedItems:c,setSelectedItems:d}=zr(),{items:f,rootId:m}=b.useMemo(()=>oEe(e),[e]);vke(),b.useEffect(function(){if(t?.path!==r&&r){const S=f[r]?.data;S&&n(S)}},[r,f,t?.path,n]);const h=Hq(),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:EI(x.targetItem,yke(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(zke,{canDragAndDrop:!0,canDropOnFolder:!0,canDropOnNonFolder:!1,canReorderItems:!1,canSearch:!0,canRename:!1,getItemTitle:ije,items:f,onDrop:v,renderItemTitle:cje,viewState:{applicationsTree:{focusedItem:r,expandedItems:o,selectedItems:c}},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(tEe,{treeId:"applicationsTree",rootItem:m,treeLabel:"Applications file tree"})}),u.jsx(rje,{})]})}async function dje(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 Uc(n)}throw i}async function w7({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 Uc(1e4),await dje(()=>al({instanceClient:n,timeout:3e3}),12,15e3),r}function fje(){return ct({mutationFn:w7})}function pje({onRestartedSuccessfully:e}={}){const{clusterId:t}=it({strict:!1}),n=rr(),[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 c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=we.loading("Restarting",{...c,description:u.jsx(Am,{animated:!0,width:"0%"})}),f=await lj(t),m=Et.checkForFabricConnect(f.id),h=f?.instances??[],v=h.filter(x=>x.status==="RUNNING").map(x=>Qa({id:x.id,forceFabricConnect:m,operationsUrl:Yk(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}`,{...c,id:d,description:u.jsx(Am,{animated:!0,width:(x===0?0:x/v.length*100)+"%"})});try{await al({instanceClient:S}),await w7({operation:"restart",replicated:!1,instanceClient:S}),y+=1}catch{x+1!==v.length&&(we.loading(`Failed Restarting Instance ${x+1} of ${v.length}`,{...c,id:d,description:"We will carry on momentarily."}),await Uc(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=Zr(h.length,"instance","instances"),S=Zr(y,'"RUNNING" instance was','"RUNNING" instances were');we.error("Error",{id:d,description:`Failed to fully restart cluster.
159
+ `+([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(Xo).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>we.dismiss()}})}},[t,e,n]),isRestartPending:r}}function mje({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=it({strict:!1}),o="Instance",{mutate:a,isPending:c}=fje(),d=rr();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:c}}function S7({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:c}){const{onRestartClick:d,isRestartPending:f}=pje(),{onRestartClick:m,isRestartPending:h}=mje({operation:i,instanceClient:r});return u.jsxs(dx,{children:[u.jsx(fx,{asChild:!0,children:u.jsxs(be,{variant:c||"positiveOutline",className:_i("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(ine,{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(px,{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 hje({toggledSidebar:e,toggleSidebar:t}){const n=Zt(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=zr(),{content:c}=Bh(i?.path),d=gf(),f=n.entityType==="instance"?"Instance":"Cluster",m=Wa("ShowAddDirectoryOrFileModalType","file"),h=Wa("ShowAddDirectoryOrFileModalType","directory"),v=Wa("ShowDownloadApplicationModal",!0),y=Wa("ShowRenameFileModal",!0),x=Wa("ShowDeleteDirectoryOrFileModal",!0),S=Wa("ShowRedeployApplicationModal",!0),C=k1("SaveFile",!0),k=k1("RevertChanges",!0),E=k1("ShowNewTableModal",!0),j=c===void 0||c===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(Yte,{}):u.jsx(Gte,{})]}),i&&i?.path!==_o&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(dx,{children:[u.jsx(fx,{asChild:!0,children:u.jsxs(be,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx($te,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(px,{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."})})]}),!_r(i)&&!i.package&&d&&u.jsxs(be,{variant:"default",className:"rounded-none",onClick:C,disabled:j||o,title:"Save",children:[u.jsx(jo,{className:"pointer-events-none"}),u.jsxs("span",{className:"hidden lg:inline-block pointer-events-none",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!_r(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!j||o,title:"Rename",children:[u.jsx(N4,{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(fte,{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(mte,{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(Xr,{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(k4,{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(sE,{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(S7,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!j||o}),!_r(i)&&!i.package&&d&&u.jsxs(be,{variant:"ghost",className:"rounded-none",onClick:k,disabled:j||o,title:"Revert Changes",children:[u.jsx(bne,{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 gje(e){return b.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=sq().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 vje(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const yje=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bje=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xje={};function BP(e,t){return(xje.jsx?bje:yje).test(e)}const wje=/[ \t\n\f\r]/g;function Sje(e){return typeof e=="object"?e.type==="text"?HP(e.value):!1:HP(e)}function HP(e){return e.replace(wje,"")===""}class Hh{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Hh.prototype.normal={};Hh.prototype.property={};Hh.prototype.space=void 0;function _7(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hh(n,r,t)}function kk(e){return e.toLowerCase()}class Ei{constructor(t,n){this.attribute=n,this.property=t}}Ei.prototype.attribute="";Ei.prototype.booleanish=!1;Ei.prototype.boolean=!1;Ei.prototype.commaOrSpaceSeparated=!1;Ei.prototype.commaSeparated=!1;Ei.prototype.defined=!1;Ei.prototype.mustUseProperty=!1;Ei.prototype.number=!1;Ei.prototype.overloadedBoolean=!1;Ei.prototype.property="";Ei.prototype.spaceSeparated=!1;Ei.prototype.space=void 0;let _je=0;const yt=au(),er=au(),Ek=au(),je=au(),gn=au(),Cd=au(),Di=au();function au(){return 2**++_je}const jk=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:er,commaOrSpaceSeparated:Di,commaSeparated:Cd,number:je,overloadedBoolean:Ek,spaceSeparated:gn},Symbol.toStringTag,{value:"Module"})),I1=Object.keys(jk);class II extends Ei{constructor(t,n,r,i){let o=-1;if(super(t,n),qP(this,"space",i),typeof r=="number")for(;++o<I1.length;){const a=I1[o];qP(this,I1[o],(r&jk[a])===jk[a])}}}II.prototype.defined=!0;function qP(e,t,n){n&&(e[t]=n)}function If(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new II(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[kk(r)]=r,n[kk(o.attribute)]=r}return new Hh(t,n,e.space)}const C7=If({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:gn,ariaCurrent:null,ariaDescribedBy:gn,ariaDetails:null,ariaDisabled:er,ariaDropEffect:gn,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:gn,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gn,ariaLevel:je,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:gn,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:gn,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:er,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function k7(e,t){return t in e?e[t]:t}function E7(e,t){return k7(e,t.toLowerCase())}const Cje=If({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cd,acceptCharset:gn,accessKey:gn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:gn,autoFocus:yt,autoPlay:yt,blocking:gn,capture:null,charSet:null,checked:yt,cite:null,className:gn,cols:je,colSpan:null,content:null,contentEditable:er,controls:yt,controlsList:gn,coords:je|Cd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Ek,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:gn,height:je,hidden:Ek,high:je,href:null,hrefLang:null,htmlFor:gn,httpEquiv:gn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:gn,itemRef:gn,itemScope:yt,itemType:gn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:je,pattern:null,ping:gn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:gn,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:gn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:er,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gn,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:E7}),kje=If({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:Di,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:gn,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:Cd,g2:Cd,glyphName:Cd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,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:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Di,rev:Di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Di,requiredFeatures:Di,requiredFonts:Di,requiredFormats:Di,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Di,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:k7}),j7=If({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()}}),R7=If({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:E7}),I7=If({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Eje={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"},jje=/[A-Z]/g,KP=/-[a-z]/g,Rje=/^data[-\w.:]+$/i;function Ije(e,t){const n=kk(t);let r=t,i=Ei;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Rje.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(KP,Tje);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!KP.test(o)){let a=o.replace(jje,Nje);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=II}return new i(r,t)}function Nje(e){return"-"+e.toLowerCase()}function Tje(e){return e.charAt(1).toUpperCase()}const Oje=_7([C7,Cje,j7,R7,I7],"html"),NI=_7([C7,kje,j7,R7,I7],"svg");function Aje(e){return e.join(" ").trim()}var nd={},N1,GP;function Dje(){if(GP)return N1;GP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
160
+ `,f="/",m="*",h="",v="comment",y="declaration";N1=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(Y){var U=Y.match(t);U&&(k+=U.length);var H=Y.lastIndexOf(d);E=~H?Y.length-H:E+Y.length}function R(){var Y={line:k,column:E};return function(U){return U.position=new T(Y),M(),U}}function T(Y){this.start=Y,this.end={line:k,column:E},this.source=C.source}T.prototype.content=S;function N(Y){var U=new Error(C.source+":"+k+":"+E+": "+Y);if(U.reason=Y,U.filename=C.source,U.line=k,U.column=E,U.source=S,!C.silent)throw U}function O(Y){var U=Y.exec(S);if(U){var H=U[0];return j(H),S=S.slice(H.length),U}}function M(){O(n)}function L(Y){var U;for(Y=Y||[];U=K();)U!==!1&&Y.push(U);return Y}function K(){var Y=R();if(!(f!=S.charAt(0)||m!=S.charAt(1))){for(var U=2;h!=S.charAt(U)&&(m!=S.charAt(U)||f!=S.charAt(U+1));)++U;if(U+=2,h===S.charAt(U-1))return N("End of comment missing");var H=S.slice(2,U-2);return E+=2,j(H),S=S.slice(U),E+=2,Y({type:v,comment:H})}}function ee(){var Y=R(),U=O(r);if(U){if(K(),!O(i))return N("property missing ':'");var H=O(o),z=Y({type:y,property:x(U[0].replace(e,h)),value:H?x(H[0].replace(e,h)):h});return O(a),z}}function q(){var Y=[];L(Y);for(var U;U=ee();)U!==!1&&(Y.push(U),L(Y));return Y}return M(),q()};function x(S){return S?S.replace(c,h):h}return N1}var ZP;function $je(){if(ZP)return nd;ZP=1;var e=nd&&nd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nd,"__esModule",{value:!0}),nd.default=n;const t=e(Dje());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;c?i(f,m,d):m&&(o=o||{},o[f]=m)}),o}return nd}var Vp={},YP;function Pje(){if(YP)return Vp;YP=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.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()},c=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,c):f=f.replace(r,c),f.replace(t,a))};return Vp.camelCase=d,Vp}var Bp,WP;function Mje(){if(WP)return Bp;WP=1;var e=Bp&&Bp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e($je()),n=Pje();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,Bp=r,Bp}var zje=Mje();const Lje=ef(zje),N7=T7("end"),TI=T7("start");function T7(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 Fje(e){const t=TI(e),n=N7(e);if(t&&n)return{start:t,end:n}}function um(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?XP(e.position):"start"in e||"end"in e?XP(e):"line"in e||"column"in e?Rk(e):""}function Rk(e){return JP(e&&e.line)+":"+JP(e&&e.column)}function XP(e){return Rk(e&&e.start)+"-"+Rk(e&&e.end)}function JP(e){return e&&typeof e=="number"?e:1}class Lr 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 c=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=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=um(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}}Lr.prototype.file="";Lr.prototype.name="";Lr.prototype.reason="";Lr.prototype.message="";Lr.prototype.stack="";Lr.prototype.column=void 0;Lr.prototype.line=void 0;Lr.prototype.ancestors=void 0;Lr.prototype.cause=void 0;Lr.prototype.fatal=void 0;Lr.prototype.place=void 0;Lr.prototype.ruleId=void 0;Lr.prototype.source=void 0;const OI={}.hasOwnProperty,Uje=new Map,Vje=/[A-Z]/g,Bje=new Set(["table","tbody","thead","tfoot","tr"]),Hje=new Set(["td","th"]),O7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qje(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=Qje(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=Jje(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"?NI:Oje,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=A7(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function A7(e,t,n){if(t.type==="element")return Kje(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Gje(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Yje(e,t,n);if(t.type==="mdxjsEsm")return Zje(e,t);if(t.type==="root")return Wje(e,t,n);if(t.type==="text")return Xje(e,t)}function Kje(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=NI,e.schema=i),e.ancestors.push(t);const o=$7(e,t.tagName,!1),a=eRe(e,t);let c=DI(e,t);return Bje.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Sje(d):!0})),D7(e,a,o,t),AI(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Gje(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)}Pm(e,t.position)}function Zje(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pm(e,t.position)}function Yje(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=NI,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:$7(e,t.name,!0),a=tRe(e,t),c=DI(e,t);return D7(e,a,o,t),AI(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function Wje(e,t,n){const r={};return AI(r,DI(e,t)),e.create(t,e.Fragment,r,n)}function Xje(e,t){return t.value}function D7(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function AI(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Jje(e,t,n){return r;function r(i,o,a,c){const f=Array.isArray(a.children)?n:t;return c?f(o,a,c):f(o,a)}}function Qje(e,t){return n;function n(r,i,o,a){const c=Array.isArray(o.children),d=TI(r);return t(i,o,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function eRe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&OI.call(t.properties,i)){const o=nRe(e,i,t.properties[i]);if(o){const[a,c]=o;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&Hje.has(t.tagName)?r=c:n[a]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tRe(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 c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Pm(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 c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Pm(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function DI(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Uje;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 c=A7(e,o,a);c!==void 0&&n.push(c)}return n}function nRe(e,t,n){const r=Ije(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?vje(n):Aje(n)),r.property==="style"){let i=typeof n=="object"?n:rRe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=iRe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Eje[r.property]||r.property:r.attribute,n]}}function rRe(e,t){try{return Lje(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Lr("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=O7+"#cannot-parse-style-attribute",i}}function $7(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 c=BP(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=a}else r=BP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return OI.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Pm(e)}function Pm(e,t){const n=new Lr("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=O7+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iRe(e){const t={};let n;for(n in e)OI.call(e,n)&&(t[oRe(n)]=e[n]);return t}function oRe(e){let t=e.replace(Vje,aRe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aRe(e){return"-"+e.toLowerCase()}const T1={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"]},sRe={};function lRe(e,t){const n=sRe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return P7(e,r,i)}function P7(e,t,n){if(cRe(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 QP(e.children,t,n)}return Array.isArray(e)?QP(e,t,n):""}function QP(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=P7(e[i],t,n);return r.join("")}function cRe(e){return!!(e&&typeof e=="object")}const eM=document.createElement("i");function $I(e){const t="&"+e+";";eM.innerHTML=t;const n=eM.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 vo(e,t){return e.length>0?(_a(e,e.length,0,t),e):t}const tM={}.hasOwnProperty;function uRe(e){const t={};let n=-1;for(;++n<e.length;)dRe(t,e[n]);return t}function dRe(e,t){let n;for(n in t){const i=(tM.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){tM.call(i,a)||(i[a]=[]);const c=o[a];fRe(i[a],Array.isArray(c)?c:c?[c]:[])}}}function fRe(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 M7(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 kd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ca=Ll(/[A-Za-z]/),Li=Ll(/[\dA-Za-z]/),pRe=Ll(/[#-'*+\--9=?A-Z^-~]/);function Ik(e){return e!==null&&(e<32||e===127)}const Nk=Ll(/\d/),mRe=Ll(/[\dA-Fa-f]/),hRe=Ll(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function Si(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const gRe=Ll(new RegExp("\\p{P}|\\p{S}","u")),vRe=Ll(/\s/);function Ll(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Nf(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Li(e.charCodeAt(n+1))&&Li(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 c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(a=String.fromCharCode(o,c),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 bn(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),c(d)):t(d)}function c(d){return Kt(d)&&o++<i?(e.consume(d),c):(e.exit(n),t(d))}}const yRe={tokenize:bRe};function bRe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),bn(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return lt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),a)}}const xRe={tokenize:wRe},nM={tokenize:SRe};function wRe(e){const t=this,n=[];let r=0,i,o,a;return c;function c(j){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const R=t.events.length;let T=R,N;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){N=t.events[T][1].end;break}k(r);let O=R;for(;O<t.events.length;)t.events[O][1].end={...N},O++;return _a(t.events,T+1,0,t.events.slice(R)),t.events.length=O,f(j)}return c(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(nM,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(nM,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,c):(e.consume(j),S)}function C(j,R){const T=t.sliceStream(j);if(R&&T.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(T),t.parser.lazy[j.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const O=t.events.length;let M=O,L,K;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(L){K=t.events[M][1].end;break}L=!0}for(k(r),N=O;N<t.events.length;)t.events[N][1].end={...K},N++;_a(t.events,M+1,0,t.events.slice(O)),t.events.length=N}}function k(j){let R=n.length;for(;R-- >j;){const T=n[R];t.containerState=T[1],T[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 SRe(e,t,n){return bn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rM(e){if(e===null||Si(e)||vRe(e))return 1;if(gRe(e))return 2}function PI(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 Tk={name:"attention",resolveAll:_Re,tokenize:CRe};function _Re(e,t){let n=-1,r,i,o,a,c,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};iM(h,-d),iM(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={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:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=vo(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=vo(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=vo(f,PI(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=vo(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=vo(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 CRe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=rM(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),m=rM(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 iM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kRe={name:"autolink",tokenize:ERe};function ERe(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 ca(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Li(y)?(r=1,c(y)):f(y)}function c(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Li(y))&&r++<32?(e.consume(y),c):(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||Ik(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),m):pRe(y)?(e.consume(y),f):n(y)}function m(y){return Li(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||Li(y))&&r++<63){const x=y===45?v:h;return e.consume(y),x}return n(y)}}const F0={partial:!0,tokenize:jRe};function jRe(e,t,n){return r;function r(o){return Kt(o)?bn(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||lt(o)?t(o):n(o)}}const z7={continuation:{tokenize:IRe},exit:NRe,name:"blockQuote",tokenize:RRe};function RRe(e,t,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.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 IRe(e,t,n){const r=this;return i;function i(a){return Kt(a)?bn(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(z7,t,n)(a)}}function NRe(e){e.exit("blockQuote")}const L7={name:"characterEscape",tokenize:TRe};function TRe(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 hRe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const F7={name:"characterReference",tokenize:ORe};function ORe(e,t,n){const r=this;let i=0,o,a;return c;function c(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=Li,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=mRe,m):(e.enter("characterReferenceValue"),o=7,a=Nk,m(h))}function m(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Li&&!$I(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 oM={partial:!0,tokenize:DRe},aM={concrete:!0,name:"codeFenced",tokenize:ARe};function ARe(e,t,n){const r=this,i={partial:!0,tokenize:T};let o=0,a=0,c;return d;function d(N){return f(N)}function f(N){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,c=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(N)}function m(N){return N===c?(a++,e.consume(N),m):a<3?n(N):(e.exit("codeFencedFenceSequence"),Kt(N)?bn(e,h,"whitespace")(N):h(N))}function h(N){return N===null||lt(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(oM,S,R)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===null||lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Kt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),bn(e,y,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),v)}function y(N){return N===null||lt(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===c?n(N):(e.consume(N),x)}function S(N){return e.attempt(i,R,C)(N)}function C(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),k}function k(N){return o>0&&Kt(N)?bn(e,E,"linePrefix",o+1)(N):E(N)}function E(N){return N===null||lt(N)?e.check(oM,S,R)(N):(e.enter("codeFlowValue"),j(N))}function j(N){return N===null||lt(N)?(e.exit("codeFlowValue"),E(N)):(e.consume(N),j)}function R(N){return e.exit("codeFenced"),t(N)}function T(N,O,M){let L=0;return K;function K(H){return N.enter("lineEnding"),N.consume(H),N.exit("lineEnding"),ee}function ee(H){return N.enter("codeFencedFence"),Kt(H)?bn(N,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):q(H)}function q(H){return H===c?(N.enter("codeFencedFenceSequence"),Y(H)):M(H)}function Y(H){return H===c?(L++,N.consume(H),Y):L>=a?(N.exit("codeFencedFenceSequence"),Kt(H)?bn(N,U,"whitespace")(H):U(H)):M(H)}function U(H){return H===null||lt(H)?(N.exit("codeFencedFence"),O(H)):M(H)}}}function DRe(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 O1={name:"codeIndented",tokenize:PRe},$Re={partial:!0,tokenize:MRe};function PRe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),bn(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($Re,a,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||lt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function MRe(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):bn(e,o,"linePrefix",5)(a)}function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):lt(a)?i(a):n(a)}}const zRe={name:"codeText",previous:FRe,resolve:LRe,tokenize:URe};function LRe(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 FRe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function URe(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(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 VRe{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&&Hp(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),Hp(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hp(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);Hp(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hp(this.left,n.reverse())}}}function Hp(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 U7(e){const t={};let n=-1,r,i,o,a,c,d,f;const m=new VRe(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,BRe(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},c=m.slice(i,n),c.unshift(r),m.splice(i,n-i+1,c))}}return _a(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function BRe(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 c=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<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[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=c.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 HRe={resolve:KRe,tokenize:GRe},qRe={partial:!0,tokenize:ZRe};function KRe(e){return U7(e),e}function GRe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):lt(c)?e.check(qRe,a,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ZRe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),bn(e,o,"linePrefix")}function o(a){if(a===null||lt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function V7(e,t,n,r,i,o,a,c,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||Ik(k)?n(k):(e.enter(r),e.enter(a),e.enter(c),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(c),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(c),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||Si(k))?(e.exit("chunkString"),e.exit(c),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||Ik(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 B7(e,t,n,r,i,o){const a=this;let c=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 c>999||y===null||y===91||y===93&&!d||y===94&&!c&&"_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)||c++>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),c++,h):h(y)}}function H7(e,t,n,r,i,o){let a;return c;function c(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"),bn(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 dm(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)?bn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const YRe={name:"definition",tokenize:XRe},WRe={partial:!0,tokenize:JRe};function XRe(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return B7.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=kd(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 Si(y)?dm(e,f)(y):f(y)}function f(y){return V7(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function m(y){return e.attempt(WRe,h,h)(y)}function h(y){return Kt(y)?bn(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 JRe(e,t,n){return r;function r(c){return Si(c)?dm(e,i)(c):n(c)}function i(c){return H7(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Kt(c)?bn(e,a,"whitespace")(c):a(c)}function a(c){return c===null||lt(c)?t(c):n(c)}}const QRe={name:"hardBreakEscape",tokenize:eIe};function eIe(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 tIe={name:"headingAtx",resolve:nIe,tokenize:rIe};function nIe(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 rIe(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||Si(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||lt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?bn(e,c,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),c(m))}function f(m){return m===null||m===35||Si(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),f)}}const iIe=["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"],sM=["pre","script","style","textarea"],oIe={concrete:!0,name:"htmlFlow",resolveTo:lIe,tokenize:cIe},aIe={partial:!0,tokenize:dIe},sIe={partial:!0,tokenize:uIe};function lIe(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 cIe(e,t,n){const r=this;let i,o,a,c,d;return f;function f(A){return m(A)}function m(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),v):A===47?(e.consume(A),o=!0,S):A===63?(e.consume(A),i=3,r.interrupt?t:D):ca(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function v(A){return A===45?(e.consume(A),i=2,y):A===91?(e.consume(A),i=5,c=0,x):ca(A)?(e.consume(A),i=4,r.interrupt?t:D):n(A)}function y(A){return A===45?(e.consume(A),r.interrupt?t:D):n(A)}function x(A){const J="CDATA[";return A===J.charCodeAt(c++)?(e.consume(A),c===J.length?r.interrupt?t:q:x):n(A)}function S(A){return ca(A)?(e.consume(A),a=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||Si(A)){const J=A===47,fe=a.toLowerCase();return!J&&!o&&sM.includes(fe)?(i=1,r.interrupt?t(A):q(A)):iIe.includes(a.toLowerCase())?(i=6,J?(e.consume(A),k):r.interrupt?t(A):q(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?E(A):j(A))}return A===45||Li(A)?(e.consume(A),a+=String.fromCharCode(A),C):n(A)}function k(A){return A===62?(e.consume(A),r.interrupt?t:q):n(A)}function E(A){return Kt(A)?(e.consume(A),E):K(A)}function j(A){return A===47?(e.consume(A),K):A===58||A===95||ca(A)?(e.consume(A),R):Kt(A)?(e.consume(A),j):K(A)}function R(A){return A===45||A===46||A===58||A===95||Li(A)?(e.consume(A),R):T(A)}function T(A){return A===61?(e.consume(A),N):Kt(A)?(e.consume(A),T):j(A)}function N(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),d=A,O):Kt(A)?(e.consume(A),N):M(A)}function O(A){return A===d?(e.consume(A),d=null,L):A===null||lt(A)?n(A):(e.consume(A),O)}function M(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Si(A)?T(A):(e.consume(A),M)}function L(A){return A===47||A===62||Kt(A)?j(A):n(A)}function K(A){return A===62?(e.consume(A),ee):n(A)}function ee(A){return A===null||lt(A)?q(A):Kt(A)?(e.consume(A),ee):n(A)}function q(A){return A===45&&i===2?(e.consume(A),z):A===60&&i===1?(e.consume(A),W):A===62&&i===4?(e.consume(A),$):A===63&&i===3?(e.consume(A),D):A===93&&i===5?(e.consume(A),te):lt(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(aIe,V,Y)(A)):A===null||lt(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),q)}function Y(A){return e.check(sIe,U,V)(A)}function U(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),H}function H(A){return A===null||lt(A)?Y(A):(e.enter("htmlFlowData"),q(A))}function z(A){return A===45?(e.consume(A),D):q(A)}function W(A){return A===47?(e.consume(A),a="",F):q(A)}function F(A){if(A===62){const J=a.toLowerCase();return sM.includes(J)?(e.consume(A),$):q(A)}return ca(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),F):q(A)}function te(A){return A===93?(e.consume(A),D):q(A)}function D(A){return A===62?(e.consume(A),$):A===45&&i===2?(e.consume(A),D):q(A)}function $(A){return A===null||lt(A)?(e.exit("htmlFlowData"),V(A)):(e.consume(A),$)}function V(A){return e.exit("htmlFlow"),t(A)}}function uIe(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 dIe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(F0,t,n)}}const fIe={name:"htmlText",tokenize:pIe};function pIe(e,t,n){const r=this;let i,o,a;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),T):D===63?(e.consume(D),j):ca(D)?(e.consume(D),M):n(D)}function f(D){return D===45?(e.consume(D),m):D===91?(e.consume(D),o=0,x):ca(D)?(e.consume(D),E):n(D)}function m(D){return D===45?(e.consume(D),y):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),v):lt(D)?(a=h,W(D)):(e.consume(D),h)}function v(D){return D===45?(e.consume(D),y):h(D)}function y(D){return D===62?z(D):D===45?v(D):h(D)}function x(D){const $="CDATA[";return D===$.charCodeAt(o++)?(e.consume(D),o===$.length?S:x):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),C):lt(D)?(a=S,W(D)):(e.consume(D),S)}function C(D){return D===93?(e.consume(D),k):S(D)}function k(D){return D===62?z(D):D===93?(e.consume(D),k):S(D)}function E(D){return D===null||D===62?z(D):lt(D)?(a=E,W(D)):(e.consume(D),E)}function j(D){return D===null?n(D):D===63?(e.consume(D),R):lt(D)?(a=j,W(D)):(e.consume(D),j)}function R(D){return D===62?z(D):j(D)}function T(D){return ca(D)?(e.consume(D),N):n(D)}function N(D){return D===45||Li(D)?(e.consume(D),N):O(D)}function O(D){return lt(D)?(a=O,W(D)):Kt(D)?(e.consume(D),O):z(D)}function M(D){return D===45||Li(D)?(e.consume(D),M):D===47||D===62||Si(D)?L(D):n(D)}function L(D){return D===47?(e.consume(D),z):D===58||D===95||ca(D)?(e.consume(D),K):lt(D)?(a=L,W(D)):Kt(D)?(e.consume(D),L):z(D)}function K(D){return D===45||D===46||D===58||D===95||Li(D)?(e.consume(D),K):ee(D)}function ee(D){return D===61?(e.consume(D),q):lt(D)?(a=ee,W(D)):Kt(D)?(e.consume(D),ee):L(D)}function q(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,Y):lt(D)?(a=q,W(D)):Kt(D)?(e.consume(D),q):(e.consume(D),U)}function Y(D){return D===i?(e.consume(D),i=void 0,H):D===null?n(D):lt(D)?(a=Y,W(D)):(e.consume(D),Y)}function U(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||Si(D)?L(D):(e.consume(D),U)}function H(D){return D===47||D===62||Si(D)?L(D):n(D)}function z(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function W(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),F}function F(D){return Kt(D)?bn(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):te(D)}function te(D){return e.enter("htmlTextData"),a(D)}}const MI={name:"labelEnd",resolveAll:vIe,resolveTo:yIe,tokenize:bIe},mIe={tokenize:xIe},hIe={tokenize:wIe},gIe={tokenize:SIe};function vIe(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 yIe(e,t){let n=e.length,r=0,i,o,a,c;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 c=[["enter",d,t],["enter",f,t]],c=vo(c,e.slice(o+1,o+r+3)),c=vo(c,[["enter",m,t]]),c=vo(c,PI(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),c=vo(c,[["exit",m,t],e[a-2],e[a-1],["exit",f,t]]),c=vo(c,e.slice(a+1)),c=vo(c,[["exit",d,t]]),_a(e,o,e.length,c),e}function bIe(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 c;function c(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(kd(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(mIe,m,a?m:h)(v):v===91?e.attempt(hIe,m,a?f:h)(v):a?m(v):h(v)}function f(v){return e.attempt(gIe,m,h)(v)}function m(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function xIe(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 Si(h)?dm(e,o)(h):o(h)}function o(h){return h===41?m(h):V7(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Si(h)?dm(e,d)(h):m(h)}function c(h){return n(h)}function d(h){return h===34||h===39||h===40?H7(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Si(h)?dm(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 wIe(e,t,n){const r=this;return i;function i(c){return B7.call(r,e,o,a,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(kd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function SIe(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 _Ie={name:"labelStartImage",resolveAll:MI.resolveAll,tokenize:CIe};function CIe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const kIe={name:"labelStartLink",resolveAll:MI.resolveAll,tokenize:EIe};function EIe(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 A1={name:"lineEnding",tokenize:jIe};function jIe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),bn(e,t,"linePrefix")}}const py={name:"thematicBreak",tokenize:RIe};function RIe(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,c(f)}function c(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)?bn(e,c,"whitespace")(f):c(f))}}const fi={continuation:{tokenize:OIe},exit:DIe,name:"list",tokenize:TIe},IIe={partial:!0,tokenize:$Ie},NIe={partial:!0,tokenize:AIe};function TIe(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 c;function c(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Nk(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(py,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 Nk(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(F0,r.interrupt?n:m,e.attempt(IIe,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 OIe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(F0,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,bn(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(NIe,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,bn(e,e.attempt(fi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function AIe(e,t,n){const r=this;return bn(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 DIe(e){e.exit(this.containerState.type)}function $Ie(e,t,n){const r=this;return bn(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 lM={name:"setextUnderline",resolveTo:PIe,tokenize:MIe};function PIe(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 MIe(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"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Kt(f)?bn(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||lt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const zIe={tokenize:LIe};function LIe(e){const t=this,n=e.attempt(F0,r,e.attempt(this.parser.constructs.flowInitial,i,bn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(HRe,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 FIe={resolveAll:K7()},UIe=q7("string"),VIe=q7("text");function q7(e){return{resolveAll:K7(e==="text"?BIe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,c);return a;function a(m){return f(m)?o(m):c(m)}function c(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 K7(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 BIe(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,c=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},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 HIe={42:fi,43:fi,45:fi,48:fi,49:fi,50:fi,51:fi,52:fi,53:fi,54:fi,55:fi,56:fi,57:fi,62:z7},qIe={91:YRe},KIe={[-2]:O1,[-1]:O1,32:O1},GIe={35:tIe,42:py,45:[lM,py],60:oIe,61:lM,95:py,96:aM,126:aM},ZIe={38:F7,92:L7},YIe={[-5]:A1,[-4]:A1,[-3]:A1,33:_Ie,38:F7,42:Tk,60:[kRe,fIe],91:kIe,92:[QRe,L7],93:MI,95:Tk,96:zRe},WIe={null:[Tk,FIe]},XIe={null:[42,95]},JIe={null:[]},QIe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XIe,contentInitial:qIe,disable:JIe,document:HIe,flow:GIe,flowInitial:KIe,insideSpan:WIe,string:ZIe,text:YIe},Symbol.toStringTag,{value:"Module"}));function eNe(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=[],c=[];const d={attempt:O(T),check:O(N),consume:E,enter:j,exit:R,interrupt:O(N,{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=vo(a,ee),C(),a[a.length-1]!==null?[]:(M(t,0),f.events=PI(o,f.events,f),f.events)}function v(ee,q){return nNe(y(ee),q)}function y(ee){return tNe(a,ee)}function x(){const{_bufferIndex:ee,_index:q,line:Y,column:U,offset:H}=r;return{_bufferIndex:ee,_index:q,line:Y,column:U,offset:H}}function S(ee){i[ee.line]=ee.column,K()}function C(){let ee;for(;r._index<a.length;){const q=a[r._index];if(typeof q=="string")for(ee=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ee&&r._bufferIndex<q.length;)k(q.charCodeAt(r._bufferIndex));else k(q)}}function k(ee){m=m(ee)}function E(ee){lt(ee)?(r.line++,r.column=1,r.offset+=ee===-3?2:1,K()):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,q){const Y=q||{};return Y.type=ee,Y.start=x(),f.events.push(["enter",Y,f]),c.push(Y),Y}function R(ee){const q=c.pop();return q.end=x(),f.events.push(["exit",q,f]),q}function T(ee,q){M(ee,q.from)}function N(ee,q){q.restore()}function O(ee,q){return Y;function Y(U,H,z){let W,F,te,D;return Array.isArray(U)?V(U):"tokenize"in U?V([U]):$(U);function $(ge){return B;function B(se){const _e=se!==null&&ge[se],Ie=se!==null&&ge.null,Fe=[...Array.isArray(_e)?_e:_e?[_e]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return V(Fe)(se)}}function V(ge){return W=ge,F=0,ge.length===0?z:A(ge[F])}function A(ge){return B;function B(se){return D=L(),te=ge,ge.partial||(f.currentConstruct=ge),ge.name&&f.parser.constructs.disable.null.includes(ge.name)?fe():ge.tokenize.call(q?Object.assign(Object.create(f),q):f,d,J,fe)(se)}}function J(ge){return ee(te,D),H}function fe(ge){return D.restore(),++F<W.length?A(W[F]):z}}}function M(ee,q){ee.resolveAll&&!o.includes(ee)&&o.push(ee),ee.resolve&&_a(f.events,q,f.events.length-q,ee.resolve(f.events.slice(q),f)),ee.resolveTo&&(f.events=ee.resolveTo(f.events,f))}function L(){const ee=x(),q=f.previous,Y=f.currentConstruct,U=f.events.length,H=Array.from(c);return{from:U,restore:z};function z(){r=ee,f.previous=q,f.currentConstruct=Y,f.events.length=U,c=H,K()}}function K(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tNe(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 c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function nNe(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=`
161
+ `;break}case-3:{a=`\r
162
+ `;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 rNe(e){const r={constructs:uRe([QIe,...(e||{}).extensions||[]]),content:i(yRe),defined:[],document:i(xRe),flow:i(zIe),lazy:{},string:i(UIe),text:i(VIe)};return r;function i(o){return a;function a(c){return eNe(r,o,c)}}}function iNe(e){for(;!U7(e););return e}const cM=/[\0\t\n\r]/g;function oNe(){let e=1,t="",n=!0,r;return i;function i(o,a,c){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(cM.lastIndex=h,f=cM.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 c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const aNe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sNe(e){return e.replace(aNe,lNe)}function lNe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return M7(n.slice(o?2:1),o?16:10)}return $I(n)||e}const G7={}.hasOwnProperty;function cNe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),uNe(n)(iNe(rNe(n).document().write(oNe()(e,t,!0))))}function uNe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Mt),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(Qt),blockQuote:o(Ie),characterEscape:L,characterReference:L,codeFenced:o(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Fe,a),codeText:o(Le,a),codeTextData:L,data:L,codeFlowValue:L,definition:o(We),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(gt),hardBreakEscape:o(Tn),hardBreakTrailing:o(Tn),htmlFlow:o(sn,a),htmlFlowData:L,htmlText:o(sn,a),htmlTextData:L,image:o(jr),label:a,link:o(Mt),listItem:o(ae),listItemValue:v,listOrdered:o(G,h),listUnordered:o(G),paragraph:o(pe),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Qt),strong:o(Ce),thematicBreak:o(ue)},exit:{atxHeading:d(),atxHeadingSequence:T,autolink:d(),autolinkEmail:_e,autolinkProtocol:se,blockQuote:d(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ge,characterReference:B,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:K,codeIndented:d(k),codeText:d(H),codeTextData:K,data:K,definition:d(),definitionDestinationString:R,definitionLabelString:E,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(q),hardBreakTrailing:d(q),htmlFlow:d(Y),htmlFlowData:K,htmlText:d(U),htmlTextData:K,image:d(W),label:te,labelText:F,lineEnding:ee,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:J,resourceDestinationString:D,resourceTitleString:$,resource:V,setextHeading:d(M),setextHeadingLineSequence:O,setextHeadingText:N,strong:d(),thematicBreak:d()}};Z7(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(X){let ve={type:"root",children:[]};const Ee={stack:[ve],tokenStack:[],config:t,enter:c,exit:f,buffer:a,resume:m,data:n},Ke=[];let et=-1;for(;++et<X.length;)if(X[et][1].type==="listOrdered"||X[et][1].type==="listUnordered")if(X[et][0]==="enter")Ke.push(et);else{const Vt=Ke.pop();et=i(X,Vt,et)}for(et=-1;++et<X.length;){const Vt=t[X[et][0]];G7.call(Vt,X[et][1].type)&&Vt[X[et][1].type].call(Object.assign({sliceSerialize:X[et][2].sliceSerialize},Ee),X[et][1])}if(Ee.tokenStack.length>0){const Vt=Ee.tokenStack[Ee.tokenStack.length-1];(Vt[1]||uM).call(Ee,void 0,Vt[0])}for(ve.position={start:Ks(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Ks(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)ve=t.transforms[et](ve)||ve;return ve}function i(X,ve,Ee){let Ke=ve-1,et=-1,Vt=!1,jn,ln,zt,wn;for(;++Ke<=Ee;){const _t=X[Ke];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?et++:et--,wn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(jn&&!wn&&!et&&!zt&&(zt=Ke),wn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wn=void 0}if(!et&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||et===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(jn){let ur=Ke;for(ln=void 0;ur--;){const Sn=X[ur];if(Sn[1].type==="lineEnding"||Sn[1].type==="lineEndingBlank"){if(Sn[0]==="exit")continue;ln&&(X[ln][1].type="lineEndingBlank",Vt=!0),Sn[1].type="lineEnding",ln=ur}else if(!(Sn[1].type==="linePrefix"||Sn[1].type==="blockQuotePrefix"||Sn[1].type==="blockQuotePrefixWhitespace"||Sn[1].type==="blockQuoteMarker"||Sn[1].type==="listItemIndent"))break}zt&&(!ln||zt<ln)&&(jn._spread=!0),jn.end=Object.assign({},ln?X[ln][1].start:_t[1].end),X.splice(ln||Ke,0,["exit",jn,_t[2]]),Ke++,Ee++}if(_t[1].type==="listItemPrefix"){const ur={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};jn=ur,X.splice(Ke,0,["enter",ur,_t[2]]),Ke++,Ee++,zt=void 0,wn=!0}}}return X[ve][1]._spread=Vt,Ee}function o(X,ve){return Ee;function Ee(Ke){c.call(this,X(Ke),Ke),ve&&ve.call(this,Ke)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(X,ve,Ee){this.stack[this.stack.length-1].children.push(X),this.stack.push(X),this.tokenStack.push([ve,Ee||void 0]),X.position={start:Ks(ve.start),end:void 0}}function d(X){return ve;function ve(Ee){X&&X.call(this,Ee),f.call(this,Ee)}}function f(X,ve){const Ee=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==X.type&&(ve?ve.call(this,X,Ke[0]):(Ke[1]||uM).call(this,X,Ke[0]));else throw new Error("Cannot close `"+X.type+"` ("+um({start:X.start,end:X.end})+"): it’s not open");Ee.position.end=Ks(X.end)}function m(){return lRe(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(X){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(X),10),this.data.expectingFirstListItemValue=void 0}}function y(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=X}function x(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=X}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.value=X.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.value=X.replace(/(\r?\n|\r)$/g,"")}function E(X){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=kd(this.sliceSerialize(X)).toLowerCase()}function j(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.title=X}function R(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.url=X}function T(X){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Ee=this.sliceSerialize(X).length;ve.depth=Ee}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function O(X){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(X).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function L(X){const Ee=this.stack[this.stack.length-1].children;let Ke=Ee[Ee.length-1];(!Ke||Ke.type!=="text")&&(Ke=re(),Ke.position={start:Ks(X.start),end:void 0},Ee.push(Ke)),this.stack.push(Ke)}function K(X){const ve=this.stack.pop();ve.value+=this.sliceSerialize(X),ve.position.end=Ks(X.end)}function ee(X){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ve.children[ve.children.length-1];Ee.position.end=Ks(X.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(L.call(this,X),K.call(this,X))}function q(){this.data.atHardBreak=!0}function Y(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.value=X}function U(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.value=X}function H(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.value=X}function z(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ve,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function W(){const X=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";X.type+="Reference",X.referenceType=ve,delete X.url,delete X.title}else delete X.identifier,delete X.label;this.data.referenceType=void 0}function F(X){const ve=this.sliceSerialize(X),Ee=this.stack[this.stack.length-2];Ee.label=sNe(ve),Ee.identifier=kd(ve).toLowerCase()}function te(){const X=this.stack[this.stack.length-1],ve=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ke=X.children;Ee.children=Ke}else Ee.alt=ve}function D(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.url=X}function $(){const X=this.resume(),ve=this.stack[this.stack.length-1];ve.title=X}function V(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function J(X){const ve=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ve,Ee.identifier=kd(this.sliceSerialize(X)).toLowerCase(),this.data.referenceType="full"}function fe(X){this.data.characterReferenceType=X.type}function ge(X){const ve=this.sliceSerialize(X),Ee=this.data.characterReferenceType;let Ke;Ee?(Ke=M7(ve,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=$I(ve);const et=this.stack[this.stack.length-1];et.value+=Ke}function B(X){const ve=this.stack.pop();ve.position.end=Ks(X.end)}function se(X){K.call(this,X);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(X)}function _e(X){K.call(this,X);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(X)}function Ie(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function We(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gt(){return{type:"emphasis",children:[]}}function Qt(){return{type:"heading",depth:0,children:[]}}function Tn(){return{type:"break"}}function sn(){return{type:"html",value:""}}function jr(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function G(X){return{type:"list",ordered:X.type==="listOrdered",start:null,spread:X._spread,children:[]}}function ae(X){return{type:"listItem",spread:X._spread,checked:null,children:[]}}function pe(){return{type:"paragraph",children:[]}}function Ce(){return{type:"strong",children:[]}}function re(){return{type:"text",value:""}}function ue(){return{type:"thematicBreak"}}}function Ks(e){return{line:e.line,column:e.column,offset:e.offset}}function Z7(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Z7(e,r):dNe(e,r)}}function dNe(e,t){let n;for(n in t)if(G7.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 uM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+um({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+um({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+um({start:t.start,end:t.end})+") is still open")}function fNe(e){const t=this;t.parser=n;function n(r){return cNe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pNe(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 mNe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
163
+ `}]}function hNe(e,t){const n=t.value?t.value+`
164
+ `:"",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 gNe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vNe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yNe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Nf(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),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 bNe(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 xNe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Y7(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 wNe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Y7(e,t);const i={src:Nf(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 SNe(e,t){const n={src:Nf(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 _Ne(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 CNe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Y7(e,t);const i={href:Nf(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 kNe(e,t){const n={href:Nf(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 ENe(e,t,n){const r=e.all(t),i=n?jNe(n):W7(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 c=-1;for(;++c<r.length;){const m=r[c];(i||c!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
165
+ `}),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:`
166
+ `});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function jNe(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=W7(n[r])}return t}function W7(e){const t=e.spread;return t??e.children.length>1}function RNe(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 INe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NNe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function TNe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ONe(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)},c=TI(t.children[1]),d=N7(t.children[t.children.length-1]);c&&d&&(a.position={start:c,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 ANe(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,c=a?a.length:t.children.length;let d=-1;const f=[];for(;++d<c;){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 DNe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const dM=9,fM=32;function $Ne(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(pM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(pM(t.slice(i),i>0,!1)),o.join("")}function pM(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===dM||o===fM;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===dM||o===fM;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function PNe(e,t){const n={type:"text",value:$Ne(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function MNe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zNe={blockquote:pNe,break:mNe,code:hNe,delete:gNe,emphasis:vNe,footnoteReference:yNe,heading:bNe,html:xNe,imageReference:wNe,image:SNe,inlineCode:_Ne,linkReference:CNe,link:kNe,listItem:ENe,list:RNe,paragraph:INe,root:NNe,strong:TNe,table:ONe,tableCell:DNe,tableRow:ANe,text:PNe,thematicBreak:MNe,toml:Hv,yaml:Hv,definition:Hv,footnoteDefinition:Hv};function Hv(){}const X7=-1,U0=0,fm=1,vb=2,zI=3,LI=4,FI=5,UI=6,J7=7,Q7=8,mM=typeof self=="object"?self:globalThis,LNe=(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 U0:case X7:return n(a,i);case fm:{const c=n([],i);for(const d of a)c.push(r(d));return c}case vb:{const c=n({},i);for(const[d,f]of a)c[r(d)]=r(f);return c}case zI:return n(new Date(a),i);case LI:{const{source:c,flags:d}=a;return n(new RegExp(c,d),i)}case FI:{const c=n(new Map,i);for(const[d,f]of a)c.set(r(d),r(f));return c}case UI:{const c=n(new Set,i);for(const d of a)c.add(r(d));return c}case J7:{const{name:c,message:d}=a;return n(new mM[c](d),i)}case Q7: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:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new mM[o](a),i)};return r},hM=e=>LNe(new Map,e)(0),rd="",{toString:FNe}={},{keys:UNe}=Object,qp=e=>{const t=typeof e;if(t!=="object"||!e)return[U0,t];const n=FNe.call(e).slice(8,-1);switch(n){case"Array":return[fm,rd];case"Object":return[vb,rd];case"Date":return[zI,rd];case"RegExp":return[LI,rd];case"Map":return[FI,rd];case"Set":return[UI,rd];case"DataView":return[fm,n]}return n.includes("Array")?[fm,n]:n.includes("Error")?[J7,n]:[vb,n]},qv=([e,t])=>e===U0&&(t==="function"||t==="symbol"),VNe=(e,t,n,r)=>{const i=(a,c)=>{const d=r.push(a)-1;return n.set(c,d),d},o=a=>{if(n.has(a))return n.get(a);let[c,d]=qp(a);switch(c){case U0:{let m=a;switch(d){case"bigint":c=Q7,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return i([X7],a)}return i([c,m],a)}case fm:{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([c,m],a);for(const v of a)m.push(o(v));return h}case vb:{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([c,m],a);for(const v of UNe(a))(e||!qv(qp(a[v])))&&m.push([o(v),o(a[v])]);return h}case zI:return i([c,a.toISOString()],a);case LI:{const{source:m,flags:h}=a;return i([c,{source:m,flags:h}],a)}case FI:{const m=[],h=i([c,m],a);for(const[v,y]of a)(e||!(qv(qp(v))||qv(qp(y))))&&m.push([o(v),o(y)]);return h}case UI:{const m=[],h=i([c,m],a);for(const v of a)(e||!qv(qp(v)))&&m.push(o(v));return h}}const{message:f}=a;return i([c,{name:d,message:f}],a)};return o},gM=(e,{json:t,lossy:n}={})=>{const r=[];return VNe(!(t||n),!!t,new Map,r)(e),r},yb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hM(gM(e,t)):structuredClone(e):(e,t)=>hM(gM(e,t));function BNe(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 HNe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function qNe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||BNe,r=e.options.footnoteBackLabel||HNe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];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=Nf(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),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...yb(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
167
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
168
+ `}]}}const eK=(function(e){if(e==null)return YNe;if(typeof e=="function")return V0(e);if(typeof e=="object")return Array.isArray(e)?KNe(e):GNe(e);if(typeof e=="string")return ZNe(e);throw new Error("Expected function, string, or object as test")});function KNe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eK(e[n]);return V0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function GNe(e){const t=e;return V0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ZNe(e){return V0(t);function t(n){return n&&n.type===e}}function V0(e){return t;function t(n,r,i){return!!(WNe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function YNe(){return!0}function WNe(e){return e!==null&&typeof e=="object"&&"type"in e}const tK=[],XNe=!0,vM=!1,JNe="skip";function QNe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=eK(i),a=r?-1:1;c(e,void 0,[])();function c(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=tK,x,S,C;if((!t||o(d,f,m[m.length-1]||void 0))&&(y=eTe(n(d,m)),y[0]===vM))return y;if("children"in d&&d.children){const k=d;if(k.children&&y[0]!==JNe)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=c(E,S,C)(),x[0]===vM)return x;S=typeof x[1]=="number"?x[1]:S+a}}return y}}}function eTe(e){return Array.isArray(e)?e:typeof e=="number"?[XNe,e]:e==null?tK:[e]}function nK(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),QNe(e,o,c,i);function c(d,f){const m=f[f.length-1],h=m?m.children.indexOf(d):void 0;return a(d,h,m)}}const Ok={}.hasOwnProperty,tTe={};function nTe(e,t){const n=t||tTe,r=new Map,i=new Map,o=new Map,a={...zNe,...n.handlers},c={all:f,applyData:iTe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:rTe,wrap:aTe};return nK(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)}}),c;function d(m,h){const v=m.type,y=c.handlers[v];if(Ok.call(c.handlers,v)&&y)return y(c,m,h);if(c.options.passThrough&&c.options.passThrough.includes(v)){if("children"in m){const{children:S,...C}=m,k=yb(C);return k.children=c.all(m),k}return yb(m)}return(c.options.unknownHandler||oTe)(c,m,h)}function f(m){const h=[];if("children"in m){const v=m.children;let y=-1;for(;++y<v.length;){const x=c.one(v[y],m);if(x){if(y&&v[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=yM(x.value)),!Array.isArray(x)&&x.type==="element")){const S=x.children[0];S&&S.type==="text"&&(S.value=yM(S.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function rTe(e,t){e.position&&(t.position=Fje(e))}function iTe(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,yb(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function oTe(e,t){const n=t.data||{},r="value"in t&&!(Ok.call(n,"hProperties")||Ok.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 aTe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
169
+ `});++r<e.length;)r&&n.push({type:"text",value:`
170
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
171
+ `}),n}function yM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bM(e,t){const n=nTe(e,t),r=n.one(e,void 0),i=qNe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
172
+ `},i),o}function sTe(e,t){return e&&"run"in e?async function(n,r){const i=bM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return bM(n,{file:r,...e||t})}}function xM(e){if(e)throw e}var D1,wM;function lTe(){if(wM)return D1;wM=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},c=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return D1=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=c(S,m),v=c(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},D1}var cTe=lTe();const $1=ef(cTe);function Ak(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 uTe(){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);c(null,...i);function c(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?dTe(m,c)(...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 dTe(e,t){let n;return r;function r(...a){const c=e.length>a.length;let d;c&&a.push(i);try{d=e.apply(this,a)}catch(f){const m=f;if(c&&n)throw m;return i(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...c){n||(n=!0,t(a,...c))}function o(a){i(null,a)}}const sa={basename:fTe,dirname:pTe,extname:mTe,join:hTe,sep:"/"};function fTe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qh(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,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function pTe(e){if(qh(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 mTe(e){qh(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),c===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 hTe(...e){let t=-1,n;for(;++t<e.length;)qh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gTe(n)}function gTe(e){qh(e);const t=e.codePointAt(0)===47;let n=vTe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vTe(e,t){let n="",r=0,i=-1,o=0,a=-1,c,d;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===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 c===46&&o>-1?o++:o=-1}return n}function qh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const yTe={cwd:bTe};function bTe(){return"/"}function Dk(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xTe(e){if(typeof e=="string")e=new URL(e);else if(!Dk(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 wTe(e)}function wTe(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 P1=["history","path","basename","stem","extname","dirname"];class rK{constructor(t){let n;t?Dk(t)?n={path:t}:typeof t=="string"||STe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":yTe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<P1.length;){const o=P1[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)P1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?sa.basename(this.path):void 0}set basename(t){z1(t,"basename"),M1(t,"basename"),this.path=sa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?sa.dirname(this.path):void 0}set dirname(t){SM(this.basename,"dirname"),this.path=sa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?sa.extname(this.path):void 0}set extname(t){if(M1(t,"extname"),SM(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=sa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dk(t)&&(t=xTe(t)),z1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?sa.basename(this.path,this.extname):void 0}set stem(t){z1(t,"stem"),M1(t,"stem"),this.path=sa.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 Lr(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 M1(e,t){if(e&&e.includes(sa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+sa.sep+"`")}function z1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function SM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function STe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _Te=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),CTe={}.hasOwnProperty;class VI extends _Te{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=uTe()}copy(){const t=new VI;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(U1("data",this.frozen),this.namespace[t]=n,this):CTe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(U1("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=Kv(t),r=this.parser||this.Parser;return L1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),L1("process",this.parser||this.Parser),F1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const c=Kv(t),d=r.parse(c);r.run(d,c,function(m,h,v){if(m||!h||!v)return f(m);const y=h,x=r.stringify(y,v);jTe(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(),L1("processSync",this.parser||this.Parser),F1("processSync",this.compiler||this.Compiler),this.process(t,i),CM("processSync","process",n),r;function i(o,a){n=!0,xM(o),r=a}}run(t,n,r){_M(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,c){const d=Kv(n);i.run(t,d,f);function f(m,h,v){const y=h||t;m?c(m):a?a(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),CM("runSync","run",r),i;function o(a,c){xM(a),i=c,r=!0}}stringify(t,n){this.freeze();const r=Kv(n),i=this.compiler||this.Compiler;return F1("stringify",i),_M(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(U1("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(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");c(f.plugins),f.settings&&(i.settings=$1(!0,i.settings,f.settings))}function c(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];Ak(S)&&Ak(y)&&(y=$1(!0,S,y)),r[v]=[f,y,...x]}}}}const kTe=new VI().freeze();function L1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function F1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function U1(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 _M(e){if(!Ak(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function CM(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Kv(e){return ETe(e)?e:new rK(e)}function ETe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jTe(e){return typeof e=="string"||RTe(e)}function RTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ITe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kM=[],EM={allowDangerousHtml:!0},NTe=/^(https?|ircs?|mailto|xmpp)$/i,TTe=[{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 OTe(e){const t=ATe(e),n=DTe(e);return $Te(t.runSync(t.parse(n),n),e)}function ATe(e){const t=e.rehypePlugins||kM,n=e.remarkPlugins||kM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...EM}:EM;return kTe().use(fNe).use(n).use(sTe,r).use(t)}function DTe(e){const t=e.children||"",n=new rK;return typeof t=="string"&&(n.value=t),n}function $Te(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||PTe;for(const m of TTe)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+ITe+m.id,void 0);return nK(e,f),qje(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 T1)if(Object.hasOwn(T1,y)&&Object.hasOwn(m.properties,y)){const x=m.properties[y],S=T1[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 c&&m.children?v.children.splice(h,1,...m.children):v.children.splice(h,1),h}}}function PTe(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||NTe.test(e.slice(0,t))?e:""}var MTe="Separator",jM="horizontal",zTe=["horizontal","vertical"],iK=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=jM,...i}=e,o=LTe(r)?r:jM,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(n6.div,{"data-orientation":o,...c,...i,ref:t})});iK.displayName=MTe;function LTe(e){return zTe.includes(e)}var FTe=iK;function B0({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return u.jsx(FTe,{"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 H0="Tabs",[UTe]=Xi(H0,[_f]),oK=_f(),[VTe,BI]=UTe(H0),aK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:d="automatic",...f}=e,m=Wc(c),[h,v]=qo({prop:r,onChange:i,defaultProp:o??"",caller:H0});return u.jsx(VTe,{scope:n,baseId:Fi(),value:h,onValueChange:v,orientation:a,dir:m,activationMode:d,children:u.jsx(Ye.div,{dir:m,"data-orientation":a,...f,ref:t})})});aK.displayName=H0;var sK="TabsList",lK=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=BI(sK,n),a=oK(n);return u.jsx(oI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(Ye.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});lK.displayName=sK;var cK="TabsTrigger",uK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=BI(cK,n),c=oK(n),d=pK(a.baseId,r),f=mK(a.baseId,r),m=r===a.value;return u.jsx(aI,{asChild:!0,...c,focusable:!i,active:m,children:u.jsx(Ye.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)})})})});uK.displayName=cK;var dK="TabsContent",fK=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,c=BI(dK,n),d=pK(c.baseId,r),f=mK(c.baseId,r),m=r===c.value,h=b.useRef(m);return b.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),u.jsx(ir,{present:i||m,children:({present:v})=>u.jsx(Ye.div,{"data-state":m?"active":"inactive","data-orientation":c.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})})});fK.displayName=dK;function pK(e,t){return`${e}-trigger-${t}`}function mK(e,t){return`${e}-content-${t}`}var BTe=aK,HTe=lK,qTe=uK,KTe=fK;function $k({className:e,...t}){return u.jsx(BTe,{"data-slot":"tabs",className:Ue("flex flex-col gap-2",e),...t})}function Pk({className:e,...t}){return u.jsx(HTe,{"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 Xs({className:e,...t}){return u.jsx(qTe,{"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 Js({className:e,...t}){return u.jsx(KTe,{"data-slot":"tabs-content",className:Ue("flex-1 outline-none",e),...t})}function hK(e,t,n){for(const r of e)if(r[t]===n)return r}const GTe=Ab("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 HI({className:e,variant:t,...n}){return u.jsx("div",{"data-slot":"alert",role:"alert",className:Ue(GTe({variant:t}),e),...n})}function ZTe({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 qI({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 YTe(e){const{user:t}=fs(),n=nx(),{instance:r,cluster:i}=qm({strict:!1}),o=n.instanceClient.defaults.baseURL;return b.useMemo(()=>{const a=_0(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}
173
+ 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 WTe({defaultApplicationName:e,formState:t,watch:n}){const r=n("applicationName")||e,i=YTe(r),o=p9(...i.map(a=>a.code));return u.jsxs(u.Fragment,{children:[u.jsxs(jl,{children:[u.jsx(Rl,{children:"Deploy with Harper CLI"}),u.jsx(Hc,{children:"Follow these steps to deploy your application using the Harper CLI"})]}),u.jsxs(ps,{className:"space-y-6",children:[i.map((a,c)=>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:c+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[c],children:u.jsx(_4,{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(HI,{className:"mt-2",children:[u.jsx(lE,{className:"w-4 h-4"}),u.jsx(qI,{children:a.alert})]})]}),u.jsx(B0,{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(iE,{className:"w-4 h-4 mr-2"}),"I Have Completed These Steps"]})]})]})}function XTe({control:e,defaultApplicationName:t}){return u.jsxs(u.Fragment,{children:[u.jsxs(jl,{children:[u.jsx(Rl,{children:"Application Name"}),u.jsx(Hc,{children:"Choose a name for your new API application"})]}),u.jsx(ps,{children:u.jsxs("div",{className:"space-y-2",children:[u.jsx($e,{control:e,name:"applicationName",render:({field:n})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoCapitalize:"words",autoComplete:"off",autoFocus:!0,placeholder:t,...n})}),u.jsx(Oe,{})]})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Use lowercase letters, numbers, underscores, and hyphens"})]})})]})}function JTe({control:e,formState:t,isImportingApplication:n,setValue:r,watch:i}){const o=i("contents.source"),a=b.useCallback(c=>{r("contents.source",c)},[r]);return u.jsxs(u.Fragment,{children:[u.jsxs(jl,{children:[u.jsx(Rl,{children:"Import Existing Application"}),u.jsx(Hc,{children:"Import from Git, NPM, or a tarball URL"})]}),u.jsxs(ps,{className:"space-y-6",children:[u.jsxs($k,{value:o,onValueChange:a,children:[u.jsxs(Pk,{className:"grid w-full grid-cols-3",children:[u.jsxs(Xs,{value:"git",children:[u.jsx(aE,{className:"w-4 h-4 mr-2"}),"Git"]}),u.jsxs(Xs,{value:"npm",children:[u.jsx(sE,{className:"w-4 h-4 mr-2"}),"NPM"]}),u.jsxs(Xs,{value:"tarball",children:[u.jsx(Ote,{className:"w-4 h-4 mr-2"}),"Tarball"]})]}),u.jsx(Js,{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:c})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Git Repository URL"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(Oe,{})]})})})}),u.jsx(Js,{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:c})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"NPM Package Reference"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(Oe,{})]})})})}),u.jsx(Js,{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:c})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Tarball URL"}),u.jsx(De,{children:u.jsx(Me,{type:"url",autoCapitalize:"none",autoComplete:"off",autoFocus:!0,...c})}),u.jsx(Oe,{})]})})})})]}),u.jsx($e,{control:e,name:"contents.installCommand",render:({field:c})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Install Command"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoCapitalize:"none",autoComplete:"off",placeholder:"npm install",...c})}),u.jsx(Oe,{})]})}),u.jsx(Te,{children:"Authorization"}),u.jsx($e,{control:e,name:"contents.requiresAuth",render:({field:c})=>u.jsxs($k,{className:"w-full pt-2 pb-0 mb-0",value:String(c.value),onValueChange:d=>c.onChange(d==="true"),children:[u.jsxs(Pk,{className:"grid w-full grid-cols-2",children:[u.jsx(Xs,{value:"false",children:"Public Access"}),u.jsx(Xs,{value:"true",children:"Requires Auth"})]}),u.jsx(Js,{value:"false",className:"space-y-4 mt-4"}),u.jsx(Js,{value:"true",className:"space-y-4 mt-4",children:u.jsx(HI,{children:u.jsx(qI,{children:u.jsxs("span",{children:["You can manage your certificates over in"," ",u.jsx(Ze,{to:"config",className:"underline",children:"Config"})," ",">"," ",u.jsx(Ze,{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(B0,{className:"bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(O4,{className:"w-4 h-4 mr-2"}),"Import Application"]})]})]})}const KI=[{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"}],QTe=Dt({type:wf("template"),id:nt("Please select a template.")}),eOe={type:"template",id:KI[0].id},tOe=Dt({type:wf("import"),source:Al(["git","npm","tarball"]),ref:nt().nonempty("Please enter a URL or package reference."),installCommand:nt(),requiresAuth:Yt()}),nOe={type:"import",source:"git",ref:"",requiresAuth:!1,installCommand:""},rOe=Dt({type:wf("cli")}),iOe={type:"cli"},oOe=Dt({applicationName:nt().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:SR("type",[QTe,tOe,rOe])});var GI="Radio",[aOe,gK]=Xi(GI),[sOe,lOe]=aOe(GI),vK=b.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:a,value:c="on",onCheck:d,form:f,...m}=e,[h,v]=b.useState(null),y=ft(t,C=>v(C)),x=b.useRef(!1),S=h?f||!!h.closest("form"):!0;return u.jsxs(sOe,{scope:n,checked:i,disabled:a,children:[u.jsx(Ye.button,{type:"button",role:"radio","aria-checked":i,"data-state":wK(i),"data-disabled":a?"":void 0,disabled:a,value:c,...m,ref:y,onClick:Re(e.onClick,C=>{i||d?.(),S&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),S&&u.jsx(xK,{control:h,bubbles:!x.current,name:r,value:c,checked:i,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});vK.displayName=GI;var yK="RadioIndicator",bK=b.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=lOe(yK,n);return u.jsx(ir,{present:r||o.checked,children:u.jsx(Ye.span,{"data-state":wK(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t})})});bK.displayName=yK;var cOe="RadioBubbleInput",xK=b.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const a=b.useRef(null),c=ft(a,o),d=RE(n),f=CU(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(Ye.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xK.displayName=cOe;function wK(e){return e?"checked":"unchecked"}var uOe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],q0="RadioGroup",[dOe]=Xi(q0,[_f,gK]),SK=_f(),_K=gK(),[fOe,pOe]=dOe(q0),CK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:a=!1,disabled:c=!1,orientation:d,dir:f,loop:m=!0,onValueChange:h,...v}=e,y=SK(n),x=Wc(f),[S,C]=qo({prop:o,defaultProp:i??null,onChange:h,caller:q0});return u.jsx(fOe,{scope:n,name:r,required:a,disabled:c,value:S,onValueChange:C,children:u.jsx(oI,{asChild:!0,...y,orientation:d,dir:x,loop:m,children:u.jsx(Ye.div,{role:"radiogroup","aria-required":a,"aria-orientation":d,"data-disabled":c?"":void 0,dir:x,...v,ref:t})})})});CK.displayName=q0;var kK="RadioGroupItem",EK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=pOe(kK,n),a=o.disabled||r,c=SK(n),d=_K(n),f=b.useRef(null),m=ft(t,f),h=o.value===i.value,v=b.useRef(!1);return b.useEffect(()=>{const y=S=>{uOe.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(aI,{asChild:!0,...c,focusable:!a,active:h,children:u.jsx(vK,{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()})})})});EK.displayName=kK;var mOe="RadioGroupIndicator",jK=b.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=_K(n);return u.jsx(bK,{...i,...r,ref:t})});jK.displayName=mOe;var hOe=CK,gOe=EK,vOe=jK;function yOe({className:e,...t}){return u.jsx(hOe,{"data-slot":"radio-group",className:Ue("grid gap-3",e),...t})}function bOe({className:e,...t}){return u.jsx(gOe,{"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(vOe,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:u.jsx(w4,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function RK(e){e.stopPropagation()}function xOe({control:e,formState:t,isCreatingFromTemplate:n}){return u.jsxs(u.Fragment,{children:[u.jsxs(jl,{children:[u.jsx(Rl,{children:"Choose a Template"}),u.jsx(Hc,{children:"Start with a pre-configured template for common use cases"})]}),u.jsxs(ps,{children:[u.jsx($e,{control:e,name:"contents.id",render:({field:r})=>u.jsx(yOe,{value:r.value,onValueChange:r.onChange,children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:KI.map(i=>u.jsxs("div",{className:"relative",children:[u.jsx(bOe,{value:i.id,id:i.id,className:"peer sr-only"}),u.jsxs(ah,{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:RK,className:"text-muted-foreground hover:text-white transition-colors -m-4 p-4",children:u.jsx(aE,{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(Zo,{variant:"outline",children:o},o))})]})]},i.id))})})}),u.jsx(B0,{className:"my-6 bg-black"}),u.jsxs(be,{className:"w-full",disabled:!t.isValid||n,children:[u.jsx(O4,{className:"w-4 h-4 mr-2"}),"Create from Template"]})]})]})}function wOe(e){const t=nx(),{reloadRootEntries:n,setFocusedItem:r,setExpandedItems:i,setSelectedItems:o}=zr(),a=b.useCallback(({project:c})=>{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()===c.toLowerCase()){r(h.name),o([h.name]),i([h.name]),e(!1),we.success("Imported successfully",{description:`${c} is now available in your ${t.entityType}!`,id:d,duration:5e3});return}we.warning("Deployment Not Detected",{description:`I searched for ${c} 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 SOe({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 _Oe(){return ct({mutationFn:SOe})}function COe(e){const{mutate:t,isPending:n}=_Oe(),r=nx(),{reloadRootEntries:i,setFocusedItem:o,setExpandedItems:a,setSelectedItems:c}=zr(),d=b.useCallback(({contents:f,project:m})=>{const h=we.loading("Creating from template...",{description:"This may take a bit.",duration:3e5}),v=hK(KI,"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),c([m]),a([m])}})},[t,r,e,i,o,a,c]);return b.useMemo(()=>({isCreatingFromTemplate:n,createFromTemplate:d}),[n,d])}async function kOe({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 IK(){return ct({mutationFn:kOe})}function EOe(e){const{mutate:t,isPending:n}=IK(),r=rr(),i=Zt(),{reloadRootEntries:o,setFocusedItem:a,setExpandedItems:c,setSelectedItems:d}=zr(),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]),c([h])},onError:()=>{we.dismiss(v)}})},[t,r,i,e,o,a,c,d]);return b.useMemo(()=>({isImportingApplication:n,importApplication:f}),[n,f])}function jOe(){const{rootEntries:e}=zr(),{organization:t,instance:n,cluster:r}=qm({strict:!1}),i=b.useMemo(()=>{const O=_0(r?.name||n?.name||t?.name||"");if(O==="")return O;let M=O,L=1;for(;hK(e,"name",M);)L+=1,M=`${O}-${L}`;return M},[e,r,n,t]),o=b.useCallback((O,M)=>{!O.applicationName&&!i?M.addIssue({code:"custom",path:["applicationName"],message:"Please name your application!"}):e.find(L=>L.name===O.applicationName)&&M.addIssue({code:"custom",path:["applicationName"],message:"That application name is already in use!"})},[i,e]),a=on({resolver:mn(oOe.superRefine(o)),defaultValues:{applicationName:"",contents:{...nOe,...iOe,...eOe}}}),{watch:c,handleSubmit:d,control:f,setValue:m,formState:h,trigger:v}=a,[y,x]=b.useState(!1),{isCreatingFromTemplate:S,createFromTemplate:C}=COe(x),{isImportingApplication:k,importApplication:E}=EOe(x),{checkCLI:j}=wOe(x),R=b.useCallback(O=>{const M=O.applicationName||i;switch(O.contents.type){case"template":{C({contents:O.contents,project:M});break}case"import":{E({contents:O.contents,project:M});break}case"cli":{j({contents:O.contents,project:M});break}}},[j,C,i,E]),T=c("contents.type"),N=b.useCallback(O=>{const M=h.isValid;m("contents.type",O),M||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(an,{...a,children:u.jsx("form",{onSubmit:d(R),className:"flex flex-col gap-4 p-4",children:u.jsxs("fieldset",{disabled:k||S||y,children:[u.jsx(Tc,{className:"bg-black-dark",children:u.jsx(XTe,{control:f,defaultApplicationName:i})}),u.jsx(Tc,{className:"bg-black-dark mt-4 pt-0",children:u.jsxs($k,{defaultValue:T,onValueChange:N,children:[u.jsxs(Pk,{className:"w-full grid grid-cols-3 mt-0",children:[u.jsxs(Xs,{value:"template",children:[u.jsx(Mee,{}),u.jsx("span",{className:"hidden sm:inline-block",children:"Templates"})]}),u.jsxs(Xs,{value:"import",children:[u.jsx(_te,{}),"Import"]}),u.jsxs(Xs,{value:"cli",children:[u.jsx(lE,{}),u.jsx("span",{className:"hidden md:inline-block",children:"Harper"})," CLI"]})]}),u.jsx("div",{className:"mx-6 mt-1",children:u.jsx(B0,{className:"bg-black"})}),u.jsx(Js,{value:"template",className:"space-y-4",children:u.jsx(xOe,{control:f,formState:h,isCreatingFromTemplate:S})}),u.jsx(Js,{value:"import",className:"space-y-4",children:u.jsx(JTe,{control:f,formState:h,isImportingApplication:k,setValue:m,watch:c})}),u.jsx(Js,{value:"cli",className:"space-y-4",children:u.jsx(WTe,{defaultApplicationName:i,formState:h,watch:c})})]})})]})})})]})}const ROe={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 IOe(){const e=Zt(),{openedEntryContents:t,openedEntry:n,restrictPackageModification:r,isSavingFile:i,saveFile:o}=zr(),{content:a,setContent:c}=Bh(!!n&&!n.package&&n.path),d=b.useCallback(C=>{c(C!==t?C:void 0)},[t,c]),f=gf(),[m,h]=b.useState(null),v=M0(n?.path),y=ROe[v]||"plaintext",x=b.useCallback((C,k)=>{h([C,k])},[]);if(b.useEffect(()=>{if(m&&f&&!n?.package&&!r)return gke(m)},[m,f,n,r]),sb("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]),sb("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(Fh,{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 NOe(){const{openedEntry:e,openedEntryContents:t}=zr(),n=gje(e?.project);return e?.path===_o?u.jsx(jOe,{}):_r(e)?u.jsx("div",{className:"directoryReadMe max-w-3xl",children:u.jsx(OTe,{urlTransform:n,children:t})}):Fq(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/${M0(e?.name)};base64,${t}`})}):u.jsx(IOe,{})}function TOe(e){let t=e?.fqdn;return t?(t.match(/^https?:\/\//i)||(t=`https://${t}`),new URL(t).toString()):null}function OOe(){const{clusterId:e,instanceId:t}=it({strict:!1}),n=eh(),{data:r}=Pt(Tl(e));return!!e&&Et.checkForFabricConnect(e)||!!t&&Et.checkForFabricConnect(t)?TOe(r):n.defaults.baseURL?n.defaults.baseURL.replace(/:9925\/?/,""):null}function AOe(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 DOe({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 NK(e,t,n,r=[]){const i=[];for(const o of e){const a=n(o,r);i.push(a);const c=o,d=c[t];d&&(a[t]=NK(d,t,n,[...r,c]))}return i}function $Oe({children:e}){const t=En(),[n,r]=b.useState(void 0),[i,o]=b.useState(void 0),{setContent:a}=Bh(n?.path),c=Zt(),d=OOe(),f=rr(),{open:m}=Er({strict:!1}),{data:h}=Wi(DOe(c)),v=b.useMemo(()=>{const F=new Set;return{rootEntries:NK(h.entries||[],"entries",(D,$)=>{const V=_r(D)&&D.entries.find(J=>J.name.toLowerCase()==="readme.md"),A=[...$.map(J=>J.name),D.name].join("/");return F.add(A),{name:D.name,path:A,project:($[0]||D)?.name,package:($[0]||D)?.package,overviewEntry:V&&!_r(V)&&{name:V.name,path:[...$.map(J=>J.name),D.name,V.name].join("/"),project:($[0]||D)?.name,package:($[0]||D)?.package}||void 0}}),pathsRegistry:F}},[h]),y=b.useCallback(async()=>f.fetchQuery({queryKey:[c.entityId,"get_components"],networkMode:"online"}),[f,c]),x=b.useCallback(F=>v.pathsRegistry.has(F),[v.pathsRegistry]),S=v.rootEntries.filter(F=>!F.package&&F.path!==_o).map(F=>F.name);let C=S[0],k=S.slice(0,1);C||(C=_o,k=[_o]);const[E,j]=_d(`FileFocused/${c.entityId}`,C),[R,T]=_d(`FolderOpened/${c.entityId}`,S),[N,O]=_d(`FileSelected/${c.entityId}`,k);b.useEffect(()=>{if(m?.length){const F=m.split("?"),te=F[0],D=F[1],$=te.split("/");if(D){const V=D.split("=");ei(V[0],V[1]==="true"?!0:V[1]==="false"?!1:V[1])}T(V=>{const A=new Set(V);for(let J=1;J<$.length;J++)A.add($.slice(0,J).join("/"));return[...A]}),O([te]),j(te),t({search:void 0})}},[t,m,T,j,O]);const M=n&&(_r(n)?n.overviewEntry?.path:n.path)||"",L=n&&(_r(n)?n.overviewEntry?.project:n.project)||"",K=n&&(_r(n)?!!n.overviewEntry?.path:!1)||!1,ee=Vq({file:M?.split("/").slice(1).join("/"),project:L,...c}),{data:q}=Pt(ake({file:M?.split("/").slice(1).join("/"),project:L,...c}));b.useEffect(function(){const te=q?.project+"/"+q?.file;let D=q?.message;te===M&&D!==void 0?(K&&d&&q&&(D=AOe(D,d,q)),o(D)):o(void 0)},[q,M,K,c]);const{mutate:Y,isPending:U}=Bq(),H=b.useCallback((F,te)=>{Y(F,{onSuccess:()=>{n?.path===te&&F.payload!==void 0&&(a(void 0),o(F.payload||void 0),f.setQueryData(ee,{...q,message:F.payload}))},onError:D=>{console.error("Error saving file:",D)}})},[ee,q,n?.path,f,Y,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===Ws||n.path===_o:!1,[n]),W=b.useMemo(()=>({rootEntries:v.rootEntries,reloadRootEntries:y,entryExists:x,focusedItem:E,setFocusedItem:j,expandedItems:R,setExpandedItems:T,selectedItems:N,setSelectedItems:O,restrictPackageModification:z,openedEntry:n,setOpenedEntry:r,openedEntryContents:i,setOpenedEntryContents:o,saveFile:H,isSavingFile:U}),[v.rootEntries,y,x,E,j,R,T,N,O,z,n,r,i,o,H,U]);return u.jsx(zq.Provider,{value:W,children:e})}function Fl(e){const t=e;if(t?.focus)RM(t);else{const n=e;n?.target?.focus&&RM(n.target)}}function RM(e){Uc(1).then(()=>{e.focus?.()})}function POe(){const{value:e,trigger:t}=zl("ShowAddDirectoryOrFileModalType",!1),n=b.useCallback(()=>{ei("ShowAddDirectoryOrFileModalType",!1),Fl(t)},[t]),{openedEntry:r,entryExists:i,reloadRootEntries:o,setFocusedItem:a,setSelectedItems:c,setExpandedItems:d}=zr(),f=Zt(),{mutate:m,isPending:h}=Bq(),v=Sl.object({name:Sl.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=on({resolver:mn(v),defaultValues:{name:""}}),x=b.useCallback(C=>{if(!r||!e)return;const k=r.path.split("/"),E=(_r(r)?k.slice(1):k.slice(1,-1)).join("/"),j=E?`${E}/${C.name}`:C.name;if(i(r.project+"/"+j)){we.error(`${bo(e)} already exists!`,{description:j});return}m({file:j,project:r.project,payload:e==="directory"?void 0:"",...f},{onSuccess:()=>{o(),n(),y.reset();const R=[r.project,E,C.name].filter(Xo).join("/");a(R),c([R]),e==="directory"&&d(T=>[...T,R])}})},[m,y,n,f,r,i,o,d,a,c,e]),S=b.useCallback(()=>{n(),y.reset()},[n,y]);return u.jsx(Fn,{onOpenChange:n,open:!!e,children:u.jsx(Un,{"aria-describedby":void 0,className:"text-white",children:u.jsx(an,{...y,children:u.jsxs("form",{onSubmit:y.handleSubmit(x),children:[u.jsxs(gr,{children:[u.jsxs($n,{children:["Add ",e]}),u.jsxs(kr,{children:["Enter the name of the ",e," you want to add:"]})]}),u.jsx($e,{control:y.control,name:"name",render:({field:C})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"Name"}),u.jsx(De,{children:u.jsx(Me,{disabled:h,type:"text",autoComplete:"off",autoCapitalize:"off",...C})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{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(Xr,{})," Add ",e]})]})})]})})})})}function MOe(){const{value:e,trigger:t}=zl("ShowDeleteDirectoryOrFileModal",!1),n=Zt(),{openedEntry:r,reloadRootEntries:i,setFocusedItem:o,setSelectedItems:a,selectedItems:c}=zr(),d=c.length>1,f=_r(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(()=>{ei("ShowDeleteDirectoryOrFileModal",!1),Fl(t)},[t]),S=b.useCallback(async()=>{x();let k=[],E=0,j=!1;const R={label:"Cancel",onClick:()=>{j=!0}},T={label:"OK",onClick:()=>{}},N="deleting-files";for(const O of c.reverse()){k=O.split("/");const M=k[0],L=k.length>1?k.slice(1).join("/"):void 0;if(we.loading(`${v} in progress...`,{id:N,description:`${E} of ${Zr(c.length,"item","items")}`,action:R}),await Lq({file:L,project:M,...n}),j)break;E+=1}if(j?we.warning(`${v} canceled!`,{id:N,description:"",action:T}):we.success(`${v} completed!`,{id:N,description:"",action:T}),k.length){const O=k.slice(0,-1).join("/");o(O||void 0),a(O?[O]:[]),i()}},[v,x,n,i,c,o,a]),C=b.useCallback(k=>{k.preventDefault(),S()},[S]);return u.jsx(Fn,{onOpenChange:x,open:e,children:u.jsxs(Un,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(gr,{children:[u.jsxs($n,{children:[v," ",y]}),u.jsxs(kr,{children:["Are you sure you want to ",v.toLowerCase()," ",d?`these ${c.length} items`:`this ${y.toLowerCase()}`,"?"]}),!h&&u.jsx(kr,{className:"whitespace-pre",children:d?c.join(`
174
+ `):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 zOe({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 LOe(){return ct({mutationFn:zOe})}function FOe(){const{value:e,trigger:t}=zl("ShowDownloadApplicationModal",!1),n=Zt(),{openedEntry:r}=zr(),{mutate:i,isPending:o,isSuccess:a}=LOe(),c=a?"Downloaded":o?"Downloading":"Download",[d,f]=b.useState(!1),m=b.useCallback(y=>{f(y.target.checked)},[]),h=b.useCallback(()=>{ei("ShowDownloadApplicationModal",!1),Fl(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(Fn,{onOpenChange:h,open:e,children:u.jsxs(Un,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(gr,{children:[u.jsx($n,{children:"Download Application"}),u.jsxs(kr,{children:["This will package up the contents of ",u.jsx("strong",{children:r?.project})," into a gzipped file."]})]}),u.jsxs(ah,{className:"flex",children:[u.jsx(Me,{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(k4,{})," ",c,o?"...":""]})]})]})})}function ma({className:e,...t}){const{formDescriptionId:n}=yx();return u.jsx("p",{"data-slot":"form-description",id:n,className:Ue("text-muted-foreground text-sm",e),...t})}function Mm(e=!1){const[t,n]=b.useState(e),r=b.useCallback(a=>{a?.preventDefault?.(),n(c=>!c)},[]),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 UOe({field:e}){const{toggled:t,toggle:n}=Mm(!1);return u.jsxs(Ne,{className:"my-4",children:[u.jsxs(Te,{onClick:n,className:_i("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Db,{}):u.jsx(vi,{})," Optional Database Name"]}),u.jsx(ma,{className:t?"":"hidden",children:'"data" is the default recommended name'}),u.jsx(De,{className:t?"":"hidden",children:u.jsx(Me,{type:"text",className:"my-1",...e})}),u.jsx(Oe,{})]})}var bb=(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))(bb||{});const K0=/^[\x20-\x2E|\x30-\x5F|\x61-\x7E]*$/,TK=nt().regex(K0,{error:"Database name cannot include backticks or forward slashes."}).max(75,{error:"Database name cannot be longer than 75 characters."}),VOe=nt().nonempty({error:"Field name is required."}).regex(K0,{error:"Field name cannot include backticks or forward slashes."}).max(250,{error:"Field name cannot be longer than 250 characters."}),OK=nt().nonempty({error:"Table name is required."}).regex(K0,{error:"Table name cannot include backticks or forward slashes."}).max(250,{error:"Table name cannot be longer than 250 characters."}),BOe=Dt({tableName:OK,databaseName:TK,expiration:uR().or(wf("")),enableRest:Yt(),sealed:Yt(),tableFields:cs(Dt({fieldName:VOe,fieldType:Al(bb),primaryKey:Yt(),nullable:Yt(),indexed:Yt(),array:Yt()})).min(1,{error:"Please add at least one field."})});function HOe({field:e}){const{toggled:t,toggle:n}=Mm(!1),r=b.useCallback(i=>e.onChange(i.target.value?parseInt(i.target.value,10):i.target.value),[]);return u.jsxs(Ne,{className:"my-4",children:[u.jsxs(Te,{onClick:n,className:_i("flex items-center gap-2",t?"":"text-muted-foreground italic"),children:[t?u.jsx(Db,{}):u.jsx(vi,{})," Optional Expiration"]}),u.jsx(ma,{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(De,{className:t?"":"hidden",children:u.jsx(Me,{...e,type:"number",min:0,step:1,className:"my-1",onChange:r})}),u.jsx(Oe,{})]})}function qOe(){const e=Wa("ShowNewTableModal",!1),{openedEntry:t,openedEntryContents:n}=zr(),{setContent:r}=Bh(!!t&&!t.package&&t.path),i=on({resolver:mn(BOe),defaultValues:{tableName:"",databaseName:"data",expiration:"",enableRest:!0,sealed:!0,tableFields:[{fieldName:"id",fieldType:bb.ID,primaryKey:!0,nullable:!0,indexed:!1,array:!1}]}}),{control:o,handleSubmit:a,formState:c}=i,{fields:d,append:f,remove:m}=aj({name:"tableFields",control:o}),h=b.useCallback(()=>{f({fieldName:"",fieldType:bb.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(Xo),k=C.length?`(${C.join(", ")})`:"",E=y.enableRest?" @export":"",j=y.sealed?" @sealed":"",R=y.tableFields.map(T=>{const N=T.array?`[${T.fieldType}]`:T.fieldType,O=T.nullable?"":"!",M=T.primaryKey?" @primaryKey":"",L=T.indexed?" @indexed":"";return`
175
+ ${T.fieldName}: ${N}${O}${M}${L}`}).join("");return`${S}
176
+ type ${y.tableName} @table${k}${E}${j} {${R}
177
+ }
178
+ `}),e()},[r,e,n]);return u.jsx(an,{...i,children:u.jsxs("form",{onSubmit:a(v),children:[u.jsx($e,{control:o,name:"tableName",render:({field:y})=>u.jsxs(Ne,{className:"my-4",children:[u.jsx(Te,{children:"Table Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",className:"my-1",...y})}),u.jsx(Oe,{})]})}),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(Ne,{children:[u.jsx(Te,{children:"Field Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",...S})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.fieldType`,render:({field:S})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Type"}),u.jsx(De,{children:u.jsxs(qi,{...S,onValueChange:S.onChange,defaultValue:S.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{})}),u.jsxs(Zi,{children:[u.jsx(At,{value:"Any",children:"Any"}),u.jsx(At,{value:"BigInt",children:"BigInt"}),u.jsx(At,{value:"Blob",children:"Blob"}),u.jsx(At,{value:"Boolean",children:"Boolean"}),u.jsx(At,{value:"Bytes",children:"Bytes"}),u.jsx(At,{value:"Date",children:"Date"}),u.jsx(At,{value:"Float",children:"Float"}),u.jsx(At,{value:"ID",children:"ID"}),u.jsx(At,{value:"Int",children:"Int"}),u.jsx(At,{value:"Long",children:"Long"}),u.jsx(At,{value:"String",children:"String"})]})]})}),u.jsx(Oe,{})]})})]}),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(Ne,{className:"inline-flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Te,{className:"flex-1 py-2.5",children:"Indexed"}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.primaryKey`,render:({field:S})=>u.jsxs(Ne,{className:"inline-flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Te,{className:"flex-1 py-2.5",children:"Primary Key"}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.nullable`,render:({field:S})=>u.jsxs(Ne,{className:"inline-flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Te,{className:"flex-1 py-2.5",children:"Nullable"}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o,name:`tableFields.${x}.array`,render:({field:S})=>u.jsxs(Ne,{className:"inline-flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:S.value,onChange:C=>S.onChange(C.target.checked)})}),u.jsx(Te,{className:"flex-1 py-2.5",children:"Array"}),u.jsx(Oe,{})]})}),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(Xr,{})," Add Another Field"]}),u.jsx("hr",{className:"my-6 border-gray-600"}),u.jsx($e,{control:o,name:"databaseName",render:({field:y})=>u.jsx(UOe,{field:y})}),u.jsx($e,{control:o,name:"expiration",render:({field:y})=>u.jsx(HOe,{field:y})}),u.jsx($e,{control:o,name:"enableRest",render:({field:y})=>u.jsxs(Ne,{className:"flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Te,{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(Oe,{})]})}),u.jsx($e,{control:o,name:"sealed",render:({field:y})=>u.jsxs(Ne,{className:"flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-5",checked:y.value,onChange:x=>y.onChange(x.target.checked)})}),u.jsxs(Te,{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(Oe,{})]})}),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(Dee,{})," Cancel"]}),u.jsxs(be,{variant:"positive",type:"submit",className:"w-full rounded-full",disabled:!c.isValid,children:[u.jsx(Xr,{})," New Table"]})]})]})})}function KOe(){const{value:e,trigger:t}=zl("ShowNewTableModal",!1),n=b.useCallback(()=>{ei("ShowNewTableModal",!1),Fl(t)},[t]);return u.jsx(Fn,{onOpenChange:n,open:e,children:u.jsxs(Un,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(gr,{children:[u.jsx($n,{children:"New Table"}),u.jsx(kr,{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(qOe,{})]})})}function GOe(){const{value:e,trigger:t}=zl("ShowRedeployApplicationModal",!1),n=rr(),r=Zt(),{openedEntry:i}=zr(),o=i?.package,{mutate:a,isPending:c}=IK(),d=on({defaultValues:{applicationUrl:o,installCommand:""}}),{control:f,handleSubmit:m,reset:h}=d;b.useEffect(()=>{h({applicationUrl:o})},[h,o]);const v=b.useCallback(()=>{ei("ShowRedeployApplicationModal",!1),Fl(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(Fn,{onOpenChange:v,open:e,children:u.jsxs(Un,{"aria-describedby":void 0,className:"text-white",children:[u.jsxs(gr,{children:[u.jsx($n,{children:"Redeploy Package"}),u.jsx(kr,{children:"Redeploy this package?"})]}),u.jsx("div",{children:u.jsx(an,{...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(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Package Reference"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoFocus:!0,...S})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:f,name:"installCommand",render:({field:S})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Install Command"}),u.jsx(De,{children:u.jsx(Me,{type:"text",placeholder:"npm install",...S})}),u.jsx(Oe,{})]})}),u.jsxs(be,{variant:"positiveOutline",type:"submit",className:"w-full rounded-full",disabled:c,children:[u.jsx(ba,{})," Redeploy Application"]}),u.jsx(be,{type:"button",variant:"ghostOutline",className:"w-full rounded-full",onClick:v,disabled:c,children:"Cancel"})]})})})]})})}function ZOe(e){return EI(e.split("/").slice(0,-1))}function YOe(e,t){return EI(ZOe(e),t)}function WOe(){const{value:e,trigger:t}=zl("ShowRenameFileModal",!1),n=b.useCallback(()=>{ei("ShowRenameFileModal",!1),Fl(t)},[t]),{openedEntry:r,entryExists:i}=zr(),o=Sl.object({name:Sl.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,c]=b.useState(!1),d=Hq(),f=on({resolver:mn(o)});b.useEffect(()=>{r?.name&&f.reset({name:r?.name})},[f,r?.name]);const m=b.useCallback(async v=>{if(!r)return;const y=YOe(r.path,v.name);if(i(y)){we.error(`${_r(r)?"Directory":"File"} already exists!`,{description:y});return}c(!0),await d([{from:r.path,to:y}]),n(),f.reset(),c(!1)},[n,i,f,r,d,c]),h=b.useCallback(()=>{n(),f.reset()},[n,f]);return u.jsx(Fn,{onOpenChange:n,open:e,children:u.jsx(Un,{"aria-describedby":void 0,className:"text-white",children:u.jsx(an,{...f,children:u.jsxs("form",{onSubmit:f.handleSubmit(m),children:[u.jsxs(gr,{children:[u.jsx($n,{children:"Rename File"}),u.jsx(kr,{children:r?.path})]}),u.jsx($e,{control:f.control,name:"name",render:({field:v})=>u.jsxs(Ne,{className:"my-2",children:[u.jsx(Te,{children:"Name"}),u.jsx(De,{children:u.jsx(Me,{disabled:a,type:"text",autoComplete:"off",autoCapitalize:"off",...v})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{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(N4,{})," Rename"]})]})})]})})})})}function XOe(){const{toggle:e,toggled:t}=oke("ApplicationsSidebarOpened",!0);return u.jsxs($Oe,{children:[u.jsx("aside",{id:"file-explorer-sidebar",className:_i("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(uje,{})}),u.jsxs("div",{className:_i("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(NOe,{}),u.jsx(hje,{toggledSidebar:t,toggleSidebar:e})]}),u.jsx(POe,{}),u.jsx(KOe,{}),u.jsx(MOe,{}),u.jsx(FOe,{}),u.jsx(GOe,{}),u.jsx(WOe,{})]})}function JOe(e){return[rt({getParentRoute:()=>e,path:"/",component:XOe})]}const nl="flex items-center p-2 rounded-lg group",rl={className:"text-white hover:bg-gray-700"},il={className:"text-black bg-white pointer-events-none cursor-default"};function QOe(){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(eAe,{}),u.jsx(tAe,{})]}),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(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:u.jsx(kl,{})})})]})}function eAe(){const e=it({strict:!1}),t=PE();return u.jsxs("div",{className:"hidden md:block pl-4 pt-4",children:[u.jsxs(Ze,{to:lr(e,"config"),className:nl,activeOptions:{exact:!0},inactiveProps:rl,activeProps:il,children:[u.jsx(b4,{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(Ze,{to:lr(e,"config/users"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(A4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config/roles"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(E4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config/ssh-keys"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(j4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}function tAe(){const e=it({strict:!1}),t=PE();return u.jsxs("ul",{className:"flex space-x-4 md:hidden py-2 px-4",children:[u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config"),className:nl,activeOptions:{exact:!0},inactiveProps:rl,activeProps:il,children:[u.jsx(b4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Overview"})]})}),t&&u.jsxs(u.Fragment,{children:[u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config/users"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(A4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Users"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config/roles"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(E4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"Roles"})]})}),u.jsx("li",{children:u.jsxs(Ze,{to:lr(e,"config/ssh-keys"),className:nl,inactiveProps:rl,activeProps:il,children:[u.jsx(j4,{className:"inline-block"})," ",u.jsx("span",{className:"ms-3",children:"SSH Keys"})]})})]})]})}async function nAe({clusterId:e,instanceId:t}){return null}function rAe(e){return{queryKey:[e.clusterId,e.instanceId],queryFn:()=>nAe(e),retry:!1}}const iAe=({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(Dr,{className:"w-10"}):t?.version||"Unknown"})]});function oAe({entityId:e,instanceClient:t}){return{queryKey:[e,"get_configuration"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"get_configuration"});return n}}}function ZI({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 aAe({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 IM(e,t){const n=NM(e),r=NM(t);return!n||!r?!1:lAe(r,n)>=0}function NM(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=V1(o[0]),c=V1(o[1]??"0"),d=V1(o[2]??"0");if(a==null||c==null||d==null)return null;const f=i?i.split(".").map(m=>sAe(m)?Number(m):m):[];return{major:a,minor:c,patch:d,pre:f}}function V1(e){return e==null||e===""||!/^\d+$/.test(e)?null:Number(e)}function sAe(e){return/^\d+$/.test(e)}function lAe(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],c=t.pre[o],d=typeof a=="number",f=typeof c=="number";if(d&&f){if(a!==c)return a<c?-1:1;continue}if(d&&!f)return-1;if(!d&&f)return 1;if(a!==c)return String(a)<String(c)?-1:1}return e.pre.length!==t.pre.length?e.pre.length<t.pre.length?-1:1:0}const cAe=({children:e})=>u.jsx(u.Fragment,{children:e});function uAe(){const{clusterId:e,instanceId:t}=it({strict:!1}),{instance:n}=qm({strict:!1}),r="Instance",i=Zt(),{version:o}=Hm({strict:!1}),a=!hd,{data:c,isLoading:d}=Pt(rAe({clusterId:e,instanceId:t})),{data:f}=Pt(aAe(i,a));c?.cluster,c?.instance;const{data:m,isLoading:h}=Pt(ZI(i)),{data:v,isLoading:y}=Pt(oAe(i));return b.useMemo(()=>{if(e&&!t)return[];if(f&&n?.licenses){const x=kf(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(cAe,{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(iAe,{loadingRegistration:h,registrationInfo:m})}),u.jsx("div",{className:"px-4 pb-4 text-right sm:col-span-1 sm:px-0",children:u.jsx(S7,{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(Dr,{className:"w-full"}),u.jsx(Dr,{className:"w-full"}),u.jsx(Dr,{className:"w-1/2"})]}):u.jsx($0,{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 Gv=j0(),dAe=[{header:"Role",accessorKey:"role",enableSorting:!1},Gv.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Ec((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),Gv.display({header:"Updated",id:"__updatedtime__",enableSorting:!1,cell:e=>Ec((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}),Gv.display({header:"Super User",id:"super_user",enableSorting:!1,cell:e=>e.row.original.permission.super_user?"Yes":"No"}),Gv.display({header:"Structure User",id:"structure_user",enableSorting:!1,cell:e=>e.row.original.permission.structure_user?"Yes":"No"})];async function fAe(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 pAe(){return ct({mutationFn:fAe})}const mAe=Dt({role:nt().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:Yt(),structure_user:Yt()});function hAe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=on({resolver:mn(mAe),defaultValues:{role:"",super_user:!1,structure_user:!1}}),i=Zt(),{mutate:o,isPending:a}=pAe(),c=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(Fn,{onOpenChange:n,open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(c),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(gr,{className:"md:col-span-2",children:[u.jsx($n,{children:"Add New Role"}),u.jsx(kr,{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(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"super_user",render:({field:f})=>u.jsxs(Ne,{className:"flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Te,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Super User"}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"structure_user",render:({field:f})=>u.jsxs(Ne,{className:"flex",children:[u.jsx(De,{children:u.jsx(Me,{type:"checkbox",className:"w-6",checked:f.value,onChange:m=>f.onChange(m.target.checked)})}),u.jsx(Te,{className:"pl-4 pr-8 flex-1 py-2.5",children:"Structure User"}),u.jsx(Oe,{})]})}),u.jsx(Zn,{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(jo,{})," Add Role"]})]})})]})})})})}function YI({entityId:e,instanceClient:t}){return{queryKey:[e,"list_roles"],queryFn:()=>gAe({instanceClient:t}),refetchInterval:1e4}}async function gAe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_roles"});return t}function vAe({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,c]=n.split(".").map(f=>parseInt(f,10)),d=n!=="2.0.000"&&o<=2&&a<=1&&c<=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]=yAe(y,v,r)}else{const y=t&&t[f]&&t[f].tables[m];i[f].tables[m]=bAe(y,v,r)}}}return i}function yAe(e,t,n){const r=e&&kf(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 bAe(e,t,n){const r=e&&kf(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 xAe({id:e,permission:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"alter_role",id:e,permission:t});return r}function wAe(){return ct({mutationFn:xAe})}async function SAe({id:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_role",id:e});return n}function _Ae(){return ct({mutationFn:SAe})}function AK({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 CAe({data:e,instanceId:t,clusterId:n,isModalOpen:r,closeModal:i,onSelectRole:o,onChangesSaved:a}){const{role:c,permission:d}=e,[f,m]=b.useState(JSON.stringify(d,null,2)),h=Zt(),[v,y]=b.useState(!0),{data:x}=Pt(AK(h)),{data:S}=Pt(ZI(h)),k=fs().user?.role?.role===e.role,[E,j]=Iq(f?.includes("attribute_name")),{mutate:R,isPending:T}=wAe(),{mutate:N}=_Ae(),O=b.useCallback(Y=>{y(Y.length===0)},[y]),M=b.useMemo(()=>JSON.stringify(x&&S&&vAe({instanceDatabaseMap:x,currentRolePermissions:f&&Mh(f)||d,version:S.version,showAttributes:E}),null,2),[d,x,S,E,f]);b.useEffect(()=>{m(M)},[M]);const L=b.useCallback(Y=>{if(Y){const U=JSON.parse(Y);if(U.super_user||U.structure_user||U.cluster_user)for(const H in U)(H!=="super_user"&&H!=="structure_user"&&H!=="cluster_user"||U[H]===!1)&&delete U[H];R({id:e.id,permission:U,...h},{onSuccess:()=>{we.success("Role updated successfully!"),o(void 0),a()}})}},[R,e.id,h,a,o]),K=b.useCallback(()=>{N({id:e.id,...h},{onSuccess:()=>{we.success("Role deleted successfully!"),o(void 0),a()}})},[e.id,N,h,a,o]),ee=b.useCallback(()=>{f&&v&&L(f)},[f,L,v]),q=b.useCallback(()=>{K()},[K]);return u.jsx(Fn,{onOpenChange:i,open:r,children:u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsxs($n,{children:[k?"View":"Edit",' Role "',c,'"']}),u.jsx(kr,{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."}),M?u.jsx(Fh,{theme:"vs-dark",height:"400px",defaultLanguage:"json",value:f,options:k?{readOnly:!0}:void 0,onValidate:O,onChange:m,defaultValue:M}):u.jsx(Dr,{}),u.jsx(Zn,{children:!k&&u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(be,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:q,disabled:T,children:"Delete Role"}),u.jsx("div",{className:"grow"}),u.jsxs(ah,{className:"flex",children:[u.jsx(Me,{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:T||!v,children:"Save Changes"})]})})]})})}function TM(){const e=En(),{clusterId:t,instanceId:n,roleId:r}=it({strict:!1}),i=Zt(),{data:o,refetch:a,isFetching:c,isRefetching:d}=Wi(YI(i)),f=b.useMemo(()=>o?.find(j=>j.id===r),[o,r]),m=b.useCallback(j=>{const R=[r?"..":"",j].filter(Boolean);e({to:R.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=Ml(a);return u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{columns:dAe,data:o,isFetching:c,onRowClick:C,children:[u.jsxs(be,{variant:"defaultOutline",onClick:E,accessKey:"r",disabled:c||d,children:[u.jsx(ba,{}),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(Xr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(hAe,{isModalOpen:v,onChangesSaved:S,setIsModalOpen:y}),h&&u.jsx(CAe,{instanceId:n,clusterId:t,isModalOpen:h,closeModal:k,data:f,onSelectRole:m,onChangesSaved:()=>a()})]})}async function kAe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_ssh_keys"});return t}function EAe(e){return{queryKey:[e.entityId,"list_ssh_keys"],queryFn:()=>kAe(e)}}const jAe=[{header:"SSH Key Name",accessorKey:"name",enableSorting:!1}];function xb({className:e,...t}){return u.jsx("textarea",{"data-slot":"input",className:Ue(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
179
+ selection:text-primary-foreground
180
+ dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
181
+ dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
182
+ aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
183
+ flex w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
184
+ file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
185
+ focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
186
+ 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 RAe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"get_ssh_known_hosts"});return t}function IAe(e){return{queryKey:[e.entityId,"get_ssh_known_hosts"],queryFn:()=>RAe(e)}}const NAe=Dt({known_hosts:nt().trim()});async function TAe(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 OAe(){return ct({mutationFn:TAe})}function AAe(){const e=Zt(),{data:t}=Wi(IAe(e)),n=on({resolver:mn(NAe),defaultValues:{known_hosts:t?.known_hosts||""}}),{mutate:r,isPending:i}=OAe(),o=b.useCallback(async a=>{const{known_hosts:c}=a;c&&r({known_hosts:c.trim()+`
187
+ `,...e},{onSuccess:()=>{n.reset(a),we.success("Known hosts saved!")}})},[r,n,e]);return u.jsx(an,{...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(Ne,{className:"md:col-span-2 gap-0",children:[u.jsx(Te,{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(ma,{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(De,{children:u.jsx(xb,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:10,...a})}),u.jsx(Oe,{}),u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full mt-2",disabled:i||!n.formState.isDirty||!n.formState.isValid,children:[u.jsx(jo,{})," ",i?"Saving":"Save"," Known Hosts",i?"...":""]})]})]})})})})}const DAe=Dt({name:nt().trim().min(1).regex(/^[a-zA-Z0-9-_]*$/,{error:"Can only contain letters, numbers, dashes and underscores."}),key:nt().min(1).trim(),host:nt().min(1).trim(),hostname:nt().min(1).trim(),known_hosts:nt().trim().optional()});async function $Ae(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 PAe(){return ct({mutationFn:$Ae})}function MAe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=on({resolver:mn(DAe),defaultValues:{name:"",key:"",host:"",hostname:"",known_hosts:""}}),i=Zt(),{mutate:o,isPending:a}=PAe(),c=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()+`
188
+ `,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(Fn,{onOpenChange:n,open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...r,children:u.jsxs("form",{onSubmit:r.handleSubmit(c),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsxs(gr,{className:"md:col-span-2",children:[u.jsx($n,{children:"Add New SSH Key"}),u.jsx(kr,{children:"Enter the details of your SSH Key below."})]}),u.jsx($e,{control:r.control,name:"name",render:({field:f})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",autoFocus:!0,...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"key",render:({field:f})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Key"}),u.jsx(ma,{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(De,{children:u.jsx(xb,{autoComplete:"off",autoCapitalize:"off",rows:3,...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"host",render:({field:f})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Host"}),u.jsx(ma,{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(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"hostname",render:({field:f})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Hostname"}),u.jsx(ma,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:r.control,name:"known_hosts",render:({field:f})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Known Hosts"}),u.jsx(ma,{children:"Optionally, append known hosts, one per line. GitHub known hosts should resolve automatically."}),u.jsx(De,{children:u.jsx(xb,{autoComplete:"off",autoCapitalize:"off",className:"whitespace-nowrap",rows:3,...f})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{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(jo,{})," Add SSH Key"]})]})})]})})})})}async function zAe(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 LAe(){return ct({mutationFn:zAe})}async function FAe({name:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"get_ssh_key",name:e});return n}function UAe(e){return{queryKey:[e.entityId,"get_ssh_key"],queryFn:()=>FAe(e),refetchInterval:1e4}}const VAe=Dt({name:nt().trim(),key:nt().min(1).trim()});async function BAe(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 HAe(){return ct({mutationFn:BAe})}function qAe({data:e,isModalOpen:t,closeModal:n,onSelectSSHKey:r,onChangesSaved:i}){const{name:o}=e,a=on({resolver:mn(VAe),defaultValues:{name:o,key:""}}),c=Zt(),{data:d}=Pt(UAe({...c,name:o})),{mutate:f,isPending:m}=HAe(),{mutate:h}=LAe(),v=b.useCallback(async({key:x})=>{x&&f({name:o,key:x.trim()+`
189
+ `,...c},{onSuccess:()=>{we.success("SSH Key updated successfully!"),r(void 0),i()}})},[f,o,c,r,i]),y=b.useCallback(()=>{h({name:o,...c},{onSuccess:()=>{we.success("SSH Key deleted successfully!"),r(void 0),i()}})},[o,h,c,i,r]);return u.jsx(Fn,{onOpenChange:n,open:t,children:u.jsx(Un,{className:"sm:max-w-[750px]","aria-describedby":void 0,children:u.jsx(an,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(v),className:"grid gap-4 my-4 md:grid-cols-2",children:[u.jsx($n,{children:"Edit SSH Key"}),u.jsx($e,{control:a.control,name:"name",render:({field:x})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Name"}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",readOnly:!0,disabled:!0,...x})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a.control,name:"key",render:({field:x})=>u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Key"}),u.jsx(ma,{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(De,{children:u.jsx(xb,{autoComplete:"off",autoCapitalize:"off",autoFocus:!0,rows:3,...x})}),u.jsx(Oe,{})]})}),u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Host"}),u.jsx(ma,{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(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.host||"",disabled:!0,readOnly:!0})}),u.jsx(Oe,{})]}),u.jsxs(Ne,{className:"md:col-span-2",children:[u.jsx(Te,{className:"pb-1",children:"Hostname"}),u.jsx(ma,{children:'When making the request, the actual hostname to use, i.e. "github.com".'}),u.jsx(De,{children:u.jsx(Me,{type:"text",autoComplete:"off",autoCapitalize:"off",value:d?.hostname||"",disabled:!0,readOnly:!0})}),u.jsx(Oe,{})]}),u.jsxs(Zn,{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 OM(){const e=En(),{keyName:t}=it({strict:!1}),n=Zt(),{data:r,refetch:i,isFetching:o,isRefetching:a}=Pt(EAe(n)),c=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&&!!c,[m,h]=b.useState(!1),v=b.useCallback(()=>{h(!0)},[h]),y=Ml(i);return u.jsxs(u.Fragment,{children:[u.jsxs(jf,{columns:jAe,data:r||[],isFetching:o,onRowClick:d,children:[u.jsx(Ze,{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(ba,{}),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(Xr,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),m&&u.jsx(MAe,{isModalOpen:m,onChangesSaved:i,setIsModalOpen:h}),f&&u.jsx(qAe,{isModalOpen:f,closeModal:d,data:c,onSelectSSHKey:d,onChangesSaved:i}),u.jsx(b.Suspense,{fallback:u.jsx(eo,{text:"Loading..."}),children:u.jsx(AAe,{})})]})}const AM=j0(),KAe=[{header:"Username",accessorKey:"username",enableSorting:!1},AM.display({header:"Role",enableSorting:!1,id:"role",cell:e=>e.row.original.role.role}),{header:"Active",accessorKey:"active",enableSorting:!1},AM.display({header:"Created",enableSorting:!1,id:"__createdtime__",cell:e=>Ec((Date.now()-e.row.original.__createdtime__)/1e3,e.row.original.__createdtime__)}),{header:"Updated",accessorKey:"__updatedtime__",enableSorting:!1,cell:e=>Ec((Date.now()-e.row.original.__updatedtime__)/1e3,e.row.original.__updatedtime__)}];function GAe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const r=Zt(),{data:i}=Wi(YI(r)),o=on({resolver:mn(md),defaultValues:{username:"",role:"",password:"",confirmPassword:""}}),{mutate:a,isPending:c}=qCe(),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(Fn,{onOpenChange:n,open:e,children:u.jsx(Un,{"aria-describedby":void 0,children:u.jsx(an,{...o,children:u.jsxs("form",{onSubmit:o.handleSubmit(d),className:"grid gap-4 my-4",children:[u.jsx(gr,{children:u.jsx($n,{children:"Add New User"})}),u.jsx($e,{control:o.control,name:"username",render:({field:f})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Username"}),u.jsx(De,{children:u.jsx(Me,{type:"text",enterKeyHint:"next",autoComplete:"username",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o.control,name:"password",render:({field:f})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o.control,name:"confirmPassword",render:({field:f})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...f})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:o.control,name:"role",render:({field:f})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...f,onValueChange:m=>f.onChange(m),children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Role"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(yI,{children:"Role"}),i?.map(m=>u.jsx(At,{value:m.id,children:m.role},m.id))]})})]})})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",disabled:c,children:[u.jsx(jo,{})," Add User"]})})})]})})})})}const ZAe=Dt({username:md.shape.username,role:md.shape.role,newPassword:md.shape.password.or(Em()).optional(),confirmPassword:md.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 YAe({data:e,onUserUpdated:t}){const n=Zt(),{data:r}=Wi(YI(n)),{mutate:i,isPending:o}=KCe(),a=on({resolver:mn(ZAe),defaultValues:{username:e.username,role:e.role.role,newPassword:"",confirmPassword:""}}),c=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(an,{...a,children:u.jsxs("form",{onSubmit:a.handleSubmit(c),className:"grid gap-4 my-4",children:[u.jsx(gr,{children:u.jsx($n,{children:"Edit User"})}),u.jsx($e,{control:a.control,name:"username",render:({field:d})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Username"}),u.jsx(De,{children:u.jsx(Me,{type:"text",enterKeyHint:"next",autoComplete:"username",disabled:!0,readOnly:!0,...d})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a.control,name:"newPassword",render:({field:d})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Change Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a.control,name:"confirmPassword",render:({field:d})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Confirm Password"}),u.jsx(De,{children:u.jsx(Me,{type:"password",enterKeyHint:"next",autoComplete:"new-password",...d})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:a.control,name:"role",render:({field:d})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Role"}),u.jsx(b.Suspense,{fallback:u.jsx(Dr,{}),children:u.jsx(De,{children:u.jsxs(qi,{...d,onValueChange:f=>d.onChange(f),children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Choose Role"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(yI,{children:"Role"}),r?.map(f=>u.jsx(At,{value:f.id,children:f.role},f.id))]})})]})})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(be,{variant:"submit",className:"rounded-full",disabled:o,children:[u.jsx(jo,{})," Save Changes"]})})})]})})}const WAe=Dt({username:XR,confirmUsernameForDeletion:nt().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 XAe({data:e,onUserDeleted:t}){const{mutate:n,isPending:r}=GCe(),i=on({resolver:mn(WAe),defaultValues:{username:e.username,confirmUsernameForDeletion:""}}),o=nx(),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(an,{...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:c})=>u.jsxs(Ne,{children:[u.jsx(Te,{className:"pb-1",children:"Confirm Username"}),u.jsx(De,{children:u.jsx(Me,{type:"text",enterKeyHint:"next",autoComplete:"username",...c})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{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 JAe({closeModal:e,clusterId:t,instanceId:n,data:r,isModalOpen:i,onUserDeleted:o,onUserUpdated:a}){const f=!(fs().user?.username===r.username);return u.jsx(Fn,{onOpenChange:e,open:i,children:u.jsxs(Un,{className:"sm:max-w-[750px]",children:[u.jsx(YAe,{data:r,onUserUpdated:a}),f&&u.jsx(XAe,{data:r,onUserDeleted:o})]})})}function QAe({entityId:e,instanceClient:t}){return{queryKey:[e,"list_users"],queryFn:()=>eDe({instanceClient:t}),refetchInterval:1e4}}async function eDe({instanceClient:e}){const{data:t}=await e.post("/",{operation:"list_users"});return t}function DM(){const e=En(),{instanceId:t,clusterId:n,username:r}=it({strict:!1}),i=Zt(),{data:o,refetch:a,isFetching:c,isRefetching:d}=Wi(QAe(i)),f=b.useMemo(()=>o?.find(O=>O.username===r),[o,r]),m=b.useCallback(O=>{const M=[r?"..":"",O].filter(Boolean);e({to:M.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(O=>{m(O.original.username)},[m]),j=b.useCallback(()=>{m(void 0)},[m]),R=b.useCallback(()=>{a(),m(void 0)},[m,a]),T=b.useCallback(()=>{a(),m(void 0)},[m,a]),N=Ml(a);return u.jsxs(b.Suspense,{fallback:u.jsx(eo,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(jf,{data:o,isFetching:c||d,columns:KAe,onRowClick:E,sortingState:S,children:[u.jsxs(be,{variant:"defaultOutline",onClick:N,accessKey:"r",disabled:c||d,children:[u.jsx(ba,{})," ",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(Xr,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),u.jsx(GAe,{isModalOpen:v,onChangesSaved:k,setIsModalOpen:y}),h&&u.jsx(JAe,{instanceId:t,clusterId:n,closeModal:j,data:f,isModalOpen:h,onUserDeleted:T,onUserUpdated:R})]})}function my({context:e,params:t}){const n=sU(t);return e.queryClient.ensureQueryData(ZI(n))}function tDe(e){const t=rt({getParentRoute:()=>e,path:"config",component:QOe}),n=rt({getParentRoute:()=>t,path:"/",component:uAe,loader:my}),r=rt({getParentRoute:()=>t,path:"roles",component:TM}),i=rt({getParentRoute:()=>t,path:"roles/$roleId",component:TM}),o=rt({getParentRoute:()=>t,path:"users",component:DM}),a=rt({getParentRoute:()=>t,path:"users/$username",component:DM}),c=rt({getParentRoute:()=>t,path:"ssh-keys",component:OM}),d=rt({getParentRoute:()=>t,path:"ssh-keys/$keyName",component:OM});return t.addChildren([n,r,i,o,a,c,d])}function Mk({clusterId:e,databaseName:t,instanceId:n,organizationId:r,tableName:i}){const o=["databases",t,i].filter(Xo).join("/");return lr({organizationId:r,instanceId:n,clusterId:e},o)}function nDe(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var WI="ScrollArea",[DK]=Xi(WI),[rDe,To]=DK(WI),$K=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[c,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,R]=b.useState(0),[T,N]=b.useState(!1),[O,M]=b.useState(!1),L=ft(t,ee=>d(ee)),K=Wc(i);return u.jsx(rDe,{scope:n,type:r,dir:K,scrollHideDelay:o,scrollArea:c,viewport:f,onViewportChange:m,content:h,onContentChange:v,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:T,onScrollbarXEnabledChange:N,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:O,onScrollbarYEnabledChange:M,onCornerWidthChange:E,onCornerHeightChange:R,children:u.jsx(Ye.div,{dir:K,...a,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})})});$K.displayName=WI;var PK="ScrollAreaViewport",MK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=To(PK,n),c=b.useRef(null),d=ft(t,c,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(Ye.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})})]})});MK.displayName=PK;var ja="ScrollAreaScrollbar",zK=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=To(ja,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,c=e.orientation==="horizontal";return b.useEffect(()=>(c?o(!0):a(!0),()=>{c?o(!1):a(!1)}),[c,o,a]),i.type==="hover"?u.jsx(iDe,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx(oDe,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(LK,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(XI,{...r,ref:t}):null});zK.displayName=ja;var iDe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=To(ja,e.__scopeScrollArea),[o,a]=b.useState(!1);return b.useEffect(()=>{const c=i.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),a(!0)},m=()=>{d=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",m),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(ir,{present:n||o,children:u.jsx(LK,{"data-state":o?"visible":"hidden",...r,ref:t})})}),oDe=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=To(ja,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Z0(()=>d("SCROLL_END"),100),[c,d]=nDe("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(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,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(ir,{present:n||c!=="hidden",children:u.jsx(XI,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),LK=b.forwardRef((e,t)=>{const n=To(ja,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=b.useState(!1),c=e.orientation==="horizontal",d=Z0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?f:m)}},10);return Qd(n.viewport,d),Qd(n.content,d),u.jsx(ir,{present:r||o,children:u.jsx(XI,{"data-state":o?"visible":"hidden",...i,ref:t})})}),XI=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=To(ja,e.__scopeScrollArea),o=b.useRef(null),a=b.useRef(0),[c,d]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=HK(c.viewport,c.content),m={...r,sizes:c,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 dDe(v,a.current,c,y)}return n==="horizontal"?u.jsx(aDe,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,y=$M(v,c,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(sDe,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,y=$M(v,c);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}),aDe=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=To(ja,e.__scopeScrollArea),[a,c]=b.useState(),d=b.useRef(null),f=ft(t,d,o.onScrollbarXChange);return b.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),u.jsx(UK,{"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":G0(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),KK(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:Sb(a.paddingLeft),paddingEnd:Sb(a.paddingRight)}})}})}),sDe=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=To(ja,e.__scopeScrollArea),[a,c]=b.useState(),d=b.useRef(null),f=ft(t,d,o.onScrollbarYChange);return b.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),u.jsx(UK,{"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":G0(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),KK(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:Sb(a.paddingTop),paddingEnd:Sb(a.paddingBottom)}})}})}),[lDe,FK]=DK(ja),UK=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:m,onResize:h,...v}=e,y=To(ja,n),[x,S]=b.useState(null),C=ft(t,L=>S(L)),k=b.useRef(null),E=b.useRef(""),j=y.viewport,R=r.content-r.viewport,T=In(m),N=In(d),O=Z0(h,10);function M(L){if(k.current){const K=L.clientX-k.current.left,ee=L.clientY-k.current.top;f({x:K,y:ee})}}return b.useEffect(()=>{const L=K=>{const ee=K.target;x?.contains(ee)&&T(K,R)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[j,x,R,T]),b.useEffect(N,[r,N]),Qd(x,O),Qd(y.content,O),u.jsx(lDe,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:In(o),onThumbPointerUp:In(a),onThumbPositionChange:N,onThumbPointerDown:In(c),children:u.jsx(Ye.div,{...v,ref:C,style:{position:"absolute",...v.style},onPointerDown:Re(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),k.current=x.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),M(L))}),onPointerMove:Re(e.onPointerMove,M),onPointerUp:Re(e.onPointerUp,L=>{const K=L.target;K.hasPointerCapture(L.pointerId)&&K.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=E.current,y.viewport&&(y.viewport.style.scrollBehavior=""),k.current=null})})})}),wb="ScrollAreaThumb",VK=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=FK(wb,e.__scopeScrollArea);return u.jsx(ir,{present:n||i.hasThumb,children:u.jsx(cDe,{ref:t,...r})})}),cDe=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=To(wb,n),a=FK(wb,n),{onThumbPositionChange:c}=a,d=ft(t,h=>a.onThumbChange(h)),f=b.useRef(void 0),m=Z0(()=>{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=fDe(h,c);f.current=y,c()}};return c(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[o.viewport,m,c]),u.jsx(Ye.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)})});VK.displayName=wb;var JI="ScrollAreaCorner",BK=b.forwardRef((e,t)=>{const n=To(JI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(uDe,{...e,ref:t}):null});BK.displayName=JI;var uDe=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=To(JI,n),[o,a]=b.useState(0),[c,d]=b.useState(0),f=!!(o&&c);return Qd(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),d(m)}),Qd(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),a(m)}),f?u.jsx(Ye.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Sb(e){return e?parseInt(e,10):0}function HK(e,t){const n=e/t;return isNaN(n)?0:n}function G0(e){const t=HK(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function dDe(e,t,n,r="ltr"){const i=G0(n),o=i/2,a=t||o,c=i-a,d=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return qK([d,f],h)(e)}function $M(e,t,n="ltr"){const r=G0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,c=o-r,d=n==="ltr"?[0,a]:[a*-1,0],f=ik(e,d);return qK([0,a],[0,c])(f)}function qK(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 KK(e,t){return e>0&&e<t}var fDe=(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,c=n.top!==o.top;(a||c)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Z0(e,t){const n=In(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 Qd(e,t){const n=In(t);nr(()=>{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 pDe=$K,mDe=MK,hDe=BK;function gDe({className:e,children:t,...n}){return u.jsxs(pDe,{"data-slot":"scroll-area",className:Ue("relative",e),...n,children:[u.jsx(mDe,{"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(vDe,{}),u.jsx(hDe,{})]})}function vDe({className:e,orientation:t="vertical",...n}){return u.jsx(zK,{"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(VK,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}async function yDe({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 bDe(){return ct({mutationFn:yDe})}const Zv=Dt({databaseName:TK,tableName:OK,primaryKey:nt().regex(K0,{error:"Primary key cannot include backticks or forward slashes."}).max(250,{error:"Primary key cannot be longer than 250 characters."})});function xDe({databaseName:e,onSelectTable:t}){const n=rr(),r=Zt(),i=xn(),[o,a]=b.useState(!1),c=on({resolver:mn(Zv),defaultValues:{databaseName:e||"",tableName:"",primaryKey:""}}),{mutate:d}=bDe(),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),c.reset(),t(h,v),await i.invalidate()}})};return u.jsxs(Fn,{open:o,onOpenChange:a,children:[u.jsx(k8,{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(Xr,{}),u.jsxs("span",{children:["Create a ",u.jsx("u",{children:"T"}),"able"]})]})})}),u.jsxs(Un,{className:"sm:max-w-[425px]",children:[u.jsxs(gr,{children:[u.jsx($n,{children:"Create a New Table"}),u.jsx(kr,{children:"What would you like to create?"})]}),u.jsx(an,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(f),className:"grid gap-6 text-white",children:[u.jsx($e,{control:c.control,name:"tableName",render:({field:m})=>u.jsxs(Ne,{className:"",children:[u.jsx(Te,{className:"pb-1",children:"Table Name"}),u.jsx(De,{children:u.jsx(Me,{...m,type:"text",maxLength:Zv.shape.tableName.maxLength,autoFocus:!0,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:c.control,name:"primaryKey",render:({field:m})=>u.jsxs(Ne,{className:"",children:[u.jsx(Te,{className:"pb-1",children:"Primary Key"}),u.jsx(De,{children:u.jsx(Me,{...m,placeholder:"id",type:"text",maxLength:Zv.shape.primaryKey.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:c.control,name:"databaseName",render:({field:m})=>u.jsxs(Ne,{className:"",children:[u.jsx(Te,{className:"pb-1",children:"Database Name"}),u.jsx(De,{children:u.jsx(Me,{...m,type:"text",placeholder:"data",maxLength:Zv.shape.databaseName.maxLength,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})}),u.jsx(Oe,{})]})}),u.jsx(Zn,{children:u.jsxs(be,{type:"submit",variant:"submit",className:"rounded-full",children:[u.jsx(dne,{}),"Create New Table"]})})]})})]})]})}function wDe({instanceDatabaseMap:e}){const t=xn(),n=!e,r=it({strict:!1}),i=En(),o=gf(),{databaseNames:a,tableNames:c}=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:Mk({...r,databaseName:m,tableName:h[0]})}):t.invalidate()},[e,r,t,i]),f=b.useCallback((m,h)=>{i({to:Mk({...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(Dr,{className:"w-full h-9 m-0 rounded-md bg-gray-700"}):u.jsx("div",{className:"flex space-x-2",children:u.jsxs(qi,{name:"databaseSelect",value:r.databaseName||"",disabled:a.length===0,onValueChange:d,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select a Database"})}),u.jsx(Zi,{children:u.jsx(Yo,{children:a.map(m=>u.jsx(At,{value:m,children:m},m))})})]})}),n?u.jsx(Dr,{className:"w-full min-h-80 rounded-md bg-gray-700 mb-0"}):u.jsxs(gDe,{className:"border rounded-md min-h-80 border-grey-700 mt-4",children:[c.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!'})]}):c.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:c.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(vi,{})})]})},m))})]}),o&&u.jsx(xDe,{databaseName:r.databaseName,onSelectTable:f})]})}function SDe(e){if(!e)return{dataTableColumns:[],hashAttribute:""};const{hash_attribute:t,attributes:n}=e,r=[],i=[],o=[],a=[];for(let c=n.length-1;c>=0;c--){const{attribute:d,type:f,is_primary_key:m,indexed:h}=n[c],v={header:d,accessorKey:d,enableSorting:!!(m||h),enableColumnFilter:!!(m||h),size:_De(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 _De(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 CDe({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 kDe(){return ct({mutationFn:CDe})}function EDe({isModalOpen:e,instanceTable:t,setIsModalOpen:n,refreshTable:r}){const{mutate:i,isPending:o}=kDe(),a=Zt(),[c,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]=jDe(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&&c){const E=JSON.parse(f),j=Array.isArray(E)?E:[E],R=we.loading(`Adding ${j.length} records...`);i({...a,databaseName:t.schema,tableName:t.name,records:j},{onSuccess:T=>{r(),T.skipped_hashes?.length||n(!1),x(T.skipped_hashes),(T.skipped_hashes?.length>0?we.warning:we.success)(T.skipped_hashes?.length>0?"Warning!":"Success!",{id:R,description:u.jsxs(u.Fragment,{children:[T.inserted_hashes.length>0&&u.jsxs("p",{children:["Added ",Zr(T.inserted_hashes.length,"record","records")]}),T.skipped_hashes.length>0&&u.jsxs("p",{children:["Skipped ",Zr(T.skipped_hashes.length,"record","records")]})]})})}})}},[f,i,a,t.name,t.schema,c,r,n]);return u.jsx(Fn,{onOpenChange:n,open:e,children:u.jsxs(Un,{"aria-describedby":void 0,onEscapeKeyDown:E=>{h&&E.preventDefault()},children:[u.jsx(gr,{children:u.jsxs($n,{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($0,{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(HI,{className:"mt-2",children:[u.jsx(lE,{className:"w-4 h-4"}),u.jsxs(ZTe,{children:["Skipped ",y.length===1?"Hash":"Hashes"," Detected"]}),u.jsx(qI,{className:"max-h-36 overflow-auto",children:u.jsx("ol",{children:y.map(E=>u.jsx("li",{children:E},E))})})]}),u.jsx(Zn,{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||!c||o,children:[u.jsx(jo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})})})]})})}function jDe(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 RDe({databaseName:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:"drop_database",database:e,replicated:t});return r}function IDe(){return ct({mutationFn:RDe})}function NDe({databaseName:e,onDeleted:t}){const{value:n,trigger:r}=zl("ShowDeleteDatabase",!1),i=b.useCallback(()=>{ei("ShowDeleteDatabase",!1),Fl(r)},[r]),o=gf(),a=rr(),c=Zt(),d=xn(),{mutate:f,isPending:m}=IDe(),h=b.useCallback(()=>{f({databaseName:e,...c,replicated:c.entityType==="cluster"},{onSuccess:async()=>{i(),await a.invalidateQueries({queryKey:[c.entityId,"describe_all"],refetchType:"all"}),await d.invalidate(),we.success(`Database ${e} dropped successfully`),t("database")}})},[i,e,f,c,t,a,d]);return!o||!e?u.jsx(u.Fragment,{}):u.jsx(b0,{typeOfThingBeingDeleted:"database",nameOfThingBeingDeleted:e,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:n,setIsModalOpen:i,deletionConfirmed:h,deletionPending:m})}async function TDe({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 ODe(){return ct({mutationFn:TDe})}function ADe({databaseName:e,tableName:t,onDeleted:n}){const{value:r,trigger:i}=zl("ShowDeleteTable",!1),o=b.useCallback(()=>{ei("ShowDeleteTable",!1),Fl(i)},[i]),a=gf(),c=rr(),d=Zt(),f=xn(),{mutate:m,isPending:h}=ODe(),v=b.useCallback(()=>{m({databaseName:e,tableName:t,...d,replicated:d.entityType==="cluster"},{onSuccess:async()=>{o(),await c.invalidateQueries({queryKey:[d.entityId,"describe_all"],refetchType:"all"}),await f.invalidate(),we.success(`Table ${t} dropped successfully`),n("table")}})},[o,e,m,d,n,c,f,t]);return!a||!e?u.jsx(u.Fragment,{}):u.jsx(b0,{typeOfThingBeingDeleted:"table",nameOfThingBeingDeleted:`${e} > ${t}`,transitiveVerb:"Drop",presentParticiple:"Dropping",isModalOpen:r,setIsModalOpen:o,deletionConfirmed:v,deletionPending:h})}function DDe({canEditRecords:e,canDeleteRecords:t,setIsModalOpen:n,isModalOpen:r,hashAttribute:i,data:o,onSaveChanges:a,onDeleteRecord:c,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__:R,...T})=>T);return JSON.stringify(E,null,4)},[o]),k=b.useCallback(E=>{y(!0),h(E.length===0)},[h]);return u.jsx(Fn,{onOpenChange:n,open:r,children:u.jsxs(Un,{"aria-describedby":void 0,onEscapeKeyDown:e?E=>{v&&E.preventDefault()}:void 0,children:[u.jsx(gr,{children:u.jsxs($n,{children:[e?"Edit":"View"," Row"]})}),o?u.jsx($0,{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(eo,{}),u.jsx(Zn,{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&&c([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(jo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"S"}),"ave Changes"]})]})]})})]})})}async function $De(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 PDe(){return ct({mutationFn:$De})}const MDe=Dt({fileData:nt(),database:nt(),table:nt()});function zDe({setIsModalOpen:e,isModalOpen:t,onSaveChanges:n,database:r,table:i}){const[o,a]=b.useState(null),c=Zt(),{mutate:d,isPending:f}=PDe(),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=on({resolver:mn(MDe),defaultValues:{database:r,table:i,fileData:""}}),v=y=>{d({fileData:y.fileData,database:r,table:i,...c},{onSuccess:({message:x})=>{h.reset(),a(null),n(x)}})};return u.jsx(Fn,{onOpenChange:()=>{e(!1),h.reset()},open:t,children:u.jsxs(Un,{children:[u.jsxs(gr,{children:[u.jsx($n,{children:"Import CSV"}),u.jsx(kr,{children:"Upload a CSV file to import data into the table."})]}),u.jsx(an,{...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(Ne,{className:"relative",children:[u.jsx(Te,{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(De,{children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[u.jsx(S4,{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(Me,{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(Oe,{})]})})}),u.jsx(Zn,{className:"mt-4",children:u.jsxs(be,{variant:"submit",className:"rounded-full",accessKey:"u",disabled:!o||f,children:[u.jsx(jo,{}),u.jsxs("span",{children:[u.jsx("u",{children:"U"}),"pload CSV"]})]})})]})})]})})}async function LDe({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 FDe(){return ct({mutationFn:LDe})}function UDe({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 VDe=["1","bet","k","ok","si","tru","true","yes","yup"];function BDe(e){const t=e.toLowerCase().trim();return VDe.includes(t)}function PM(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function HDe(e){if(e.startsWith("0.")&&PM(e))return!0;const t=e.toUpperCase().includes("E");return!(e!=="0"&&e.startsWith("0"))&&!t&&PM(e)}const MM={true:!0,TRUE:!0,false:!1,FALSE:!1,undefined:null,null:null,NULL:null,NaN:NaN},qDe=/^((\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 KDe(e){return e==null||e===""||typeof e!="string"?e:MM[e]!==void 0?MM[e]:HDe(e)?Number(e):qDe.test(e)?new Date(e):e}function GDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,conditions:o,sort:a,pageIndex:c,pageSize:d,onlyIfCached:f}=e;return{enabled:t&&!!o,queryKey:[n,r,i,"search_by_conditions",o,a.attribute||"default",a.descending||!1,c||0,d||0,f],staleTime:6e4,gcTime:5e3,retry:!1,queryFn:()=>GK(e)}}function GK({instanceClient:e,databaseName:t,tableName:n,conditions:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:c,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:c,noCacheStore:c},{timeout:0,headers:d})}function ZDe(e,t,n){return t.split(/ & /).map(i=>YDe(e,i,n))}function YDe(e,t,n){t.startsWith(e)&&(t=t.substring(e.length));const{comparator:r,value:i}=XDe(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:BDe(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:KDe(i)}}}const zM={"=== ":"equals","== ":"eq","equals ":"equals","equal ":"equals","eq ":"eq","!== ":"not_equal","!= ":"ne","notequals ":"not_equal","notequal ":"not_equal","ne ":"ne"},WDe={">":"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 XDe(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=WDe[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 JDe({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 QDe(e){const{enabled:t,entityId:n,databaseName:r,tableName:i,searchAttribute:o,sort:a,pageIndex:c,pageSize:d,onlyIfCached:f}=e;return{enabled:t,queryKey:[n,r,i,"search_by_value",o,a.attribute||"default",a.descending||!1,c||0,d||0,f],retry:!1,staleTime:6e4,gcTime:5e3,queryFn:()=>ZK(e)}}function ZK({instanceClient:e,databaseName:t,tableName:n,searchAttribute:r,sort:i,pageIndex:o,pageSize:a,onlyIfCached:c,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:c,noCacheStore:c},{timeout:0,headers:d})}async function e$e(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 t$e(){return ct({mutationFn:e$e})}const n$e=c0(nt(),nt());function r$e({applyFilters:e,columnFiltersForm:t,headerGroups:n}){const r=b.useCallback(i=>{if(i.key==="Enter")return i.preventDefault(),e(),!1},[e]);return u.jsx(zh,{children:u.jsx(an,{...t,children:n.map(i=>u.jsx(Vi,{className:"border-none",children:i.headers.map(o=>u.jsx(us,{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(Ne,{className:"border-r-1 border-r-black",children:[u.jsx(De,{children:u.jsx(Me,{...a,type:"text",autoCapitalize:"none",autoComplete:"off",className:"rounded-none",onKeyDown:r,value:a.value??""})}),u.jsx(Oe,{})]})})},o.id))},i.id))})})}function i$e({columns:e,columnVisibility:t,setColumnVisibility:n}){const r=b.useMemo(()=>e.map(i=>i.header).filter(Xo),[e]);return u.jsxs(Dh,{children:[u.jsx($h,{asChild:!0,children:u.jsxs(be,{variant:"ghost",children:[u.jsx(nte,{className:"inline-block "}),"Columns"]})}),u.jsx(Ph,{children:r.map(i=>u.jsx(o$e,{columnHeader:i,columnVisibility:t,setColumnVisibility:n},i))})]})}function o$e({columnHeader:e,columnVisibility:t,setColumnVisibility:n}){const{toggled:r,toggle:i}=Mm(t[e]??!0);return b.useEffect(()=>{t[e]!==r&&n({...t,[e]:r})},[e,t,r,n]),u.jsx(q0e,{checked:r,onClick:i,children:e},e)}function a$e({className:e}){return u.jsx(R4,{className:_i("animate-spin",e)})}function s$e({applyFilters:e,columns:t,columnVisibility:n,columnFiltersForm:r,data:i,isFetching:o,onColumnClick:a,onRowClick:c,pageIndex:d,pageSize:f,setPageIndex:m,setPageSize:h,filtersToggled:v,totalPages:y,totalRecords:x}){const S=N0({data:i||[],columns:t,manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onEnd",pageCount:y,defaultColumn:{minSize:1},state:{columnVisibility:n},rowCount:x,getCoreRowModel:I0(),getPaginationRowModel:B_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(T0,{containerClassName:"rounded-md bg-black-dark grow max-h-[calc(100vh-128px-16px-112px-80px)]",children:[u.jsx(zh,{children:S.getHeaderGroups().map(E=>u.jsx(Vi,{className:"border-none",children:E.headers.map(j=>u.jsx(vq,{header:j,onColumnClick:a},j.id))},E.id))}),v&&u.jsx(r$e,{applyFilters:e,columnFiltersForm:r,headerGroups:S.getHeaderGroups()}),u.jsx(O0,{className:"bg-black border border-grey-700",children:S.getRowModel().rows?.length?S.getRowModel().rows.map(E=>u.jsx(Vi,{"data-state":E.getIsSelected()&&"selected",onClick:()=>c?.(E),className:Ue("hover:bg-muted/10 data-[state=selected]:bg-muted",c&&"cursor-pointer"),children:E.getVisibleCells().map(j=>u.jsx(us,{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()):Fc(j.column.columnDef.cell,j.getContext())},j.id))},E.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:t.length,className:"h-24 text-center",children:o||i===void 0?u.jsx(a$e,{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(Oc,{}),"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(Dr,{}):fy(x)})]}),x!==void 0&&x>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:u.jsxs(qi,{defaultValue:f.toString(),onValueChange:E=>{h(Number(E))},children:[u.jsx(Gi,{className:"h-10 w-20",children:u.jsx(Ki,{})}),u.jsx(Zi,{side:"top",children:[20,50,100,250].map(E=>u.jsx(At,{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:fy(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:fy(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(vi,{})]})]})]})}function l$e({instanceDatabaseMap:e,databaseName:t,tableName:n}){const r=it({strict:!1}),i=En(),o=Zt(),{clusterId:a,instanceId:c}=r,{toggled:d,toggle:f}=Mm(!0),m=H_(c??a,t,n,"insert"),h=H_(c??a,t,n,"update"),v=H_(c??a,t,n,"delete"),y=gf(),{data:x}=Pt(UDe({...o,databaseName:t,tableName:n})),S=b.useMemo(()=>kf(x?.attributes??[],"attribute"),[x]),[C,k]=Qp(null,r),[E,j]=b.useState(!1),R=b.useMemo(()=>(t?Object.keys(e?.[t]||[]).sort():[]).length===1,[e,t]),{toggled:T,toggleOn:N,toggleOff:O}=Mm(!1),M=on({resolver:mn(n$e)}),{reset:L}=M,K=M.watch(),[ee,q]=Qp(null,[r.clusterId,r.instanceId,t,n]),Y=b.useCallback(()=>{const Bt=[];for(const Xe in K)if(K[Xe]?.length)try{Bt.push(...ZDe(Xe,K[Xe],S[Xe]))}catch(en){we.error(String(en))}q(Bt.length?Bt:null),L({...K})},[S,L,K]),U=b.useCallback(()=>{L({},{keepValues:!1,keepDirtyValues:!1,keepDefaultValues:!1}),L(),q(null),O()},[O,L]);b.useEffect(function(){return U()},[r,U]);const{dataTableColumns:H,hashAttribute:z}=SDe(x),[W,F]=b.useState(!1),[te,D]=b.useState(!1),[$,V]=Qp({attribute:z,descending:!1},r),[A,J]=Qp(0,[t,n]),[fe,ge]=b.useState(20),B=x?.record_count,se=x?.record_count?Math.ceil(x.record_count/fe):0,_e=T&&!!ee,Ie={...o,enabled:!_e&&!!z,databaseName:t,tableName:n,searchAttribute:z,sort:$,pageSize:fe,pageIndex:A,onlyIfCached:d},Fe=QDe(Ie),{data:Le,isFetching:We}=Pt(Fe),gt={...o,enabled:_e&&!!z,databaseName:t,tableName:n,conditions:ee,sort:$,pageSize:fe,pageIndex:A,onlyIfCached:d},Qt=GDe(gt),{data:Tn,isFetching:sn}=Pt(Qt),jr=_e?Tn:Le,Mt=We||sn,{data:G}=Pt(JDe({...o,enabled:E,databaseName:t,tableName:n,ids:C})),{mutate:ae,isPending:pe}=t$e(),{mutate:Ce,isPending:re}=FDe(),ue=rr(),X=b.useCallback(()=>ue.invalidateQueries({queryKey:[o.entityId,t,n]}),[ue,o.entityId,t,n]),[ve,Ee]=b.useState(!1),Ke=b.useCallback(async()=>{if(!z)return;const Bt=we.loading("Loading CSV...");Ee(!0);const Xe={pageIndex:0,pageSize:1e6,headers:{Accept:"text/csv"}},en=await(_e?GK({...gt,...Xe}):ZK({...Ie,...Xe}));we.loading("Preparing CSV...",{id:Bt});const Yn=en.data,dr=new Blob([Yn],{type:"text/csv"}),Qo=URL.createObjectURL(dr),cn=document.createElement("a");cn.href=Qo,cn.setAttribute("download",`${t}.${n}.${new Date().toISOString()}.csv`),cn.click(),we.success("CSV Exported!",{id:Bt}),Ee(!1)},[t,n,Fe,Qt]),et=b.useCallback(Bt=>{ae({...o,databaseName:t,tableName:n,records:Bt},{onSuccess:()=>{X(),j(!1),we.success("Record updated successfully")}})},[ae,o,t,n,X]),Vt=b.useCallback(Bt=>{Ce({...o,databaseName:t,tableName:n,hashValues:Bt},{onSuccess:()=>{X(),j(!1),we.success("Record deleted successfully")}})},[Ce,o,t,n,X]),jn=b.useCallback(Bt=>{X(),D(!1),we.success(`${Bt}. Please wait a few moments then refresh the table.`)},[X]),ln=Bt=>{k([Bt.original[z]]),j(!E)},zt=(Bt,Xe)=>{V({attribute:Bt,descending:!Xe})},wn=Ml(X),_t=b.useCallback(()=>{F(!0)},[F]),ur=b.useCallback(()=>{D(!0)},[D]),Sn=b.useCallback(Bt=>{i({to:Bt==="table"?"../":"../../"})},[i]),[Fr,vs]=_d(`ColumnDisplayed/${t}}/${n}`,{}),ys=Wa("ShowDeleteTable",!0),Ra=Wa("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:_t,disabled:W,accessKey:"n",children:[u.jsx(Xr,{}),u.jsxs("span",{children:["Add ",u.jsx("u",{children:"N"}),"ew Record(s)"]})]}),m&&u.jsxs(be,{variant:"positiveOutline",onClick:ur,disabled:te,accessKey:"c",children:[u.jsx(S4,{}),u.jsxs("span",{children:["Import ",u.jsx("u",{children:"C"}),"SV"]})]}),u.jsxs(be,{variant:"positiveOutline",onClick:Ke,disabled:ve,accessKey:"e",children:[u.jsx(Qee,{}),u.jsxs("span",{children:[u.jsx("u",{children:"E"}),"xport CSV"]})]})]}),u.jsxs("div",{className:"flex space-x-2",children:[T&&ee&&u.jsxs(be,{variant:"ghost",onClick:U,accessKey:"f",children:[u.jsx(XD,{className:"inline-block "}),u.jsxs("span",{children:["Clear ",u.jsx("u",{children:"F"}),"ilters"]})]}),T&&M.formState.isDirty&&u.jsxs(be,{variant:"default",onClick:Y,children:[u.jsx(gte,{className:"inline-block "}),"Apply Filters"]}),T&&!ee&&u.jsxs(be,{variant:"ghost",onClick:O,accessKey:"f",children:[u.jsx(XD,{className:"inline-block "}),u.jsxs("span",{children:["Hide ",u.jsx("u",{children:"F"}),"ilters"]})]}),!T&&u.jsxs(be,{variant:"ghost",onClick:N,accessKey:"f",children:[u.jsx(bte,{className:"inline-block "}),u.jsxs("span",{children:["Show ",u.jsx("u",{children:"F"}),"ilters"]})]}),u.jsx(be,{variant:"defaultOutline",onClick:wn,disabled:Mt,children:u.jsx(ba,{})}),u.jsx(i$e,{columns:H,columnVisibility:Fr,setColumnVisibility:vs}),u.jsxs(Dh,{children:[u.jsx($h,{disabled:!e,children:u.jsx(oE,{"aria-label":"Table options",color:e?"white":"gray"})}),u.jsxs(Ph,{side:"bottom",align:"end",children:[u.jsxs(Sr,{className:"focus:bg-primary/70 focus:text-white",onClick:f,children:[d?u.jsx(Kee,{className:"text-green"}):u.jsx(w4,{}),"Only If Cached",u.jsx(Ze,{to:"https://docs.harperdb.io/docs/developers/applications/caching#cache-control-header",target:"_blank",rel:"noopener noreferrer",onClick:RK,children:u.jsx(ute,{})})]}),y&&!R&&u.jsxs(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:ys,children:[u.jsx(Ca,{className:"inline-block "}),"Drop Table"]}),y&&u.jsxs(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:Ra,children:[u.jsx(mne,{}),"Drop Database"]})]})]})]})]}),u.jsx(s$e,{data:jr?.data,isFetching:Mt,filtersToggled:T,columns:H,columnVisibility:Fr,onRowClick:ln,onColumnClick:zt,totalPages:se,totalRecords:B,pageIndex:A,pageSize:fe,columnFiltersForm:M,applyFilters:Y,setPageIndex:J,setPageSize:ge}),m&&x&&W&&u.jsx(EDe,{instanceTable:x,isModalOpen:W,refreshTable:X,setIsModalOpen:F}),u.jsx(DDe,{canEditRecords:h,canDeleteRecords:v,setIsModalOpen:j,isModalOpen:E,hashAttribute:z,data:G?.data,onSaveChanges:et,onDeleteRecord:Vt,isUpdateTableRecordsPending:pe,isDeleteTableRecordsPending:re}),u.jsx(NDe,{databaseName:t,onDeleted:Sn}),u.jsx(ADe,{databaseName:t,tableName:n,onDeleted:Sn}),u.jsx(zDe,{isModalOpen:te,setIsModalOpen:D,onSaveChanges:jn,database:t,table:n})]})}function c$e(){const e=it({strict:!1}),t=Zt(),{data:n}=Pt(AK(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(_c,{to:Mk({...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(wDe,{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(l$e,{instanceDatabaseMap:n,databaseName:e.databaseName,tableName:e.tableName})})]})}function u$e(e){return rt({getParentRoute:()=>e,path:"/databases/{-$databaseName}/{-$tableName}",component:c$e})}function d$e({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 YK={className:"text-white"};function f$e(){const e=PE(),t=it({strict:!1}),{version:n}=Hm({strict:!1}),r=IM("4.6.0",n),i=IM("4.7.0-beta.7",n),o=Zt(),{data:a}=Pt(d$e(o,r)),c=a?.restartRequired??!1,d=b.useMemo(()=>[{to:lr(t),activeOptions:{exact:!0},name:"Applications",shortName:"Apps",icon:u.jsx(sE,{className:"inline-block"})},{to:lr(t,"databases"),icon:u.jsx(ate,{className:"inline-block"}),name:"Databases"},e&&i&&{to:lr(t,"apis"),name:"APIs",icon:u.jsx(sne,{className:"inline-block"})},e&&r&&{to:lr(t,"status"),icon:u.jsx(wte,{className:"inline-block"}),name:"Status"},e&&{to:lr(t,"logs"),icon:u.jsx(Hte,{className:"inline-block"}),name:"Logs"},e&&{to:lr(t,"config"),icon:u.jsx(cne,{className:"inline-block"}),name:"Config"}].filter(Xo),[e,t,i,r]);return u.jsxs(u.Fragment,{children:[u.jsx(p$e,{links:d,restartRequired:c}),u.jsx(m$e,{links:d,restartRequired:c})]})}function p$e({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(mx,{restartRequired:t}),u.jsx("div",{className:"flex space-x-2",children:e.map(({shortName:n,...r})=>u.jsxs(Ze,{className:"p-2 text-center text-gray-400 hover:text-white",activeProps:YK,...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 m$e({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(mx,{restartRequired:t}),u.jsxs(Dh,{children:[u.jsx($h,{asChild:!0,children:u.jsx(be,{variant:"ghost",className:"p-0",children:u.jsx(I4,{className:"h-8 w-8"})})}),u.jsxs(Ph,{children:[u.jsx(Jy,{children:"Instance Menu"}),u.jsx(Qy,{}),e.map(n=>u.jsx(Sr,{asChild:!0,children:u.jsx(Ze,{to:n.to,activeProps:YK,children:n.name})},n.to))]})]})]})})}function B1(){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(f$e,{})}),u.jsx("div",{className:"mt-32 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(kl,{})})]})}function h$e(e){switch(e){case"local":return rt({getParentRoute:()=>P0,id:"_instanceLayout",component:B1,loader:my});case"cluster":return rt({getParentRoute:()=>ds,id:"_instanceLayout",component:B1,beforeLoad:LM,loader:my});case"instance":return rt({getParentRoute:()=>ds,path:"instance/$instanceId",component:B1,beforeLoad:LM,loader:my})}}async function LM({context:e,params:t}){const n=e.authentication[t.instanceId||t.clusterId];if(n?.isLoading||n?.user)return;const r=e.authentication[An];if(r?.isLoading)return;const{update:i}=t.instanceId?cU(r.user,t.organizationId,t.clusterId):lU(r.user,t.organizationId,t.clusterId);if(i){const a=t.instanceId||t.clusterId,c=Qa({id:a,forceFabricConnect:!0});try{const d=await al({instanceClient:c});Et.setUserForIdAndKey(a,c.defaults.baseURL,d),Et.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 Vc({to:o,search:Oq()})}const g$e=Ab(`inline-flex
190
+ items-center
191
+ justify-center
192
+ gap-2
193
+ whitespace-nowrap
194
+ rounded-lg
195
+ text-sm
196
+ transition-[color,box-shadow]
197
+ disabled:pointer-events-none
198
+ disabled:opacity-50
199
+ [&_svg]:pointer-events-none
200
+ [&_svg:not([class*='size-'])]:size-4
201
+ [&_svg]:shrink-0
202
+ ring-ring/10
203
+ dark:ring-ring/20
204
+ dark:outline-ring/40
205
+ outline-ring/50
206
+ focus-visible:ring-1
207
+ focus-visible:outline-1
208
+ focus-visible:ring-purple-200
209
+ 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 WK="Toggle",XK=b.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:WK});return u.jsx(Ye.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||c(!a)})})});XK.displayName=WK;var v$e=XK;function y$e({className:e,variant:t,size:n,...r}){return u.jsx(v$e,{"data-slot":"toggle",className:Ue(g$e({variant:t,size:n,className:e})),...r})}function JK(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 FM=["secondary","default","warning","outline","success","destructive"];let UM=0;const H1=new Map,QK=e=>{if(H1.has(e))return H1.get(e);UM++;const t=UM%FM.length,n=FM[t];return H1.set(e,n),n};function b$e({columns:e,data:t,onRowClick:n}){const r=N0({data:t,columns:e,getCoreRowModel:I0()});return u.jsx("div",{className:"rounded-md bg-black-dark logsTable",children:u.jsxs(T0,{className:"text-xs",children:[u.jsx(zh,{children:r.getHeaderGroups().map(i=>u.jsx(Vi,{className:"border-none",children:i.headers.map(o=>u.jsx(_I,{className:"p-4 max-w-96",children:o.isPlaceholder?null:Fc(o.column.columnDef.header,o.getContext())},o.id))},i.id))}),u.jsx(O0,{className:"bg-black",children:r.getRowModel().rows?.length?r.getRowModel().rows.map(i=>u.jsx(Vi,{"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(us,{className:"p-1",children:Fc(o.column.columnDef.cell,o.getContext())},o.id))},i.id)):u.jsx(Vi,{children:u.jsx(us,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function x$e(e){try{JSON.parse(e)}catch{return!1}return!0}function w$e({setIsModalOpen:e,isModalOpen:t,data:n}){const r=n?QK(n.node):"default";return u.jsx(Fn,{onOpenChange:e,open:t,children:u.jsxs(Un,{"aria-describedby":void 0,children:[u.jsx(gr,{children:u.jsx($n,{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(Zo,{variant:JK(n.level),children:bo(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(Zo,{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($0,{className:"w-full h-72",language:x$e(n.message)?"json":"text",theme:"vs-dark",value:n.message,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1}})]})]}):u.jsx(eo,{}),u.jsx(Zn,{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(jo,{})," Save Changes"]})]})})]})})}function S$e({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 _$e=Dt({limit:nt().optional(),level:Al(["notify","error","warn","info","debug","trace","undefined"]).optional(),from:nt().or(Em()).optional(),until:nt().or(Em()).optional()});function C$e({form:e,resetFilters:t,submitFilters:n}){return u.jsx("div",{children:u.jsx(an,{...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(Ne,{children:[u.jsx(Te,{children:"Log Limit:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log limit"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"1000",children:"1000"}),u.jsx(At,{value:"500",children:"500"}),u.jsx(At,{value:"250",children:"250"}),u.jsx(At,{value:"100",children:"100"}),u.jsx(At,{value:"10",children:"10"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"level",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Log Level:"}),u.jsxs(qi,{onValueChange:r.onChange,value:r.value,children:[u.jsx(Gi,{className:"w-full",children:u.jsx(Ki,{placeholder:"Select log level"})}),u.jsx(Zi,{children:u.jsxs(Yo,{children:[u.jsx(At,{value:"undefined",children:"All"}),u.jsx(At,{value:"notify",children:"Notify"}),u.jsx(At,{value:"error",children:"Error"}),u.jsx(At,{value:"warn",children:"Warn"}),u.jsx(At,{value:"info",children:"Info"}),u.jsx(At,{value:"debug",children:"Debug"}),u.jsx(At,{value:"trace",children:"Trace"})]})})]}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"from",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"Start Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),u.jsx($e,{control:e.control,name:"until",render:({field:r})=>u.jsxs(Ne,{children:[u.jsx(Te,{children:"End Date:"}),u.jsx(De,{children:u.jsx(Me,{type:"datetime-local",value:r.value,onChange:r.onChange})}),u.jsx(Oe,{})]})}),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 q1={limit:"100",level:"undefined",from:"",until:""},k$e=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Zo,{variant:JK(t),children:bo(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=QK(t);return u.jsx(u.Fragment,{children:t?u.jsxs(dx,{children:[u.jsx(fx,{asChild:!0,children:u.jsxs(Zo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(px,{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})})}}],E$e=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function j$e(){const[e,t]=b.useState(q1),[n,r]=b.useState(!1),[i,o]=b.useState(),[a,c]=b.useState(!1),d=Zt(),{data:f,isLoading:m,refetch:h,isFetching:v}=Pt(S$e({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=on({resolver:mn(_$e),defaultValues:q1,mode:"onChange"}),x=E=>{o(E.original),r(!0)},S=async E=>{if(!E$e(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(q1)},k=Ml(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(C$e,{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(ba,{}),"Refresh"]}),u.jsxs(y$e,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(ba,{}),"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(b$e,{columns:k$e,data:f||[],onRowClick:x})})}),u.jsx(w$e,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function R$e(e){return rt({getParentRoute:()=>e,path:"logs",component:j$e})}function I$e(e){return rt({getParentRoute:()=>e,path:"status",component:Jz(async()=>Jm(()=>import("./index-DHFTW4ZU.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function N$e(e){const t=h$e(e),n=[R$e(t),...JOe(t),rke(t),I$e(t),tDe(t),u$e(t)];return t.addChildren(n)}rt({getParentRoute:()=>P0,path:"profile",component:Jz(async()=>Jm(()=>import("./index-DCIk8mGR.js"),[]),"ProfileIndex")});const T$e=tx.addChildren([...obe,P0.addChildren([N$e("local")])]);function O$e({routeTree:e=T$e,authentication:t}){const n=$X();return gQ({routeTree:e,history:n,defaultNotFoundComponent:Sne,defaultErrorComponent:Ey,defaultPreload:_ne()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:jy,authentication:t||{}}})}function A$e(){const e=wQ(),t=O$e({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(bQ,{router:t,context:{authentication:e}}),!1]})}const D$e=({...e})=>u.jsx(Wne,{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 VM=!1;function $$e(){b.useEffect(()=>{VM||(VM=!0)},[])}var P$e=function(){return null};function M$e(){return Tfe(),Sde(),$$e(),u.jsxs(u.Fragment,{children:[u.jsxs(vX,{client:jy,children:[u.jsx(A$e,{}),u.jsx(P$e,{buttonPosition:"bottom-right"})]}),u.jsx(D$e,{richColors:!0})]})}var K1={exports:{}},Kp={},G1={exports:{}},Z1={};var BM;function z$e(){return BM||(BM=1,(function(e){function t(z,W){var F=z.length;z.push(W);e:for(;0<F;){var te=F-1>>>1,D=z[te];if(0<i(D,W))z[te]=W,z[F]=D,F=te;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],F=z.pop();if(F!==W){z[0]=F;e:for(var te=0,D=z.length,$=D>>>1;te<$;){var V=2*(te+1)-1,A=z[V],J=V+1,fe=z[J];if(0>i(A,F))J<D&&0>i(fe,A)?(z[te]=fe,z[J]=F,te=J):(z[te]=A,z[V]=F,te=V);else if(J<D&&0>i(fe,F))z[te]=fe,z[J]=F,te=J;else break e}}return W}function i(z,W){var F=z.sortIndex-W.sortIndex;return F!==0?F: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,c=a.now();e.unstable_now=function(){return a.now()-c}}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 R(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 T(z){if(S=!1,R(z),!x)if(n(d)!==null)x=!0,N||(N=!0,q());else{var W=n(f);W!==null&&H(T,W.startTime-z)}}var N=!1,O=-1,M=5,L=-1;function K(){return C?!0:!(e.unstable_now()-L<M)}function ee(){if(C=!1,N){var z=e.unstable_now();L=z;var W=!0;try{e:{x=!1,S&&(S=!1,E(O),O=-1),y=!0;var F=v;try{t:{for(R(z),h=n(d);h!==null&&!(h.expirationTime>z&&K());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=z);if(z=e.unstable_now(),typeof D=="function"){h.callback=D,R(z),W=!0;break t}h===n(d)&&r(d),R(z)}else r(d);h=n(d)}if(h!==null)W=!0;else{var $=n(f);$!==null&&H(T,$.startTime-z),W=!1}}break e}finally{h=null,v=F,y=!1}W=void 0}}finally{W?q():N=!1}}}var q;if(typeof j=="function")q=function(){j(ee)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,U=Y.port2;Y.port1.onmessage=ee,q=function(){U.postMessage(null)}}else q=function(){k(ee,0)};function H(z,W){O=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"):M=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 F=v;v=W;try{return z()}finally{v=F}},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 F=v;v=z;try{return W()}finally{v=F}},e.unstable_scheduleCallback=function(z,W,F){var te=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?te+F:te):F=te,z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=F+D,z={id:m++,callback:W,priorityLevel:z,startTime:F,expirationTime:D,sortIndex:-1},F>te?(z.sortIndex=F,t(f,z),n(d)===null&&z===n(f)&&(S?(E(O),O=-1):S=!0,H(T,F-te))):(z.sortIndex=D,t(d,z),x||y||(x=!0,N||(N=!0,q()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var W=v;return function(){var F=v;v=W;try{return z.apply(this,arguments)}finally{v=F}}}})(Z1)),Z1}var HM;function L$e(){return HM||(HM=1,G1.exports=z$e()),G1.exports}var qM;function F$e(){if(qM)return Kp;qM=1;var e=L$e(),t=Vm(),n=Xz();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)l+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+s+"; visit "+l+" 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 l=s,p=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(p=l.return),s=l.return;while(s)}return l.tag===3?p:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var p=s,g=l;;){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),l;_=_.sibling}throw Error(r(188))}if(p.return!==g.return)p=w,g=_;else{for(var I=!1,P=w.child;P;){if(P===p){I=!0,p=w,g=_;break}if(P===g){I=!0,g=w,p=_;break}P=P.sibling}if(!I){for(P=_.child;P;){if(P===p){I=!0,p=_,g=w;break}if(P===g){I=!0,g=_,p=w;break}P=P.sibling}if(!I)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:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(s),l!==null)return l;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"),R=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function q(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function U(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?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 T:return"Suspense";case N:return"SuspenseList";case L: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 R:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return l=s.displayName||null,l!==null?l:U(s.type)||"Memo";case M:l=s._payload,s=s._init;try{return U(s(l))}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,F={pending:!1,data:null,method:null,action:null},te=[],D=-1;function $(s){return{current:s}}function V(s){0>D||(s.current=te[D],te[D]=null,D--)}function A(s,l){D++,te[D]=s.current,s.current=l}var J=$(null),fe=$(null),ge=$(null),B=$(null);function se(s,l){switch(A(ge,l),A(fe,s),A(J,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?pA(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=pA(l),s=mA(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(J),A(J,s)}function _e(){V(J),V(fe),V(ge)}function Ie(s){s.memoizedState!==null&&A(B,s);var l=J.current,p=mA(l,s.type);l!==p&&(A(fe,s),A(J,p))}function Fe(s){fe.current===s&&(V(J),V(fe)),B.current===s&&(V(B),gp._currentValue=F)}var Le,We;function gt(s){if(Le===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);Le=l&&l[1]||"",We=-1<p.stack.indexOf(`
210
+ at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
211
+ `+Le+s+We}var Qt=!1;function Tn(s,l){if(!s||Qt)return"";Qt=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(he){var de=he}Reflect.construct(s,[],Se)}else{try{Se.call()}catch(he){de=he}s.call(Se.prototype)}}else{try{throw Error()}catch(he){de=he}(Se=s())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(he){if(he&&de&&typeof he.stack=="string")return[he.stack,de.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(),I=_[0],P=_[1];if(I&&P){var Z=I.split(`
212
+ `),ce=P.split(`
213
+ `);for(w=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;w<ce.length&&!ce[w].includes("DetermineComponentFrameRoot");)w++;if(g===Z.length||w===ce.length)for(g=Z.length-1,w=ce.length-1;1<=g&&0<=w&&Z[g]!==ce[w];)w--;for(;1<=g&&0<=w;g--,w--)if(Z[g]!==ce[w]){if(g!==1||w!==1)do if(g--,w--,0>w||Z[g]!==ce[w]){var ye=`
214
+ `+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{Qt=!1,Error.prepareStackTrace=p}return(p=s?s.displayName||s.name:"")?gt(p):""}function sn(s,l){switch(s.tag){case 26:case 27:case 5:return gt(s.type);case 16:return gt("Lazy");case 13:return s.child!==l&&l!==null?gt("Suspense Fallback"):gt("Suspense");case 19:return gt("SuspenseList");case 0:case 15:return Tn(s.type,!1);case 11:return Tn(s.type.render,!1);case 1:return Tn(s.type,!0);case 31:return gt("Activity");default:return""}}function jr(s){try{var l="",p=null;do l+=sn(s,p),p=s,s=s.return;while(s);return l}catch(g){return`
215
+ Error generating stack: `+g.message+`
216
+ `+g.stack}}var Mt=Object.prototype.hasOwnProperty,G=e.unstable_scheduleCallback,ae=e.unstable_cancelCallback,pe=e.unstable_shouldYield,Ce=e.unstable_requestPaint,re=e.unstable_now,ue=e.unstable_getCurrentPriorityLevel,X=e.unstable_ImmediatePriority,ve=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ke=e.unstable_LowPriority,et=e.unstable_IdlePriority,Vt=e.log,jn=e.unstable_setDisableYieldValue,ln=null,zt=null;function wn(s){if(typeof Vt=="function"&&jn(s),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(ln,s)}catch{}}var _t=Math.clz32?Math.clz32:Fr,ur=Math.log,Sn=Math.LN2;function Fr(s){return s>>>=0,s===0?32:31-(ur(s)/Sn|0)|0}var vs=256,ys=262144,Ra=4194304;function Bt(s){var l=s&42;if(l!==0)return l;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,l,p){var g=s.pendingLanes;if(g===0)return 0;var w=0,_=s.suspendedLanes,I=s.pingedLanes;s=s.warmLanes;var P=g&134217727;return P!==0?(g=P&~_,g!==0?w=Bt(g):(I&=P,I!==0?w=Bt(I):p||(p=P&~s,p!==0&&(w=Bt(p))))):(P=g&~_,P!==0?w=Bt(P):I!==0?w=Bt(I):p||(p=g&~s,p!==0&&(w=Bt(p)))),w===0?0:l!==0&&l!==w&&(l&_)===0&&(_=w&-w,p=l&-l,_>=p||_===32&&(p&4194048)!==0)?l:w}function en(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Yn(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 dr(){var s=Ra;return Ra<<=1,(Ra&62914560)===0&&(Ra=4194304),s}function Qo(s){for(var l=[],p=0;31>p;p++)l.push(s);return l}function cn(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ni(s,l,p,g,w,_){var I=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 P=s.entanglements,Z=s.expirationTimes,ce=s.hiddenUpdates;for(p=I&~p;0<p;){var ye=31-_t(p),Se=1<<ye;P[ye]=0,Z[ye]=-1;var de=ce[ye];if(de!==null)for(ce[ye]=null,ye=0;ye<de.length;ye++){var he=de[ye];he!==null&&(he.lane&=-536870913)}p&=~Se}g!==0&&Ul(s,g,0),_!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=_&~(I&~l))}function Ul(s,l,p){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-_t(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|p&261930}function ri(s,l){var p=s.entangledLanes|=l;for(s=s.entanglements;p;){var g=31-_t(p),w=1<<g;w&l|s[g]&l&&(s[g]|=l),p&=~w}}function ii(s,l){var p=l&-l;return p=(p&42)!==0?1:su(p),(p&(s.suspendedLanes|l))!==0?0:p}function su(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 Oo(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Y0(){var s=W.p;return s!==0?s:(s=window.event,s===void 0?32:MA(s.type))}function QI(s,l){var p=W.p;try{return W.p=s,l()}finally{W.p=p}}var bs=Math.random().toString(36).slice(2),vr="__reactFiber$"+bs,oi="__reactProps$"+bs,lu="__reactContainer$"+bs,W0="__reactEvents$"+bs,eG="__reactListeners$"+bs,tG="__reactHandles$"+bs,eN="__reactResources$"+bs,Tf="__reactMarker$"+bs;function X0(s){delete s[vr],delete s[oi],delete s[W0],delete s[eG],delete s[tG]}function cu(s){var l=s[vr];if(l)return l;for(var p=s.parentNode;p;){if(l=p[lu]||p[vr]){if(p=l.alternate,l.child!==null||p!==null&&p.child!==null)for(s=wA(s);s!==null;){if(p=s[vr])return p;s=wA(s)}return l}s=p,p=s.parentNode}return null}function uu(s){if(s=s[vr]||s[lu]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Of(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function du(s){var l=s[eN];return l||(l=s[eN]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function fr(s){s[Tf]=!0}var tN=new Set,nN={};function Vl(s,l){fu(s,l),fu(s+"Capture",l)}function fu(s,l){for(nN[s]=l,s=0;s<l.length;s++)tN.add(l[s])}var nG=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]*$"),rN={},iN={};function rG(s){return Mt.call(iN,s)?!0:Mt.call(rN,s)?!1:nG.test(s)?iN[s]=!0:(rN[s]=!0,!1)}function Kh(s,l,p){if(rG(l))if(p===null)s.removeAttribute(l);else{switch(typeof p){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+p)}}function Gh(s,l,p){if(p===null)s.removeAttribute(l);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+p)}}function Ia(s,l,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(l,p,""+g)}}function to(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function oN(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function iG(s,l,p){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var w=g.get,_=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return w.call(this)},set:function(I){p=""+I,_.call(this,I)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return p},setValue:function(I){p=""+I},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function J0(s){if(!s._valueTracker){var l=oN(s)?"checked":"value";s._valueTracker=iG(s,l,""+s[l])}}function aN(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var p=l.getValue(),g="";return s&&(g=oN(s)?s.checked?"true":"false":s.value),s=g,s!==p?(l.setValue(s),!0):!1}function Zh(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 oG=/[\n"\\]/g;function no(s){return s.replace(oG,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Q0(s,l,p,g,w,_,I,P){s.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.type=I:s.removeAttribute("type"),l!=null?I==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+to(l)):s.value!==""+to(l)&&(s.value=""+to(l)):I!=="submit"&&I!=="reset"||s.removeAttribute("value"),l!=null?ew(s,I,to(l)):p!=null?ew(s,I,to(p)):g!=null&&s.removeAttribute("value"),w==null&&_!=null&&(s.defaultChecked=!!_),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+to(P):s.removeAttribute("name")}function sN(s,l,p,g,w,_,I,P){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),l!=null||p!=null){if(!(_!=="submit"&&_!=="reset"||l!=null)){J0(s);return}p=p!=null?""+to(p):"",l=l!=null?""+to(l):p,P||l===s.value||(s.value=l),s.defaultValue=l}g=g??w,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=P?s.checked:!!g,s.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(s.name=I),J0(s)}function ew(s,l,p){l==="number"&&Zh(s.ownerDocument)===s||s.defaultValue===""+p||(s.defaultValue=""+p)}function pu(s,l,p,g){if(s=s.options,l){l={};for(var w=0;w<p.length;w++)l["$"+p[w]]=!0;for(p=0;p<s.length;p++)w=l.hasOwnProperty("$"+s[p].value),s[p].selected!==w&&(s[p].selected=w),w&&g&&(s[p].defaultSelected=!0)}else{for(p=""+to(p),l=null,w=0;w<s.length;w++){if(s[w].value===p){s[w].selected=!0,g&&(s[w].defaultSelected=!0);return}l!==null||s[w].disabled||(l=s[w])}l!==null&&(l.selected=!0)}}function lN(s,l,p){if(l!=null&&(l=""+to(l),l!==s.value&&(s.value=l),p==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=p!=null?""+to(p):""}function cN(s,l,p,g){if(l==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=""),l=p}p=to(l),s.defaultValue=p,g=s.textContent,g===p&&g!==""&&g!==null&&(s.value=g),J0(s)}function mu(s,l){if(l){var p=s.firstChild;if(p&&p===s.lastChild&&p.nodeType===3){p.nodeValue=l;return}}s.textContent=l}var aG=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 uN(s,l,p){var g=l.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,p):typeof p!="number"||p===0||aG.has(l)?l==="float"?s.cssFloat=p:s[l]=(""+p).trim():s[l]=p+"px"}function dN(s,l,p){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,p!=null){for(var g in p)!p.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var w in l)g=l[w],l.hasOwnProperty(w)&&p[w]!==g&&uN(s,w,g)}else for(var _ in l)l.hasOwnProperty(_)&&uN(s,_,l[_])}function tw(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 sG=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"]]),lG=/^[\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 Yh(s){return lG.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Na(){}var nw=null;function rw(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var hu=null,gu=null;function fN(s){var l=uu(s);if(l&&(s=l.stateNode)){var p=s[oi]||null;e:switch(s=l.stateNode,l.type){case"input":if(Q0(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),l=p.name,p.type==="radio"&&l!=null){for(p=s;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+no(""+l)+'"][type="radio"]'),l=0;l<p.length;l++){var g=p[l];if(g!==s&&g.form===s.form){var w=g[oi]||null;if(!w)throw Error(r(90));Q0(g,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(l=0;l<p.length;l++)g=p[l],g.form===s.form&&aN(g)}break e;case"textarea":lN(s,p.value,p.defaultValue);break e;case"select":l=p.value,l!=null&&pu(s,!!p.multiple,l,!1)}}}var iw=!1;function pN(s,l,p){if(iw)return s(l,p);iw=!0;try{var g=s(l);return g}finally{if(iw=!1,(hu!==null||gu!==null)&&(Pg(),hu&&(l=hu,s=gu,gu=hu=null,fN(l),s)))for(l=0;l<s.length;l++)fN(s[l])}}function Af(s,l){var p=s.stateNode;if(p===null)return null;var g=p[oi]||null;if(g===null)return null;p=g[l];e:switch(l){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,l,typeof p));return p}var Ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ow=!1;if(Ta)try{var Df={};Object.defineProperty(Df,"passive",{get:function(){ow=!0}}),window.addEventListener("test",Df,Df),window.removeEventListener("test",Df,Df)}catch{ow=!1}var xs=null,aw=null,Wh=null;function mN(){if(Wh)return Wh;var s,l=aw,p=l.length,g,w="value"in xs?xs.value:xs.textContent,_=w.length;for(s=0;s<p&&l[s]===w[s];s++);var I=p-s;for(g=1;g<=I&&l[p-g]===w[_-g];g++);return Wh=w.slice(s,1<g?1-g:void 0)}function Xh(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Jh(){return!0}function hN(){return!1}function ai(s){function l(p,g,w,_,I){this._reactName=p,this._targetInst=w,this.type=g,this.nativeEvent=_,this.target=I,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(p=s[P],this[P]=p?p(_):_[P]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Jh:hN,this.isPropagationStopped=hN,this}return h(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Jh)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Jh)},persist:function(){},isPersistent:Jh}),l}var Bl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qh=ai(Bl),$f=h({},Bl,{view:0,detail:0}),cG=ai($f),sw,lw,Pf,eg=h({},$f,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uw,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!==Pf&&(Pf&&s.type==="mousemove"?(sw=s.screenX-Pf.screenX,lw=s.screenY-Pf.screenY):lw=sw=0,Pf=s),sw)},movementY:function(s){return"movementY"in s?s.movementY:lw}}),gN=ai(eg),uG=h({},eg,{dataTransfer:0}),dG=ai(uG),fG=h({},$f,{relatedTarget:0}),cw=ai(fG),pG=h({},Bl,{animationName:0,elapsedTime:0,pseudoElement:0}),mG=ai(pG),hG=h({},Bl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),gG=ai(hG),vG=h({},Bl,{data:0}),vN=ai(vG),yG={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bG={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"},xG={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wG(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=xG[s])?!!l[s]:!1}function uw(){return wG}var SG=h({},$f,{key:function(s){if(s.key){var l=yG[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Xh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?bG[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uw,charCode:function(s){return s.type==="keypress"?Xh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Xh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),_G=ai(SG),CG=h({},eg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yN=ai(CG),kG=h({},$f,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uw}),EG=ai(kG),jG=h({},Bl,{propertyName:0,elapsedTime:0,pseudoElement:0}),RG=ai(jG),IG=h({},eg,{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}),NG=ai(IG),TG=h({},Bl,{newState:0,oldState:0}),OG=ai(TG),AG=[9,13,27,32],dw=Ta&&"CompositionEvent"in window,Mf=null;Ta&&"documentMode"in document&&(Mf=document.documentMode);var DG=Ta&&"TextEvent"in window&&!Mf,bN=Ta&&(!dw||Mf&&8<Mf&&11>=Mf),xN=" ",wN=!1;function SN(s,l){switch(s){case"keyup":return AG.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _N(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var vu=!1;function $G(s,l){switch(s){case"compositionend":return _N(l);case"keypress":return l.which!==32?null:(wN=!0,xN);case"textInput":return s=l.data,s===xN&&wN?null:s;default:return null}}function PG(s,l){if(vu)return s==="compositionend"||!dw&&SN(s,l)?(s=mN(),Wh=aw=xs=null,vu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return bN&&l.locale!=="ko"?null:l.data;default:return null}}var MG={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 CN(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!MG[s.type]:l==="textarea"}function kN(s,l,p,g){hu?gu?gu.push(g):gu=[g]:hu=g,l=Bg(l,"onChange"),0<l.length&&(p=new Qh("onChange","change",null,p,g),s.push({event:p,listeners:l}))}var zf=null,Lf=null;function zG(s){sA(s,0)}function tg(s){var l=Of(s);if(aN(l))return s}function EN(s,l){if(s==="change")return l}var jN=!1;if(Ta){var fw;if(Ta){var pw="oninput"in document;if(!pw){var RN=document.createElement("div");RN.setAttribute("oninput","return;"),pw=typeof RN.oninput=="function"}fw=pw}else fw=!1;jN=fw&&(!document.documentMode||9<document.documentMode)}function IN(){zf&&(zf.detachEvent("onpropertychange",NN),Lf=zf=null)}function NN(s){if(s.propertyName==="value"&&tg(Lf)){var l=[];kN(l,Lf,s,rw(s)),pN(zG,l)}}function LG(s,l,p){s==="focusin"?(IN(),zf=l,Lf=p,zf.attachEvent("onpropertychange",NN)):s==="focusout"&&IN()}function FG(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return tg(Lf)}function UG(s,l){if(s==="click")return tg(l)}function VG(s,l){if(s==="input"||s==="change")return tg(l)}function BG(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var ji=typeof Object.is=="function"?Object.is:BG;function Ff(s,l){if(ji(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var p=Object.keys(s),g=Object.keys(l);if(p.length!==g.length)return!1;for(g=0;g<p.length;g++){var w=p[g];if(!Mt.call(l,w)||!ji(s[w],l[w]))return!1}return!0}function TN(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function ON(s,l){var p=TN(s);s=0;for(var g;p;){if(p.nodeType===3){if(g=s+p.textContent.length,s<=l&&g>=l)return{node:p,offset:l-s};s=g}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=TN(p)}}function AN(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?AN(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function DN(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Zh(s.document);l instanceof s.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)s=l.contentWindow;else break;l=Zh(s.document)}return l}function mw(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var HG=Ta&&"documentMode"in document&&11>=document.documentMode,yu=null,hw=null,Uf=null,gw=!1;function $N(s,l,p){var g=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;gw||yu==null||yu!==Zh(g)||(g=yu,"selectionStart"in g&&mw(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}),Uf&&Ff(Uf,g)||(Uf=g,g=Bg(hw,"onSelect"),0<g.length&&(l=new Qh("onSelect","select",null,l,p),s.push({event:l,listeners:g}),l.target=yu)))}function Hl(s,l){var p={};return p[s.toLowerCase()]=l.toLowerCase(),p["Webkit"+s]="webkit"+l,p["Moz"+s]="moz"+l,p}var bu={animationend:Hl("Animation","AnimationEnd"),animationiteration:Hl("Animation","AnimationIteration"),animationstart:Hl("Animation","AnimationStart"),transitionrun:Hl("Transition","TransitionRun"),transitionstart:Hl("Transition","TransitionStart"),transitioncancel:Hl("Transition","TransitionCancel"),transitionend:Hl("Transition","TransitionEnd")},vw={},PN={};Ta&&(PN=document.createElement("div").style,"AnimationEvent"in window||(delete bu.animationend.animation,delete bu.animationiteration.animation,delete bu.animationstart.animation),"TransitionEvent"in window||delete bu.transitionend.transition);function ql(s){if(vw[s])return vw[s];if(!bu[s])return s;var l=bu[s],p;for(p in l)if(l.hasOwnProperty(p)&&p in PN)return vw[s]=l[p];return s}var MN=ql("animationend"),zN=ql("animationiteration"),LN=ql("animationstart"),qG=ql("transitionrun"),KG=ql("transitionstart"),GG=ql("transitioncancel"),FN=ql("transitionend"),UN=new Map,yw="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(" ");yw.push("scrollEnd");function Ao(s,l){UN.set(s,l),Vl(l,[s])}var ng=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=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(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ro=[],xu=0,bw=0;function rg(){for(var s=xu,l=bw=xu=0;l<s;){var p=ro[l];ro[l++]=null;var g=ro[l];ro[l++]=null;var w=ro[l];ro[l++]=null;var _=ro[l];if(ro[l++]=null,g!==null&&w!==null){var I=g.pending;I===null?w.next=w:(w.next=I.next,I.next=w),g.pending=w}_!==0&&VN(p,w,_)}}function ig(s,l,p,g){ro[xu++]=s,ro[xu++]=l,ro[xu++]=p,ro[xu++]=g,bw|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function xw(s,l,p,g){return ig(s,l,p,g),og(s)}function Kl(s,l){return ig(s,null,null,l),og(s)}function VN(s,l,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&&l!==null&&(w=31-_t(p),s=_.hiddenUpdates,g=s[w],g===null?s[w]=[l]:g.push(l),l.lane=p|536870912),_):null}function og(s){if(50<cp)throw cp=0,IS=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var wu={};function ZG(s,l,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=l,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 Ri(s,l,p,g){return new ZG(s,l,p,g)}function ww(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Oa(s,l){var p=s.alternate;return p===null?(p=Ri(s.tag,l,s.key,s.mode),p.elementType=s.elementType,p.type=s.type,p.stateNode=s.stateNode,p.alternate=s,s.alternate=p):(p.pendingProps=l,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,l=s.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=s.sibling,p.index=s.index,p.ref=s.ref,p.refCleanup=s.refCleanup,p}function BN(s,l){s.flags&=65011714;var p=s.alternate;return p===null?(s.childLanes=0,s.lanes=l,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,l=p.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function ag(s,l,p,g,w,_){var I=0;if(g=s,typeof s=="function")ww(s)&&(I=1);else if(typeof s=="string")I=QZ(s,p,J.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case L:return s=Ri(31,p,l,w),s.elementType=L,s.lanes=_,s;case S:return Gl(p.children,w,_,l);case C:I=8,w|=24;break;case k:return s=Ri(12,p,l,w|2),s.elementType=k,s.lanes=_,s;case T:return s=Ri(13,p,l,w),s.elementType=T,s.lanes=_,s;case N:return s=Ri(19,p,l,w),s.elementType=N,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case j:I=10;break e;case E:I=9;break e;case R:I=11;break e;case O:I=14;break e;case M:I=16,g=null;break e}I=29,p=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=Ri(I,p,l,w),l.elementType=s,l.type=g,l.lanes=_,l}function Gl(s,l,p,g){return s=Ri(7,s,g,l),s.lanes=p,s}function Sw(s,l,p){return s=Ri(6,s,null,l),s.lanes=p,s}function HN(s){var l=Ri(18,null,null,0);return l.stateNode=s,l}function _w(s,l,p){return l=Ri(4,s.children!==null?s.children:[],s.key,l),l.lanes=p,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var qN=new WeakMap;function io(s,l){if(typeof s=="object"&&s!==null){var p=qN.get(s);return p!==void 0?p:(l={value:s,source:l,stack:jr(l)},qN.set(s,l),l)}return{value:s,source:l,stack:jr(l)}}var Su=[],_u=0,sg=null,Vf=0,oo=[],ao=0,ws=null,ea=1,ta="";function Aa(s,l){Su[_u++]=Vf,Su[_u++]=sg,sg=s,Vf=l}function KN(s,l,p){oo[ao++]=ea,oo[ao++]=ta,oo[ao++]=ws,ws=s;var g=ea;s=ta;var w=32-_t(g)-1;g&=~(1<<w),p+=1;var _=32-_t(l)+w;if(30<_){var I=w-w%5;_=(g&(1<<I)-1).toString(32),g>>=I,w-=I,ea=1<<32-_t(l)+w|p<<w|g,ta=_+s}else ea=1<<_|p<<w|g,ta=s}function Cw(s){s.return!==null&&(Aa(s,1),KN(s,1,0))}function kw(s){for(;s===sg;)sg=Su[--_u],Su[_u]=null,Vf=Su[--_u],Su[_u]=null;for(;s===ws;)ws=oo[--ao],oo[ao]=null,ta=oo[--ao],oo[ao]=null,ea=oo[--ao],oo[ao]=null}function GN(s,l){oo[ao++]=ea,oo[ao++]=ta,oo[ao++]=ws,ea=l.id,ta=l.overflow,ws=s}var yr=null,_n=null,Ot=!1,Ss=null,so=!1,Ew=Error(r(519));function _s(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bf(io(l,s)),Ew}function ZN(s){var l=s.stateNode,p=s.type,g=s.memoizedProps;switch(l[vr]=s,l[oi]=g,p){case"dialog":Rt("cancel",l),Rt("close",l);break;case"iframe":case"object":case"embed":Rt("load",l);break;case"video":case"audio":for(p=0;p<dp.length;p++)Rt(dp[p],l);break;case"source":Rt("error",l);break;case"img":case"image":case"link":Rt("error",l),Rt("load",l);break;case"details":Rt("toggle",l);break;case"input":Rt("invalid",l),sN(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Rt("invalid",l);break;case"textarea":Rt("invalid",l),cN(l,g.value,g.defaultValue,g.children)}p=g.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||l.textContent===""+p||g.suppressHydrationWarning===!0||dA(l.textContent,p)?(g.popover!=null&&(Rt("beforetoggle",l),Rt("toggle",l)),g.onScroll!=null&&Rt("scroll",l),g.onScrollEnd!=null&&Rt("scrollend",l),g.onClick!=null&&(l.onclick=Na),l=!0):l=!1,l||_s(s,!0)}function YN(s){for(yr=s.return;yr;)switch(yr.tag){case 5:case 31:case 13:so=!1;return;case 27:case 3:so=!0;return;default:yr=yr.return}}function Cu(s){if(s!==yr)return!1;if(!Ot)return YN(s),Ot=!0,!1;var l=s.tag,p;if((p=l!==3&&l!==27)&&((p=l===5)&&(p=s.type,p=!(p!=="form"&&p!=="button")||HS(s.type,s.memoizedProps)),p=!p),p&&_n&&_s(s),YN(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));_n=xA(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));_n=xA(s)}else l===27?(l=_n,Ms(s.type)?(s=YS,YS=null,_n=s):_n=l):_n=yr?co(s.stateNode.nextSibling):null;return!0}function Zl(){_n=yr=null,Ot=!1}function jw(){var s=Ss;return s!==null&&(ui===null?ui=s:ui.push.apply(ui,s),Ss=null),s}function Bf(s){Ss===null?Ss=[s]:Ss.push(s)}var Rw=$(null),Yl=null,Da=null;function Cs(s,l,p){A(Rw,l._currentValue),l._currentValue=p}function $a(s){s._currentValue=Rw.current,V(Rw)}function Iw(s,l,p){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===p)break;s=s.return}}function Nw(s,l,p,g){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var _=w.dependencies;if(_!==null){var I=w.child;_=_.firstContext;e:for(;_!==null;){var P=_;_=w;for(var Z=0;Z<l.length;Z++)if(P.context===l[Z]){_.lanes|=p,P=_.alternate,P!==null&&(P.lanes|=p),Iw(_.return,p,s),g||(I=null);break e}_=P.next}}else if(w.tag===18){if(I=w.return,I===null)throw Error(r(341));I.lanes|=p,_=I.alternate,_!==null&&(_.lanes|=p),Iw(I,p,s),I=null}else I=w.child;if(I!==null)I.return=w;else for(I=w;I!==null;){if(I===s){I=null;break}if(w=I.sibling,w!==null){w.return=I.return,I=w;break}I=I.return}w=I}}function ku(s,l,p,g){s=null;for(var w=l,_=!1;w!==null;){if(!_){if((w.flags&524288)!==0)_=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var I=w.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var P=w.type;ji(w.pendingProps.value,I.value)||(s!==null?s.push(P):s=[P])}}else if(w===B.current){if(I=w.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(gp):s=[gp])}w=w.return}s!==null&&Nw(l,s,p,g),l.flags|=262144}function lg(s){for(s=s.firstContext;s!==null;){if(!ji(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Wl(s){Yl=s,Da=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function br(s){return WN(Yl,s)}function cg(s,l){return Yl===null&&Wl(s),WN(s,l)}function WN(s,l){var p=l._currentValue;if(l={context:l,memoizedValue:p,next:null},Da===null){if(s===null)throw Error(r(308));Da=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Da=Da.next=l;return p}var YG=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(p,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(p){return p()})}},WG=e.unstable_scheduleCallback,XG=e.unstable_NormalPriority,Wn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tw(){return{controller:new YG,data:new Map,refCount:0}}function Hf(s){s.refCount--,s.refCount===0&&WG(XG,function(){s.controller.abort()})}var qf=null,Ow=0,Eu=0,ju=null;function JG(s,l){if(qf===null){var p=qf=[];Ow=0,Eu=$S(),ju={status:"pending",value:void 0,then:function(g){p.push(g)}}}return Ow++,l.then(XN,XN),l}function XN(){if(--Ow===0&&qf!==null){ju!==null&&(ju.status="fulfilled");var s=qf;qf=null,Eu=0,ju=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function QG(s,l){var p=[],g={status:"pending",value:null,reason:null,then:function(w){p.push(w)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var w=0;w<p.length;w++)(0,p[w])(l)},function(w){for(g.status="rejected",g.reason=w,w=0;w<p.length;w++)(0,p[w])(void 0)}),g}var JN=z.S;z.S=function(s,l){$O=re(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&JG(s,l),JN!==null&&JN(s,l)};var Xl=$(null);function Aw(){var s=Xl.current;return s!==null?s:un.pooledCache}function ug(s,l){l===null?A(Xl,Xl.current):A(Xl,l.pool)}function QN(){var s=Aw();return s===null?null:{parent:Wn._currentValue,pool:s}}var Ru=Error(r(460)),Dw=Error(r(474)),dg=Error(r(542)),fg={then:function(){}};function eT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function tT(s,l,p){switch(p=s[p],p===void 0?s.push(l):p!==l&&(l.then(Na,Na),l=p),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,rT(s),s;default:if(typeof l.status=="string")l.then(Na,Na);else{if(s=un,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var w=l;w.status="fulfilled",w.value=g}},function(g){if(l.status==="pending"){var w=l;w.status="rejected",w.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,rT(s),s}throw Ql=l,Ru}}function Jl(s){try{var l=s._init;return l(s._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(Ql=p,Ru):p}}var Ql=null;function nT(){if(Ql===null)throw Error(r(459));var s=Ql;return Ql=null,s}function rT(s){if(s===Ru||s===dg)throw Error(r(483))}var Iu=null,Kf=0;function pg(s){var l=Kf;return Kf+=1,Iu===null&&(Iu=[]),tT(Iu,s,l)}function Gf(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function mg(s,l){throw l.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function iT(s){function l(ie,ne){if(s){var le=ie.deletions;le===null?(ie.deletions=[ne],ie.flags|=16):le.push(ne)}}function p(ie,ne){if(!s)return null;for(;ne!==null;)l(ie,ne),ne=ne.sibling;return null}function g(ie){for(var ne=new Map;ie!==null;)ie.key!==null?ne.set(ie.key,ie):ne.set(ie.index,ie),ie=ie.sibling;return ne}function w(ie,ne){return ie=Oa(ie,ne),ie.index=0,ie.sibling=null,ie}function _(ie,ne,le){return ie.index=le,s?(le=ie.alternate,le!==null?(le=le.index,le<ne?(ie.flags|=67108866,ne):le):(ie.flags|=67108866,ne)):(ie.flags|=1048576,ne)}function I(ie){return s&&ie.alternate===null&&(ie.flags|=67108866),ie}function P(ie,ne,le,xe){return ne===null||ne.tag!==6?(ne=Sw(le,ie.mode,xe),ne.return=ie,ne):(ne=w(ne,le),ne.return=ie,ne)}function Z(ie,ne,le,xe){var Je=le.type;return Je===S?ye(ie,ne,le.props.children,xe,le.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&Jl(Je)===ne.type)?(ne=w(ne,le.props),Gf(ne,le),ne.return=ie,ne):(ne=ag(le.type,le.key,le.props,null,ie.mode,xe),Gf(ne,le),ne.return=ie,ne)}function ce(ie,ne,le,xe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=_w(le,ie.mode,xe),ne.return=ie,ne):(ne=w(ne,le.children||[]),ne.return=ie,ne)}function ye(ie,ne,le,xe,Je){return ne===null||ne.tag!==7?(ne=Gl(le,ie.mode,xe,Je),ne.return=ie,ne):(ne=w(ne,le),ne.return=ie,ne)}function Se(ie,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Sw(""+ne,ie.mode,le),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case y:return le=ag(ne.type,ne.key,ne.props,null,ie.mode,le),Gf(le,ne),le.return=ie,le;case x:return ne=_w(ne,ie.mode,le),ne.return=ie,ne;case M:return ne=Jl(ne),Se(ie,ne,le)}if(H(ne)||q(ne))return ne=Gl(ne,ie.mode,le,null),ne.return=ie,ne;if(typeof ne.then=="function")return Se(ie,pg(ne),le);if(ne.$$typeof===j)return Se(ie,cg(ie,ne),le);mg(ie,ne)}return null}function de(ie,ne,le,xe){var Je=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Je!==null?null:P(ie,ne,""+le,xe);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case y:return le.key===Je?Z(ie,ne,le,xe):null;case x:return le.key===Je?ce(ie,ne,le,xe):null;case M:return le=Jl(le),de(ie,ne,le,xe)}if(H(le)||q(le))return Je!==null?null:ye(ie,ne,le,xe,null);if(typeof le.then=="function")return de(ie,ne,pg(le),xe);if(le.$$typeof===j)return de(ie,ne,cg(ie,le),xe);mg(ie,le)}return null}function he(ie,ne,le,xe,Je){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return ie=ie.get(le)||null,P(ne,ie,""+xe,Je);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case y:return ie=ie.get(xe.key===null?le:xe.key)||null,Z(ne,ie,xe,Je);case x:return ie=ie.get(xe.key===null?le:xe.key)||null,ce(ne,ie,xe,Je);case M:return xe=Jl(xe),he(ie,ne,le,xe,Je)}if(H(xe)||q(xe))return ie=ie.get(le)||null,ye(ne,ie,xe,Je,null);if(typeof xe.then=="function")return he(ie,ne,le,pg(xe),Je);if(xe.$$typeof===j)return he(ie,ne,le,cg(ne,xe),Je);mg(ne,xe)}return null}function Be(ie,ne,le,xe){for(var Je=null,Lt=null,Ge=ne,vt=ne=0,Tt=null;Ge!==null&&vt<le.length;vt++){Ge.index>vt?(Tt=Ge,Ge=null):Tt=Ge.sibling;var Ft=de(ie,Ge,le[vt],xe);if(Ft===null){Ge===null&&(Ge=Tt);break}s&&Ge&&Ft.alternate===null&&l(ie,Ge),ne=_(Ft,ne,vt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft,Ge=Tt}if(vt===le.length)return p(ie,Ge),Ot&&Aa(ie,vt),Je;if(Ge===null){for(;vt<le.length;vt++)Ge=Se(ie,le[vt],xe),Ge!==null&&(ne=_(Ge,ne,vt),Lt===null?Je=Ge:Lt.sibling=Ge,Lt=Ge);return Ot&&Aa(ie,vt),Je}for(Ge=g(Ge);vt<le.length;vt++)Tt=he(Ge,ie,vt,le[vt],xe),Tt!==null&&(s&&Tt.alternate!==null&&Ge.delete(Tt.key===null?vt:Tt.key),ne=_(Tt,ne,vt),Lt===null?Je=Tt:Lt.sibling=Tt,Lt=Tt);return s&&Ge.forEach(function(Vs){return l(ie,Vs)}),Ot&&Aa(ie,vt),Je}function tt(ie,ne,le,xe){if(le==null)throw Error(r(151));for(var Je=null,Lt=null,Ge=ne,vt=ne=0,Tt=null,Ft=le.next();Ge!==null&&!Ft.done;vt++,Ft=le.next()){Ge.index>vt?(Tt=Ge,Ge=null):Tt=Ge.sibling;var Vs=de(ie,Ge,Ft.value,xe);if(Vs===null){Ge===null&&(Ge=Tt);break}s&&Ge&&Vs.alternate===null&&l(ie,Ge),ne=_(Vs,ne,vt),Lt===null?Je=Vs:Lt.sibling=Vs,Lt=Vs,Ge=Tt}if(Ft.done)return p(ie,Ge),Ot&&Aa(ie,vt),Je;if(Ge===null){for(;!Ft.done;vt++,Ft=le.next())Ft=Se(ie,Ft.value,xe),Ft!==null&&(ne=_(Ft,ne,vt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft);return Ot&&Aa(ie,vt),Je}for(Ge=g(Ge);!Ft.done;vt++,Ft=le.next())Ft=he(Ge,ie,vt,Ft.value,xe),Ft!==null&&(s&&Ft.alternate!==null&&Ge.delete(Ft.key===null?vt:Ft.key),ne=_(Ft,ne,vt),Lt===null?Je=Ft:Lt.sibling=Ft,Lt=Ft);return s&&Ge.forEach(function(uY){return l(ie,uY)}),Ot&&Aa(ie,vt),Je}function rn(ie,ne,le,xe){if(typeof le=="object"&&le!==null&&le.type===S&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case y:e:{for(var Je=le.key;ne!==null;){if(ne.key===Je){if(Je=le.type,Je===S){if(ne.tag===7){p(ie,ne.sibling),xe=w(ne,le.props.children),xe.return=ie,ie=xe;break e}}else if(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&Jl(Je)===ne.type){p(ie,ne.sibling),xe=w(ne,le.props),Gf(xe,le),xe.return=ie,ie=xe;break e}p(ie,ne);break}else l(ie,ne);ne=ne.sibling}le.type===S?(xe=Gl(le.props.children,ie.mode,xe,le.key),xe.return=ie,ie=xe):(xe=ag(le.type,le.key,le.props,null,ie.mode,xe),Gf(xe,le),xe.return=ie,ie=xe)}return I(ie);case x:e:{for(Je=le.key;ne!==null;){if(ne.key===Je)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){p(ie,ne.sibling),xe=w(ne,le.children||[]),xe.return=ie,ie=xe;break e}else{p(ie,ne);break}else l(ie,ne);ne=ne.sibling}xe=_w(le,ie.mode,xe),xe.return=ie,ie=xe}return I(ie);case M:return le=Jl(le),rn(ie,ne,le,xe)}if(H(le))return Be(ie,ne,le,xe);if(q(le)){if(Je=q(le),typeof Je!="function")throw Error(r(150));return le=Je.call(le),tt(ie,ne,le,xe)}if(typeof le.then=="function")return rn(ie,ne,pg(le),xe);if(le.$$typeof===j)return rn(ie,ne,cg(ie,le),xe);mg(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ne!==null&&ne.tag===6?(p(ie,ne.sibling),xe=w(ne,le),xe.return=ie,ie=xe):(p(ie,ne),xe=Sw(le,ie.mode,xe),xe.return=ie,ie=xe),I(ie)):p(ie,ne)}return function(ie,ne,le,xe){try{Kf=0;var Je=rn(ie,ne,le,xe);return Iu=null,Je}catch(Ge){if(Ge===Ru||Ge===dg)throw Ge;var Lt=Ri(29,Ge,null,ie.mode);return Lt.lanes=xe,Lt.return=ie,Lt}}}var ec=iT(!0),oT=iT(!1),ks=!1;function $w(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pw(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Es(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function js(s,l,p){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Ht&2)!==0){var w=g.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),g.pending=l,l=og(s),VN(s,null,p),l}return ig(s,g,l,p),og(s)}function Zf(s,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,p|=g,l.lanes=p,ri(s,p)}}function Mw(s,l){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 I={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};_===null?w=_=I:_=_.next=I,p=p.next}while(p!==null);_===null?w=_=l:_=_.next=l}else w=_=l;p={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:_,shared:g.shared,callbacks:g.callbacks},s.updateQueue=p;return}s=p.lastBaseUpdate,s===null?p.firstBaseUpdate=l:s.next=l,p.lastBaseUpdate=l}var zw=!1;function Yf(){if(zw){var s=ju;if(s!==null)throw s}}function Wf(s,l,p,g){zw=!1;var w=s.updateQueue;ks=!1;var _=w.firstBaseUpdate,I=w.lastBaseUpdate,P=w.shared.pending;if(P!==null){w.shared.pending=null;var Z=P,ce=Z.next;Z.next=null,I===null?_=ce:I.next=ce,I=Z;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,P=ye.lastBaseUpdate,P!==I&&(P===null?ye.firstBaseUpdate=ce:P.next=ce,ye.lastBaseUpdate=Z))}if(_!==null){var Se=w.baseState;I=0,ye=ce=Z=null,P=_;do{var de=P.lane&-536870913,he=de!==P.lane;if(he?(Nt&de)===de:(g&de)===de){de!==0&&de===Eu&&(zw=!0),ye!==null&&(ye=ye.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Be=s,tt=P;de=l;var rn=p;switch(tt.tag){case 1:if(Be=tt.payload,typeof Be=="function"){Se=Be.call(rn,Se,de);break e}Se=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=tt.payload,de=typeof Be=="function"?Be.call(rn,Se,de):Be,de==null)break e;Se=h({},Se,de);break e;case 2:ks=!0}}de=P.callback,de!==null&&(s.flags|=64,he&&(s.flags|=8192),he=w.callbacks,he===null?w.callbacks=[de]:he.push(de))}else he={lane:de,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ye===null?(ce=ye=he,Z=Se):ye=ye.next=he,I|=de;if(P=P.next,P===null){if(P=w.shared.pending,P===null)break;he=P,P=he.next,he.next=null,w.lastBaseUpdate=he,w.shared.pending=null}}while(!0);ye===null&&(Z=Se),w.baseState=Z,w.firstBaseUpdate=ce,w.lastBaseUpdate=ye,_===null&&(w.shared.lanes=0),Os|=I,s.lanes=I,s.memoizedState=Se}}function aT(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function sT(s,l){var p=s.callbacks;if(p!==null)for(s.callbacks=null,s=0;s<p.length;s++)aT(p[s],l)}var Nu=$(null),hg=$(0);function lT(s,l){s=Ha,A(hg,s),A(Nu,l),Ha=s|l.baseLanes}function Lw(){A(hg,Ha),A(Nu,Nu.current)}function Fw(){Ha=hg.current,V(Nu),V(hg)}var Ii=$(null),lo=null;function Rs(s){var l=s.alternate;A(Vn,Vn.current&1),A(Ii,s),lo===null&&(l===null||Nu.current!==null||l.memoizedState!==null)&&(lo=s)}function Uw(s){A(Vn,Vn.current),A(Ii,s),lo===null&&(lo=s)}function cT(s){s.tag===22?(A(Vn,Vn.current),A(Ii,s),lo===null&&(lo=s)):Is()}function Is(){A(Vn,Vn.current),A(Ii,Ii.current)}function Ni(s){V(Ii),lo===s&&(lo=null),V(Vn)}var Vn=$(0);function gg(s){for(var l=s;l!==null;){if(l.tag===13){var p=l.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||GS(p)||ZS(p)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Pa=0,pt=null,tn=null,Xn=null,vg=!1,Tu=!1,tc=!1,yg=0,Xf=0,Ou=null,eZ=0;function Pn(){throw Error(r(321))}function Vw(s,l){if(l===null)return!1;for(var p=0;p<l.length&&p<s.length;p++)if(!ji(s[p],l[p]))return!1;return!0}function Bw(s,l,p,g,w,_){return Pa=_,pt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,z.H=s===null||s.memoizedState===null?KT:iS,tc=!1,_=p(g,w),tc=!1,Tu&&(_=dT(l,p,g,w)),uT(s),_}function uT(s){z.H=ep;var l=tn!==null&&tn.next!==null;if(Pa=0,Xn=tn=pt=null,vg=!1,Xf=0,Ou=null,l)throw Error(r(300));s===null||Jn||(s=s.dependencies,s!==null&&lg(s)&&(Jn=!0))}function dT(s,l,p,g){pt=s;var w=0;do{if(Tu&&(Ou=null),Xf=0,Tu=!1,25<=w)throw Error(r(301));if(w+=1,Xn=tn=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}z.H=GT,_=l(p,g)}while(Tu);return _}function tZ(){var s=z.H,l=s.useState()[0];return l=typeof l.then=="function"?Jf(l):l,s=s.useState()[0],(tn!==null?tn.memoizedState:null)!==s&&(pt.flags|=1024),l}function Hw(){var s=yg!==0;return yg=0,s}function qw(s,l,p){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~p}function Kw(s){if(vg){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}vg=!1}Pa=0,Xn=tn=pt=null,Tu=!1,Xf=yg=0,Ou=null}function Ur(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?pt.memoizedState=Xn=s:Xn=Xn.next=s,Xn}function Bn(){if(tn===null){var s=pt.alternate;s=s!==null?s.memoizedState:null}else s=tn.next;var l=Xn===null?pt.memoizedState:Xn.next;if(l!==null)Xn=l,tn=s;else{if(s===null)throw pt.alternate===null?Error(r(467)):Error(r(310));tn=s,s={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},Xn===null?pt.memoizedState=Xn=s:Xn=Xn.next=s}return Xn}function bg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jf(s){var l=Xf;return Xf+=1,Ou===null&&(Ou=[]),s=tT(Ou,s,l),l=pt,(Xn===null?l.memoizedState:Xn.next)===null&&(l=l.alternate,z.H=l===null||l.memoizedState===null?KT:iS),s}function xg(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Jf(s);if(s.$$typeof===j)return br(s)}throw Error(r(438,String(s)))}function Gw(s){var l=null,p=pt.updateQueue;if(p!==null&&(l=p.memoCache),l==null){var g=pt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(w){return w.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),p===null&&(p=bg(),pt.updateQueue=p),p.memoCache=l,p=l.data[l.index],p===void 0)for(p=l.data[l.index]=Array(s),g=0;g<s;g++)p[g]=K;return l.index++,p}function Ma(s,l){return typeof l=="function"?l(s):l}function wg(s){var l=Bn();return Zw(l,tn,s)}function Zw(s,l,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 I=w.next;w.next=_.next,_.next=I}l.baseQueue=w=_,g.pending=null}if(_=s.baseState,w===null)s.memoizedState=_;else{l=w.next;var P=I=null,Z=null,ce=l,ye=!1;do{var Se=ce.lane&-536870913;if(Se!==ce.lane?(Nt&Se)===Se:(Pa&Se)===Se){var de=ce.revertLane;if(de===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Se===Eu&&(ye=!0);else if((Pa&de)===de){ce=ce.next,de===Eu&&(ye=!0);continue}else Se={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Z===null?(P=Z=Se,I=_):Z=Z.next=Se,pt.lanes|=de,Os|=de;Se=ce.action,tc&&p(_,Se),_=ce.hasEagerState?ce.eagerState:p(_,Se)}else de={lane:Se,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Z===null?(P=Z=de,I=_):Z=Z.next=de,pt.lanes|=Se,Os|=Se;ce=ce.next}while(ce!==null&&ce!==l);if(Z===null?I=_:Z.next=P,!ji(_,s.memoizedState)&&(Jn=!0,ye&&(p=ju,p!==null)))throw p;s.memoizedState=_,s.baseState=I,s.baseQueue=Z,g.lastRenderedState=_}return w===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Yw(s){var l=Bn(),p=l.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=s;var g=p.dispatch,w=p.pending,_=l.memoizedState;if(w!==null){p.pending=null;var I=w=w.next;do _=s(_,I.action),I=I.next;while(I!==w);ji(_,l.memoizedState)||(Jn=!0),l.memoizedState=_,l.baseQueue===null&&(l.baseState=_),p.lastRenderedState=_}return[_,g]}function fT(s,l,p){var g=pt,w=Bn(),_=Ot;if(_){if(p===void 0)throw Error(r(407));p=p()}else p=l();var I=!ji((tn||w).memoizedState,p);if(I&&(w.memoizedState=p,Jn=!0),w=w.queue,Jw(hT.bind(null,g,w,s),[s]),w.getSnapshot!==l||I||Xn!==null&&Xn.memoizedState.tag&1){if(g.flags|=2048,Au(9,{destroy:void 0},mT.bind(null,g,w,p,l),null),un===null)throw Error(r(349));_||(Pa&127)!==0||pT(g,l,p)}return p}function pT(s,l,p){s.flags|=16384,s={getSnapshot:l,value:p},l=pt.updateQueue,l===null?(l=bg(),pt.updateQueue=l,l.stores=[s]):(p=l.stores,p===null?l.stores=[s]:p.push(s))}function mT(s,l,p,g){l.value=p,l.getSnapshot=g,gT(l)&&vT(s)}function hT(s,l,p){return p(function(){gT(l)&&vT(s)})}function gT(s){var l=s.getSnapshot;s=s.value;try{var p=l();return!ji(s,p)}catch{return!0}}function vT(s){var l=Kl(s,2);l!==null&&di(l,s,2)}function Ww(s){var l=Ur();if(typeof s=="function"){var p=s;if(s=p(),tc){wn(!0);try{p()}finally{wn(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:s},l}function yT(s,l,p,g){return s.baseState=p,Zw(s,tn,typeof g=="function"?g:Ma)}function nZ(s,l,p,g,w){if(Cg(s))throw Error(r(485));if(s=l.action,s!==null){var _={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){_.listeners.push(I)}};z.T!==null?p(!0):_.isTransition=!1,g(_),p=l.pending,p===null?(_.next=l.pending=_,bT(l,_)):(_.next=p.next,l.pending=p.next=_)}}function bT(s,l){var p=l.action,g=l.payload,w=s.state;if(l.isTransition){var _=z.T,I={};z.T=I;try{var P=p(w,g),Z=z.S;Z!==null&&Z(I,P),xT(s,l,P)}catch(ce){Xw(s,l,ce)}finally{_!==null&&I.types!==null&&(_.types=I.types),z.T=_}}else try{_=p(w,g),xT(s,l,_)}catch(ce){Xw(s,l,ce)}}function xT(s,l,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(g){wT(s,l,g)},function(g){return Xw(s,l,g)}):wT(s,l,p)}function wT(s,l,p){l.status="fulfilled",l.value=p,ST(l),s.state=p,l=s.pending,l!==null&&(p=l.next,p===l?s.pending=null:(p=p.next,l.next=p,bT(s,p)))}function Xw(s,l,p){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=p,ST(l),l=l.next;while(l!==g)}s.action=null}function ST(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function _T(s,l){return l}function CT(s,l){if(Ot){var p=un.formState;if(p!==null){e:{var g=pt;if(Ot){if(_n){t:{for(var w=_n,_=so;w.nodeType!==8;){if(!_){w=null;break t}if(w=co(w.nextSibling),w===null){w=null;break t}}_=w.data,w=_==="F!"||_==="F"?w:null}if(w){_n=co(w.nextSibling),g=w.data==="F!";break e}}_s(g)}g=!1}g&&(l=p[0])}}return p=Ur(),p.memoizedState=p.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_T,lastRenderedState:l},p.queue=g,p=BT.bind(null,pt,g),g.dispatch=p,g=Ww(!1),_=rS.bind(null,pt,!1,g.queue),g=Ur(),w={state:l,dispatch:null,action:s,pending:null},g.queue=w,p=nZ.bind(null,pt,w,_,p),w.dispatch=p,g.memoizedState=s,[l,p,!1]}function kT(s){var l=Bn();return ET(l,tn,s)}function ET(s,l,p){if(l=Zw(s,l,_T)[0],s=wg(Ma)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=Jf(l)}catch(I){throw I===Ru?dg:I}else g=l;l=Bn();var w=l.queue,_=w.dispatch;return p!==l.memoizedState&&(pt.flags|=2048,Au(9,{destroy:void 0},rZ.bind(null,w,p),null)),[g,_,s]}function rZ(s,l){s.action=l}function jT(s){var l=Bn(),p=tn;if(p!==null)return ET(l,p,s);Bn(),l=l.memoizedState,p=Bn();var g=p.queue.dispatch;return p.memoizedState=s,[l,g,!1]}function Au(s,l,p,g){return s={tag:s,create:p,deps:g,inst:l,next:null},l=pt.updateQueue,l===null&&(l=bg(),pt.updateQueue=l),p=l.lastEffect,p===null?l.lastEffect=s.next=s:(g=p.next,p.next=s,s.next=g,l.lastEffect=s),s}function RT(){return Bn().memoizedState}function Sg(s,l,p,g){var w=Ur();pt.flags|=s,w.memoizedState=Au(1|l,{destroy:void 0},p,g===void 0?null:g)}function _g(s,l,p,g){var w=Bn();g=g===void 0?null:g;var _=w.memoizedState.inst;tn!==null&&g!==null&&Vw(g,tn.memoizedState.deps)?w.memoizedState=Au(l,_,p,g):(pt.flags|=s,w.memoizedState=Au(1|l,_,p,g))}function IT(s,l){Sg(8390656,8,s,l)}function Jw(s,l){_g(2048,8,s,l)}function iZ(s){pt.flags|=4;var l=pt.updateQueue;if(l===null)l=bg(),pt.updateQueue=l,l.events=[s];else{var p=l.events;p===null?l.events=[s]:p.push(s)}}function NT(s){var l=Bn().memoizedState;return iZ({ref:l,nextImpl:s}),function(){if((Ht&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function TT(s,l){return _g(4,2,s,l)}function OT(s,l){return _g(4,4,s,l)}function AT(s,l){if(typeof l=="function"){s=s();var p=l(s);return function(){typeof p=="function"?p():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function DT(s,l,p){p=p!=null?p.concat([s]):null,_g(4,4,AT.bind(null,l,s),p)}function Qw(){}function $T(s,l){var p=Bn();l=l===void 0?null:l;var g=p.memoizedState;return l!==null&&Vw(l,g[1])?g[0]:(p.memoizedState=[s,l],s)}function PT(s,l){var p=Bn();l=l===void 0?null:l;var g=p.memoizedState;if(l!==null&&Vw(l,g[1]))return g[0];if(g=s(),tc){wn(!0);try{s()}finally{wn(!1)}}return p.memoizedState=[g,l],g}function eS(s,l,p){return p===void 0||(Pa&1073741824)!==0&&(Nt&261930)===0?s.memoizedState=l:(s.memoizedState=p,s=MO(),pt.lanes|=s,Os|=s,p)}function MT(s,l,p,g){return ji(p,l)?p:Nu.current!==null?(s=eS(s,p,g),ji(s,l)||(Jn=!0),s):(Pa&42)===0||(Pa&1073741824)!==0&&(Nt&261930)===0?(Jn=!0,s.memoizedState=p):(s=MO(),pt.lanes|=s,Os|=s,l)}function zT(s,l,p,g,w){var _=W.p;W.p=_!==0&&8>_?_:8;var I=z.T,P={};z.T=P,rS(s,!1,l,p);try{var Z=w(),ce=z.S;if(ce!==null&&ce(P,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ye=QG(Z,g);Qf(s,l,ye,Ai(s))}else Qf(s,l,g,Ai(s))}catch(Se){Qf(s,l,{then:function(){},status:"rejected",reason:Se},Ai())}finally{W.p=_,I!==null&&P.types!==null&&(I.types=P.types),z.T=I}}function oZ(){}function tS(s,l,p,g){if(s.tag!==5)throw Error(r(476));var w=LT(s).queue;zT(s,w,l,F,p===null?oZ:function(){return FT(s),p(g)})}function LT(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:F},next:null};var p={};return l.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:p},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function FT(s){var l=LT(s);l.next===null&&(l=s.alternate.memoizedState),Qf(s,l.next.queue,{},Ai())}function nS(){return br(gp)}function UT(){return Bn().memoizedState}function VT(){return Bn().memoizedState}function aZ(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var p=Ai();s=Es(p);var g=js(l,s,p);g!==null&&(di(g,l,p),Zf(g,l,p)),l={cache:Tw()},s.payload=l;return}l=l.return}}function sZ(s,l,p){var g=Ai();p={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Cg(s)?HT(l,p):(p=xw(s,l,p,g),p!==null&&(di(p,s,g),qT(p,l,g)))}function BT(s,l,p){var g=Ai();Qf(s,l,p,g)}function Qf(s,l,p,g){var w={lane:g,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Cg(s))HT(l,w);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=l.lastRenderedReducer,_!==null))try{var I=l.lastRenderedState,P=_(I,p);if(w.hasEagerState=!0,w.eagerState=P,ji(P,I))return ig(s,l,w,0),un===null&&rg(),!1}catch{}if(p=xw(s,l,w,g),p!==null)return di(p,s,g),qT(p,l,g),!0}return!1}function rS(s,l,p,g){if(g={lane:2,revertLane:$S(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Cg(s)){if(l)throw Error(r(479))}else l=xw(s,p,g,2),l!==null&&di(l,s,2)}function Cg(s){var l=s.alternate;return s===pt||l!==null&&l===pt}function HT(s,l){Tu=vg=!0;var p=s.pending;p===null?l.next=l:(l.next=p.next,p.next=l),s.pending=l}function qT(s,l,p){if((p&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,p|=g,l.lanes=p,ri(s,p)}}var ep={readContext:br,use:xg,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useInsertionEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useSyncExternalStore:Pn,useId:Pn,useHostTransitionStatus:Pn,useFormState:Pn,useActionState:Pn,useOptimistic:Pn,useMemoCache:Pn,useCacheRefresh:Pn};ep.useEffectEvent=Pn;var KT={readContext:br,use:xg,useCallback:function(s,l){return Ur().memoizedState=[s,l===void 0?null:l],s},useContext:br,useEffect:IT,useImperativeHandle:function(s,l,p){p=p!=null?p.concat([s]):null,Sg(4194308,4,AT.bind(null,l,s),p)},useLayoutEffect:function(s,l){return Sg(4194308,4,s,l)},useInsertionEffect:function(s,l){Sg(4,2,s,l)},useMemo:function(s,l){var p=Ur();l=l===void 0?null:l;var g=s();if(tc){wn(!0);try{s()}finally{wn(!1)}}return p.memoizedState=[g,l],g},useReducer:function(s,l,p){var g=Ur();if(p!==void 0){var w=p(l);if(tc){wn(!0);try{p(l)}finally{wn(!1)}}}else w=l;return g.memoizedState=g.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},g.queue=s,s=s.dispatch=sZ.bind(null,pt,s),[g.memoizedState,s]},useRef:function(s){var l=Ur();return s={current:s},l.memoizedState=s},useState:function(s){s=Ww(s);var l=s.queue,p=BT.bind(null,pt,l);return l.dispatch=p,[s.memoizedState,p]},useDebugValue:Qw,useDeferredValue:function(s,l){var p=Ur();return eS(p,s,l)},useTransition:function(){var s=Ww(!1);return s=zT.bind(null,pt,s.queue,!0,!1),Ur().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,p){var g=pt,w=Ur();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=l(),un===null)throw Error(r(349));(Nt&127)!==0||pT(g,l,p)}w.memoizedState=p;var _={value:p,getSnapshot:l};return w.queue=_,IT(hT.bind(null,g,_,s),[s]),g.flags|=2048,Au(9,{destroy:void 0},mT.bind(null,g,_,p,l),null),p},useId:function(){var s=Ur(),l=un.identifierPrefix;if(Ot){var p=ta,g=ea;p=(g&~(1<<32-_t(g)-1)).toString(32)+p,l="_"+l+"R_"+p,p=yg++,0<p&&(l+="H"+p.toString(32)),l+="_"}else p=eZ++,l="_"+l+"r_"+p.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:nS,useFormState:CT,useActionState:CT,useOptimistic:function(s){var l=Ur();l.memoizedState=l.baseState=s;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=p,l=rS.bind(null,pt,!0,p),p.dispatch=l,[s,l]},useMemoCache:Gw,useCacheRefresh:function(){return Ur().memoizedState=aZ.bind(null,pt)},useEffectEvent:function(s){var l=Ur(),p={impl:s};return l.memoizedState=p,function(){if((Ht&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},iS={readContext:br,use:xg,useCallback:$T,useContext:br,useEffect:Jw,useImperativeHandle:DT,useInsertionEffect:TT,useLayoutEffect:OT,useMemo:PT,useReducer:wg,useRef:RT,useState:function(){return wg(Ma)},useDebugValue:Qw,useDeferredValue:function(s,l){var p=Bn();return MT(p,tn.memoizedState,s,l)},useTransition:function(){var s=wg(Ma)[0],l=Bn().memoizedState;return[typeof s=="boolean"?s:Jf(s),l]},useSyncExternalStore:fT,useId:UT,useHostTransitionStatus:nS,useFormState:kT,useActionState:kT,useOptimistic:function(s,l){var p=Bn();return yT(p,tn,s,l)},useMemoCache:Gw,useCacheRefresh:VT};iS.useEffectEvent=NT;var GT={readContext:br,use:xg,useCallback:$T,useContext:br,useEffect:Jw,useImperativeHandle:DT,useInsertionEffect:TT,useLayoutEffect:OT,useMemo:PT,useReducer:Yw,useRef:RT,useState:function(){return Yw(Ma)},useDebugValue:Qw,useDeferredValue:function(s,l){var p=Bn();return tn===null?eS(p,s,l):MT(p,tn.memoizedState,s,l)},useTransition:function(){var s=Yw(Ma)[0],l=Bn().memoizedState;return[typeof s=="boolean"?s:Jf(s),l]},useSyncExternalStore:fT,useId:UT,useHostTransitionStatus:nS,useFormState:jT,useActionState:jT,useOptimistic:function(s,l){var p=Bn();return tn!==null?yT(p,tn,s,l):(p.baseState=s,[s,p.queue.dispatch])},useMemoCache:Gw,useCacheRefresh:VT};GT.useEffectEvent=NT;function oS(s,l,p,g){l=s.memoizedState,p=p(g,l),p=p==null?l:h({},l,p),s.memoizedState=p,s.lanes===0&&(s.updateQueue.baseState=p)}var aS={enqueueSetState:function(s,l,p){s=s._reactInternals;var g=Ai(),w=Es(g);w.payload=l,p!=null&&(w.callback=p),l=js(s,w,g),l!==null&&(di(l,s,g),Zf(l,s,g))},enqueueReplaceState:function(s,l,p){s=s._reactInternals;var g=Ai(),w=Es(g);w.tag=1,w.payload=l,p!=null&&(w.callback=p),l=js(s,w,g),l!==null&&(di(l,s,g),Zf(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var p=Ai(),g=Es(p);g.tag=2,l!=null&&(g.callback=l),l=js(s,g,p),l!==null&&(di(l,s,p),Zf(l,s,p))}};function ZT(s,l,p,g,w,_,I){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,_,I):l.prototype&&l.prototype.isPureReactComponent?!Ff(p,g)||!Ff(w,_):!0}function YT(s,l,p,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(p,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(p,g),l.state!==s&&aS.enqueueReplaceState(l,l.state,null)}function nc(s,l){var p=l;if("ref"in l){p={};for(var g in l)g!=="ref"&&(p[g]=l[g])}if(s=s.defaultProps){p===l&&(p=h({},p));for(var w in s)p[w]===void 0&&(p[w]=s[w])}return p}function WT(s){ng(s)}function XT(s){console.error(s)}function JT(s){ng(s)}function kg(s,l){try{var p=s.onUncaughtError;p(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function QT(s,l,p){try{var g=s.onCaughtError;g(p.value,{componentStack:p.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function sS(s,l,p){return p=Es(p),p.tag=3,p.payload={element:null},p.callback=function(){kg(s,l)},p}function eO(s){return s=Es(s),s.tag=3,s}function tO(s,l,p,g){var w=p.type.getDerivedStateFromError;if(typeof w=="function"){var _=g.value;s.payload=function(){return w(_)},s.callback=function(){QT(l,p,g)}}var I=p.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(s.callback=function(){QT(l,p,g),typeof w!="function"&&(As===null?As=new Set([this]):As.add(this));var P=g.stack;this.componentDidCatch(g.value,{componentStack:P!==null?P:""})})}function lZ(s,l,p,g,w){if(p.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=p.alternate,l!==null&&ku(l,p,w,!0),p=Ii.current,p!==null){switch(p.tag){case 31:case 13:return lo===null?Mg():p.alternate===null&&Mn===0&&(Mn=3),p.flags&=-257,p.flags|=65536,p.lanes=w,g===fg?p.flags|=16384:(l=p.updateQueue,l===null?p.updateQueue=new Set([g]):l.add(g),OS(s,g,w)),!1;case 22:return p.flags|=65536,g===fg?p.flags|=16384:(l=p.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},p.updateQueue=l):(p=l.retryQueue,p===null?l.retryQueue=new Set([g]):p.add(g)),OS(s,g,w)),!1}throw Error(r(435,p.tag))}return OS(s,g,w),Mg(),!1}if(Ot)return l=Ii.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=w,g!==Ew&&(s=Error(r(422),{cause:g}),Bf(io(s,p)))):(g!==Ew&&(l=Error(r(423),{cause:g}),Bf(io(l,p))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,g=io(g,p),w=sS(s.stateNode,g,w),Mw(s,w),Mn!==4&&(Mn=2)),!1;var _=Error(r(520),{cause:g});if(_=io(_,p),lp===null?lp=[_]:lp.push(_),Mn!==4&&(Mn=2),l===null)return!0;g=io(g,p),p=l;do{switch(p.tag){case 3:return p.flags|=65536,s=w&-w,p.lanes|=s,s=sS(p.stateNode,g,s),Mw(p,s),!1;case 1:if(l=p.type,_=p.stateNode,(p.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(As===null||!As.has(_))))return p.flags|=65536,w&=-w,p.lanes|=w,w=eO(w),tO(w,s,p,g),Mw(p,w),!1}p=p.return}while(p!==null);return!1}var lS=Error(r(461)),Jn=!1;function xr(s,l,p,g){l.child=s===null?oT(l,null,p,g):ec(l,s.child,p,g)}function nO(s,l,p,g,w){p=p.render;var _=l.ref;if("ref"in g){var I={};for(var P in g)P!=="ref"&&(I[P]=g[P])}else I=g;return Wl(l),g=Bw(s,l,p,I,_,w),P=Hw(),s!==null&&!Jn?(qw(s,l,w),za(s,l,w)):(Ot&&P&&Cw(l),l.flags|=1,xr(s,l,g,w),l.child)}function rO(s,l,p,g,w){if(s===null){var _=p.type;return typeof _=="function"&&!ww(_)&&_.defaultProps===void 0&&p.compare===null?(l.tag=15,l.type=_,iO(s,l,_,g,w)):(s=ag(p.type,null,g,l,l.mode,w),s.ref=l.ref,s.return=l,l.child=s)}if(_=s.child,!gS(s,w)){var I=_.memoizedProps;if(p=p.compare,p=p!==null?p:Ff,p(I,g)&&s.ref===l.ref)return za(s,l,w)}return l.flags|=1,s=Oa(_,g),s.ref=l.ref,s.return=l,l.child=s}function iO(s,l,p,g,w){if(s!==null){var _=s.memoizedProps;if(Ff(_,g)&&s.ref===l.ref)if(Jn=!1,l.pendingProps=g=_,gS(s,w))(s.flags&131072)!==0&&(Jn=!0);else return l.lanes=s.lanes,za(s,l,w)}return cS(s,l,p,g,w)}function oO(s,l,p,g){var w=g.children,_=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(_=_!==null?_.baseLanes|p:p,s!==null){for(g=l.child=s.child,w=0;g!==null;)w=w|g.lanes|g.childLanes,g=g.sibling;g=w&~_}else g=0,l.child=null;return aO(s,l,_,p,g)}if((p&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&ug(l,_!==null?_.cachePool:null),_!==null?lT(l,_):Lw(),cT(l);else return g=l.lanes=536870912,aO(s,l,_!==null?_.baseLanes|p:p,p,g)}else _!==null?(ug(l,_.cachePool),lT(l,_),Is(),l.memoizedState=null):(s!==null&&ug(l,null),Lw(),Is());return xr(s,l,w,p),l.child}function tp(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function aO(s,l,p,g,w){var _=Aw();return _=_===null?null:{parent:Wn._currentValue,pool:_},l.memoizedState={baseLanes:p,cachePool:_},s!==null&&ug(l,null),Lw(),cT(l),s!==null&&ku(s,l,g,!0),l.childLanes=w,null}function Eg(s,l){return l=Rg({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function sO(s,l,p){return ec(l,s.child,null,p),s=Eg(l,l.pendingProps),s.flags|=2,Ni(l),l.memoizedState=null,s}function cZ(s,l,p){var g=l.pendingProps,w=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(Ot){if(g.mode==="hidden")return s=Eg(l,g),l.lanes=536870912,tp(null,s);if(Uw(l),(s=_n)?(s=bA(s,so),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},p=HN(s),p.return=l,l.child=p,yr=l,_n=null)):s=null,s===null)throw _s(l);return l.lanes=536870912,null}return Eg(l,g)}var _=s.memoizedState;if(_!==null){var I=_.dehydrated;if(Uw(l),w)if(l.flags&256)l.flags&=-257,l=sO(s,l,p);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(Jn||ku(s,l,p,!1),w=(p&s.childLanes)!==0,Jn||w){if(g=un,g!==null&&(I=ii(g,p),I!==0&&I!==_.retryLane))throw _.retryLane=I,Kl(s,I),di(g,s,I),lS;Mg(),l=sO(s,l,p)}else s=_.treeContext,_n=co(I.nextSibling),yr=l,Ot=!0,Ss=null,so=!1,s!==null&&GN(l,s),l=Eg(l,g),l.flags|=4096;return l}return s=Oa(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function jg(s,l){var p=l.ref;if(p===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(s===null||s.ref!==p)&&(l.flags|=4194816)}}function cS(s,l,p,g,w){return Wl(l),p=Bw(s,l,p,g,void 0,w),g=Hw(),s!==null&&!Jn?(qw(s,l,w),za(s,l,w)):(Ot&&g&&Cw(l),l.flags|=1,xr(s,l,p,w),l.child)}function lO(s,l,p,g,w,_){return Wl(l),l.updateQueue=null,p=dT(l,g,p,w),uT(s),g=Hw(),s!==null&&!Jn?(qw(s,l,_),za(s,l,_)):(Ot&&g&&Cw(l),l.flags|=1,xr(s,l,p,_),l.child)}function cO(s,l,p,g,w){if(Wl(l),l.stateNode===null){var _=wu,I=p.contextType;typeof I=="object"&&I!==null&&(_=br(I)),_=new p(g,_),l.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=aS,l.stateNode=_,_._reactInternals=l,_=l.stateNode,_.props=g,_.state=l.memoizedState,_.refs={},$w(l),I=p.contextType,_.context=typeof I=="object"&&I!==null?br(I):wu,_.state=l.memoizedState,I=p.getDerivedStateFromProps,typeof I=="function"&&(oS(l,p,I,g),_.state=l.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(I=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),I!==_.state&&aS.enqueueReplaceState(_,_.state,null),Wf(l,g,_,w),Yf(),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){_=l.stateNode;var P=l.memoizedProps,Z=nc(p,P);_.props=Z;var ce=_.context,ye=p.contextType;I=wu,typeof ye=="object"&&ye!==null&&(I=br(ye));var Se=p.getDerivedStateFromProps;ye=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(P||ce!==I)&&YT(l,_,g,I),ks=!1;var de=l.memoizedState;_.state=de,Wf(l,g,_,w),Yf(),ce=l.memoizedState,P||de!==ce||ks?(typeof Se=="function"&&(oS(l,p,Se,g),ce=l.memoizedState),(Z=ks||ZT(l,p,Z,g,de,ce,I))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(l.flags|=4194308)):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=ce),_.props=g,_.state=ce,_.context=I,g=Z):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{_=l.stateNode,Pw(s,l),I=l.memoizedProps,ye=nc(p,I),_.props=ye,Se=l.pendingProps,de=_.context,ce=p.contextType,Z=wu,typeof ce=="object"&&ce!==null&&(Z=br(ce)),P=p.getDerivedStateFromProps,(ce=typeof P=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(I!==Se||de!==Z)&&YT(l,_,g,Z),ks=!1,de=l.memoizedState,_.state=de,Wf(l,g,_,w),Yf();var he=l.memoizedState;I!==Se||de!==he||ks||s!==null&&s.dependencies!==null&&lg(s.dependencies)?(typeof P=="function"&&(oS(l,p,P,g),he=l.memoizedState),(ye=ks||ZT(l,p,ye,g,de,he,Z)||s!==null&&s.dependencies!==null&&lg(s.dependencies))?(ce||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(g,he,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(g,he,Z)),typeof _.componentDidUpdate=="function"&&(l.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof _.componentDidUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=he),_.props=g,_.state=he,_.context=Z,g=ye):(typeof _.componentDidUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&de===s.memoizedState||(l.flags|=1024),g=!1)}return _=g,jg(s,l),g=(l.flags&128)!==0,_||g?(_=l.stateNode,p=g&&typeof p.getDerivedStateFromError!="function"?null:_.render(),l.flags|=1,s!==null&&g?(l.child=ec(l,s.child,null,w),l.child=ec(l,null,p,w)):xr(s,l,p,w),l.memoizedState=_.state,s=l.child):s=za(s,l,w),s}function uO(s,l,p,g){return Zl(),l.flags|=256,xr(s,l,p,g),l.child}var uS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function dS(s){return{baseLanes:s,cachePool:QN()}}function fS(s,l,p){return s=s!==null?s.childLanes&~p:0,l&&(s|=Oi),s}function dO(s,l,p){var g=l.pendingProps,w=!1,_=(l.flags&128)!==0,I;if((I=_)||(I=s!==null&&s.memoizedState===null?!1:(Vn.current&2)!==0),I&&(w=!0,l.flags&=-129),I=(l.flags&32)!==0,l.flags&=-33,s===null){if(Ot){if(w?Rs(l):Is(),(s=_n)?(s=bA(s,so),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:ws!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},p=HN(s),p.return=l,l.child=p,yr=l,_n=null)):s=null,s===null)throw _s(l);return ZS(s)?l.lanes=32:l.lanes=536870912,null}var P=g.children;return g=g.fallback,w?(Is(),w=l.mode,P=Rg({mode:"hidden",children:P},w),g=Gl(g,w,p,null),P.return=l,g.return=l,P.sibling=g,l.child=P,g=l.child,g.memoizedState=dS(p),g.childLanes=fS(s,I,p),l.memoizedState=uS,tp(null,g)):(Rs(l),pS(l,P))}var Z=s.memoizedState;if(Z!==null&&(P=Z.dehydrated,P!==null)){if(_)l.flags&256?(Rs(l),l.flags&=-257,l=mS(s,l,p)):l.memoizedState!==null?(Is(),l.child=s.child,l.flags|=128,l=null):(Is(),P=g.fallback,w=l.mode,g=Rg({mode:"visible",children:g.children},w),P=Gl(P,w,p,null),P.flags|=2,g.return=l,P.return=l,g.sibling=P,l.child=g,ec(l,s.child,null,p),g=l.child,g.memoizedState=dS(p),g.childLanes=fS(s,I,p),l.memoizedState=uS,l=tp(null,g));else if(Rs(l),ZS(P)){if(I=P.nextSibling&&P.nextSibling.dataset,I)var ce=I.dgst;I=ce,g=Error(r(419)),g.stack="",g.digest=I,Bf({value:g,source:null,stack:null}),l=mS(s,l,p)}else if(Jn||ku(s,l,p,!1),I=(p&s.childLanes)!==0,Jn||I){if(I=un,I!==null&&(g=ii(I,p),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,Kl(s,g),di(I,s,g),lS;GS(P)||Mg(),l=mS(s,l,p)}else GS(P)?(l.flags|=192,l.child=s.child,l=null):(s=Z.treeContext,_n=co(P.nextSibling),yr=l,Ot=!0,Ss=null,so=!1,s!==null&&GN(l,s),l=pS(l,g.children),l.flags|=4096);return l}return w?(Is(),P=g.fallback,w=l.mode,Z=s.child,ce=Z.sibling,g=Oa(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,ce!==null?P=Oa(ce,P):(P=Gl(P,w,p,null),P.flags|=2),P.return=l,g.return=l,g.sibling=P,l.child=g,tp(null,g),g=l.child,P=s.child.memoizedState,P===null?P=dS(p):(w=P.cachePool,w!==null?(Z=Wn._currentValue,w=w.parent!==Z?{parent:Z,pool:Z}:w):w=QN(),P={baseLanes:P.baseLanes|p,cachePool:w}),g.memoizedState=P,g.childLanes=fS(s,I,p),l.memoizedState=uS,tp(s.child,g)):(Rs(l),p=s.child,s=p.sibling,p=Oa(p,{mode:"visible",children:g.children}),p.return=l,p.sibling=null,s!==null&&(I=l.deletions,I===null?(l.deletions=[s],l.flags|=16):I.push(s)),l.child=p,l.memoizedState=null,p)}function pS(s,l){return l=Rg({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function Rg(s,l){return s=Ri(22,s,null,l),s.lanes=0,s}function mS(s,l,p){return ec(l,s.child,null,p),s=pS(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function fO(s,l,p){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),Iw(s.return,l,p)}function hS(s,l,p,g,w,_){var I=s.memoizedState;I===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:p,tailMode:w,treeForkCount:_}:(I.isBackwards=l,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=p,I.tailMode=w,I.treeForkCount=_)}function pO(s,l,p){var g=l.pendingProps,w=g.revealOrder,_=g.tail;g=g.children;var I=Vn.current,P=(I&2)!==0;if(P?(I=I&1|2,l.flags|=128):I&=1,A(Vn,I),xr(s,l,g,p),g=Ot?Vf:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&fO(s,p,l);else if(s.tag===19)fO(s,p,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(p=l.child,w=null;p!==null;)s=p.alternate,s!==null&&gg(s)===null&&(w=p),p=p.sibling;p=w,p===null?(w=l.child,l.child=null):(w=p.sibling,p.sibling=null),hS(l,!1,w,p,_,g);break;case"backwards":case"unstable_legacy-backwards":for(p=null,w=l.child,l.child=null;w!==null;){if(s=w.alternate,s!==null&&gg(s)===null){l.child=w;break}s=w.sibling,w.sibling=p,p=w,w=s}hS(l,!0,p,null,_,g);break;case"together":hS(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function za(s,l,p){if(s!==null&&(l.dependencies=s.dependencies),Os|=l.lanes,(p&l.childLanes)===0)if(s!==null){if(ku(s,l,p,!1),(p&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,p=Oa(s,s.pendingProps),l.child=p,p.return=l;s.sibling!==null;)s=s.sibling,p=p.sibling=Oa(s,s.pendingProps),p.return=l;p.sibling=null}return l.child}function gS(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&lg(s)))}function uZ(s,l,p){switch(l.tag){case 3:se(l,l.stateNode.containerInfo),Cs(l,Wn,s.memoizedState.cache),Zl();break;case 27:case 5:Ie(l);break;case 4:se(l,l.stateNode.containerInfo);break;case 10:Cs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Uw(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(Rs(l),l.flags|=128,null):(p&l.child.childLanes)!==0?dO(s,l,p):(Rs(l),s=za(s,l,p),s!==null?s.sibling:null);Rs(l);break;case 19:var w=(s.flags&128)!==0;if(g=(p&l.childLanes)!==0,g||(ku(s,l,p,!1),g=(p&l.childLanes)!==0),w){if(g)return pO(s,l,p);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),A(Vn,Vn.current),g)break;return null;case 22:return l.lanes=0,oO(s,l,p,l.pendingProps);case 24:Cs(l,Wn,s.memoizedState.cache)}return za(s,l,p)}function mO(s,l,p){if(s!==null)if(s.memoizedProps!==l.pendingProps)Jn=!0;else{if(!gS(s,p)&&(l.flags&128)===0)return Jn=!1,uZ(s,l,p);Jn=(s.flags&131072)!==0}else Jn=!1,Ot&&(l.flags&1048576)!==0&&KN(l,Vf,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Jl(l.elementType),l.type=s,typeof s=="function")ww(s)?(g=nc(s,g),l.tag=1,l=cO(null,l,s,g,p)):(l.tag=0,l=cS(null,l,s,g,p));else{if(s!=null){var w=s.$$typeof;if(w===R){l.tag=11,l=nO(null,l,s,g,p);break e}else if(w===O){l.tag=14,l=rO(null,l,s,g,p);break e}}throw l=U(s)||s,Error(r(306,l,""))}}return l;case 0:return cS(s,l,l.type,l.pendingProps,p);case 1:return g=l.type,w=nc(g,l.pendingProps),cO(s,l,g,w,p);case 3:e:{if(se(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var _=l.memoizedState;w=_.element,Pw(s,l),Wf(l,g,null,p);var I=l.memoizedState;if(g=I.cache,Cs(l,Wn,g),g!==_.cache&&Nw(l,[Wn],p,!0),Yf(),g=I.element,_.isDehydrated)if(_={element:g,isDehydrated:!1,cache:I.cache},l.updateQueue.baseState=_,l.memoizedState=_,l.flags&256){l=uO(s,l,g,p);break e}else if(g!==w){w=io(Error(r(424)),l),Bf(w),l=uO(s,l,g,p);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,_n=co(s.firstChild),yr=l,Ot=!0,Ss=null,so=!0,p=oT(l,null,g,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Zl(),g===w){l=za(s,l,p);break e}xr(s,l,g,p)}l=l.child}return l;case 26:return jg(s,l),s===null?(p=kA(l.type,null,l.pendingProps,null))?l.memoizedState=p:Ot||(p=l.type,s=l.pendingProps,g=Hg(ge.current).createElement(p),g[vr]=l,g[oi]=s,wr(g,p,s),fr(g),l.stateNode=g):l.memoizedState=kA(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Ie(l),s===null&&Ot&&(g=l.stateNode=SA(l.type,l.pendingProps,ge.current),yr=l,so=!0,w=_n,Ms(l.type)?(YS=w,_n=co(g.firstChild)):_n=w),xr(s,l,l.pendingProps.children,p),jg(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&Ot&&((w=g=_n)&&(g=FZ(g,l.type,l.pendingProps,so),g!==null?(l.stateNode=g,yr=l,_n=co(g.firstChild),so=!1,w=!0):w=!1),w||_s(l)),Ie(l),w=l.type,_=l.pendingProps,I=s!==null?s.memoizedProps:null,g=_.children,HS(w,_)?g=null:I!==null&&HS(w,I)&&(l.flags|=32),l.memoizedState!==null&&(w=Bw(s,l,tZ,null,null,p),gp._currentValue=w),jg(s,l),xr(s,l,g,p),l.child;case 6:return s===null&&Ot&&((s=p=_n)&&(p=UZ(p,l.pendingProps,so),p!==null?(l.stateNode=p,yr=l,_n=null,s=!0):s=!1),s||_s(l)),null;case 13:return dO(s,l,p);case 4:return se(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=ec(l,null,g,p):xr(s,l,g,p),l.child;case 11:return nO(s,l,l.type,l.pendingProps,p);case 7:return xr(s,l,l.pendingProps,p),l.child;case 8:return xr(s,l,l.pendingProps.children,p),l.child;case 12:return xr(s,l,l.pendingProps.children,p),l.child;case 10:return g=l.pendingProps,Cs(l,l.type,g.value),xr(s,l,g.children,p),l.child;case 9:return w=l.type._context,g=l.pendingProps.children,Wl(l),w=br(w),g=g(w),l.flags|=1,xr(s,l,g,p),l.child;case 14:return rO(s,l,l.type,l.pendingProps,p);case 15:return iO(s,l,l.type,l.pendingProps,p);case 19:return pO(s,l,p);case 31:return cZ(s,l,p);case 22:return oO(s,l,p,l.pendingProps);case 24:return Wl(l),g=br(Wn),s===null?(w=Aw(),w===null&&(w=un,_=Tw(),w.pooledCache=_,_.refCount++,_!==null&&(w.pooledCacheLanes|=p),w=_),l.memoizedState={parent:g,cache:w},$w(l),Cs(l,Wn,w)):((s.lanes&p)!==0&&(Pw(s,l),Wf(l,null,null,p),Yf()),w=s.memoizedState,_=l.memoizedState,w.parent!==g?(w={parent:g,cache:g},l.memoizedState=w,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=w),Cs(l,Wn,g)):(g=_.cache,Cs(l,Wn,g),g!==w.cache&&Nw(l,[Wn],p,!0))),xr(s,l,l.pendingProps.children,p),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function La(s){s.flags|=4}function vS(s,l,p,g,w){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(UO())s.flags|=8192;else throw Ql=fg,Dw}else s.flags&=-16777217}function hO(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!NA(l))if(UO())s.flags|=8192;else throw Ql=fg,Dw}function Ig(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?dr():536870912,s.lanes|=l,Mu|=l)}function np(s,l){if(!Ot)switch(s.tailMode){case"hidden":l=s.tail;for(var p=null;l!==null;)l.alternate!==null&&(p=l),l=l.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?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Cn(s){var l=s.alternate!==null&&s.alternate.child===s.child,p=0,g=0;if(l)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,l}function dZ(s,l,p){var g=l.pendingProps;switch(kw(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(l),null;case 1:return Cn(l),null;case 3:return p=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),$a(Wn),_e(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(s===null||s.child===null)&&(Cu(l)?La(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,jw())),Cn(l),null;case 26:var w=l.type,_=l.memoizedState;return s===null?(La(l),_!==null?(Cn(l),hO(l,_)):(Cn(l),vS(l,w,null,g,p))):_?_!==s.memoizedState?(La(l),Cn(l),hO(l,_)):(Cn(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&La(l),Cn(l),vS(l,w,s,g,p)),null;case 27:if(Fe(l),p=ge.current,w=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&La(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}s=J.current,Cu(l)?ZN(l):(s=SA(w,g,p),l.stateNode=s,La(l))}return Cn(l),null;case 5:if(Fe(l),w=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&La(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Cn(l),null}if(_=J.current,Cu(l))ZN(l);else{var I=Hg(ge.current);switch(_){case 1:_=I.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:_=I.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":_=I.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":_=I.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":_=I.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?_.multiple=!0:g.size&&(_.size=g.size);break;default:_=typeof g.is=="string"?I.createElement(w,{is:g.is}):I.createElement(w)}}_[vr]=l,_[oi]=g;e:for(I=l.child;I!==null;){if(I.tag===5||I.tag===6)_.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===l)break e;for(;I.sibling===null;){if(I.return===null||I.return===l)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}l.stateNode=_;e:switch(wr(_,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&&La(l)}}return Cn(l),vS(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,p),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&La(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=ge.current,Cu(l)){if(s=l.stateNode,p=l.memoizedProps,g=null,w=yr,w!==null)switch(w.tag){case 27:case 5:g=w.memoizedProps}s[vr]=l,s=!!(s.nodeValue===p||g!==null&&g.suppressHydrationWarning===!0||dA(s.nodeValue,p)),s||_s(l,!0)}else s=Hg(s).createTextNode(g),s[vr]=l,l.stateNode=s}return Cn(l),null;case 31:if(p=l.memoizedState,s===null||s.memoizedState!==null){if(g=Cu(l),p!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[vr]=l}else Zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Cn(l),s=!1}else p=jw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=p),s=!0;if(!s)return l.flags&256?(Ni(l),l):(Ni(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Cn(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=Cu(l),g!==null&&g.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=l.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[vr]=l}else Zl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Cn(l),w=!1}else w=jw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return l.flags&256?(Ni(l),l):(Ni(l),null)}return Ni(l),(l.flags&128)!==0?(l.lanes=p,l):(p=g!==null,s=s!==null&&s.memoizedState!==null,p&&(g=l.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&&(l.child.flags|=8192),Ig(l,l.updateQueue),Cn(l),null);case 4:return _e(),s===null&&LS(l.stateNode.containerInfo),Cn(l),null;case 10:return $a(l.type),Cn(l),null;case 19:if(V(Vn),g=l.memoizedState,g===null)return Cn(l),null;if(w=(l.flags&128)!==0,_=g.rendering,_===null)if(w)np(g,!1);else{if(Mn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(_=gg(s),_!==null){for(l.flags|=128,np(g,!1),s=_.updateQueue,l.updateQueue=s,Ig(l,s),l.subtreeFlags=0,s=p,p=l.child;p!==null;)BN(p,s),p=p.sibling;return A(Vn,Vn.current&1|2),Ot&&Aa(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&&re()>Dg&&(l.flags|=128,w=!0,np(g,!1),l.lanes=4194304)}else{if(!w)if(s=gg(_),s!==null){if(l.flags|=128,w=!0,s=s.updateQueue,l.updateQueue=s,Ig(l,s),np(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!Ot)return Cn(l),null}else 2*re()-g.renderingStartTime>Dg&&p!==536870912&&(l.flags|=128,w=!0,np(g,!1),l.lanes=4194304);g.isBackwards?(_.sibling=l.child,l.child=_):(s=g.last,s!==null?s.sibling=_:l.child=_,g.last=_)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=re(),s.sibling=null,p=Vn.current,A(Vn,w?p&1|2:p&1),Ot&&Aa(l,g.treeForkCount),s):(Cn(l),null);case 22:case 23:return Ni(l),Fw(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(p&536870912)!==0&&(l.flags&128)===0&&(Cn(l),l.subtreeFlags&6&&(l.flags|=8192)):Cn(l),p=l.updateQueue,p!==null&&Ig(l,p.retryQueue),p=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==p&&(l.flags|=2048),s!==null&&V(Xl),null;case 24:return p=null,s!==null&&(p=s.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),$a(Wn),Cn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function fZ(s,l){switch(kw(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return $a(Wn),_e(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Fe(l),null;case 31:if(l.memoizedState!==null){if(Ni(l),l.alternate===null)throw Error(r(340));Zl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Ni(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Zl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return V(Vn),null;case 4:return _e(),null;case 10:return $a(l.type),null;case 22:case 23:return Ni(l),Fw(),s!==null&&V(Xl),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return $a(Wn),null;case 25:return null;default:return null}}function gO(s,l){switch(kw(l),l.tag){case 3:$a(Wn),_e();break;case 26:case 27:case 5:Fe(l);break;case 4:_e();break;case 31:l.memoizedState!==null&&Ni(l);break;case 13:Ni(l);break;case 19:V(Vn);break;case 10:$a(l.type);break;case 22:case 23:Ni(l),Fw(),s!==null&&V(Xl);break;case 24:$a(Wn)}}function rp(s,l){try{var p=l.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,I=p.inst;g=_(),I.destroy=g}p=p.next}while(p!==w)}}catch(P){Xt(l,l.return,P)}}function Ns(s,l,p){try{var g=l.updateQueue,w=g!==null?g.lastEffect:null;if(w!==null){var _=w.next;g=_;do{if((g.tag&s)===s){var I=g.inst,P=I.destroy;if(P!==void 0){I.destroy=void 0,w=l;var Z=p,ce=P;try{ce()}catch(ye){Xt(w,Z,ye)}}}g=g.next}while(g!==_)}}catch(ye){Xt(l,l.return,ye)}}function vO(s){var l=s.updateQueue;if(l!==null){var p=s.stateNode;try{sT(l,p)}catch(g){Xt(s,s.return,g)}}}function yO(s,l,p){p.props=nc(s.type,s.memoizedProps),p.state=s.memoizedState;try{p.componentWillUnmount()}catch(g){Xt(s,l,g)}}function ip(s,l){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){Xt(s,l,w)}}function na(s,l){var p=s.ref,g=s.refCleanup;if(p!==null)if(typeof g=="function")try{g()}catch(w){Xt(s,l,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(w){Xt(s,l,w)}else p.current=null}function bO(s){var l=s.type,p=s.memoizedProps,g=s.stateNode;try{e:switch(l){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){Xt(s,s.return,w)}}function yS(s,l,p){try{var g=s.stateNode;DZ(g,s.type,p,l),g[oi]=l}catch(w){Xt(s,s.return,w)}}function xO(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ms(s.type)||s.tag===4}function bS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||xO(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&&Ms(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 xS(s,l,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(s,l):(l=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,l.appendChild(s),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=Na));else if(g!==4&&(g===27&&Ms(s.type)&&(p=s.stateNode,l=null),s=s.child,s!==null))for(xS(s,l,p),s=s.sibling;s!==null;)xS(s,l,p),s=s.sibling}function Ng(s,l,p){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?p.insertBefore(s,l):p.appendChild(s);else if(g!==4&&(g===27&&Ms(s.type)&&(p=s.stateNode),s=s.child,s!==null))for(Ng(s,l,p),s=s.sibling;s!==null;)Ng(s,l,p),s=s.sibling}function wO(s){var l=s.stateNode,p=s.memoizedProps;try{for(var g=s.type,w=l.attributes;w.length;)l.removeAttributeNode(w[0]);wr(l,g,p),l[vr]=s,l[oi]=p}catch(_){Xt(s,s.return,_)}}var Fa=!1,Qn=!1,wS=!1,SO=typeof WeakSet=="function"?WeakSet:Set,pr=null;function pZ(s,l){if(s=s.containerInfo,VS=Xg,s=DN(s),mw(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 I=0,P=-1,Z=-1,ce=0,ye=0,Se=s,de=null;t:for(;;){for(var he;Se!==p||w!==0&&Se.nodeType!==3||(P=I+w),Se!==_||g!==0&&Se.nodeType!==3||(Z=I+g),Se.nodeType===3&&(I+=Se.nodeValue.length),(he=Se.firstChild)!==null;)de=Se,Se=he;for(;;){if(Se===s)break t;if(de===p&&++ce===w&&(P=I),de===_&&++ye===g&&(Z=I),(he=Se.nextSibling)!==null)break;Se=de,de=Se.parentNode}Se=he}p=P===-1||Z===-1?null:{start:P,end:Z}}else p=null}p=p||{start:0,end:0}}else p=null;for(BS={focusedElem:s,selectionRange:p},Xg=!1,pr=l;pr!==null;)if(l=pr,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,pr=s;else for(;pr!==null;){switch(l=pr,_=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.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=l,w=_.memoizedProps,_=_.memoizedState,g=p.stateNode;try{var Be=nc(p.type,w);s=g.getSnapshotBeforeUpdate(Be,_),g.__reactInternalSnapshotBeforeUpdate=s}catch(tt){Xt(p,p.return,tt)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,p=s.nodeType,p===9)KS(s);else if(p===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":KS(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=l.sibling,s!==null){s.return=l.return,pr=s;break}pr=l.return}}function _O(s,l,p){var g=p.flags;switch(p.tag){case 0:case 11:case 15:Va(s,p),g&4&&rp(5,p);break;case 1:if(Va(s,p),g&4)if(s=p.stateNode,l===null)try{s.componentDidMount()}catch(I){Xt(p,p.return,I)}else{var w=nc(p.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(w,l,s.__reactInternalSnapshotBeforeUpdate)}catch(I){Xt(p,p.return,I)}}g&64&&vO(p),g&512&&ip(p,p.return);break;case 3:if(Va(s,p),g&64&&(s=p.updateQueue,s!==null)){if(l=null,p.child!==null)switch(p.child.tag){case 27:case 5:l=p.child.stateNode;break;case 1:l=p.child.stateNode}try{sT(s,l)}catch(I){Xt(p,p.return,I)}}break;case 27:l===null&&g&4&&wO(p);case 26:case 5:Va(s,p),l===null&&g&4&&bO(p),g&512&&ip(p,p.return);break;case 12:Va(s,p);break;case 31:Va(s,p),g&4&&EO(s,p);break;case 13:Va(s,p),g&4&&jO(s,p),g&64&&(s=p.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(p=SZ.bind(null,p),VZ(s,p))));break;case 22:if(g=p.memoizedState!==null||Fa,!g){l=l!==null&&l.memoizedState!==null||Qn,w=Fa;var _=Qn;Fa=g,(Qn=l)&&!_?Ba(s,p,(p.subtreeFlags&8772)!==0):Va(s,p),Fa=w,Qn=_}break;case 30:break;default:Va(s,p)}}function CO(s){var l=s.alternate;l!==null&&(s.alternate=null,CO(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&X0(l)),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,si=!1;function Ua(s,l,p){for(p=p.child;p!==null;)kO(s,l,p),p=p.sibling}function kO(s,l,p){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(ln,p)}catch{}switch(p.tag){case 26:Qn||na(p,l),Ua(s,l,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:Qn||na(p,l);var g=Rn,w=si;Ms(p.type)&&(Rn=p.stateNode,si=!1),Ua(s,l,p),pp(p.stateNode),Rn=g,si=w;break;case 5:Qn||na(p,l);case 6:if(g=Rn,w=si,Rn=null,Ua(s,l,p),Rn=g,si=w,Rn!==null)if(si)try{(Rn.nodeType===9?Rn.body:Rn.nodeName==="HTML"?Rn.ownerDocument.body:Rn).removeChild(p.stateNode)}catch(_){Xt(p,l,_)}else try{Rn.removeChild(p.stateNode)}catch(_){Xt(p,l,_)}break;case 18:Rn!==null&&(si?(s=Rn,vA(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,p.stateNode),qu(s)):vA(Rn,p.stateNode));break;case 4:g=Rn,w=si,Rn=p.stateNode.containerInfo,si=!0,Ua(s,l,p),Rn=g,si=w;break;case 0:case 11:case 14:case 15:Ns(2,p,l),Qn||Ns(4,p,l),Ua(s,l,p);break;case 1:Qn||(na(p,l),g=p.stateNode,typeof g.componentWillUnmount=="function"&&yO(p,l,g)),Ua(s,l,p);break;case 21:Ua(s,l,p);break;case 22:Qn=(g=Qn)||p.memoizedState!==null,Ua(s,l,p),Qn=g;break;default:Ua(s,l,p)}}function EO(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{qu(s)}catch(p){Xt(l,l.return,p)}}}function jO(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{qu(s)}catch(p){Xt(l,l.return,p)}}function mZ(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new SO),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new SO),l;default:throw Error(r(435,s.tag))}}function Tg(s,l){var p=mZ(s);l.forEach(function(g){if(!p.has(g)){p.add(g);var w=_Z.bind(null,s,g);g.then(w,w)}})}function li(s,l){var p=l.deletions;if(p!==null)for(var g=0;g<p.length;g++){var w=p[g],_=s,I=l,P=I;e:for(;P!==null;){switch(P.tag){case 27:if(Ms(P.type)){Rn=P.stateNode,si=!1;break e}break;case 5:Rn=P.stateNode,si=!1;break e;case 3:case 4:Rn=P.stateNode.containerInfo,si=!0;break e}P=P.return}if(Rn===null)throw Error(r(160));kO(_,I,w),Rn=null,si=!1,_=w.alternate,_!==null&&(_.return=null),w.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)RO(l,s),l=l.sibling}var Do=null;function RO(s,l){var p=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:li(l,s),ci(s),g&4&&(Ns(3,s,s.return),rp(3,s),Ns(5,s,s.return));break;case 1:li(l,s),ci(s),g&512&&(Qn||p===null||na(p,p.return)),g&64&&Fa&&(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=Do;if(li(l,s),ci(s),g&512&&(Qn||p===null||na(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],(!_||_[Tf]||_[vr]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=w.createElement(g),w.head.insertBefore(_,w.querySelector("head > title"))),wr(_,g,p),_[vr]=s,fr(_),g=_;break e;case"link":var I=RA("link","href",w).get(g+(p.href||""));if(I){for(var P=0;P<I.length;P++)if(_=I[P],_.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)){I.splice(P,1);break t}}_=w.createElement(g),wr(_,g,p),w.head.appendChild(_);break;case"meta":if(I=RA("meta","content",w).get(g+(p.content||""))){for(P=0;P<I.length;P++)if(_=I[P],_.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)){I.splice(P,1);break t}}_=w.createElement(g),wr(_,g,p),w.head.appendChild(_);break;default:throw Error(r(468,g))}_[vr]=s,fr(_),g=_}s.stateNode=g}else IA(w,s.type,s.stateNode);else s.stateNode=jA(w,g,s.memoizedProps);else _!==g?(_===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):_.count--,g===null?IA(w,s.type,s.stateNode):jA(w,g,s.memoizedProps)):g===null&&s.stateNode!==null&&yS(s,s.memoizedProps,p.memoizedProps)}break;case 27:li(l,s),ci(s),g&512&&(Qn||p===null||na(p,p.return)),p!==null&&g&4&&yS(s,s.memoizedProps,p.memoizedProps);break;case 5:if(li(l,s),ci(s),g&512&&(Qn||p===null||na(p,p.return)),s.flags&32){w=s.stateNode;try{mu(w,"")}catch(Be){Xt(s,s.return,Be)}}g&4&&s.stateNode!=null&&(w=s.memoizedProps,yS(s,w,p!==null?p.memoizedProps:w)),g&1024&&(wS=!0);break;case 6:if(li(l,s),ci(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,p=s.stateNode;try{p.nodeValue=g}catch(Be){Xt(s,s.return,Be)}}break;case 3:if(Gg=null,w=Do,Do=qg(l.containerInfo),li(l,s),Do=w,ci(s),g&4&&p!==null&&p.memoizedState.isDehydrated)try{qu(l.containerInfo)}catch(Be){Xt(s,s.return,Be)}wS&&(wS=!1,IO(s));break;case 4:g=Do,Do=qg(s.stateNode.containerInfo),li(l,s),ci(s),Do=g;break;case 12:li(l,s),ci(s);break;case 31:li(l,s),ci(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Tg(s,g)));break;case 13:li(l,s),ci(s),s.child.flags&8192&&s.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(Ag=re()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Tg(s,g)));break;case 22:w=s.memoizedState!==null;var Z=p!==null&&p.memoizedState!==null,ce=Fa,ye=Qn;if(Fa=ce||w,Qn=ye||Z,li(l,s),Qn=ye,Fa=ce,ci(s),g&8192)e:for(l=s.stateNode,l._visibility=w?l._visibility&-2:l._visibility|1,w&&(p===null||Z||Fa||Qn||rc(s)),p=null,l=s;;){if(l.tag===5||l.tag===26){if(p===null){Z=p=l;try{if(_=Z.stateNode,w)I=_.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{P=Z.stateNode;var Se=Z.memoizedProps.style,de=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;P.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Be){Xt(Z,Z.return,Be)}}}else if(l.tag===6){if(p===null){Z=l;try{Z.stateNode.nodeValue=w?"":Z.memoizedProps}catch(Be){Xt(Z,Z.return,Be)}}}else if(l.tag===18){if(p===null){Z=l;try{var he=Z.stateNode;w?yA(he,!0):yA(Z.stateNode,!1)}catch(Be){Xt(Z,Z.return,Be)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;p===l&&(p=null),l=l.return}p===l&&(p=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(p=g.retryQueue,p!==null&&(g.retryQueue=null,Tg(s,p))));break;case 19:li(l,s),ci(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Tg(s,g)));break;case 30:break;case 21:break;default:li(l,s),ci(s)}}function ci(s){var l=s.flags;if(l&2){try{for(var p,g=s.return;g!==null;){if(xO(g)){p=g;break}g=g.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var w=p.stateNode,_=bS(s);Ng(s,_,w);break;case 5:var I=p.stateNode;p.flags&32&&(mu(I,""),p.flags&=-33);var P=bS(s);Ng(s,P,I);break;case 3:case 4:var Z=p.stateNode.containerInfo,ce=bS(s);xS(s,ce,Z);break;default:throw Error(r(161))}}catch(ye){Xt(s,s.return,ye)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function IO(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;IO(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Va(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)_O(s,l.alternate,l),l=l.sibling}function rc(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Ns(4,l,l.return),rc(l);break;case 1:na(l,l.return);var p=l.stateNode;typeof p.componentWillUnmount=="function"&&yO(l,l.return,p),rc(l);break;case 27:pp(l.stateNode);case 26:case 5:na(l,l.return),rc(l);break;case 22:l.memoizedState===null&&rc(l);break;case 30:rc(l);break;default:rc(l)}s=s.sibling}}function Ba(s,l,p){for(p=p&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,w=s,_=l,I=_.flags;switch(_.tag){case 0:case 11:case 15:Ba(w,_,p),rp(4,_);break;case 1:if(Ba(w,_,p),g=_,w=g.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ce){Xt(g,g.return,ce)}if(g=_,w=g.updateQueue,w!==null){var P=g.stateNode;try{var Z=w.shared.hiddenCallbacks;if(Z!==null)for(w.shared.hiddenCallbacks=null,w=0;w<Z.length;w++)aT(Z[w],P)}catch(ce){Xt(g,g.return,ce)}}p&&I&64&&vO(_),ip(_,_.return);break;case 27:wO(_);case 26:case 5:Ba(w,_,p),p&&g===null&&I&4&&bO(_),ip(_,_.return);break;case 12:Ba(w,_,p);break;case 31:Ba(w,_,p),p&&I&4&&EO(w,_);break;case 13:Ba(w,_,p),p&&I&4&&jO(w,_);break;case 22:_.memoizedState===null&&Ba(w,_,p),ip(_,_.return);break;case 30:break;default:Ba(w,_,p)}l=l.sibling}}function SS(s,l){var p=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==p&&(s!=null&&s.refCount++,p!=null&&Hf(p))}function _S(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Hf(s))}function $o(s,l,p,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)NO(s,l,p,g),l=l.sibling}function NO(s,l,p,g){var w=l.flags;switch(l.tag){case 0:case 11:case 15:$o(s,l,p,g),w&2048&&rp(9,l);break;case 1:$o(s,l,p,g);break;case 3:$o(s,l,p,g),w&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Hf(s)));break;case 12:if(w&2048){$o(s,l,p,g),s=l.stateNode;try{var _=l.memoizedProps,I=_.id,P=_.onPostCommit;typeof P=="function"&&P(I,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){Xt(l,l.return,Z)}}else $o(s,l,p,g);break;case 31:$o(s,l,p,g);break;case 13:$o(s,l,p,g);break;case 23:break;case 22:_=l.stateNode,I=l.alternate,l.memoizedState!==null?_._visibility&2?$o(s,l,p,g):op(s,l):_._visibility&2?$o(s,l,p,g):(_._visibility|=2,Du(s,l,p,g,(l.subtreeFlags&10256)!==0||!1)),w&2048&&SS(I,l);break;case 24:$o(s,l,p,g),w&2048&&_S(l.alternate,l);break;default:$o(s,l,p,g)}}function Du(s,l,p,g,w){for(w=w&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var _=s,I=l,P=p,Z=g,ce=I.flags;switch(I.tag){case 0:case 11:case 15:Du(_,I,P,Z,w),rp(8,I);break;case 23:break;case 22:var ye=I.stateNode;I.memoizedState!==null?ye._visibility&2?Du(_,I,P,Z,w):op(_,I):(ye._visibility|=2,Du(_,I,P,Z,w)),w&&ce&2048&&SS(I.alternate,I);break;case 24:Du(_,I,P,Z,w),w&&ce&2048&&_S(I.alternate,I);break;default:Du(_,I,P,Z,w)}l=l.sibling}}function op(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var p=s,g=l,w=g.flags;switch(g.tag){case 22:op(p,g),w&2048&&SS(g.alternate,g);break;case 24:op(p,g),w&2048&&_S(g.alternate,g);break;default:op(p,g)}l=l.sibling}}var ap=8192;function $u(s,l,p){if(s.subtreeFlags&ap)for(s=s.child;s!==null;)TO(s,l,p),s=s.sibling}function TO(s,l,p){switch(s.tag){case 26:$u(s,l,p),s.flags&ap&&s.memoizedState!==null&&eY(p,Do,s.memoizedState,s.memoizedProps);break;case 5:$u(s,l,p);break;case 3:case 4:var g=Do;Do=qg(s.stateNode.containerInfo),$u(s,l,p),Do=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=ap,ap=16777216,$u(s,l,p),ap=g):$u(s,l,p));break;default:$u(s,l,p)}}function OO(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function sp(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var p=0;p<l.length;p++){var g=l[p];pr=g,DO(g,s)}OO(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)AO(s),s=s.sibling}function AO(s){switch(s.tag){case 0:case 11:case 15:sp(s),s.flags&2048&&Ns(9,s,s.return);break;case 3:sp(s);break;case 12:sp(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,Og(s)):sp(s);break;default:sp(s)}}function Og(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var p=0;p<l.length;p++){var g=l[p];pr=g,DO(g,s)}OO(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Ns(8,l,l.return),Og(l);break;case 22:p=l.stateNode,p._visibility&2&&(p._visibility&=-3,Og(l));break;default:Og(l)}s=s.sibling}}function DO(s,l){for(;pr!==null;){var p=pr;switch(p.tag){case 0:case 11:case 15:Ns(8,p,l);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:Hf(p.memoizedState.cache)}if(g=p.child,g!==null)g.return=p,pr=g;else e:for(p=s;pr!==null;){g=pr;var w=g.sibling,_=g.return;if(CO(g),g===p){pr=null;break e}if(w!==null){w.return=_,pr=w;break e}pr=_}}}var hZ={getCacheForType:function(s){var l=br(Wn),p=l.data.get(s);return p===void 0&&(p=s(),l.data.set(s,p)),p},cacheSignal:function(){return br(Wn).controller.signal}},gZ=typeof WeakMap=="function"?WeakMap:Map,Ht=0,un=null,jt=null,Nt=0,Wt=0,Ti=null,Ts=!1,Pu=!1,CS=!1,Ha=0,Mn=0,Os=0,ic=0,kS=0,Oi=0,Mu=0,lp=null,ui=null,ES=!1,Ag=0,$O=0,Dg=1/0,$g=null,As=null,or=0,Ds=null,zu=null,qa=0,jS=0,RS=null,PO=null,cp=0,IS=null;function Ai(){return(Ht&2)!==0&&Nt!==0?Nt&-Nt:z.T!==null?$S():Y0()}function MO(){if(Oi===0)if((Nt&536870912)===0||Ot){var s=ys;ys<<=1,(ys&3932160)===0&&(ys=262144),Oi=s}else Oi=536870912;return s=Ii.current,s!==null&&(s.flags|=32),Oi}function di(s,l,p){(s===un&&(Wt===2||Wt===9)||s.cancelPendingCommit!==null)&&(Lu(s,0),$s(s,Nt,Oi,!1)),cn(s,p),((Ht&2)===0||s!==un)&&(s===un&&((Ht&2)===0&&(ic|=p),Mn===4&&$s(s,Nt,Oi,!1)),ra(s))}function zO(s,l,p){if((Ht&6)!==0)throw Error(r(327));var g=!p&&(l&127)===0&&(l&s.expiredLanes)===0||en(s,l),w=g?bZ(s,l):TS(s,l,!0),_=g;do{if(w===0){Pu&&!g&&$s(s,l,0,!1);break}else{if(p=s.current.alternate,_&&!vZ(p)){w=TS(s,l,!1),_=!1;continue}if(w===2){if(_=l,s.errorRecoveryDisabledLanes&_)var I=0;else I=s.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){l=I;e:{var P=s;w=lp;var Z=P.current.memoizedState.isDehydrated;if(Z&&(Lu(P,I).flags|=256),I=TS(P,I,!1),I!==2){if(CS&&!Z){P.errorRecoveryDisabledLanes|=_,ic|=_,w=4;break e}_=ui,ui=w,_!==null&&(ui===null?ui=_:ui.push.apply(ui,_))}w=I}if(_=!1,w!==2)continue}}if(w===1){Lu(s,0),$s(s,l,0,!0);break}e:{switch(g=s,_=w,_){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:$s(g,l,Oi,!Ts);break e;case 2:ui=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(w=Ag+300-re(),10<w)){if($s(g,l,Oi,!Ts),Xe(g,0,!0)!==0)break e;qa=l,g.timeoutHandle=hA(LO.bind(null,g,p,ui,$g,ES,l,Oi,ic,Mu,Ts,_,"Throttled",-0,0),w);break e}LO(g,p,ui,$g,ES,l,Oi,ic,Mu,Ts,_,null,-0,0)}}break}while(!0);ra(s)}function LO(s,l,p,g,w,_,I,P,Z,ce,ye,Se,de,he){if(s.timeoutHandle=-1,Se=l.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Na},TO(l,_,Se);var Be=(_&62914560)===_?Ag-re():(_&4194048)===_?$O-re():0;if(Be=tY(Se,Be),Be!==null){qa=_,s.cancelPendingCommit=Be(GO.bind(null,s,l,_,p,g,w,I,P,Z,ye,Se,null,de,he)),$s(s,_,I,!ce);return}}GO(s,l,_,p,g,w,I,P,Z)}function vZ(s){for(var l=s;;){var p=l.tag;if((p===0||p===11||p===15)&&l.flags&16384&&(p=l.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(!ji(_(),w))return!1}catch{return!1}}if(p=l.child,l.subtreeFlags&16384&&p!==null)p.return=l,l=p;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function $s(s,l,p,g){l&=~kS,l&=~ic,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var w=l;0<w;){var _=31-_t(w),I=1<<_;g[_]=-1,w&=~I}p!==0&&Ul(s,p,l)}function Pg(){return(Ht&6)===0?(up(0),!1):!0}function NS(){if(jt!==null){if(Wt===0)var s=jt.return;else s=jt,Da=Yl=null,Kw(s),Iu=null,Kf=0,s=jt;for(;s!==null;)gO(s.alternate,s),s=s.return;jt=null}}function Lu(s,l){var p=s.timeoutHandle;p!==-1&&(s.timeoutHandle=-1,MZ(p)),p=s.cancelPendingCommit,p!==null&&(s.cancelPendingCommit=null,p()),qa=0,NS(),un=s,jt=p=Oa(s.current,null),Nt=l,Wt=0,Ti=null,Ts=!1,Pu=en(s,l),CS=!1,Mu=Oi=kS=ic=Os=Mn=0,ui=lp=null,ES=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var w=31-_t(g),_=1<<w;l|=s[w],g&=~_}return Ha=l,rg(),p}function FO(s,l){pt=null,z.H=ep,l===Ru||l===dg?(l=nT(),Wt=3):l===Dw?(l=nT(),Wt=4):Wt=l===lS?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ti=l,jt===null&&(Mn=1,kg(s,io(l,s.current)))}function UO(){var s=Ii.current;return s===null?!0:(Nt&4194048)===Nt?lo===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?s===lo:!1}function VO(){var s=z.H;return z.H=ep,s===null?ep:s}function BO(){var s=z.A;return z.A=hZ,s}function Mg(){Mn=4,Ts||(Nt&4194048)!==Nt&&Ii.current!==null||(Pu=!0),(Os&134217727)===0&&(ic&134217727)===0||un===null||$s(un,Nt,Oi,!1)}function TS(s,l,p){var g=Ht;Ht|=2;var w=VO(),_=BO();(un!==s||Nt!==l)&&($g=null,Lu(s,l)),l=!1;var I=Mn;e:do try{if(Wt!==0&&jt!==null){var P=jt,Z=Ti;switch(Wt){case 8:NS(),I=6;break e;case 3:case 2:case 9:case 6:Ii.current===null&&(l=!0);var ce=Wt;if(Wt=0,Ti=null,Fu(s,P,Z,ce),p&&Pu){I=0;break e}break;default:ce=Wt,Wt=0,Ti=null,Fu(s,P,Z,ce)}}yZ(),I=Mn;break}catch(ye){FO(s,ye)}while(!0);return l&&s.shellSuspendCounter++,Da=Yl=null,Ht=g,z.H=w,z.A=_,jt===null&&(un=null,Nt=0,rg()),I}function yZ(){for(;jt!==null;)HO(jt)}function bZ(s,l){var p=Ht;Ht|=2;var g=VO(),w=BO();un!==s||Nt!==l?($g=null,Dg=re()+500,Lu(s,l)):Pu=en(s,l);e:do try{if(Wt!==0&&jt!==null){l=jt;var _=Ti;t:switch(Wt){case 1:Wt=0,Ti=null,Fu(s,l,_,1);break;case 2:case 9:if(eT(_)){Wt=0,Ti=null,qO(l);break}l=function(){Wt!==2&&Wt!==9||un!==s||(Wt=7),ra(s)},_.then(l,l);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:eT(_)?(Wt=0,Ti=null,qO(l)):(Wt=0,Ti=null,Fu(s,l,_,7));break;case 5:var I=null;switch(jt.tag){case 26:I=jt.memoizedState;case 5:case 27:var P=jt;if(I?NA(I):P.stateNode.complete){Wt=0,Ti=null;var Z=P.sibling;if(Z!==null)jt=Z;else{var ce=P.return;ce!==null?(jt=ce,zg(ce)):jt=null}break t}}Wt=0,Ti=null,Fu(s,l,_,5);break;case 6:Wt=0,Ti=null,Fu(s,l,_,6);break;case 8:NS(),Mn=6;break e;default:throw Error(r(462))}}xZ();break}catch(ye){FO(s,ye)}while(!0);return Da=Yl=null,z.H=g,z.A=w,Ht=p,jt!==null?0:(un=null,Nt=0,rg(),Mn)}function xZ(){for(;jt!==null&&!pe();)HO(jt)}function HO(s){var l=mO(s.alternate,s,Ha);s.memoizedProps=s.pendingProps,l===null?zg(s):jt=l}function qO(s){var l=s,p=l.alternate;switch(l.tag){case 15:case 0:l=lO(p,l,l.pendingProps,l.type,void 0,Nt);break;case 11:l=lO(p,l,l.pendingProps,l.type.render,l.ref,Nt);break;case 5:Kw(l);default:gO(p,l),l=jt=BN(l,Ha),l=mO(p,l,Ha)}s.memoizedProps=s.pendingProps,l===null?zg(s):jt=l}function Fu(s,l,p,g){Da=Yl=null,Kw(l),Iu=null,Kf=0;var w=l.return;try{if(lZ(s,w,l,p,Nt)){Mn=1,kg(s,io(p,s.current)),jt=null;return}}catch(_){if(w!==null)throw jt=w,_;Mn=1,kg(s,io(p,s.current)),jt=null;return}l.flags&32768?(Ot||g===1?s=!0:Pu||(Nt&536870912)!==0?s=!1:(Ts=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ii.current,g!==null&&g.tag===13&&(g.flags|=16384))),KO(l,s)):zg(l)}function zg(s){var l=s;do{if((l.flags&32768)!==0){KO(l,Ts);return}s=l.return;var p=dZ(l.alternate,l,Ha);if(p!==null){jt=p;return}if(l=l.sibling,l!==null){jt=l;return}jt=l=s}while(l!==null);Mn===0&&(Mn=5)}function KO(s,l){do{var p=fZ(s.alternate,s);if(p!==null){p.flags&=32767,jt=p;return}if(p=s.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!l&&(s=s.sibling,s!==null)){jt=s;return}jt=s=p}while(s!==null);Mn=6,jt=null}function GO(s,l,p,g,w,_,I,P,Z){s.cancelPendingCommit=null;do Lg();while(or!==0);if((Ht&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(_=l.lanes|l.childLanes,_|=bw,ni(s,p,_,I,P,Z),s===un&&(jt=un=null,Nt=0),zu=l,Ds=s,qa=p,jS=_,RS=w,PO=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,CZ(Ee,function(){return JO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,w=W.p,W.p=2,I=Ht,Ht|=4;try{pZ(s,l,p)}finally{Ht=I,W.p=w,z.T=g}}or=1,ZO(),YO(),WO()}}function ZO(){if(or===1){or=0;var s=Ds,l=zu,p=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Ht;Ht|=4;try{RO(l,s);var _=BS,I=DN(s.containerInfo),P=_.focusedElem,Z=_.selectionRange;if(I!==P&&P&&P.ownerDocument&&AN(P.ownerDocument.documentElement,P)){if(Z!==null&&mw(P)){var ce=Z.start,ye=Z.end;if(ye===void 0&&(ye=ce),"selectionStart"in P)P.selectionStart=ce,P.selectionEnd=Math.min(ye,P.value.length);else{var Se=P.ownerDocument||document,de=Se&&Se.defaultView||window;if(de.getSelection){var he=de.getSelection(),Be=P.textContent.length,tt=Math.min(Z.start,Be),rn=Z.end===void 0?tt:Math.min(Z.end,Be);!he.extend&&tt>rn&&(I=rn,rn=tt,tt=I);var ie=ON(P,tt),ne=ON(P,rn);if(ie&&ne&&(he.rangeCount!==1||he.anchorNode!==ie.node||he.anchorOffset!==ie.offset||he.focusNode!==ne.node||he.focusOffset!==ne.offset)){var le=Se.createRange();le.setStart(ie.node,ie.offset),he.removeAllRanges(),tt>rn?(he.addRange(le),he.extend(ne.node,ne.offset)):(le.setEnd(ne.node,ne.offset),he.addRange(le))}}}}for(Se=[],he=P;he=he.parentNode;)he.nodeType===1&&Se.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Se.length;P++){var xe=Se[P];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Xg=!!VS,BS=VS=null}finally{Ht=w,W.p=g,z.T=p}}s.current=l,or=2}}function YO(){if(or===2){or=0;var s=Ds,l=zu,p=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||p){p=z.T,z.T=null;var g=W.p;W.p=2;var w=Ht;Ht|=4;try{_O(s,l.alternate,l)}finally{Ht=w,W.p=g,z.T=p}}or=3}}function WO(){if(or===4||or===3){or=0,Ce();var s=Ds,l=zu,p=qa,g=PO;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?or=5:(or=0,zu=Ds=null,XO(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&(As=null),Oo(p),l=l.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(ln,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=z.T,w=W.p,W.p=2,z.T=null;try{for(var _=s.onRecoverableError,I=0;I<g.length;I++){var P=g[I];_(P.value,{componentStack:P.stack})}}finally{z.T=l,W.p=w}}(qa&3)!==0&&Lg(),ra(s),w=s.pendingLanes,(p&261930)!==0&&(w&42)!==0?s===IS?cp++:(cp=0,IS=s):cp=0,up(0)}}function XO(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Hf(l)))}function Lg(){return ZO(),YO(),WO(),JO()}function JO(){if(or!==5)return!1;var s=Ds,l=jS;jS=0;var p=Oo(qa),g=z.T,w=W.p;try{W.p=32>p?32:p,z.T=null,p=RS,RS=null;var _=Ds,I=qa;if(or=0,zu=Ds=null,qa=0,(Ht&6)!==0)throw Error(r(331));var P=Ht;if(Ht|=4,AO(_.current),NO(_,_.current,I,p),Ht=P,up(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(ln,_)}catch{}return!0}finally{W.p=w,z.T=g,XO(s,l)}}function QO(s,l,p){l=io(p,l),l=sS(s.stateNode,l,2),s=js(s,l,2),s!==null&&(cn(s,2),ra(s))}function Xt(s,l,p){if(s.tag===3)QO(s,s,p);else for(;l!==null;){if(l.tag===3){QO(l,s,p);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(As===null||!As.has(g))){s=io(p,s),p=eO(2),g=js(l,p,2),g!==null&&(tO(p,g,l,s),cn(g,2),ra(g));break}}l=l.return}}function OS(s,l,p){var g=s.pingCache;if(g===null){g=s.pingCache=new gZ;var w=new Set;g.set(l,w)}else w=g.get(l),w===void 0&&(w=new Set,g.set(l,w));w.has(p)||(CS=!0,w.add(p),s=wZ.bind(null,s,l,p),l.then(s,s))}function wZ(s,l,p){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&p,s.warmLanes&=~p,un===s&&(Nt&p)===p&&(Mn===4||Mn===3&&(Nt&62914560)===Nt&&300>re()-Ag?(Ht&2)===0&&Lu(s,0):kS|=p,Mu===Nt&&(Mu=0)),ra(s)}function eA(s,l){l===0&&(l=dr()),s=Kl(s,l),s!==null&&(cn(s,l),ra(s))}function SZ(s){var l=s.memoizedState,p=0;l!==null&&(p=l.retryLane),eA(s,p)}function _Z(s,l){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(l),eA(s,p)}function CZ(s,l){return G(s,l)}var Fg=null,Uu=null,AS=!1,Ug=!1,DS=!1,Ps=0;function ra(s){s!==Uu&&s.next===null&&(Uu===null?Fg=Uu=s:Uu=Uu.next=s),Ug=!0,AS||(AS=!0,EZ())}function up(s,l){if(!DS&&Ug){DS=!0;do for(var p=!1,g=Fg;g!==null;){if(s!==0){var w=g.pendingLanes;if(w===0)var _=0;else{var I=g.suspendedLanes,P=g.pingedLanes;_=(1<<31-_t(42|s)+1)-1,_&=w&~(I&~P),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(p=!0,iA(g,_))}else _=Nt,_=Xe(g,g===un?_:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(_&3)===0||en(g,_)||(p=!0,iA(g,_));g=g.next}while(p);DS=!1}}function kZ(){tA()}function tA(){Ug=AS=!1;var s=0;Ps!==0&&PZ()&&(s=Ps);for(var l=re(),p=null,g=Fg;g!==null;){var w=g.next,_=nA(g,l);_===0?(g.next=null,p===null?Fg=w:p.next=w,w===null&&(Uu=p)):(p=g,(s!==0||(_&3)!==0)&&(Ug=!0)),g=w}or!==0&&or!==5||up(s),Ps!==0&&(Ps=0)}function nA(s,l){for(var p=s.suspendedLanes,g=s.pingedLanes,w=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var I=31-_t(_),P=1<<I,Z=w[I];Z===-1?((P&p)===0||(P&g)!==0)&&(w[I]=Yn(P,l)):Z<=l&&(s.expiredLanes|=P),_&=~P}if(l=un,p=Nt,p=Xe(s,s===l?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,p===0||s===l&&(Wt===2||Wt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&ae(g),s.callbackNode=null,s.callbackPriority=0;if((p&3)===0||en(s,p)){if(l=p&-p,l===s.callbackPriority)return l;switch(g!==null&&ae(g),Oo(p)){case 2:case 8:p=ve;break;case 32:p=Ee;break;case 268435456:p=et;break;default:p=Ee}return g=rA.bind(null,s),p=G(p,g),s.callbackPriority=l,s.callbackNode=p,l}return g!==null&&g!==null&&ae(g),s.callbackPriority=2,s.callbackNode=null,2}function rA(s,l){if(or!==0&&or!==5)return s.callbackNode=null,s.callbackPriority=0,null;var p=s.callbackNode;if(Lg()&&s.callbackNode!==p)return null;var g=Nt;return g=Xe(s,s===un?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(zO(s,g,l),nA(s,re()),s.callbackNode!=null&&s.callbackNode===p?rA.bind(null,s):null)}function iA(s,l){if(Lg())return null;zO(s,l,!0)}function EZ(){zZ(function(){(Ht&6)!==0?G(X,kZ):tA()})}function $S(){if(Ps===0){var s=Eu;s===0&&(s=vs,vs<<=1,(vs&261888)===0&&(vs=256)),Ps=s}return Ps}function oA(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Yh(""+s)}function aA(s,l){var p=l.ownerDocument.createElement("input");return p.name=l.name,p.value=l.value,s.id&&p.setAttribute("form",s.id),l.parentNode.insertBefore(p,l),s=new FormData(s),p.parentNode.removeChild(p),s}function jZ(s,l,p,g,w){if(l==="submit"&&p&&p.stateNode===w){var _=oA((w[oi]||null).action),I=g.submitter;I&&(l=(l=I[oi]||null)?oA(l.formAction):I.getAttribute("formAction"),l!==null&&(_=l,I=null));var P=new Qh("action","action",null,g,w);s.push({event:P,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Ps!==0){var Z=I?aA(w,I):new FormData(w);tS(p,{pending:!0,data:Z,method:w.method,action:_},null,Z)}}else typeof _=="function"&&(P.preventDefault(),Z=I?aA(w,I):new FormData(w),tS(p,{pending:!0,data:Z,method:w.method,action:_},_,Z))},currentTarget:w}]})}}for(var PS=0;PS<yw.length;PS++){var MS=yw[PS],RZ=MS.toLowerCase(),IZ=MS[0].toUpperCase()+MS.slice(1);Ao(RZ,"on"+IZ)}Ao(MN,"onAnimationEnd"),Ao(zN,"onAnimationIteration"),Ao(LN,"onAnimationStart"),Ao("dblclick","onDoubleClick"),Ao("focusin","onFocus"),Ao("focusout","onBlur"),Ao(qG,"onTransitionRun"),Ao(KG,"onTransitionStart"),Ao(GG,"onTransitionCancel"),Ao(FN,"onTransitionEnd"),fu("onMouseEnter",["mouseout","mouseover"]),fu("onMouseLeave",["mouseout","mouseover"]),fu("onPointerEnter",["pointerout","pointerover"]),fu("onPointerLeave",["pointerout","pointerover"]),Vl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dp="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(" "),NZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dp));function sA(s,l){l=(l&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(l)for(var I=g.length-1;0<=I;I--){var P=g[I],Z=P.instance,ce=P.currentTarget;if(P=P.listener,Z!==_&&w.isPropagationStopped())break e;_=P,w.currentTarget=ce;try{_(w)}catch(ye){ng(ye)}w.currentTarget=null,_=Z}else for(I=0;I<g.length;I++){if(P=g[I],Z=P.instance,ce=P.currentTarget,P=P.listener,Z!==_&&w.isPropagationStopped())break e;_=P,w.currentTarget=ce;try{_(w)}catch(ye){ng(ye)}w.currentTarget=null,_=Z}}}}function Rt(s,l){var p=l[W0];p===void 0&&(p=l[W0]=new Set);var g=s+"__bubble";p.has(g)||(lA(l,s,2,!1),p.add(g))}function zS(s,l,p){var g=0;l&&(g|=4),lA(p,s,g,l)}var Vg="_reactListening"+Math.random().toString(36).slice(2);function LS(s){if(!s[Vg]){s[Vg]=!0,tN.forEach(function(p){p!=="selectionchange"&&(NZ.has(p)||zS(p,!1,s),zS(p,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Vg]||(l[Vg]=!0,zS("selectionchange",!1,l))}}function lA(s,l,p,g){switch(MA(l)){case 2:var w=iY;break;case 8:w=oY;break;default:w=e_}p=w.bind(null,l,p,s),w=void 0,!ow||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),g?w!==void 0?s.addEventListener(l,p,{capture:!0,passive:w}):s.addEventListener(l,p,!0):w!==void 0?s.addEventListener(l,p,{passive:w}):s.addEventListener(l,p,!1)}function FS(s,l,p,g,w){var _=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var P=g.stateNode.containerInfo;if(P===w)break;if(I===4)for(I=g.return;I!==null;){var Z=I.tag;if((Z===3||Z===4)&&I.stateNode.containerInfo===w)return;I=I.return}for(;P!==null;){if(I=cu(P),I===null)return;if(Z=I.tag,Z===5||Z===6||Z===26||Z===27){g=_=I;continue e}P=P.parentNode}}g=g.return}pN(function(){var ce=_,ye=rw(p),Se=[];e:{var de=UN.get(s);if(de!==void 0){var he=Qh,Be=s;switch(s){case"keypress":if(Xh(p)===0)break e;case"keydown":case"keyup":he=_G;break;case"focusin":Be="focus",he=cw;break;case"focusout":Be="blur",he=cw;break;case"beforeblur":case"afterblur":he=cw;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":he=gN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=dG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=EG;break;case MN:case zN:case LN:he=mG;break;case FN:he=RG;break;case"scroll":case"scrollend":he=cG;break;case"wheel":he=NG;break;case"copy":case"cut":case"paste":he=gG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=yN;break;case"toggle":case"beforetoggle":he=OG}var tt=(l&4)!==0,rn=!tt&&(s==="scroll"||s==="scrollend"),ie=tt?de!==null?de+"Capture":null:de;tt=[];for(var ne=ce,le;ne!==null;){var xe=ne;if(le=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||le===null||ie===null||(xe=Af(ne,ie),xe!=null&&tt.push(fp(ne,xe,le))),rn)break;ne=ne.return}0<tt.length&&(de=new he(de,Be,null,p,ye),Se.push({event:de,listeners:tt}))}}if((l&7)===0){e:{if(de=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",de&&p!==nw&&(Be=p.relatedTarget||p.fromElement)&&(cu(Be)||Be[lu]))break e;if((he||de)&&(de=ye.window===ye?ye:(de=ye.ownerDocument)?de.defaultView||de.parentWindow:window,he?(Be=p.relatedTarget||p.toElement,he=ce,Be=Be?cu(Be):null,Be!==null&&(rn=o(Be),tt=Be.tag,Be!==rn||tt!==5&&tt!==27&&tt!==6)&&(Be=null)):(he=null,Be=ce),he!==Be)){if(tt=gN,xe="onMouseLeave",ie="onMouseEnter",ne="mouse",(s==="pointerout"||s==="pointerover")&&(tt=yN,xe="onPointerLeave",ie="onPointerEnter",ne="pointer"),rn=he==null?de:Of(he),le=Be==null?de:Of(Be),de=new tt(xe,ne+"leave",he,p,ye),de.target=rn,de.relatedTarget=le,xe=null,cu(ye)===ce&&(tt=new tt(ie,ne+"enter",Be,p,ye),tt.target=le,tt.relatedTarget=rn,xe=tt),rn=xe,he&&Be)t:{for(tt=TZ,ie=he,ne=Be,le=0,xe=ie;xe;xe=tt(xe))le++;xe=0;for(var Je=ne;Je;Je=tt(Je))xe++;for(;0<le-xe;)ie=tt(ie),le--;for(;0<xe-le;)ne=tt(ne),xe--;for(;le--;){if(ie===ne||ne!==null&&ie===ne.alternate){tt=ie;break t}ie=tt(ie),ne=tt(ne)}tt=null}else tt=null;he!==null&&cA(Se,de,he,tt,!1),Be!==null&&rn!==null&&cA(Se,rn,Be,tt,!0)}}e:{if(de=ce?Of(ce):window,he=de.nodeName&&de.nodeName.toLowerCase(),he==="select"||he==="input"&&de.type==="file")var Lt=EN;else if(CN(de))if(jN)Lt=VG;else{Lt=FG;var Ge=LG}else he=de.nodeName,!he||he.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ce&&tw(ce.elementType)&&(Lt=EN):Lt=UG;if(Lt&&(Lt=Lt(s,ce))){kN(Se,Lt,p,ye);break e}Ge&&Ge(s,de,ce),s==="focusout"&&ce&&de.type==="number"&&ce.memoizedProps.value!=null&&ew(de,"number",de.value)}switch(Ge=ce?Of(ce):window,s){case"focusin":(CN(Ge)||Ge.contentEditable==="true")&&(yu=Ge,hw=ce,Uf=null);break;case"focusout":Uf=hw=yu=null;break;case"mousedown":gw=!0;break;case"contextmenu":case"mouseup":case"dragend":gw=!1,$N(Se,p,ye);break;case"selectionchange":if(HG)break;case"keydown":case"keyup":$N(Se,p,ye)}var vt;if(dw)e:{switch(s){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else vu?SN(s,p)&&(Tt="onCompositionEnd"):s==="keydown"&&p.keyCode===229&&(Tt="onCompositionStart");Tt&&(bN&&p.locale!=="ko"&&(vu||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&vu&&(vt=mN()):(xs=ye,aw="value"in xs?xs.value:xs.textContent,vu=!0)),Ge=Bg(ce,Tt),0<Ge.length&&(Tt=new vN(Tt,s,null,p,ye),Se.push({event:Tt,listeners:Ge}),vt?Tt.data=vt:(vt=_N(p),vt!==null&&(Tt.data=vt)))),(vt=DG?$G(s,p):PG(s,p))&&(Tt=Bg(ce,"onBeforeInput"),0<Tt.length&&(Ge=new vN("onBeforeInput","beforeinput",null,p,ye),Se.push({event:Ge,listeners:Tt}),Ge.data=vt)),jZ(Se,s,ce,p,ye)}sA(Se,l)})}function fp(s,l,p){return{instance:s,listener:l,currentTarget:p}}function Bg(s,l){for(var p=l+"Capture",g=[];s!==null;){var w=s,_=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||_===null||(w=Af(s,p),w!=null&&g.unshift(fp(s,w,_)),w=Af(s,l),w!=null&&g.push(fp(s,w,_))),s.tag===3)return g;s=s.return}return[]}function TZ(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function cA(s,l,p,g,w){for(var _=l._reactName,I=[];p!==null&&p!==g;){var P=p,Z=P.alternate,ce=P.stateNode;if(P=P.tag,Z!==null&&Z===g)break;P!==5&&P!==26&&P!==27||ce===null||(Z=ce,w?(ce=Af(p,_),ce!=null&&I.unshift(fp(p,ce,Z))):w||(ce=Af(p,_),ce!=null&&I.push(fp(p,ce,Z)))),p=p.return}I.length!==0&&s.push({event:l,listeners:I})}var OZ=/\r\n?/g,AZ=/\u0000|\uFFFD/g;function uA(s){return(typeof s=="string"?s:""+s).replace(OZ,`
217
+ `).replace(AZ,"")}function dA(s,l){return l=uA(l),uA(s)===l}function nn(s,l,p,g,w,_){switch(p){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||mu(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&mu(s,""+g);break;case"className":Gh(s,"class",g);break;case"tabIndex":Gh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Gh(s,p,g);break;case"style":dN(s,g,_);break;case"data":if(l!=="object"){Gh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||p!=="href")){s.removeAttribute(p);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Yh(""+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"?(l!=="input"&&nn(s,l,"name",w.name,w,null),nn(s,l,"formEncType",w.formEncType,w,null),nn(s,l,"formMethod",w.formMethod,w,null),nn(s,l,"formTarget",w.formTarget,w,null)):(nn(s,l,"encType",w.encType,w,null),nn(s,l,"method",w.method,w,null),nn(s,l,"target",w.target,w,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(p);break}g=Yh(""+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=Yh(""+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),Kh(s,"popover",g);break;case"xlinkActuate":Ia(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ia(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ia(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ia(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ia(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ia(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ia(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ia(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ia(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Kh(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=sG.get(p)||p,Kh(s,p,g))}}function US(s,l,p,g,w,_){switch(p){case"style":dN(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"?mu(s,g):(typeof g=="number"||typeof g=="bigint")&&mu(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(!nN.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(w=p.endsWith("Capture"),l=p.slice(2,w?p.length-7:void 0),_=s[oi]||null,_=_!=null?_[p]:null,typeof _=="function"&&s.removeEventListener(l,_,w),typeof g=="function")){typeof _!="function"&&_!==null&&(p in s?s[p]=null:s.hasAttribute(p)&&s.removeAttribute(p)),s.addEventListener(l,g,w);break e}p in s?s[p]=g:g===!0?s.setAttribute(p,""):Kh(s,p,g)}}}function wr(s,l,p){switch(l){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 I=p[_];if(I!=null)switch(_){case"src":g=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:nn(s,l,_,I,p,null)}}w&&nn(s,l,"srcSet",p.srcSet,p,null),g&&nn(s,l,"src",p.src,p,null);return;case"input":Rt("invalid",s);var P=_=I=w=null,Z=null,ce=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":I=ye;break;case"checked":Z=ye;break;case"defaultChecked":ce=ye;break;case"value":_=ye;break;case"defaultValue":P=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,l));break;default:nn(s,l,g,ye,p,null)}}sN(s,_,P,Z,ce,I,w,!1);return;case"select":Rt("invalid",s),g=I=_=null;for(w in p)if(p.hasOwnProperty(w)&&(P=p[w],P!=null))switch(w){case"value":_=P;break;case"defaultValue":I=P;break;case"multiple":g=P;default:nn(s,l,w,P,p,null)}l=_,p=I,s.multiple=!!g,l!=null?pu(s,!!g,l,!1):p!=null&&pu(s,!!g,p,!0);return;case"textarea":Rt("invalid",s),_=w=g=null;for(I in p)if(p.hasOwnProperty(I)&&(P=p[I],P!=null))switch(I){case"value":g=P;break;case"defaultValue":w=P;break;case"children":_=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:nn(s,l,I,P,p,null)}cN(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":nn(s,l,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<dp.length;g++)Rt(dp[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(ce in p)if(p.hasOwnProperty(ce)&&(g=p[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:nn(s,l,ce,g,p,null)}return;default:if(tw(l)){for(ye in p)p.hasOwnProperty(ye)&&(g=p[ye],g!==void 0&&US(s,l,ye,g,p,void 0));return}}for(P in p)p.hasOwnProperty(P)&&(g=p[P],g!=null&&nn(s,l,P,g,p,null))}function DZ(s,l,p,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,_=null,I=null,P=null,Z=null,ce=null,ye=null;for(he in p){var Se=p[he];if(p.hasOwnProperty(he)&&Se!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=Se;default:g.hasOwnProperty(he)||nn(s,l,he,null,g,Se)}}for(var de in g){var he=g[de];if(Se=p[de],g.hasOwnProperty(de)&&(he!=null||Se!=null))switch(de){case"type":_=he;break;case"name":w=he;break;case"checked":ce=he;break;case"defaultChecked":ye=he;break;case"value":I=he;break;case"defaultValue":P=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:he!==Se&&nn(s,l,de,he,g,Se)}}Q0(s,I,P,Z,ce,ye,_,w);return;case"select":he=I=P=de=null;for(_ in p)if(Z=p[_],p.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":he=Z;default:g.hasOwnProperty(_)||nn(s,l,_,null,g,Z)}for(w in g)if(_=g[w],Z=p[w],g.hasOwnProperty(w)&&(_!=null||Z!=null))switch(w){case"value":de=_;break;case"defaultValue":P=_;break;case"multiple":I=_;default:_!==Z&&nn(s,l,w,_,g,Z)}l=P,p=I,g=he,de!=null?pu(s,!!p,de,!1):!!g!=!!p&&(l!=null?pu(s,!!p,l,!0):pu(s,!!p,p?[]:"",!1));return;case"textarea":he=de=null;for(P in p)if(w=p[P],p.hasOwnProperty(P)&&w!=null&&!g.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:nn(s,l,P,null,g,w)}for(I in g)if(w=g[I],_=p[I],g.hasOwnProperty(I)&&(w!=null||_!=null))switch(I){case"value":de=w;break;case"defaultValue":he=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==_&&nn(s,l,I,w,g,_)}lN(s,de,he);return;case"option":for(var Be in p)de=p[Be],p.hasOwnProperty(Be)&&de!=null&&!g.hasOwnProperty(Be)&&(Be==="selected"?s.selected=!1:nn(s,l,Be,null,g,de));for(Z in g)de=g[Z],he=p[Z],g.hasOwnProperty(Z)&&de!==he&&(de!=null||he!=null)&&(Z==="selected"?s.selected=de&&typeof de!="function"&&typeof de!="symbol":nn(s,l,Z,de,g,he));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 tt in p)de=p[tt],p.hasOwnProperty(tt)&&de!=null&&!g.hasOwnProperty(tt)&&nn(s,l,tt,null,g,de);for(ce in g)if(de=g[ce],he=p[ce],g.hasOwnProperty(ce)&&de!==he&&(de!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:nn(s,l,ce,de,g,he)}return;default:if(tw(l)){for(var rn in p)de=p[rn],p.hasOwnProperty(rn)&&de!==void 0&&!g.hasOwnProperty(rn)&&US(s,l,rn,void 0,g,de);for(ye in g)de=g[ye],he=p[ye],!g.hasOwnProperty(ye)||de===he||de===void 0&&he===void 0||US(s,l,ye,de,g,he);return}}for(var ie in p)de=p[ie],p.hasOwnProperty(ie)&&de!=null&&!g.hasOwnProperty(ie)&&nn(s,l,ie,null,g,de);for(Se in g)de=g[Se],he=p[Se],!g.hasOwnProperty(Se)||de===he||de==null&&he==null||nn(s,l,Se,de,g,he)}function fA(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $Z(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,p=performance.getEntriesByType("resource"),g=0;g<p.length;g++){var w=p[g],_=w.transferSize,I=w.initiatorType,P=w.duration;if(_&&P&&fA(I)){for(I=0,P=w.responseEnd,g+=1;g<p.length;g++){var Z=p[g],ce=Z.startTime;if(ce>P)break;var ye=Z.transferSize,Se=Z.initiatorType;ye&&fA(Se)&&(Z=Z.responseEnd,I+=ye*(Z<P?1:(P-ce)/(Z-ce)))}if(--g,l+=8*(_+I)/(w.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var VS=null,BS=null;function Hg(s){return s.nodeType===9?s:s.ownerDocument}function pA(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 mA(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function HS(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var qS=null;function PZ(){var s=window.event;return s&&s.type==="popstate"?s===qS?!1:(qS=s,!0):(qS=null,!1)}var hA=typeof setTimeout=="function"?setTimeout:void 0,MZ=typeof clearTimeout=="function"?clearTimeout:void 0,gA=typeof Promise=="function"?Promise:void 0,zZ=typeof queueMicrotask=="function"?queueMicrotask:typeof gA<"u"?function(s){return gA.resolve(null).then(s).catch(LZ)}:hA;function LZ(s){setTimeout(function(){throw s})}function Ms(s){return s==="head"}function vA(s,l){var p=l,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),qu(l);return}g--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")g++;else if(p==="html")pp(s.ownerDocument.documentElement);else if(p==="head"){p=s.ownerDocument.head,pp(p);for(var _=p.firstChild;_;){var I=_.nextSibling,P=_.nodeName;_[Tf]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&_.rel.toLowerCase()==="stylesheet"||p.removeChild(_),_=I}}else p==="body"&&pp(s.ownerDocument.body);p=w}while(p);qu(l)}function yA(s,l){var p=s;s=0;do{var g=p.nextSibling;if(p.nodeType===1?l?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(l?(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 KS(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var p=l;switch(l=l.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":KS(p),X0(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}s.removeChild(p)}}function FZ(s,l,p,g){for(;s.nodeType===1;){var w=p;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Tf])switch(l){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(l==="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=co(s.nextSibling),s===null)break}return null}function UZ(s,l,p){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!p||(s=co(s.nextSibling),s===null))return null;return s}function bA(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=co(s.nextSibling),s===null))return null;return s}function GS(s){return s.data==="$?"||s.data==="$~"}function ZS(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function VZ(s,l){var p=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||p.readyState!=="loading")l();else{var g=function(){l(),p.removeEventListener("DOMContentLoaded",g)};p.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function co(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var YS=null;function xA(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var p=s.data;if(p==="/$"||p==="/&"){if(l===0)return co(s.nextSibling);l--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||l++}s=s.nextSibling}return null}function wA(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var p=s.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(l===0)return s;l--}else p!=="/$"&&p!=="/&"||l++}s=s.previousSibling}return null}function SA(s,l,p){switch(l=Hg(p),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function pp(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);X0(s)}var uo=new Map,_A=new Set;function qg(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ka=W.d;W.d={f:BZ,r:HZ,D:qZ,C:KZ,L:GZ,m:ZZ,X:WZ,S:YZ,M:XZ};function BZ(){var s=Ka.f(),l=Pg();return s||l}function HZ(s){var l=uu(s);l!==null&&l.tag===5&&l.type==="form"?FT(l):Ka.r(s)}var Vu=typeof document>"u"?null:document;function CA(s,l,p){var g=Vu;if(g&&typeof l=="string"&&l){var w=no(l);w='link[rel="'+s+'"][href="'+w+'"]',typeof p=="string"&&(w+='[crossorigin="'+p+'"]'),_A.has(w)||(_A.add(w),s={rel:s,crossOrigin:p,href:l},g.querySelector(w)===null&&(l=g.createElement("link"),wr(l,"link",s),fr(l),g.head.appendChild(l)))}}function qZ(s){Ka.D(s),CA("dns-prefetch",s,null)}function KZ(s,l){Ka.C(s,l),CA("preconnect",s,l)}function GZ(s,l,p){Ka.L(s,l,p);var g=Vu;if(g&&s&&l){var w='link[rel="preload"][as="'+no(l)+'"]';l==="image"&&p&&p.imageSrcSet?(w+='[imagesrcset="'+no(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(w+='[imagesizes="'+no(p.imageSizes)+'"]')):w+='[href="'+no(s)+'"]';var _=w;switch(l){case"style":_=Bu(s);break;case"script":_=Hu(s)}uo.has(_)||(s=h({rel:"preload",href:l==="image"&&p&&p.imageSrcSet?void 0:s,as:l},p),uo.set(_,s),g.querySelector(w)!==null||l==="style"&&g.querySelector(mp(_))||l==="script"&&g.querySelector(hp(_))||(l=g.createElement("link"),wr(l,"link",s),fr(l),g.head.appendChild(l)))}}function ZZ(s,l){Ka.m(s,l);var p=Vu;if(p&&s){var g=l&&typeof l.as=="string"?l.as:"script",w='link[rel="modulepreload"][as="'+no(g)+'"][href="'+no(s)+'"]',_=w;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Hu(s)}if(!uo.has(_)&&(s=h({rel:"modulepreload",href:s},l),uo.set(_,s),p.querySelector(w)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(hp(_)))return}g=p.createElement("link"),wr(g,"link",s),fr(g),p.head.appendChild(g)}}}function YZ(s,l,p){Ka.S(s,l,p);var g=Vu;if(g&&s){var w=du(g).hoistableStyles,_=Bu(s);l=l||"default";var I=w.get(_);if(!I){var P={loading:0,preload:null};if(I=g.querySelector(mp(_)))P.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":l},p),(p=uo.get(_))&&WS(s,p);var Z=I=g.createElement("link");fr(Z),wr(Z,"link",s),Z._p=new Promise(function(ce,ye){Z.onload=ce,Z.onerror=ye}),Z.addEventListener("load",function(){P.loading|=1}),Z.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Kg(I,l,g)}I={type:"stylesheet",instance:I,count:1,state:P},w.set(_,I)}}}function WZ(s,l){Ka.X(s,l);var p=Vu;if(p&&s){var g=du(p).hoistableScripts,w=Hu(s),_=g.get(w);_||(_=p.querySelector(hp(w)),_||(s=h({src:s,async:!0},l),(l=uo.get(w))&&XS(s,l),_=p.createElement("script"),fr(_),wr(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function XZ(s,l){Ka.M(s,l);var p=Vu;if(p&&s){var g=du(p).hoistableScripts,w=Hu(s),_=g.get(w);_||(_=p.querySelector(hp(w)),_||(s=h({src:s,async:!0,type:"module"},l),(l=uo.get(w))&&XS(s,l),_=p.createElement("script"),fr(_),wr(_,"link",s),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},g.set(w,_))}}function kA(s,l,p,g){var w=(w=ge.current)?qg(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"?(l=Bu(p.href),p=du(w).hoistableStyles,g=p.get(l),g||(g={type:"style",instance:null,count:0,state:null},p.set(l,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=Bu(p.href);var _=du(w).hoistableStyles,I=_.get(s);if(I||(w=w.ownerDocument||w,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,I),(_=w.querySelector(mp(s)))&&!_._p&&(I.instance=_,I.state.loading=5),uo.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},uo.set(s,p),_||JZ(w,s,p,I.state))),l&&g===null)throw Error(r(528,""));return I}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=p.async,p=p.src,typeof p=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Hu(p),p=du(w).hoistableScripts,g=p.get(l),g||(g={type:"script",instance:null,count:0,state:null},p.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Bu(s){return'href="'+no(s)+'"'}function mp(s){return'link[rel="stylesheet"]['+s+"]"}function EA(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function JZ(s,l,p,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),wr(l,"link",p),fr(l),s.head.appendChild(l))}function Hu(s){return'[src="'+no(s)+'"]'}function hp(s){return"script[async]"+s}function jA(s,l,p){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+no(p.href)+'"]');if(g)return l.instance=g,fr(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"),fr(g),wr(g,"style",w),Kg(g,p.precedence,s),l.instance=g;case"stylesheet":w=Bu(p.href);var _=s.querySelector(mp(w));if(_)return l.state.loading|=4,l.instance=_,fr(_),_;g=EA(p),(w=uo.get(w))&&WS(g,w),_=(s.ownerDocument||s).createElement("link"),fr(_);var I=_;return I._p=new Promise(function(P,Z){I.onload=P,I.onerror=Z}),wr(_,"link",g),l.state.loading|=4,Kg(_,p.precedence,s),l.instance=_;case"script":return _=Hu(p.src),(w=s.querySelector(hp(_)))?(l.instance=w,fr(w),w):(g=p,(w=uo.get(_))&&(g=h({},p),XS(g,w)),s=s.ownerDocument||s,w=s.createElement("script"),fr(w),wr(w,"link",g),s.head.appendChild(w),l.instance=w);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,Kg(g,p.precedence,s));return l.instance}function Kg(s,l,p){for(var g=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=g.length?g[g.length-1]:null,_=w,I=0;I<g.length;I++){var P=g[I];if(P.dataset.precedence===l)_=P;else if(_!==w)break}_?_.parentNode.insertBefore(s,_.nextSibling):(l=p.nodeType===9?p.head:p,l.insertBefore(s,l.firstChild))}function WS(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function XS(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Gg=null;function RA(s,l,p){if(Gg===null){var g=new Map,w=Gg=new Map;w.set(p,g)}else w=Gg,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(!(_[Tf]||_[vr]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var I=_.getAttribute(l)||"";I=s+I;var P=g.get(I);P?P.push(_):g.set(I,[_])}}return g}function IA(s,l,p){s=s.ownerDocument||s,s.head.insertBefore(p,l==="title"?s.querySelector("head > title"):null)}function QZ(s,l,p){if(p===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function NA(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function eY(s,l,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=Bu(g.href),_=l.querySelector(mp(w));if(_){l=_._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Zg.bind(s),l.then(s,s)),p.state.loading|=4,p.instance=_,fr(_);return}_=l.ownerDocument||l,g=EA(g),(w=uo.get(w))&&WS(g,w),_=_.createElement("link"),fr(_);var I=_;I._p=new Promise(function(P,Z){I.onload=P,I.onerror=Z}),wr(_,"link",g),p.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(p,l),(l=p.state.preload)&&(p.state.loading&3)===0&&(s.count++,p=Zg.bind(s),l.addEventListener("load",p),l.addEventListener("error",p))}}var JS=0;function tY(s,l){return s.stylesheets&&s.count===0&&Wg(s,s.stylesheets),0<s.count||0<s.imgCount?function(p){var g=setTimeout(function(){if(s.stylesheets&&Wg(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+l);0<s.imgBytes&&JS===0&&(JS=62500*$Z());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Wg(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>JS?50:800)+l);return s.unsuspend=p,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(w)}}:null}function Zg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wg(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Yg=null;function Wg(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Yg=new Map,l.forEach(nY,s),Yg=null,Zg.call(s))}function nY(s,l){if(!(l.state.loading&4)){var p=Yg.get(s);if(p)var g=p.get(null);else{p=new Map,Yg.set(s,p);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<w.length;_++){var I=w[_];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(p.set(I.dataset.precedence,I),g=I)}g&&p.set(null,g)}w=l.instance,I=w.getAttribute("data-precedence"),_=p.get(I)||g,_===g&&p.set(null,w),p.set(I,w),this.count++,g=Zg.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)),l.state.loading|=4}}var gp={$$typeof:j,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function rY(s,l,p,g,w,_,I,P,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=Qo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qo(0),this.hiddenUpdates=Qo(null),this.identifierPrefix=g,this.onUncaughtError=w,this.onCaughtError=_,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function TA(s,l,p,g,w,_,I,P,Z,ce,ye,Se){return s=new rY(s,l,p,I,Z,ce,ye,Se,P),l=1,_===!0&&(l|=24),_=Ri(3,null,null,l),s.current=_,_.stateNode=s,l=Tw(),l.refCount++,s.pooledCache=l,l.refCount++,_.memoizedState={element:g,isDehydrated:p,cache:l},$w(_),s}function OA(s){return s?(s=wu,s):wu}function AA(s,l,p,g,w,_){w=OA(w),g.context===null?g.context=w:g.pendingContext=w,g=Es(l),g.payload={element:p},_=_===void 0?null:_,_!==null&&(g.callback=_),p=js(s,g,l),p!==null&&(di(p,s,l),Zf(p,s,l))}function DA(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var p=s.retryLane;s.retryLane=p!==0&&p<l?p:l}}function QS(s,l){DA(s,l),(s=s.alternate)&&DA(s,l)}function $A(s){if(s.tag===13||s.tag===31){var l=Kl(s,67108864);l!==null&&di(l,s,67108864),QS(s,67108864)}}function PA(s){if(s.tag===13||s.tag===31){var l=Ai();l=su(l);var p=Kl(s,l);p!==null&&di(p,s,l),QS(s,l)}}var Xg=!0;function iY(s,l,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=2,e_(s,l,p,g)}finally{W.p=_,z.T=w}}function oY(s,l,p,g){var w=z.T;z.T=null;var _=W.p;try{W.p=8,e_(s,l,p,g)}finally{W.p=_,z.T=w}}function e_(s,l,p,g){if(Xg){var w=t_(g);if(w===null)FS(s,l,g,Jg,p),zA(s,g);else if(sY(w,s,l,p,g))g.stopPropagation();else if(zA(s,g),l&4&&-1<aY.indexOf(s)){for(;w!==null;){var _=uu(w);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var I=Bt(_.pendingLanes);if(I!==0){var P=_;for(P.pendingLanes|=2,P.entangledLanes|=2;I;){var Z=1<<31-_t(I);P.entanglements[1]|=Z,I&=~Z}ra(_),(Ht&6)===0&&(Dg=re()+500,up(0))}}break;case 31:case 13:P=Kl(_,2),P!==null&&di(P,_,2),Pg(),QS(_,2)}if(_=t_(g),_===null&&FS(s,l,g,Jg,p),_===w)break;w=_}w!==null&&g.stopPropagation()}else FS(s,l,g,null,p)}}function t_(s){return s=rw(s),n_(s)}var Jg=null;function n_(s){if(Jg=null,s=cu(s),s!==null){var l=o(s);if(l===null)s=null;else{var p=l.tag;if(p===13){if(s=a(l),s!==null)return s;s=null}else if(p===31){if(s=c(l),s!==null)return s;s=null}else if(p===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Jg=s,null}function MA(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(ue()){case X:return 2;case ve:return 8;case Ee:case Ke:return 32;case et:return 268435456;default:return 32}default:return 32}}var r_=!1,zs=null,Ls=null,Fs=null,vp=new Map,yp=new Map,Us=[],aY="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 zA(s,l){switch(s){case"focusin":case"focusout":zs=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":vp.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":yp.delete(l.pointerId)}}function bp(s,l,p,g,w,_){return s===null||s.nativeEvent!==_?(s={blockedOn:l,domEventName:p,eventSystemFlags:g,nativeEvent:_,targetContainers:[w]},l!==null&&(l=uu(l),l!==null&&$A(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),s)}function sY(s,l,p,g,w){switch(l){case"focusin":return zs=bp(zs,s,l,p,g,w),!0;case"dragenter":return Ls=bp(Ls,s,l,p,g,w),!0;case"mouseover":return Fs=bp(Fs,s,l,p,g,w),!0;case"pointerover":var _=w.pointerId;return vp.set(_,bp(vp.get(_)||null,s,l,p,g,w)),!0;case"gotpointercapture":return _=w.pointerId,yp.set(_,bp(yp.get(_)||null,s,l,p,g,w)),!0}return!1}function LA(s){var l=cu(s.target);if(l!==null){var p=o(l);if(p!==null){if(l=p.tag,l===13){if(l=a(p),l!==null){s.blockedOn=l,QI(s.priority,function(){PA(p)});return}}else if(l===31){if(l=c(p),l!==null){s.blockedOn=l,QI(s.priority,function(){PA(p)});return}}else if(l===3&&p.stateNode.current.memoizedState.isDehydrated){s.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Qg(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var p=t_(s.nativeEvent);if(p===null){p=s.nativeEvent;var g=new p.constructor(p.type,p);nw=g,p.target.dispatchEvent(g),nw=null}else return l=uu(p),l!==null&&$A(l),s.blockedOn=p,!1;l.shift()}return!0}function FA(s,l,p){Qg(s)&&p.delete(l)}function lY(){r_=!1,zs!==null&&Qg(zs)&&(zs=null),Ls!==null&&Qg(Ls)&&(Ls=null),Fs!==null&&Qg(Fs)&&(Fs=null),vp.forEach(FA),yp.forEach(FA)}function ev(s,l){s.blockedOn===l&&(s.blockedOn=null,r_||(r_=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,lY)))}var tv=null;function UA(s){tv!==s&&(tv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tv===s&&(tv=null);for(var l=0;l<s.length;l+=3){var p=s[l],g=s[l+1],w=s[l+2];if(typeof g!="function"){if(n_(g||p)===null)continue;break}var _=uu(p);_!==null&&(s.splice(l,3),l-=3,tS(_,{pending:!0,data:w,method:p.method,action:g},g,w))}}))}function qu(s){function l(Z){return ev(Z,s)}zs!==null&&ev(zs,s),Ls!==null&&ev(Ls,s),Fs!==null&&ev(Fs,s),vp.forEach(l),yp.forEach(l);for(var p=0;p<Us.length;p++){var g=Us[p];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Us.length&&(p=Us[0],p.blockedOn===null);)LA(p),p.blockedOn===null&&Us.shift();if(p=(s.ownerDocument||s).$$reactFormReplay,p!=null)for(g=0;g<p.length;g+=3){var w=p[g],_=p[g+1],I=w[oi]||null;if(typeof _=="function")I||UA(p);else if(I){var P=null;if(_&&_.hasAttribute("formAction")){if(w=_,I=_[oi]||null)P=I.formAction;else if(n_(w)!==null)continue}else P=I.action;typeof P=="function"?p[g+1]=P:(p.splice(g,3),g-=3),UA(p)}}}function VA(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(I){return w=I})},focusReset:"manual",scroll:"manual"})}function l(){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",l),navigation.addEventListener("navigateerror",l),setTimeout(p,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),w!==null&&(w(),w=null)}}}function i_(s){this._internalRoot=s}nv.prototype.render=i_.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var p=l.current,g=Ai();AA(p,g,s,l,null,null)},nv.prototype.unmount=i_.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;AA(s.current,2,null,s,null,null),Pg(),l[lu]=null}};function nv(s){this._internalRoot=s}nv.prototype.unstable_scheduleHydration=function(s){if(s){var l=Y0();s={blockedOn:null,target:s,priority:l};for(var p=0;p<Us.length&&l!==0&&l<Us[p].priority;p++);Us.splice(p,0,s),p===0&&LA(s)}};var BA=t.version;if(BA!=="19.2.3")throw Error(r(527,BA,"19.2.3"));W.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var cY={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rv.isDisabled&&rv.supportsFiber)try{ln=rv.inject(cY),zt=rv}catch{}}return Kp.createRoot=function(s,l){if(!i(s))throw Error(r(299));var p=!1,g="",w=WT,_=XT,I=JT;return l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(w=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(I=l.onRecoverableError)),l=TA(s,1,!1,null,null,p,g,null,w,_,I,VA),s[lu]=l.current,LS(s),new i_(l)},Kp.hydrateRoot=function(s,l,p){if(!i(s))throw Error(r(299));var g=!1,w="",_=WT,I=XT,P=JT,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&&(I=p.onCaughtError),p.onRecoverableError!==void 0&&(P=p.onRecoverableError),p.formState!==void 0&&(Z=p.formState)),l=TA(s,1,!0,l,p??null,g,w,Z,_,I,P,VA),l.context=OA(null),p=l.current,g=Ai(),g=su(g),w=Es(g),w.callback=null,js(p,w,g),p=g,l.current.lanes=p,cn(l,p),ra(l),s[lu]=l.current,LS(s),new nv(l)},Kp.version="19.2.3",Kp}var KM;function U$e(){if(KM)return K1.exports;KM=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(),K1.exports=F$e(),K1.exports}var V$e=U$e();V$e.createRoot(document.getElementById("root"),{onUncaughtError:(e,t)=>{ay(),console.error("Uncaught error:",e,t)},onCaughtError:(e,t)=>{ay(),console.error("Caught error:",e,t)},onRecoverableError:(e,t)=>{ay(),console.warn("Recoverable error:",e,t)}}).render(u.jsx(b.StrictMode,{children:u.jsx(M$e,{})}));export{nt as $,SE as A,eae as B,z_ as C,dse as D,St as E,Bse as F,kE as G,bL as H,w2e as I,b2e as J,x2e as K,S2e as L,foe as M,kt as N,yo as O,h2e as P,Ar as Q,xt as R,Mr as S,Zb as T,Ym as U,RL as V,Pd as W,Wm as X,ct as Y,Gt as Z,Dt as _,Fb as a,Mo as a$,xn as a0,En as a1,El as a2,on as a3,mn as a4,b as a5,Et as a6,An as a7,we as a8,_fe as a9,Qa as aA,Yk as aB,al as aC,w7 as aD,Uc as aE,Zr as aF,Xo as aG,c2e as aH,ef as aI,B$e as aJ,Vm as aK,Q as aL,C2e as aM,la as aN,Qe as aO,tE as aP,it as aQ,Pt as aR,oAe as aS,ZI as aT,OOe as aU,eo as aV,IM as aW,Ey as aX,Xr as aY,u2e as aZ,Ec as a_,u as aa,an as ab,$e as ac,Ne as ad,Te as ae,De as af,Me as ag,Oe as ah,be as ai,jo as aj,$d as ak,pE as al,yL as am,ire as an,Yc as ao,Ut as ap,cr as aq,Ro as ar,ml as as,ht as at,V4 as au,Lb as av,Zt as aw,rr as ax,Am as ay,lj as az,gl as b,Ue as b0,n4 as b1,HJ as b2,of as b3,Gk as b4,zSe as b5,MSe as b6,ah as b7,qi as b8,Gi as b9,Ki as ba,Zi as bb,Yo as bc,At as bd,Wi as be,Dr as bf,Dn as c,y2e as d,Ice as e,Nce as f,Qb as g,ga as h,aF as i,Ub as j,sle as k,g2e as l,jse as m,Jt as n,d2e as o,v2e as p,ale as q,ole as r,pF as s,Cr as t,fF as u,p2e as v,Vse as w,m2e as x,Gn as y,f2e as z};