hatchlight 0.4.1 → 0.5.0
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.
- package/bin/hatchlight.js +130 -113
- package/package.json +1 -1
- package/resources/drizzle/0012_visitors.sql +11 -0
- package/resources/drizzle/meta/0012_snapshot.json +1133 -0
- package/resources/drizzle/meta/_journal.json +7 -0
- package/resources/web/assets/{Assistant-Dcr31LAV.js → Assistant-pvqlzfRM.js} +1 -1
- package/resources/web/assets/{Gallery-CMRGE3qD.js → Gallery-BmgPWzZ8.js} +1 -1
- package/resources/web/assets/Models-DwIqpODX.js +1 -0
- package/resources/web/assets/{Settings-DSXHt9Y3.js → Settings-BV8oksGm.js} +1 -1
- package/resources/web/assets/index-Cp7pzqgE.js +1 -0
- package/resources/web/assets/index-_Khv5YZR.js +327 -0
- package/resources/web/assets/{splash-CLEpm4fL.js → splash-D2QYY8Wj.js} +1 -1
- package/resources/web/index.html +2 -2
- package/resources/web/splash.html +2 -2
- package/resources/web/assets/Models-D468Wmoj.js +0 -1
- package/resources/web/assets/index-DrgBjkJQ.js +0 -322
- package/resources/web/assets/index-ydGCWKys.js +0 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Assistant-pvqlzfRM.js","assets/index-Cp7pzqgE.js","assets/index-gLwjTNlu.css","assets/Gallery-BmgPWzZ8.js","assets/Models-DwIqpODX.js","assets/Settings-BV8oksGm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var DM=Object.defineProperty;var pE=e=>{throw TypeError(e)};var IM=(e,t,s)=>t in e?DM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var yt=(e,t,s)=>IM(e,typeof t!="symbol"?t+"":t,s),Rv=(e,t,s)=>t.has(e)||pE("Cannot "+s);var ne=(e,t,s)=>(Rv(e,t,"read from private field"),s?s.call(e):t.get(e)),ct=(e,t,s)=>t.has(e)?pE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ke=(e,t,s,o)=>(Rv(e,t,"write to private field"),o?o.call(e,s):t.set(e,s),s),St=(e,t,s)=>(Rv(e,t,"access private method"),s);var Yf=(e,t,s,o)=>({set _(a){Ke(e,t,a,s)},get _(){return ne(e,t,o)}});import{e as ib,m as PM,c as LM,p as UM,l as iy,d as Pu,a as Ou}from"./index-Cp7pzqgE.js";function BM(e,t){for(var s=0;s<t.length;s++){const o=t[s];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in e)){const c=Object.getOwnPropertyDescriptor(o,a);c&&Object.defineProperty(e,a,c.get?c:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function gC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cv={exports:{}},uu={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var gE;function HM(){if(gE)return uu;gE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(o,a,c){var u=null;if(c!==void 0&&(u=""+c),a.key!==void 0&&(u=""+a.key),"key"in a){c={};for(var m in a)m!=="key"&&(c[m]=a[m])}else c=a;return a=c.ref,{$$typeof:e,type:o,key:u,ref:a!==void 0?a:null,props:c}}return uu.Fragment=t,uu.jsx=s,uu.jsxs=s,uu}var vE;function FM(){return vE||(vE=1,Cv.exports=HM()),Cv.exports}var d=FM();function ab(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,a])=>t.indexOf(+o)===-1).map(([o,a])=>a)}function bE(e,t="|"){return e.map(s=>SC(s)).join(t)}function lb(e,t){return typeof t=="bigint"?t.toString():t}class VM{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function ay(e){return new VM(e)}function qM(e){return e==null}function ly(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function $M(e,t){const s=e/t,o=Math.round(s),a=4*Number.EPSILON*Math.max(Math.abs(s),1);return Math.abs(s-o)<a?0:s-o}function Si(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function vC(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function xo(e){return vC(e._zod.def)??e._zod.def.shape}function bC(e,t,s){Object.defineProperty(e,t,{get(){const o=s();return Si(this,t,o),o},enumerable:!0,configurable:!0})}function yC(e,t,s){t in e?Si(e,t,s):e[t]=s}function pa(e,t,s,o){const a=xo(t);for(const c of s){const u=Object.getOwnPropertyDescriptor(a,c);u.enumerable&&(u.get?bC(e,c,()=>{const m=t._zod.def.shape[c];return o?o(m,c):m}):yC(e,c,o?o(u.value,c):u.value))}}function ZM(e,t){for(const s of Reflect.ownKeys(t)){const o=Object.getOwnPropertyDescriptor(t,s);o.enumerable&&(o.get?bC(e,s,()=>t[s]):yC(e,s,o.value))}}function Ur(...e){const t={};for(const s of e){const o=Object.getOwnPropertyDescriptors(s);Object.assign(t,o)}return Object.defineProperties({},t)}function KM(e){return JSON.stringify(e)}function YM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const xC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GM=ay(()=>{var e;if(gs.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function ec(e){if(zm(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(zm(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function wC(e){return ec(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const QM=new Set(["string","number","symbol"]);function dh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(e,t,s){const o=new e._zod.constr(t??e._zod.def);return(!t||s!=null&&s.parent)&&(o._zod.parent=e),o}function ft(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0: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 SC(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function XM(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const EC={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]},JM={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function WM(e,t){const s=e._zod.def,o=s.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c={};return pa(c,e,fh(e,t)),Ei(e,Ur(s,{shape:c,checks:[]}))}function fh(e,t){var a;const s=xo(e),o=[];for(const c of Reflect.ownKeys(t)){if(!((a=Object.getOwnPropertyDescriptor(s,c))!=null&&a.enumerable))throw new Error(`Unrecognized key: "${String(c)}"`);t[c]&&o.push(c)}return o}function ez(e,t){const s=e._zod.def,o=s.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=new Set(fh(e,t)),u={};return pa(u,e,Reflect.ownKeys(xo(e)).filter(m=>!c.has(m))),Ei(e,Ur(s,{shape:u,checks:[]}))}function tz(e,t){if(!ec(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const a=xo(e);for(const c of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(a,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ei(e,Ur(e._zod.def,{shape:TC(e,t)}))}function TC(e,t){const s={};return pa(s,e,Reflect.ownKeys(xo(e))),ZM(s,t),s}function nz(e,t){if(!ec(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Ei(e,Ur(e._zod.def,{shape:TC(e,t)}))}function rz(e,t){var a,c;if(!((a=t==null?void 0:t._zod)!=null&&a.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((c=e._zod.def.checks)!=null&&c.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const s={};pa(s,e,Reflect.ownKeys(xo(e))),pa(s,t,Reflect.ownKeys(xo(t)));const o=Ur(e._zod.def,{shape:s,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ei(e,o)}function yE(e,t,s,o="partial"){const c=t._zod.def.checks;if(c&&c.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);const m=s?new Set(fh(t,s)):void 0,g={};return pa(g,t,Reflect.ownKeys(xo(t)),e&&((v,b)=>m&&!m.has(b)?v:new e({type:"optional",innerType:v}))),Ei(t,Ur(t._zod.def,{shape:g,checks:[]}))}function sz(e,t,s){const o=s?new Set(fh(t,s)):void 0,a={};return pa(a,t,Reflect.ownKeys(xo(t)),(c,u)=>o&&!o.has(u)?c:new e({type:"nonoptional",innerType:c})),Ei(t,Ur(t._zod.def,{shape:a}))}function ho(e,t=0){var s;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((s=e.issues[o])==null?void 0:s.continue)!==!0)return!0;return!1}function oz(e,t=0){var s;if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(((s=e.issues[o])==null?void 0:s.continue)===!1)return!0;return!1}function jl(e,t){return t.map(s=>{var o;return(o=s).path??(o.path=[]),s.path.unshift(e),s})}function du(e){return typeof e=="string"?e:e==null?void 0:e.message}function xE(e){const t=[];for(const s of e??[]){const o=s._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;const a=o.maximum??o.length??o.size;a>=0&&t.push([a,s])}return t}function cb(e,t,s){var o;for(let a=t;a<e.length;a++)(o=e[a]).schema??(o.schema=s)}function vi(e,t,s){var g,v,b,p,x,S,w,E,R,C;var o;const a=(v=(g=e.inst)==null?void 0:g._zod)==null?void 0:v.traits;a!=null&&a.has("$ZodType")&&(a.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);const c=e.schema!==e.inst?(p=(b=e.schema)==null?void 0:b._zod.def)==null?void 0:p.error:void 0,u=e.message?e.message:du((w=(S=(x=e.inst)==null?void 0:x._zod.def)==null?void 0:S.error)==null?void 0:w.call(S,e))??du(c==null?void 0:c(e))??du((E=t==null?void 0:t.error)==null?void 0:E.call(t,e))??du((R=s.customError)==null?void 0:R.call(s,e))??du((C=s.localeError)==null?void 0:C.call(s,e))??"Invalid input",m={};for(const j of Object.keys(e))j==="inst"||j==="schema"||j==="continue"||j==="input"||j==="__proto__"||(m[j]=e[j]);return m.path??(m.path=[]),m.message=u,t!=null&&t.reportInput&&(m.input=e.input),m}const iz=/[\uD800-\uDBFF]/;function cy(e){const t=e.length;if(!iz.test(e))return t;let s=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(s--,o++);return s}function uy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function az(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const s=e;if(s&&Object.getPrototypeOf(s)!==Object.prototype&&"constructor"in s&&s.constructor)return s.constructor.name}}return t}function Lu(...e){const[t,s,o]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:o}:{...t}}function lz(e,t){for(const s in t){const o=Object.getOwnPropertyDescriptor(t,s);o.get?Object.defineProperty(e,s,{...o,enumerable:!1}):cz(e,s,o.value)}}function bi(e,t,s,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:s}),s}function RC(e,t,s){return bi(e,t,s,!1)}function CC(e,t){for(const s in e){const o=e[s];Object.defineProperty(t,s,{configurable:!0,enumerable:!0,get(){return bi(this,s,o(this))},set(a){bi(this,s,a)}})}return t}function cz(e,t,s){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?s:bi(this,t,s.bind(this))},set(o){bi(this,t,o)}})}function uz(e,t){const s=Object.getPrototypeOf(e);return t in s?void 0:s}let Nv,si=!1;const dz={configurable:!0,get(){si=!0}};function en(e,t,s){const o=Object.getPrototypeOf(e._zod);if(t in o&&Nv!==e._zod){Nv=void 0;return}Nv=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,dz);const a=si;si=!1;try{const c=s(this);return si?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:c}),si=si||a,c}catch(c){throw delete this[t],si=si||a,c}},set(a){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:a})}})}function fz(e,t,s,o){const a=uz(e,t);a&&Object.defineProperty(a,t,{configurable:!0,get(){const c={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,c),c.value=s(this),Object.defineProperty(this,t,c),c.value},set(c){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:c})}})}const mz="~constantCatch";function hz(e){const t=()=>e;return t[mz]=!0,t}var wE;const jv={value:void 0,enumerable:!1};let SE="captureStackTrace"in Error?Error:null;function pz(e){const t=SE;if(t){const s=t.stackTraceLimit;if(typeof s=="number"){try{t.stackTraceLimit=0}catch{return SE=null,new e}try{return new e}finally{t.stackTraceLimit=s}}}return new e}function Ne(e,t,s,o){const a={};function c(x){this.def=x,this.constr=p,this.traits=new Set}c.prototype=a;const u=s,m=u&&new WeakSet;function g(x,S){if(x._zod){if(x._zod.traits.has(e))return}else{jv.value=new c(S);try{Object.defineProperty(x,"_zod",jv)}finally{jv.value=void 0}}if(x._zod.traits.add(e),t(x,S),m){const E=Object.getPrototypeOf(x),R=x._zod.constr.prototype;let C=E;for(;C&&C!==R;)C=Object.getPrototypeOf(C);const j=C??E;m.has(j)||(m.add(j),lz(j,u))}const w=p.prototype;for(const E in w)Object.prototype.hasOwnProperty.call(w,E)&&(E in x||(x[E]=w[E].bind(x)))}const v=(o==null?void 0:o.Parent)??Object;class b extends v{}Object.defineProperty(b,"name",{value:e});function p(x){var R;const S=o!=null&&o.Parent?pz(b):this;g(S,x);const w=S._zod.deferred;if(w){for(const C of w)C();S._zod.deferred=void 0}const E=(R=globalThis.__zod_globalConfig)==null?void 0:R.postProcessor;return E&&E(S),S}return Object.defineProperty(p,"init",{value:g}),Object.defineProperty(p,Symbol.hasInstance,{value:x=>{var S,w;return o!=null&&o.Parent&&x instanceof o.Parent?!0:(w=(S=x==null?void 0:x._zod)==null?void 0:S.traits)==null?void 0:w.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class ma extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class NC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(wE=globalThis).__zod_globalConfig??(wE.__zod_globalConfig={});const gs=globalThis.__zod_globalConfig;function vs(e){return e&&Object.assign(gs,e),gs}function gz(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,lb,2)),e.message}function vz(e){this._zod.message=e}const bz={get:gz,set:vz,enumerable:!0,configurable:!0},Ov={value:void 0,enumerable:!1},EE=new WeakSet([Object.prototype,Error.prototype]),yz=(e,t)=>{e.name="$ZodError",Ov.value=t,Object.defineProperty(e,"issues",Ov),Ov.value=void 0,Object.defineProperty(e,"message",bz);const s=Object.getPrototypeOf(e);EE.has(s)||(EE.add(s),Object.defineProperty(s,"toString",{configurable:!0,enumerable:!1,get(){const o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},xz=Ne("$ZodError",yz);function wz(e,t,s){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:s(),writable:!0,enumerable:!0,configurable:!0}):e[t]=s()),e[t]}function Sz(e,t=s=>s.message){const s={},o=[];for(const a of e.issues)a.path.length>0?wz(s,a.path[0],()=>[]).push(t(a)):o.push(t(a));return{formErrors:o,fieldErrors:s}}function Ez(e,t=s=>s.message){const s={_errors:[]},o=(a,c=[])=>{for(const u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(m=>o({issues:m},[...c,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...c,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...c,...u.path]);else{const m=[...c,...u.path];if(m.length===0)s._errors.push(t(u));else{let g=s,v=0;for(;v<m.length;){const b=m[v],p=v===m.length-1;if(b==="_errors"){p&&g._errors.push(t(u)),v++;continue}Object.prototype.hasOwnProperty.call(g,b)||Object.defineProperty(g,b,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const x=g[b];p&&x._errors.push(t(u)),g=x,v++}}}};return o(e),s}function mh(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const dy=e=>{const t=(s,o,a,c)=>{const u=a?{...a,async:!1}:{async:!1},m=s._zod.run({value:o,issues:[]},u);if(m instanceof Promise)throw new ma;if(m.issues.length){const g=new((c==null?void 0:c.Err)??e)(m.issues.map(v=>vi(v,u,vs())));throw xC(g,(c==null?void 0:c.callee)??t),g}return m.value};return t},fy=e=>{const t=async(s,o,a,c)=>{const u=a?{...a,async:!0}:{async:!0};let m=s._zod.run({value:o,issues:[]},u);if(m instanceof Promise&&(m=await m),m.issues.length){const g=new((c==null?void 0:c.Err)??e)(m.issues.map(v=>vi(v,u,vs())));throw xC(g,(c==null?void 0:c.callee)??t),g}return m.value};return t},my=e=>(t,s,o)=>{const a=o?{...o,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},a);if(c instanceof Promise)throw new ma;return c.issues.length?jC(e,c.issues,a):{success:!0,data:c.value}};function jC(e,t,s){let o;return{success:!1,get error(){return o||(o=new e(t.map(a=>vi(a,s,vs()))),t=void 0,s=void 0),o},set error(a){o=a,t=void 0,s=void 0}}}const hy=e=>async(t,s,o)=>{const a=o?{...o,async:!0}:{async:!0};let c=t._zod.run({value:s,issues:[]},a);return c instanceof Promise&&(c=await c),c.issues.length?jC(e,c.issues,a):{success:!0,data:c.value}},Tz=Symbol.for("zod.compile.invalid"),Rz=Symbol.for("zod.compile.fallback"),Cz=((e,t,s)=>{const o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==Tz)return!0;if(o.definite===!0&&s===void 0)return!1}return Nz(e,t,s)});function Nz(e,t,s){const o=s?{...s,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},a=e._zod.bag.fallbackRun;let c;if(a?(o[Rz]=!0,c=a({value:t,issues:[]},o)):c=e._zod.run({value:t,issues:[]},o),c instanceof Promise)throw new ma;return c.issues.length===0}const jz=async(e,t,s)=>{const o=s?{...s,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let a=e._zod.run({value:t,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length===0},Oz=e=>{const t=dy(e),s=(o,a,c,u)=>{const m=c?{...c,direction:"backward"}:{direction:"backward"};return t(o,a,m,mh(s,u))};return s},kz=e=>{const t=dy(e),s=(o,a,c,u)=>t(o,a,c,mh(s,u));return s},_z=e=>{const t=fy(e),s=async(o,a,c,u)=>{const m=c?{...c,direction:"backward"}:{direction:"backward"};return await t(o,a,m,mh(s,u))};return s},Az=e=>{const t=fy(e),s=async(o,a,c,u)=>await t(o,a,c,mh(s,u));return s},Mz=e=>(t,s,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return my(e)(t,s,a)},zz=e=>(t,s,o)=>my(e)(t,s,o),Dz=e=>async(t,s,o)=>{const a=o?{...o,direction:"backward"}:{direction:"backward"};return hy(e)(t,s,a)},Iz=e=>async(t,s,o)=>hy(e)(t,s,o),Pz=/^[cC][0-9a-z]{6,}$/,Lz=/^[0-9a-z]+$/,Uz=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Bz=/^[0-9a-vA-V]{20}$/,Hz=/^[A-Za-z0-9]{27}$/,Fz=/^[a-zA-Z0-9_-]{21}$/;function Vz(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const qz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$z=/^([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})$/,TE=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)$/,Zz=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kz="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Yz(){return new RegExp(Kz,"u")}const Gz=/^(?:(?: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])$/,Qz=/^(([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}|:))$/,Xz=/^((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])$/,Jz=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,eD=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tD=/^https?$/,nD=/^\+[1-9]\d{6,14}$/,OC="(?:(?:\\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])))";function rD(e){return new RegExp(`^${e}$`)}const sD=rD(OC);function ub(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oD(e){return new RegExp(`^${ub(e)}$`)}function iD(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${ub({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${s}|${ub({precision:e.precision})}`:s;return new RegExp(`^${OC}T(?:${o})$`)}const aD=/^[\s\S]{0,}$/,lD=/^-?\d+$/,py=/^-?\d+(?:\.\d+)?$/,cD=/^[^A-Z]*$/,uD=/^[^a-z]*$/,kr=Ne("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),gy=e=>{const t=e.value;return!qM(t)&&t.length!==void 0},Dm={number:"number",bigint:"bigint",object:"date"},kC=Ne("$ZodCheckLessThan",(e,t)=>{kr.init(e,t);const s=Dm[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Dm[typeof o.value]??s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_C=Ne("$ZodCheckGreaterThan",(e,t)=>{kr.init(e,t);const s=Dm[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Dm[typeof o.value]??s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dD=Ne("$ZodCheckMultipleOf",(e,t)=>{kr.init(e,t),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?t.value!==BigInt(0)&&s.value%t.value===BigInt(0):$M(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),fD=Ne("$ZodCheckNumberFormat",(e,t)=>{var u;kr.init(e,t),t.format=t.format||"float64";const s=(u=t.format)==null?void 0:u.includes("int"),o=s?"int":"number",[a,c]=EC[t.format];e._zod.check=m=>{const g=m.value;if(s){if(!Number.isInteger(g)){m.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?m.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):m.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}g<a&&m.issues.push({origin:"number",input:g,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),g>c&&m.issues.push({origin:"number",input:g,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),mD=Ne("$ZodCheckMaxLength",(e,t)=>{var s;kr.init(e,t),(s=e._zod.def).when??(s.when=gy),e._zod.check=o=>{const a=o.value,c=a.length;if((typeof a=="string"&&c>t.maximum?cy(a):c)<=t.maximum)return;const m=uy(a);o.issues.push({origin:m,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),hD=Ne("$ZodCheckMinLength",(e,t)=>{var s;kr.init(e,t),(s=e._zod.def).when??(s.when=gy),e._zod.check=o=>{const a=o.value,c=a.length;if((typeof a=="string"&&c>=t.minimum&&c<t.minimum*2?cy(a):c)>=t.minimum)return;const m=uy(a);o.issues.push({origin:m,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),pD=Ne("$ZodCheckLengthEquals",(e,t)=>{var s;kr.init(e,t),(s=e._zod.def).when??(s.when=gy),e._zod.check=o=>{const a=o.value,c=a.length,u=typeof a=="string"&&c>=t.length&&c<=t.length*2?cy(a):c;if(u===t.length)return;const m=uy(a),g=u>t.length;o.issues.push({origin:m,...g?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),hh=Ne("$ZodCheckStringFormat",(e,t)=>{var s,o;kr.init(e,t),t.pattern?(s=e._zod).check??(s.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),gD=Ne("$ZodCheckRegex",(e,t)=>{hh.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vD=Ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cD),hh.init(e,t)}),bD=Ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=uD),hh.init(e,t)}),yD=Ne("$ZodCheckIncludes",(e,t)=>{kr.init(e,t);const s=dh(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${s}`:s);t.pattern=o,e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),xD=Ne("$ZodCheckStartsWith",(e,t)=>{kr.init(e,t);const s=new RegExp(`^${dh(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),wD=Ne("$ZodCheckEndsWith",(e,t)=>{kr.init(e,t);const s=new RegExp(`.*${dh(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),SD=Ne("$ZodCheckOverwrite",(e,t)=>{kr.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class ED{constructor(t=[],s={}){this.content=[],this.indent=0,this.args=t,this.closed=s}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
|
|
11
|
+
`).filter(u=>u),a=Math.min(...o.map(u=>u.length-u.trimStart().length)),c=o.map(u=>u.slice(a)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const t=Function,s=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
12
|
+
${s.join(`
|
|
13
|
+
`)}
|
|
14
|
+
};`)(...Object.values(this.closed))}}const TD={major:4,minor:6,patch:7},Nn=Ne("$ZodType",(e,t)=>{var c;var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=TD;const o=e._zod.def.checks,a=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o!=null&&o.length?[...o]:[];for(const u of a)for(const m of u._zod.onattach)m(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),(c=e._zod.deferred)==null||c.push(()=>{e._zod.run=e._zod.parse});else{const u=(g,v,b)=>{if(g.memo)return g;let p=ho(g),x;for(const S of v){if(S._zod.def.when){if(oz(g)||!S._zod.def.when(g))continue}else if(p)continue;const w=g.issues.length,E=S._zod.check(g);if(E instanceof Promise&&(b==null?void 0:b.async)===!1)throw new ma;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,g.issues.length!==w&&(cb(g.issues,w,e),p||(p=ho(g,w)))});else{if(g.issues.length===w)continue;cb(g.issues,w,e),p||(p=ho(g,w))}}return x?x.then(()=>g):g},m=(g,v,b)=>{if(ho(g))return g.aborted=!0,g;const p=u(v,a,b);if(p instanceof Promise){if(b.async===!1)throw new ma;return p.then(x=>e._zod.parse(x,b))}return e._zod.parse(p,b)};e._zod.run=(g,v)=>{if(v.skipChecks)return e._zod.parse(g,v);if(v.direction==="backward"){const p=e._zod.parse({value:g.value,issues:[]},{...v,skipChecks:!0});return p instanceof Promise?p.then(x=>m(x,g,v)):m(p,g,v)}const b=e._zod.parse(g,v);if(b instanceof Promise){if(v.async===!1)throw new ma;return b.then(p=>u(p,a,v))}return u(b,a,v)}}},{get"~standard"(){return RC(this,"~standard",MC(this))},set"~standard"(e){bi(this,"~standard",e)}}),AC=(e,t)=>e.issues.length?{issues:e.issues.map(s=>vi(s,t,vs()))}:{value:e.value};async function RD(e,t){const s={async:!0};return AC(await e._zod.run({value:t,issues:[]},s),s)}function MC(e){return{validate:t=>{const s={async:!1};try{const o=e._zod.run({value:t,issues:[]},s);if(!(o instanceof Promise))return AC(o,s)}catch{}return RD(e,t)},vendor:"zod",version:1}}const vy=Ne("$ZodString",(e,t)=>{Nn.init(e,t),e._zod.pattern=t.pattern??aD,e._zod.parse=(s,o)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),bn=Ne("$ZodStringFormat",(e,t)=>{hh.init(e,t),vy.init(e,t)}),CD=Ne("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$z),bn.init(e,t)}),ND=Ne("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=TE(o))}else t.pattern??(t.pattern=TE());bn.init(e,t)}),jD=Ne("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Zz),bn.init(e,t)}),zC=1,Im=2;function DC(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function OD(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?DC(e)||Im:kD(e,t)}function kD(e,t){var s;if(!t.normalize&&((s=t.protocol)==null?void 0:s.source)===tD.source&&!/^https?:\/\//i.test(e))return zC;try{if(typeof URL<"u"){const o=URL;if(typeof o.parse=="function")return o.parse(e)??Im}return new URL(e)}catch{return Im}}const _D=/[\t\n\r]/g;function RE(e){return e.replace(_D,"")}function AD(e,t){return t.lastIndex=0,t.test(e.hostname)}function MD(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const zD=Ne("$ZodURL",(e,t)=>{bn.init(e,t),e._zod.check=s=>{try{const o=s.value.trim(),a=OD(o,t);if(a===zC){s.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:s.value,inst:e,continue:!t.abort});return}if(a===Im){s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort});return}if(a===!0){s.value=RE(o);return}t.hostname&&!AD(a,t.hostname)&&s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort}),t.protocol&&!MD(a,t.protocol)&&s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort}),s.value=t.normalize?a.href:RE(o);return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),DD=Ne("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Yz()),bn.init(e,t)}),ID=Ne("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Fz:Vz(t.length)),bn.init(e,t)}),PD=Ne("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Pz),bn.init(e,t)}),LD=Ne("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lz),bn.init(e,t)}),UD=Ne("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Uz),bn.init(e,t)}),BD=Ne("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bz),bn.init(e,t)}),HD=Ne("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Hz),bn.init(e,t)}),FD=Ne("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=iD(t)),bn.init(e,t)}),VD=Ne("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sD),bn.init(e,t)}),qD=Ne("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oD(t)),bn.init(e,t)}),$D=Ne("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qz),bn.init(e,t)}),ZD=Ne("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gz),bn.init(e,t)}),KD=/^[0-9a-fA-F:.]+$/;function IC(e){return KD.test(e)?DC(`http://[${e}]`):!1}const YD=Ne("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Qz),bn.init(e,t),e._zod.check=s=>{IC(s.value)||s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!t.abort})}}),GD=Ne("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xz),bn.init(e,t)});function QD(e){const t=e.split("/");if(t.length!==2)return!1;const[s,o]=t;if(!o)return!1;const a=Number(o);return`${a}`!==o||a<0||a>128?!1:IC(s)}const XD=Ne("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Jz),bn.init(e,t),e._zod.check=s=>{QD(s.value)||s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}});function PC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const LC=/^[0-9a-zA-Z+/]*={0,2}$/,JD=Ne("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=LC),bn.init(e,t),e._zod.check=s=>{PC(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}}),by=/^[A-Za-z0-9_-]*$/;function WD(e){if(!by.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return PC(s)}const e4=Ne("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=by),bn.init(e,t),e._zod.check=s=>{WD(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),t4=Ne("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nD),bn.init(e,t)});function n4(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[o]=s;if(!o)return!1;const a=JSON.parse(atob(o));return!("typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}}const r4=Ne("$ZodJWT",(e,t)=>{bn.init(e,t),e._zod.check=s=>{n4(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),UC=Ne("$ZodNumber",(e,t)=>{Nn.init(e,t),e._zod.pattern=py,e._zod.parse=(s,o)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const a=s.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return s;const c=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:String(a):void 0;return s.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...c?{received:c}:{}}),s}}),s4=Ne("$ZodNumberFormat",(e,t)=>{fD.init(e,t),UC.init(e,t)}),o4=Ne("$ZodUnknown",(e,t)=>{Nn.init(e,t),e._zod.parse=s=>s}),i4=Ne("$ZodNever",(e,t)=>{Nn.init(e,t),e._zod.parse=(s,o)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function a4(e,t){const s=xE(e._zod.def.checks);if(!s.length)return;const o=Math.min(...s.map(c=>c[0])),a=e._zod.parse;e._zod.parse=(c,u)=>{const m=t(c.value);if(m>o&&!(u!=null&&u.skipChecks)&&(u==null?void 0:u.direction)!=="backward"){for(const[g,v]of xE(e._zod.def.checks))if(m>g&&v._zod.def.when(c)){const b=c.issues.length;return v._zod.check(c),c.issues[b].continue=!1,cb(c.issues,b,e),c}}return a(c,u)}}const l4=e=>Array.isArray(e)?e.length:-1;function CE(e,t,s){e.issues.length&&t.issues.push(...jl(s,e.issues)),t.value[s]=e.value}const c4=Ne("$ZodArray",(e,t)=>{Nn.init(e,t);const s=gs.memoizer;s==null||s.attach(e),e._zod.parse=(o,a)=>{const c=o.value;if(!Array.isArray(c))return o.issues.push({expected:"array",code:"invalid_type",input:c,inst:e}),o;o.value=s?s.alloc(e,o,Array(c.length),a):Array(c.length);const u=[],m=a==null?void 0:a.abortEarly;for(let g=0;g<c.length;g++){const v=c[g],b=t.element._zod.run({value:v,issues:[]},a);if(b instanceof Promise)u.push(b.then(p=>CE(p,o,g)));else if(CE(b,o,g),m&&b.issues.length!==0&&ho(b))break}return u.length?Promise.all(u).then(()=>o):o},a4(e,l4)});function Pm(e,t,s,o,a,c){const u=s in o,m=c==="optional";if(!(!u&&m&&a==="optional")){if(e.issues.length){if(a!==void 0&&m&&!u)return;t.issues.push(...jl(s,e.issues))}if(!u&&a===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[s]});return}e.value===void 0?(u||a==="defaulted"&&!m)&&(t.value[s]=void 0):t.value[s]=e.value}}const u4=[];function BC(e){var u,m,g,v;const t=Object.keys(e.shape),s=Object.getOwnPropertySymbols(e.shape),o=s.length?s:u4,a=o.length?[...t,...o]:t;for(const b of a)if(!((v=(g=(m=(u=e.shape)==null?void 0:u[b])==null?void 0:m._zod)==null?void 0:g.traits)!=null&&v.has("$ZodType")))throw new Error(`Invalid element at key "${String(b)}": expected a Zod schema`);const c=XM(e.shape);return{...e,allKeys:a,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(c)}}function HC(e,t,s,o,a,c,u){const m=[],g=a.keySet,v=a.catchall._zod,b=v.def.type,p=v.optin,x=v.optout;let S=0;for(const w in t){if(u&&s.issues.length!==S){if(ho(s,S))break;S=s.issues.length}if(g.has(w))continue;if(w==="__proto__"){b==="never"&&m.push(w);continue}if(b==="never"){m.push(w);continue}const E=v.run({value:t[w],issues:[]},o);E instanceof Promise?e.push(E.then(R=>Pm(R,s,w,t,p,x))):Pm(E,s,w,t,p,x)}return m.length&&s.issues.push({code:"unrecognized_keys",keys:m,input:t,inst:c,continue:!0}),e.length?Promise.all(e).then(()=>s):s}const d4=Ne("$ZodObject",(e,t)=>{Nn.init(e,t);const s=Object.getOwnPropertyDescriptor(t,"shape"),o=s!=null&&s.get?s.get.raw:t.shape??{};if(o){const v=()=>{const b={...o};return Object.defineProperty(t,"shape",{value:b}),v.raw=b,b};v.raw=o,Object.defineProperty(t,"shape",{get:v})}const a=ay(()=>BC(t));en(e,"propValues",v=>{const b=v.def.shape,p={};for(const x in b){const S=b[x]._zod;if(S.values){Object.prototype.hasOwnProperty.call(p,x)||Si(p,x,new Set);for(const w of S.values)p[x].add(w);S.optin!==void 0&&p[x].add(void 0)}}return p});const c=zm,u=t.catchall;let m;const g=gs.memoizer;g==null||g.attach(e),e._zod.parse=(v,b)=>{m??(m=a.value);const p=v.value;if(!c(p))return v.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),v;v.value=g?g.alloc(e,v,{},b):{};const x=[],S=m.shape,w=b==null?void 0:b.abortEarly;let E=v.issues.length;for(const R of m.allKeys){if(w&&v.issues.length!==E){if(ho(v,E))break;E=v.issues.length}if(R==="__proto__")continue;const C=S[R],j=C._zod.optin,O=C._zod.optout,k=C._zod.run({value:p[R],issues:[]},b);k instanceof Promise?x.push(k.then(D=>Pm(D,v,R,p,j,O))):Pm(k,v,R,p,j,O)}return u?HC(x,p,v,b,a.value,e,w===!0):x.length?Promise.all(x).then(()=>v):v}}),f4=Ne("$ZodObjectJIT",(e,t)=>{d4.init(e,t);const s=e._zod.parse,o=ay(()=>BC(t)),a=gs.memoizer,c=S=>{var D,P;const w=o.value,E=w.symbolKeys,R=new ED(["payload","ctx"],{shape:S,inst:e,memo:a,syms:E}),C=L=>`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`,j=(L,_)=>`
|
|
15
|
+
let ${L}_ab = false;
|
|
16
|
+
for (let i = 0; i < ${L}.issues.length; i++) {
|
|
17
|
+
const iss = ${L}.issues[i];
|
|
18
|
+
iss.path = iss.path ? [${_}, ...iss.path] : [${_}];
|
|
19
|
+
payload.issues.push(iss);
|
|
20
|
+
if (iss.continue !== true) ${L}_ab = true;
|
|
21
|
+
}
|
|
22
|
+
if (${L}_ab && ctx && ctx.abortEarly) {
|
|
23
|
+
payload.value = newResult;
|
|
24
|
+
return payload;
|
|
25
|
+
}`;R.write("const input = payload.value;");const O=Object.create(null);let k=0;for(const L of w.allKeys)O[L]=`key_${k++}`;R.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const L of w.allKeys){if(L==="__proto__")continue;const _=O[L],V=typeof L=="symbol"?`syms[${E.indexOf(L)}]`:KM(L),I=`${V} in input`,X=S[L],Y=(D=X==null?void 0:X._zod)==null?void 0:D.optin,q=Y!==void 0,$=((P=X==null?void 0:X._zod)==null?void 0:P.optout)==="optional";if(R.write(`const ${_} = ${C(V)};`),q&&$){const G=Y==="optional"?`${_}_present`:`${_}.value !== undefined || ${_}_present`;R.write(`
|
|
26
|
+
const ${_}_present = ${I};
|
|
27
|
+
if (!${_}.issues.length || ${_}_present) {
|
|
28
|
+
if (${_}.issues.length) {${j(_,V)}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (${G}) {
|
|
32
|
+
newResult[${V}] = ${_}.value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
`)}else q?(R.write(`
|
|
37
|
+
if (${_}.issues.length) {${j(_,V)}
|
|
38
|
+
}
|
|
39
|
+
`),Y==="defaulted"?R.write(`newResult[${V}] = ${_}.value;`):R.write(`
|
|
40
|
+
if (${_}.value !== undefined || ${I}) {
|
|
41
|
+
newResult[${V}] = ${_}.value;
|
|
42
|
+
}
|
|
43
|
+
`)):R.write(`
|
|
44
|
+
const ${_}_present = ${I};
|
|
45
|
+
if (${_}.issues.length) {${j(_,V)}
|
|
46
|
+
}
|
|
47
|
+
if (!${_}_present && !${_}.issues.length) {
|
|
48
|
+
payload.issues.push({
|
|
49
|
+
code: "invalid_type",
|
|
50
|
+
expected: "nonoptional",
|
|
51
|
+
input: undefined,
|
|
52
|
+
path: [${V}]
|
|
53
|
+
});
|
|
54
|
+
if (ctx && ctx.abortEarly) {
|
|
55
|
+
payload.value = newResult;
|
|
56
|
+
return payload;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (${_}_present) {
|
|
61
|
+
newResult[${V}] = ${_}.value;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
`)}return R.write("payload.value = newResult;"),R.write("return payload;"),R.compile()};let u;const m=zm,g=!gs.jitless,b=g&&GM.value,p=t.catchall;let x;e._zod.parse=(S,w)=>{x??(x=o.value);const E=S.value;return m(E)?g&&b&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(u||(u=c(t.shape)),S=u(S,w),p?HC([],E,S,w,x,e,(w==null?void 0:w.abortEarly)===!0):S):s(S,w):(S.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),S)}});function NE(e,t,s,o){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const a=e.filter(c=>!ho(c));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(u=>vi(u,o,vs())))}),t)}const m4=Ne("$ZodUnion",(e,t)=>{Nn.init(e,t),en(e,"optin",o=>o.def.options.some(a=>a._zod.optin==="defaulted")?"defaulted":o.def.options.some(a=>a._zod.optin!==void 0)?"optional":void 0),en(e,"optout",o=>o.def.options.some(a=>a._zod.optout==="optional")?"optional":void 0),en(e,"values",o=>{if(o.def.options.every(a=>a._zod.values))return new Set(o.def.options.flatMap(a=>Array.from(a._zod.values)))}),en(e,"pattern",o=>{if(o.def.options.every(a=>a._zod.pattern)){const a=o.def.options.map(c=>c._zod.pattern);return new RegExp(`^(${a.map(c=>ly(c.source)).join("|")})$`)}});const s=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,a)=>{if(s)return s(o,a);let c=!1;const u=[];for(const m of t.options){const g=m._zod.run({value:o.value,issues:[]},a);if(g instanceof Promise)u.push(g),c=!0;else{if(g.issues.length===0)return g;u.push(g)}}return c?Promise.all(u).then(m=>NE(m,o,e,a)):NE(u,o,e,a)}}),h4=Ne("$ZodIntersection",(e,t)=>{Nn.init(e,t),e._zod.parse=(s,o)=>{const a=s.value,c=t.left._zod.run({value:a,issues:[]},o),u=t.right._zod.run({value:a,issues:[]},o);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([g,v])=>jE(s,g,v)):jE(s,c,u)}});function db(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(ec(e)&&ec(t)){const s=Object.keys(t),o=Object.keys(e).filter(c=>s.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(const c of o){if(c==="__proto__")continue;const u=db(e[c],t[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};a[c]=u.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let o=0;o<e.length;o++){const a=e[o],c=t[o],u=db(a,c);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};s.push(u.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function jE(e,t,s){const o=new Map;let a;const c=new Map,u=(v,b)=>{var x,S;let p;if(v.code==="unrecognized_keys"&&!((x=v.path)!=null&&x.length))a??(a=v),p=v.keys;else if(v.code==="invalid_key"&&v.origin==="record"&&((S=v.path)==null?void 0:S.length)===1){const w=String(v.path[0]);c.has(w)||c.set(w,v),p=[w]}else return!1;for(const w of p)o.has(w)||o.set(w,{}),o.get(w)[b]=!0;return!0};for(const v of t.issues)u(v,"l")||e.issues.push(v);for(const v of s.issues)u(v,"r")||e.issues.push(v);const m=[...o].filter(([,v])=>v.l&&v.r).map(([v])=>v);if(m.length){const v=a?m.filter(b=>a.keys.includes(b)):[];v.length&&e.issues.push({...a,keys:v});for(const b of m)!v.includes(b)&&c.has(b)&&e.issues.push(c.get(b))}const g=db(t.value,s.value);if(!g.valid){if(ho(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`)}return e.value=g.data,e}const p4=Ne("$ZodRecord",(e,t)=>{Nn.init(e,t);const s=gs.memoizer;s==null||s.attach(e),e._zod.parse=(o,a)=>{const c=o.value;if(!ec(c))return o.issues.push({expected:"record",code:"invalid_type",input:c,inst:e}),o;const u=[],m=t.keyType._zod.values;if(m&&!t.partial){o.value=s?s.alloc(e,o,{},a):{};const g=new Set;for(const b of m)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){if(g.add(typeof b=="number"?b.toString():b),b==="__proto__")continue;const p=t.keyType._zod.run({value:b,issues:[]},a);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(w=>vi(w,a,vs())),input:b,path:[b],inst:e});continue}const x=p.value;if(x==="__proto__")continue;const S=t.valueType._zod.run({value:c[b],issues:[]},a);S instanceof Promise?u.push(S.then(w=>{w.issues.length&&o.issues.push(...jl(b,w.issues)),o.value[x]=w.value})):(S.issues.length&&o.issues.push(...jl(b,S.issues)),o.value[x]=S.value)}let v;for(const b in c)if(!g.has(b))if(t.mode==="loose"){if(b==="__proto__")continue;o.value[b]=c[b]}else v=v??[],v.push(b);v&&v.length>0&&o.issues.push({code:"unrecognized_keys",input:c,inst:e,keys:v,continue:!0})}else{o.value=s?s.alloc(e,o,{},a):{};let g;for(const v of Reflect.ownKeys(c)){if(v==="__proto__"||!Object.prototype.propertyIsEnumerable.call(c,v))continue;let b=t.keyType._zod.run({value:v,issues:[]},a);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof v=="string"&&py.test(v)&&b.issues.length){const w=t.keyType._zod.run({value:Number(v),issues:[]},a);if(w instanceof Promise)throw new Error("Async schemas not supported in object keys currently");w.issues.length===0&&(b=w)}if(b.issues.length){t.mode==="loose"?o.value[v]=c[v]:m?(g=g??[],g.push(v)):o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(w=>vi(w,a,vs())),input:v,path:[v],inst:e});continue}const x=b.value;if(x==="__proto__")continue;const S=t.valueType._zod.run({value:c[v],issues:[]},a);S instanceof Promise?u.push(S.then(w=>{w.issues.length&&o.issues.push(...jl(v,w.issues)),o.value[x]=w.value})):(S.issues.length&&o.issues.push(...jl(v,S.issues)),o.value[x]=S.value)}g&&g.length>0&&o.issues.push({code:"unrecognized_keys",input:c,inst:e,keys:g,continue:!0})}return u.length?Promise.all(u).then(()=>o):o}}),g4=Ne("$ZodEnum",(e,t)=>{Nn.init(e,t);const s=ab(t.entries),o=new Set(s);e._zod.values=o,en(e,"pattern",a=>{const c=ab(a.def.entries).filter(u=>QM.has(typeof u));return new RegExp(c.length?`^(${c.map(u=>dh(u.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(a,c)=>{const u=a.value;return o.has(u)||a.issues.push({code:"invalid_value",values:s,input:u,inst:e}),a}}),v4=Ne("$ZodTransform",(e,t)=>{var s;Nn.init(e,t),e._zod.optin="optional",(s=gs.memoizer)==null||s.guard(e),e._zod.parse=(o,a)=>{if(a.direction==="backward")throw new NC(e.constructor.name);const c=t.transform(o.value,o);if(a.async)return(c instanceof Promise?c:Promise.resolve(c)).then(m=>(o.value=m,o));if(c instanceof Promise)throw new ma;return o.value=c,o}});function OE(e,t){return e.value=t.issues.length?void 0:t.value,e}const FC=Ne("$ZodOptional",(e,t)=>{Nn.init(e,t),en(e,"optin",s=>s.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",en(e,"values",s=>{const o=s.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),en(e,"pattern",s=>{const o=s.def.innerType._zod.pattern;return o?new RegExp(`^(${ly(o.source)})?$`):void 0}),e._zod.parse=(s,o)=>{if(s.value===void 0){if(t.innerType._zod.optin!=="defaulted")return s;const a=t.innerType._zod.run({value:s.value,issues:[]},o);return a instanceof Promise?a.then(c=>OE(s,c)):OE(s,a)}return t.innerType._zod.run(s,o)}}),b4=Ne("$ZodExactOptional",(e,t)=>{FC.init(e,t),en(e,"values",s=>s.def.innerType._zod.values),en(e,"pattern",s=>s.def.innerType._zod.pattern),e._zod.parse=(s,o)=>t.innerType._zod.run(s,o)}),y4=Ne("$ZodNullable",(e,t)=>{Nn.init(e,t),en(e,"optin",s=>s.def.innerType._zod.optin),en(e,"optout",s=>s.def.innerType._zod.optout),en(e,"pattern",s=>{const o=s.def.innerType._zod.pattern;return o?new RegExp(`^(${ly(o.source)}|null)$`):void 0}),en(e,"values",s=>s.def.innerType._zod.values?new Set([...s.def.innerType._zod.values,null]):void 0),e._zod.parse=(s,o)=>s.value===null?s:t.innerType._zod.run(s,o)}),x4=Ne("$ZodDefault",(e,t)=>{Nn.init(e,t),e._zod.optin="defaulted",en(e,"values",s=>s.def.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return t.innerType._zod.run(s,o);if(s.value===void 0)return s.value=t.defaultValue,s;const a=t.innerType._zod.run(s,o);return a instanceof Promise?a.then(c=>kE(c,t)):kE(a,t)}});function kE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const w4=Ne("$ZodPrefault",(e,t)=>{Nn.init(e,t),e._zod.optin="defaulted",en(e,"values",s=>s.def.innerType._zod.values),e._zod.parse=(s,o)=>(o.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,o))}),S4=Ne("$ZodNonOptional",(e,t)=>{Nn.init(e,t),en(e,"values",s=>{const o=s.def.innerType._zod.values;return o?new Set([...o].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,o)=>{const a=t.innerType._zod.run(s,o);return a instanceof Promise?a.then(c=>_E(c,e)):_E(a,e)}});function _E(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function AE(e,t,s,o){return t.issues.length?(e.value=s.catchValue({...t,value:e.value,error:{issues:t.issues.map(a=>vi(a,o,vs()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const E4=Ne("$ZodCatch",(e,t)=>{Nn.init(e,t),en(e,"optin",s=>s.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),en(e,"optout",s=>s.def.innerType._zod.optout),en(e,"values",s=>s.def.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return t.innerType._zod.run(s,o);const a=t.innerType._zod.run({value:s.value,issues:[]},o);return a instanceof Promise?a.then(c=>AE(s,c,t,o)):AE(s,a,t,o)}}),T4=Ne("$ZodPipe",(e,t)=>{Nn.init(e,t),en(e,"values",s=>s.def.in._zod.values),en(e,"optin",s=>s.def.in._zod.optin),en(e,"optout",s=>s.def.out._zod.optout),en(e,"propValues",s=>s.def.in._zod.propValues),e._zod.parse=(s,o)=>{if(o.direction==="backward"){const c=t.out._zod.run(s,o);return c instanceof Promise?c.then(u=>Gf(u,t.in,o)):Gf(c,t.in,o)}const a=t.in._zod.run(s,o);return a instanceof Promise?a.then(c=>Gf(c,t.out,o)):Gf(a,t.out,o)}});function Gf(e,t,s){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const R4=Ne("$ZodReadonly",(e,t)=>{Nn.init(e,t),en(e,"propValues",s=>s.def.innerType._zod.propValues),en(e,"values",s=>s.def.innerType._zod.values),en(e,"optin",s=>{var o,a;return(a=(o=s.def.innerType)==null?void 0:o._zod)==null?void 0:a.optin}),en(e,"optout",s=>{var o,a;return(a=(o=s.def.innerType)==null?void 0:o._zod)==null?void 0:a.optout}),e._zod.parse=(s,o)=>{if(o.direction==="backward")return t.innerType._zod.run(s,o);const a=t.innerType._zod.run(s,o);return a instanceof Promise?a.then(ME):ME(a)}});function ME(e){return e.memo||(e.value=Object.freeze(e.value)),e}const C4=Ne("$ZodCustom",(e,t)=>{kr.init(e,t),Nn.init(e,t),e._zod.parse=(s,o)=>s,e._zod.check=s=>{const o=s.value,a=t.fn(o);if(a instanceof Promise)return a.then(c=>zE(c,s,o,e));zE(a,s,o,e)}});function zE(e,t,s,o){if(!e){const a={code:"custom",input:s,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(a.params=o._zod.def.params),t.issues.push(Lu(a))}}class N4 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const fb="~memo",DE=[];function VC(e){return e!==null&&typeof e=="object"}function kv(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const qC=new WeakMap,xu=0,Nm=1,ku=2;function jm(e,t,s){const o=qC.get(e);if(o!==void 0)return o?ku:xu;if(t.has(e))return ku;t.add(e);let a=xu;const c=b=>{if(a!==ku&&(b!=null&&b._zod)){const p=jm(b,t);p>a&&(a=p)}},u=(b,p)=>{var S;let x=xu;for(const w of Reflect.ownKeys(b)){const E=Object.getOwnPropertyDescriptor(b,w);if(!E.enumerable)continue;const R=E.get?Nm:(S=E.value)!=null&&S._zod?jm(E.value,t):xu;R>x&&(x=R)}return x},m=b=>{b>a&&(a=b)},g=e._zod.def;switch(g.type){case"object":{const b=vC(g);m(b?u(b):Nm),c(g.catchall);break}case"array":c(g.element);break;case"tuple":for(const b of g.items)c(b);c(g.rest);break;case"record":case"map":c(g.keyType),c(g.valueType);break;case"set":c(g.valueType);break;case"union":for(const b of g.options)c(b);break;case"intersection":c(g.left),c(g.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":c(g.innerType);break;case"pipe":c(g.in),c(g.out);break;case"function":c(g.input),c(g.output);break;case"lazy":{const b=g._cachedInner??void 0;m(b?jm(b,t):Nm);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const b in g){const p=Object.getOwnPropertyDescriptor(g,b);if(!p||p.get)continue;const x=p.value;if(!(!x||typeof x!="object")){if(x._zod)c(x);else if(Array.isArray(x))for(const S of x)c(S)}}}return t.delete(e),j4(e,a)}function j4(e,t){return t!==Nm&&qC.set(e,t===ku),t}function O4(e,t){let s=e.buckets.get(t);return s||(s=new WeakMap,e.buckets.set(t,s)),s}let Qf;const Xf=[],k4={alloc(e,t,s){const o=Qf;if(!o)return s;Qf=void 0;const a={value:s,issues:null};return o.set(t.value,a),Xf.push(a),s},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const s=e._zod.parse,o=(a,c)=>{if(c.direction!=="backward"&&A4(c,a.value))throw new N4;return s(a,c)};e._zod.parse=o,e._zod.run===s&&(e._zod.run=o)})},attach(e){var t;let s,o=!1,a,c;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const u=e._zod.parse,m=(g,v)=>{if(s===void 0){const C=jm(e,new Set);if(C===xu)return e._zod.parse=u,e._zod.run===m&&(e._zod.run=u),u(g,v);C===ku||o?s=!0:o=!0}const b=g.value;if(!VC(b))return u(g,v);let p=v[fb];p||(p={buckets:new WeakMap,backEdges:void 0},v[fb]=p);let x;a===v?x=c:(x=O4(p,e),a=v,c=x);const S=x.get(b);if(S)return g.value=S.value,S.issues?S.issues.length&&g.issues.push(...kv(S.issues)):(g.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(S.value)),g;Qf=x;const w=Xf.length,E=u(g,v);Qf=void 0;const R=Xf.length>w?Xf.pop():void 0;return E instanceof Promise?E.then(C=>(R&&(R.issues=C.issues.length?kv(C.issues):DE),C)):(R&&(R.issues=E.issues.length?kv(E.issues):DE),E)};e._zod.parse=m,e._zod.run===u&&(e._zod.run=m)})}};function _4(){return k4}function A4(e,t){var o;const s=(o=e[fb])==null?void 0:o.backEdges;return s!==void 0&&VC(t)&&s.has(t)}const M4=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(c){return e[c]??null}const s={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function a(c,u){return c==="number"&&typeof u=="number"&&!Number.isFinite(u)?String(u):o[c]??c}return c=>{switch(c.code){case"invalid_type":{const u=a(c.expected),m=az(c.input),g=a(m,c.input);return`Invalid input: expected ${u}, received ${g}`}case"invalid_value":return c.values.length===1?`Invalid input: expected ${SC(c.values[0])}`:`Invalid option: expected one of ${bE(c.values,"|")}`;case"too_big":{const u=c.exact?"exactly ":c.inclusive?"<=":"<",m=t(c.origin);return m?`Too big: expected ${c.origin??"value"} to have ${u}${c.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${c.origin??"value"} to be ${u}${c.maximum.toString()}`}case"too_small":{const u=c.exact?"exactly ":c.inclusive?">=":">",m=t(c.origin);return m?`Too small: expected ${c.origin} to have ${u}${c.minimum.toString()} ${m.unit}`:`Too small: expected ${c.origin} to be ${u}${c.minimum.toString()}`}case"invalid_format":{const u=c;return u.format==="starts_with"?`Invalid string: must start with "${u.prefix}"`:u.format==="ends_with"?`Invalid string: must end with "${u.suffix}"`:u.format==="includes"?`Invalid string: must include "${u.includes}"`:u.format==="regex"?`Invalid string: must match pattern ${u.pattern}`:`Invalid ${s[u.format]??c.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${c.divisor}`;case"unrecognized_keys":return`Unrecognized key${c.keys.length>1?"s":""}: ${bE(c.keys,", ")}`;case"invalid_key":return`Invalid key in ${c.origin}`;case"invalid_union":return c.options&&Array.isArray(c.options)&&c.options.length>0?`Invalid discriminator value. Expected ${c.options.map(m=>`'${m}'`).join(" | ")}`:c.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${c.origin}`;default:return"Invalid input"}}};function z4(){return{localeError:M4()}}var IE;class D4{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const o=s[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const o={...this.get(s)??{}};delete o.id;const a={...o,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function I4(){return new D4}(IE=globalThis).__zod_globalRegistry??(IE.__zod_globalRegistry=I4());const wu=globalThis.__zod_globalRegistry;function $C(e){return e.checks&&(e.checks=[...e.checks]),e}function P4(e,t){return new e($C({type:"string",...ft(t)}))}function L4(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ft(t)})}function U4(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ft(t)})}function B4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ft(t)})}function H4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ft(t)})}function F4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ft(t)})}function V4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ft(t)})}function q4(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ft(t)})}function $4(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ft(t)})}function Z4(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ft(t)})}function K4(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ft(t)})}function Y4(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ft(t)})}function G4(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ft(t)})}function Q4(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ft(t)})}function X4(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ft(t)})}function J4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ft(t)})}function W4(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ft(t)})}function eI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ft(t)})}function tI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ft(t)})}function nI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ft(t)})}function rI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ft(t)})}function sI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ft(t)})}function oI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ft(t)})}function iI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ft(t)})}function aI(e,t){return new e({type:"string",format:"date",check:"string_format",...ft(t)})}function lI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ft(t)})}function cI(e,t){return new e({type:"string",format:"duration",check:"string_format",...ft(t)})}function uI(e,t){return new e($C({type:"number",checks:[],...ft(t)}))}function dI(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ft(t)})}function fI(e){return new e({type:"unknown"})}function mI(e,t){return new e({type:"never",...ft(t)})}function PE(e,t){return new kC({check:"less_than",...ft(t),value:e,inclusive:!1})}function _v(e,t){return new kC({check:"less_than",...ft(t),value:e,inclusive:!0})}function LE(e,t){return new _C({check:"greater_than",...ft(t),value:e,inclusive:!1})}function Av(e,t){return new _C({check:"greater_than",...ft(t),value:e,inclusive:!0})}function UE(e,t){return new dD({check:"multiple_of",...ft(t),value:e})}function ZC(e,t){return new mD({check:"max_length",...ft(t),maximum:e})}function Lm(e,t){return new hD({check:"min_length",...ft(t),minimum:e})}function KC(e,t){return new pD({check:"length_equals",...ft(t),length:e})}function hI(e,t){return new gD({check:"string_format",format:"regex",...ft(t),pattern:e})}function pI(e){return new vD({check:"string_format",format:"lowercase",...ft(e)})}function gI(e){return new bD({check:"string_format",format:"uppercase",...ft(e)})}function vI(e,t){return new yD({check:"string_format",format:"includes",...ft(t),includes:e})}function bI(e,t){return new xD({check:"string_format",format:"starts_with",...ft(t),prefix:e})}function yI(e,t){return new wD({check:"string_format",format:"ends_with",...ft(t),suffix:e})}function cc(e){return new SD({check:"overwrite",tx:e})}function xI(e){return cc(t=>t.normalize(e))}function wI(){return cc(e=>e.trim())}function SI(){return cc(e=>e.toLowerCase())}function EI(){return cc(e=>e.toUpperCase())}function TI(){return cc(e=>YM(e))}function RI(e,t,s){return new e({type:"array",element:t,...ft(s)})}function CI(e,t,s){return new e({type:"custom",check:"custom",fn:t,...ft(s)})}function NI(e,t){const s=jI(o=>(o.addIssue=a=>{if(typeof a=="string")o.issues.push(Lu(a,o.value,s._zod.def));else{const c=a;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),"input"in c||(c.input=o.value),c.inst??(c.inst=s),c.continue??(c.continue=!s._zod.def.abort),o.issues.push(Lu(c))}},e(o.value,o)),t);return s}function jI(e,t){const s=new kr({check:"custom",...ft(t)});return s._zod.check=e,s}function _u(e,...t){for(const s of t)for(const o of Reflect.ownKeys(s))Object.prototype.propertyIsEnumerable.call(s,o)&&Si(e,o,s[o]);return e}function YC(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??wu,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function uc(e,t,s,o,a){const c=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:a}):t.unrepresentable;if(c==="any")return!1;if(c===void 0||c==="throw")throw new Error(a);return Object.assign(s,c),!0}function Dn(e,t,s={path:[],schemaPath:[]}){var b,p;var o;const a=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,u),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const m=(p=(b=e._zod).toJSONSchema)==null?void 0:p.call(b);if(m)u.schema=m;else{const x={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,x);else{const w=u.schema,E=t.processors[a.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);E(e,t,w,x)}const S=e._zod.parent;S&&(u.ref||(u.ref=S),Dn(S,t,x),t.seen.get(S).isParent=!0)}const g=t.metadataRegistry.get(e);return g&&_u(u.schema,g),t.io==="input"&&vr(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&"_prefault"in u.schema&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function BE(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function GC(e,t){var u,m,g,v;const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const o=new Map;for(const b of e.seen.entries()){const p=(u=e.metadataRegistry.get(b[0]))==null?void 0:u.id;if(p){const x=o.get(p);if(x&&x!==b[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(p,b[0])}}const a=b=>{var E;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const R=(E=e.external.registry.get(b[0]))==null?void 0:E.id,C=e.external.uri??(O=>O);if(R)return{ref:C(R)};const j=b[1].defId??b[1].schema.id??`schema${e.counter++}`;return b[1].defId=j,{defId:j,ref:`${C("__shared")}#/${p}/${BE(j)}`}}const x="#",S=`${x}/${p}/`;if(b[1]===s&&!b[1].schema.id)return{ref:x};const w=b[1].schema.id??`__schema${e.counter++}`;return{defId:w,ref:S+BE(w)}},c=b=>{if(b[1].schema.$ref)return;const p=b[1],{ref:x,defId:S}=a(b);p.def={...p.schema},S&&(p.defId=S);const w=p.schema;for(const E in w)delete w[E];w.$ref=x};if(e.cycles==="throw")for(const b of e.seen.entries()){const p=b[1];if(p.cycle)throw new Error(`Cycle detected: #/${(m=p.cycle)==null?void 0:m.join("/")}/<root>
|
|
65
|
+
|
|
66
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const b of e.seen.entries()){const p=b[1];if(t===b[0]){c(b);continue}if(e.external){const S=(g=e.external.registry.get(b[0]))==null?void 0:g.id;if(t!==b[0]&&S){c(b);continue}}if((v=e.metadataRegistry.get(b[0]))==null?void 0:v.id){c(b);continue}if(p.cycle){c(b);continue}p.count>1&&e.reused==="ref"&&c(b)}e.external&&(e.sharedDefsExtractedFor=e.external)}function QC(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const s=[];for(const o of t){if(!o||typeof o!="object")return;QC(o);const a=Object.keys(o);if(a.length!==1||a[0]!=="type")return;const c=o.type;for(const u of Array.isArray(c)?c:[c]){if(typeof u!="string")return;s.includes(u)||s.push(u)}}delete e.anyOf,e.type=s.length===1?s[0]:s}const XC=new Set(["type","properties","required","additionalProperties"]),HE=["oneOf","anyOf"];function FE(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mb(e){var c;const t=[];for(const u of e){if(typeof u!="object"||u.type!=="object")return null;for(const m in u)if(!XC.has(m))return null;t.push(u)}const s={},o=new Set;for(const u of t){for(const m in u.properties){if(Object.prototype.hasOwnProperty.call(s,m))continue;const g=[];for(const b of t){const p=((c=b.properties)==null?void 0:c[m])??FE(b);p!=null&&(g.some(x=>JSON.stringify(x)===JSON.stringify(p))||g.push(p))}const v=g.length===1?g[0]:mb(g)??{allOf:g};Si(s,m,v)}for(const m of u.required??[])o.add(m)}const a={type:"object",properties:s};if(o.size&&(a.required=[...o]),t.every(u=>u.additionalProperties===!1))a.additionalProperties=!1;else{const u=[];for(const m of t){const g=FE(m);g&&!u.some(v=>JSON.stringify(v)===JSON.stringify(g))&&u.push(g)}u.length===1?a.additionalProperties=u[0]:u.length>1&&(a.additionalProperties={allOf:u})}return a}function OI(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const a of XC)if(a in e)return;const s=t.filter(a=>HE.some(c=>Array.isArray(a[c])));let o=null;if(!s.length)o=mb(t);else{const a=s[0],c=HE.find(g=>Array.isArray(a[g]));if(Object.keys(a).length!==1)return;const u=t.filter(g=>g!==a),m=a[c].map(g=>mb([...u,g]));if(m.some(g=>!g))return;o={[c]:m}}o&&(delete e.allOf,_u(e,o))}function JC(e,t){var m,g,v,b;const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=p=>{const x=e.seen.get(p);if(x.ref===null)return;const S=x.def??x.schema,w={...S},E=x.ref;if(x.ref=null,E){o(E);const C=e.seen.get(E),j=C.schema;if(j.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(S.allOf=S.allOf??[],S.allOf.push(j)):_u(S,j),_u(S,w),p._zod.parent===E)for(const k in S)k==="$ref"||k==="allOf"||k in w||delete S[k];if(j.$ref&&C.def)for(const k in S)k==="$ref"||k==="allOf"||k in C.def&&JSON.stringify(S[k])===JSON.stringify(C.def[k])&&delete S[k]}const R=p._zod.parent;if(R&&R!==E){o(R);const C=e.seen.get(R);if(C!=null&&C.schema.$ref&&(S.$ref=C.schema.$ref,C.def))for(const j in S)j==="$ref"||j==="allOf"||j in C.def&&JSON.stringify(S[j])===JSON.stringify(C.def[j])&&delete S[j]}e.override({zodSchema:p,jsonSchema:S,path:x.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const p of[...e.seen.entries()].reverse())o(p[0]);if(e.target!=="openapi-3.0")for(const p of e.seen.entries())QC(p[1].def??p[1].schema);for(const p of e.deferred)p();if(e.intersections.length){const p=new Map;for(const x of e.seen.values())for(const S of[x.schema,x.def]){const w=S==null?void 0:S.allOf;if(!Array.isArray(w))continue;const E=p.get(w);E?E.push(S):p.set(w,[S])}for(const x of e.intersections)for(const S of p.get(x)??[])OI(S)}}const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,(m=e.external)!=null&&m.uri){const p=(g=e.external.registry.get(t))==null?void 0:g.id;if(!p)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(p)}_u(a,s.defId?s.schema:s.def??s.schema);const c=(v=e.metadataRegistry.get(t))==null?void 0:v.id;c!==void 0&&a.id===c&&delete a.id;const u=((b=e.external)==null?void 0:b.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const p of e.seen.entries()){const x=p[1];x.def&&x.defId&&(x.def.id===x.defId&&delete x.def.id,Si(u,x.defId,x.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?a.$defs=u:a.definitions=u);try{const p=JSON.parse(JSON.stringify(a));return Object.defineProperty(p,"~standard",{value:{...t["~standard"],jsonSchema:{input:Um(t,"input",e.processors),output:Um(t,"output",e.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function vr(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return vr(o.element,s);if(o.type==="set")return vr(o.valueType,s);if(o.type==="lazy")return vr(o.getter(),s);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return vr(o.innerType,s);if(o.type==="intersection")return vr(o.left,s)||vr(o.right,s);if(o.type==="record"||o.type==="map")return vr(o.keyType,s)||vr(o.valueType,s);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:vr(o.in,s)||vr(o.out,s);if(o.type==="object"){for(const a in o.shape)if(vr(o.shape[a],s))return!0;return!1}if(o.type==="union"){for(const a of o.options)if(vr(a,s))return!0;return!1}if(o.type==="tuple"){for(const a of o.items)if(vr(a,s))return!0;return!!(o.rest&&vr(o.rest,s))}return!1}const kI=(e,t={})=>s=>{const o=YC({...s,processors:t});return Dn(e,o),GC(o,e),JC(o,e)},Um=(e,t,s={})=>o=>{const{libraryOptions:a,target:c}=o??{},u=YC({...a??{},target:c,io:t,processors:s});return Dn(e,u),GC(u,e),JC(u,e)},tc=(e,t,s)=>{(e[t]===void 0||s>e[t])&&(e[t]=s)},nc=(e,t,s)=>{(e[t]===void 0||s<e[t])&&(e[t]=s)},VE=(e,t)=>{tc(e,"minimum",t),nc(e,"maximum",t)},WC=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},eN=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},tN=(e,t)=>{e.mime=e.mime?e.mime.filter(s=>t.includes(s)):[...t]},nN=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},qE=(e,t)=>tc(e,"minimum",t.minimum),$E=(e,t)=>nc(e,"maximum",t.maximum),ZE=e=>(t,s)=>{nN(t,s.format);const[o,a]=e[s.format];tc(t,"minimum",o),nc(t,"maximum",a)},Mv={greater_than:(e,t)=>tc(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>nc(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>WC(e,t.value),number_format:ZE(EC),bigint_format:ZE(JM),min_length:qE,max_length:$E,length_equals:(e,t)=>VE(e,t.length),min_size:qE,max_size:$E,size_equals:(e,t)=>VE(e,t.size),string_format:(e,t)=>{nN(e,t.format),t.pattern&&eN(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>tN(e,t.mime)};function hs(e){var c;const t={},s=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...s.checks??[]]:s.checks??[];for(const u of o)(c=Mv[u._zod.def.check])==null||c.call(Mv,t,u._zod.def);const a=e._zod.bag;a.minimum!==void 0&&tc(t,"minimum",a.minimum),a.exclusiveMinimum!==void 0&&tc(t,"exclusiveMinimum",a.exclusiveMinimum),a.maximum!==void 0&&nc(t,"maximum",a.maximum),a.exclusiveMaximum!==void 0&&nc(t,"exclusiveMaximum",a.exclusiveMaximum),a.multipleOf!==void 0&&WC(t,a.multipleOf),a.format!==void 0&&(t.format??(t.format=a.format),a.format.includes("int")&&(t.isInt=!0)),a.mime&&tN(t,a.mime);for(const u of a.patterns??[])eN(t,u);return t}const _I={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AI=new Map([[LC,Wz],[by,eD]]),rN=e=>AI.get(e)??e,MI=(e,t,s,o)=>{const a=s;a.type="string";const{minimum:c,maximum:u,format:m,patterns:g,contentEncoding:v,laxFormat:b}=hs(e);if(typeof c=="number"&&(a.minLength=c),typeof u=="number"&&(a.maxLength=u),m&&(a.format=_I[m]??m,a.format===""&&delete a.format,(m==="time"||b)&&delete a.format),v&&(a.contentEncoding=v),g&&g.size>0){const p=[...g].map(rN);p.length===1?a.pattern=p[0].source:p.length>1&&(a.allOf=[...p.map(x=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},zI=(e,t,s,o)=>{const a=s,{minimum:c,maximum:u,multipleOf:m,exclusiveMaximum:g,exclusiveMinimum:v,isInt:b}=hs(e);a.type=b?"integer":"number";const p=typeof v=="number"&&v>=(c??Number.NEGATIVE_INFINITY),x=typeof g=="number"&&g<=(u??Number.POSITIVE_INFINITY),S=t.target==="draft-04"||t.target==="openapi-3.0";if(p?S?(a.minimum=v,a.exclusiveMinimum=!0):a.exclusiveMinimum=v:typeof c=="number"&&(a.minimum=c),x?S?(a.maximum=g,a.exclusiveMaximum=!0):a.exclusiveMaximum=g:typeof u=="number"&&(a.maximum=u),m){const w=new Set;for(const C of m)Number.isFinite(C)&&C!==0?w.add(Math.abs(C)):uc(e,t,a,o,`A multipleOf divisor of ${C} cannot be represented in JSON Schema`);const[E,...R]=w;E!==void 0&&(a.multipleOf=E),R.length&&(a.allOf=[...a.allOf??[],...R.map(C=>({multipleOf:C}))])}},DI=(e,t,s,o)=>{s.not={}},II=(e,t,s,o)=>{},PI=(e,t,s,o)=>{const a=e._zod.def,c=ab(a.entries);if(c.length===0){s.not={};return}c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),s.enum=c},LI=(e,t,s,o)=>{uc(e,t,s,o,"Custom types cannot be represented in JSON Schema")},UI=(e,t,s,o)=>{uc(e,t,s,o,"Transforms cannot be represented in JSON Schema")},BI=(e,t,s,o)=>{const a=s,c=e._zod.def,{minimum:u,maximum:m}=hs(e);typeof u=="number"&&(a.minItems=u),typeof m=="number"&&(a.maxItems=m),a.type="array",a.items=Dn(c.element,t,{...o,path:[...o.path,"items"]})};function Bm(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bm(t.out):t.type==="catch"?Bm(t.innerType):e._zod.optin}const HI=(e,t,s,o)=>{var v;const a=s,c=e._zod.def,u=c.shape;if(Object.getOwnPropertySymbols(u).length&&uc(e,t,a,o,"Symbol keys cannot be represented in JSON Schema"))return;a.type="object",a.properties={};for(const b in u)Si(a.properties,b,Dn(u[b],t,{...o,path:[...o.path,"properties",b]}));const g=[];for(const b of Object.keys(u)){const p=c.shape[b];(t.io==="input"?Bm(p)===void 0:p._zod.optout===void 0)&&g.push(b)}g.length>0&&(a.required=g),((v=c.catchall)==null?void 0:v._zod.def.type)==="never"?a.additionalProperties=!1:c.catchall?c.catchall&&(a.additionalProperties=Dn(c.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},FI=(e,t,s,o)=>{const a=e._zod.def,c=a.inclusive===!1,u=a.options.map((m,g)=>Dn(m,t,{...o,path:[...o.path,c?"oneOf":"anyOf",g]}));c?s.oneOf=u:s.anyOf=u},VI=(e,t,s,o)=>{const a=e._zod.def,c=Dn(a.left,t,{...o,path:[...o.path,"allOf",0]}),u=Dn(a.right,t,{...o,path:[...o.path,"allOf",1]}),m=v=>"allOf"in v&&Object.keys(v).length===1,g=[...m(c)?c.allOf:[c],...m(u)?u.allOf:[u]];s.allOf=g,t.intersections.push(g)};function hb(e,t,s){var w;if(t.$ref){if(s.has(t))return t;s.add(t);const E=(w=e.get(t))==null?void 0:w.def;if(!E)return t;const R=hb(e,E,s);return R===E?t:R}for(const E of["anyOf","oneOf"]){const R=t[E];if(!Array.isArray(R))continue;const C=R.map(j=>hb(e,j,s));C.some((j,O)=>j!==R[O])&&(t={...t,[E]:C})}const o=Array.isArray(t.type)?t.type:[t.type],a=!o.includes("string")&&o.some(E=>E==="number"||E==="integer"),c=t.enum??(t.const!==void 0?[t.const]:void 0);if(!a&&!(c!=null&&c.some(E=>typeof E=="number")))return t;const{minimum:u,maximum:m,exclusiveMinimum:g,exclusiveMaximum:v,multipleOf:b,format:p,id:x,...S}=t;return S.enum?S.enum=S.enum.map(E=>typeof E=="number"?String(E):E):typeof S.const=="number"&&(S.const=String(S.const)),a&&(S.type="string",c||(S.pattern=(o.includes("number")?py:lD).source)),S}const pb=new WeakMap;function qI(e){var o;const t=new Map;for(const a of e.seen.values())a.def&&!t.has(a.schema)&&t.set(a.schema,a);const s=new Map;for(const a of pb.get(e)??[]){const c=e.seen.get(a),u=(o=(c==null?void 0:c.def)??(c==null?void 0:c.schema))==null?void 0:o.propertyNames;if(!u||u===!0||s.has(u))continue;const m=hb(t,u,new Set);m!==u&&s.set(u,m)}if(s.size)for(const a of e.seen.values())for(const c of[a.schema,a.def]){const u=c&&s.get(c.propertyNames);u&&(c.propertyNames=u)}}const $I=(e,t,s,o)=>{const a=s,c=e._zod.def;a.type="object";const u=c.keyType,m=hs(u).patterns;if(c.mode==="loose"&&m&&m.size>0){const b=Dn(c.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});a.patternProperties={};for(const p of m)Si(a.patternProperties,rN(p).source,b)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){a.propertyNames=Dn(c.keyType,t,{...o,path:[...o.path,"propertyNames"]});let b=pb.get(t);b||(b=[],pb.set(t,b),t.deferred.push(()=>qI(t))),b.push(e)}a.additionalProperties=Dn(c.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}const g=u._zod.values,v=t.io==="input"&&Bm(c.valueType)!==void 0;if(g&&!c.partial&&!v){const b=[...g].filter(p=>typeof p=="string"||typeof p=="number");b.length>0&&(a.required=b.map(String))}},ZI=(e,t,s,o)=>{const a=e._zod.def,c=Dn(a.innerType,t,o),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=a.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},KI=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType},yy=Symbol();function sN(e,t,s,o,a){let c=!1;const u=JSON.stringify(e,(m,g)=>typeof g!="bigint"?g:(c=!0,null));return c?(uc(t,s,o,a,"BigInt defaults cannot be represented in JSON Schema"),yy):JSON.parse(u)}const YI=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType;const u=sN(a.defaultValue,e,t,s,o);u!==yy&&(s.default=u)},GI=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);if(c.ref=a.innerType,t.io!=="input")return;const u=sN(a.defaultValue,e,t,s,o);u!==yy&&(s._prefault=u)},QI=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType;let u;try{u=a.catchValue(void 0)}catch{uc(e,t,s,o,"Dynamic catch values are not supported in JSON Schema");return}s.default=u},XI=(e,t,s,o)=>{const a=e._zod.def,c=a.in._zod.traits.has("$ZodTransform"),u=t.io==="input"?c?a.out:a.in:a.out;Dn(u,t,o);const m=t.seen.get(e);m.ref=u},JI=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType,s.readOnly=!0},oN=(e,t,s,o)=>{const a=e._zod.def;Dn(a.innerType,t,o);const c=t.seen.get(e);c.ref=a.innerType},KE=new WeakSet([Object.prototype,Error.prototype]);function Jf(e,t,s){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const o=s(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}const WI=(e,t)=>{xz.init(e,t),e.name="ZodError";const s=Object.getPrototypeOf(e);KE.has(s)||(KE.add(s),Jf(s,"format",o=>a=>Ez(o,a)),Jf(s,"flatten",o=>a=>Sz(o,a)),Jf(s,"addIssue",o=>a=>{o.issues.push(a),o.message=JSON.stringify(o.issues,lb,2)}),Jf(s,"addIssues",o=>a=>{o.issues.push(...a),o.message=JSON.stringify(o.issues,lb,2)}),Object.defineProperty(s,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},rs=Ne("ZodError",WI,void 0,{Parent:Error}),eP=dy(rs),tP=fy(rs),nP=my(rs),rP=hy(rs),sP=Oz(rs),oP=kz(rs),iP=_z(rs),aP=Az(rs),lP=Mz(rs),cP=zz(rs),uP=Dz(rs),dP=Iz(rs);function fP(){gs.localeError||vs(z4())}function ph(){gs.memoizer||vs({memoizer:_4()})}const jn=Ne("ZodType",(e,t)=>(fP(),Nn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(Ur(t,{checks:[...t.checks??[],...e.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ei(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(c3(e,t))},superRefine(e,t){return this.check(u3(e,t))},overwrite(e){return this.check(cc(e))},optional(){return XE(this)},exactOptional(){return QP(this)},nullable(){return JE(this)},nullish(){return XE(JE(this))},nonoptional(e){return n3(this,e)},array(){return vb(this)},or(e){return VP([this,e])},and(e){return $P(this,e)},transform(e){return WE(this,GP(e))},default(e){return WP(this,e)},prefault(e){return t3(this,e)},catch(e){return s3(this,e)},pipe(e){return WE(this,e)},readonly(){return a3(this)},describe(e){const t=this.clone();return wu.add(t,{description:e}),t},meta(...e){if(e.length===0)return wu.get(this);const t=this.clone();return wu.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return RC(this,"~standard",{...MC(this),jsonSchema:{input:Um(this,"input"),output:Um(this,"output")}})},set"~standard"(e){bi(this,"~standard",e)},parse:function e(t,s){return eP(this,t,s,{callee:e})},parseAsync:async function e(t,s){return await tP(this,t,s,{callee:e})},safeParse(e,t){return nP(this,e,t)},async safeParseAsync(e,t){return rP(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){bi(this,"spa",e)},validate(e,t){return Cz(this,e,t)},validateAsync(e,t){return jz(this,e,t)},encode:function e(t,s){return sP(this,t,s,{callee:e})},decode:function e(t,s){return oP(this,t,s,{callee:e})},encodeAsync:async function e(t,s){return await iP(this,t,s,{callee:e})},decodeAsync:async function e(t,s){return await aP(this,t,s,{callee:e})},safeEncode(e,t){return lP(this,e,t)},safeDecode(e,t){return cP(this,e,t)},async safeEncodeAsync(e,t){return uP(this,e,t)},async safeDecodeAsync(e,t){return dP(this,e,t)},toJSONSchema(e){return kI(this,{})(e)},get description(){var e;return(e=wu.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),iN=Ne("_ZodString",(e,t)=>{vy.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>MI(e,s,o)},CC({format:e=>hs(e).format??null,minLength:e=>hs(e).minimum??null,maxLength:e=>hs(e).maximum??null},{regex(...e){return this.check(hI(...e))},includes(...e){return this.check(vI(...e))},startsWith(...e){return this.check(bI(...e))},endsWith(...e){return this.check(yI(...e))},min(...e){return this.check(Lm(...e))},max(...e){return this.check(ZC(...e))},length(...e){return this.check(KC(...e))},nonempty(...e){return this.check(Lm(1,...e))},lowercase(e){return this.check(pI(e))},uppercase(e){return this.check(gI(e))},trim(){return this.check(wI())},normalize(...e){return this.check(xI(...e))},toLowerCase(){return this.check(SI())},toUpperCase(){return this.check(EI())},slugify(){return this.check(TI())}})),mP=Ne("ZodString",(e,t)=>{vy.init(e,t),iN.init(e,t)},{email(e){return this.check(L4(bP,e))},url(e){return this.check(q4(xP,e))},jwt(e){return this.check(oI(DP,e))},emoji(e){return this.check($4(wP,e))},guid(e){return this.check(U4(yP,e))},uuid(e){return this.check(B4(Wf,e))},uuidv4(e){return this.check(H4(Wf,e))},uuidv6(e){return this.check(F4(Wf,e))},uuidv7(e){return this.check(V4(Wf,e))},nanoid(e){return this.check(Z4(SP,e))},cuid(e){return this.check(K4(EP,e))},cuid2(e){return this.check(Y4(TP,e))},ulid(e){return this.check(G4(RP,e))},base64(e){return this.check(nI(AP,e))},base64url(e){return this.check(rI(MP,e))},xid(e){return this.check(Q4(CP,e))},ksuid(e){return this.check(X4(NP,e))},ipv4(e){return this.check(J4(jP,e))},ipv6(e){return this.check(W4(OP,e))},cidrv4(e){return this.check(eI(kP,e))},cidrv6(e){return this.check(tI(_P,e))},e164(e){return this.check(sI(zP,e))},datetime(e){return this.check(iI(hP,e))},date(e){return this.check(aI(pP,e))},time(e){return this.check(lI(gP,e))},duration(e){return this.check(cI(vP,e))}});function ta(e){return P4(mP,e)}const wn=Ne("ZodStringFormat",(e,t)=>{bn.init(e,t),iN.init(e,t)}),hP=Ne("ZodISODateTime",(e,t)=>{FD.init(e,t),wn.init(e,t)}),pP=Ne("ZodISODate",(e,t)=>{VD.init(e,t),wn.init(e,t)}),gP=Ne("ZodISOTime",(e,t)=>{qD.init(e,t),wn.init(e,t)}),vP=Ne("ZodISODuration",(e,t)=>{$D.init(e,t),wn.init(e,t)}),bP=Ne("ZodEmail",(e,t)=>{jD.init(e,t),wn.init(e,t)}),yP=Ne("ZodGUID",(e,t)=>{CD.init(e,t),wn.init(e,t)}),Wf=Ne("ZodUUID",(e,t)=>{ND.init(e,t),wn.init(e,t)}),xP=Ne("ZodURL",(e,t)=>{zD.init(e,t),wn.init(e,t)}),wP=Ne("ZodEmoji",(e,t)=>{DD.init(e,t),wn.init(e,t)}),SP=Ne("ZodNanoID",(e,t)=>{ID.init(e,t),wn.init(e,t)}),EP=Ne("ZodCUID",(e,t)=>{PD.init(e,t),wn.init(e,t)}),TP=Ne("ZodCUID2",(e,t)=>{LD.init(e,t),wn.init(e,t)}),RP=Ne("ZodULID",(e,t)=>{UD.init(e,t),wn.init(e,t)}),CP=Ne("ZodXID",(e,t)=>{BD.init(e,t),wn.init(e,t)}),NP=Ne("ZodKSUID",(e,t)=>{HD.init(e,t),wn.init(e,t)}),jP=Ne("ZodIPv4",(e,t)=>{ZD.init(e,t),wn.init(e,t)}),OP=Ne("ZodIPv6",(e,t)=>{YD.init(e,t),wn.init(e,t)}),kP=Ne("ZodCIDRv4",(e,t)=>{GD.init(e,t),wn.init(e,t)}),_P=Ne("ZodCIDRv6",(e,t)=>{XD.init(e,t),wn.init(e,t)}),AP=Ne("ZodBase64",(e,t)=>{JD.init(e,t),wn.init(e,t)}),MP=Ne("ZodBase64URL",(e,t)=>{e4.init(e,t),wn.init(e,t)}),zP=Ne("ZodE164",(e,t)=>{t4.init(e,t),wn.init(e,t)}),DP=Ne("ZodJWT",(e,t)=>{r4.init(e,t),wn.init(e,t)}),aN=Ne("ZodNumber",(e,t)=>{UC.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>zI(e,s,o,a),e.isFinite=!0},CC({minValue:e=>{const{minimum:t,exclusiveMinimum:s}=hs(e);return Math.max(t??Number.NEGATIVE_INFINITY,s??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:s}=hs(e);return Math.min(t??Number.POSITIVE_INFINITY,s??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:s}=hs(e);return!!t||!!(s!=null&&s.some(Number.isSafeInteger))},format:e=>hs(e).format??null},{gt(e,t){return this.check(LE(e,t))},gte(e,t){return this.check(Av(e,t))},min(e,t){return this.check(Av(e,t))},lt(e,t){return this.check(PE(e,t))},lte(e,t){return this.check(_v(e,t))},max(e,t){return this.check(_v(e,t))},int(e){return this.check(YE(e))},safe(e){return this.check(YE(e))},positive(e){return this.check(LE(0,e))},nonnegative(e){return this.check(Av(0,e))},negative(e){return this.check(PE(0,e))},nonpositive(e){return this.check(_v(0,e))},multipleOf(e,t){return this.check(UE(e,t))},step(e,t){return this.check(UE(e,t))},finite(){return this}}));function fu(e){return uI(aN,e)}const IP=Ne("ZodNumberFormat",(e,t)=>{s4.init(e,t),aN.init(e,t)});function YE(e){return dI(IP,e)}const PP=Ne("ZodUnknown",(e,t)=>{o4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>II()});function gb(){return fI(PP)}const LP=Ne("ZodNever",(e,t)=>{i4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>DI(e,s,o)});function UP(e){return mI(LP,e)}const BP=Ne("ZodArray",(e,t)=>{ph(),c4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>BI(e,s,o,a),e.element=t.element},{min(e,t){return this.check(Lm(e,t))},nonempty(e){return this.check(Lm(1,e))},max(e,t){return this.check(ZC(e,t))},length(e,t){return this.check(KC(e,t))},unwrap(){return this.element}});function vb(e,t){return RI(BP,e,t)}const HP=Ne("ZodObject",(e,t)=>{ph(),f4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>HI(e,s,o,a),fz(e,"shape",s=>s._zod.def.shape,!1)},{keyof(){return KP(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ur(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ur(this._zod.def,{catchall:gb()}))},loose(){return this.clone(Ur(this._zod.def,{catchall:gb()}))},strict(){return this.clone(Ur(this._zod.def,{catchall:UP()}))},strip(){return this.clone(Ur(this._zod.def,{catchall:void 0}))},extend(e){return tz(this,e)},safeExtend(e){return nz(this,e)},merge(e){return rz(this,e)},pick(e){return WM(this,e)},omit(e){return ez(this,e)},partial(...e){return yE(lN,this,e[0])},exactPartial(...e){return yE(cN,this,e[0],"exactPartial")},required(...e){return sz(uN,this,e[0])}});function GE(e,t){const s={type:"object",shape:e??{},...ft(t)};return new HP(s)}const FP=Ne("ZodUnion",(e,t)=>{m4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>FI(e,s,o,a),e.options=t.options});function VP(e,t){return new FP({type:"union",options:e,...ft(t)})}const qP=Ne("ZodIntersection",(e,t)=>{h4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>VI(e,s,o,a)});function $P(e,t){return new qP({type:"intersection",left:e,right:t})}const QE=Ne("ZodRecord",(e,t)=>{ph(),p4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>$I(e,s,o,a),e.keyType=t.keyType,e.valueType=t.valueType});function ZP(e,t,s){return!t||!t._zod?new QE({type:"record",keyType:ta(),valueType:e,...ft(t)}):new QE({type:"record",keyType:e,valueType:t,...ft(s)})}const bb=Ne("ZodEnum",(e,t)=>{g4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(o,a,c)=>PI(e,o,a),e.enum=t.entries,e.options=[...e._zod.values];const s=new Set(Object.keys(t.entries));e.extract=(o,a)=>{const c={};for(const u of o)if(s.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new bb({...t,checks:[],...ft(a),entries:c})},e.exclude=(o,a)=>{const c={...t.entries};for(const u of o)if(s.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new bb({...t,checks:[],...ft(a),entries:c})}});function KP(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new bb({type:"enum",entries:s,...ft(t)})}const YP=Ne("ZodTransform",(e,t)=>{ph(),v4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>UI(e,s,o,a),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new NC(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(Lu(c,s.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),"input"in u||(u.input=s.value),u.inst??(u.inst=e),s.issues.push(Lu(u))}};const a=t.transform(s.value,s);return a instanceof Promise?a.then(c=>(s.value=c,s)):(s.value=a,s)}});function GP(e){return new YP({type:"transform",transform:e})}const lN=Ne("ZodOptional",(e,t)=>{FC.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>oN(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function XE(e){return new lN({type:"optional",innerType:e})}const cN=Ne("ZodExactOptional",(e,t)=>{b4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>oN(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function QP(e){return new cN({type:"optional",innerType:e})}const XP=Ne("ZodNullable",(e,t)=>{y4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>ZI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function JE(e){return new XP({type:"nullable",innerType:e})}const JP=Ne("ZodDefault",(e,t)=>{x4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>YI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function WP(e,t){return new JP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wC(t)}})}const e3=Ne("ZodPrefault",(e,t)=>{w4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>GI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function t3(e,t){return new e3({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wC(t)}})}const uN=Ne("ZodNonOptional",(e,t)=>{S4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>KI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function n3(e,t){return new uN({type:"nonoptional",innerType:e,...ft(t)})}const r3=Ne("ZodCatch",(e,t)=>{E4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>QI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function s3(e,t){return new r3({type:"catch",innerType:e,catchValue:typeof t=="function"?t:hz(t)})}const o3=Ne("ZodPipe",(e,t)=>{T4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>XI(e,s,o,a),e.in=t.in,e.out=t.out});function WE(e,t){return new o3({type:"pipe",in:e,out:t})}const i3=Ne("ZodReadonly",(e,t)=>{R4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>JI(e,s,o,a),e.unwrap=()=>e._zod.def.innerType});function a3(e){return new i3({type:"readonly",innerType:e})}const l3=Ne("ZodCustom",(e,t)=>{C4.init(e,t),jn.init(e,t),e._zod.processJSONSchema=(s,o,a)=>LI(e,s,o,a)});function c3(e,t={}){return CI(l3,e,t)}function u3(e,t){return NI(e,t)}vs({jitless:!0});var zv={exports:{}},bt={};/**
|
|
67
|
+
* @license React
|
|
68
|
+
* react.production.js
|
|
69
|
+
*
|
|
70
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the MIT license found in the
|
|
73
|
+
* LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/var eT;function d3(){if(eT)return bt;eT=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),S=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function j(N,z,Z){this.props=N,this.context=z,this.refs=C,this.updater=Z||E}j.prototype.isReactComponent={},j.prototype.setState=function(N,z){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,z,"setState")},j.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function O(){}O.prototype=j.prototype;function k(N,z,Z){this.props=N,this.context=z,this.refs=C,this.updater=Z||E}var D=k.prototype=new O;D.constructor=k,R(D,j.prototype),D.isPureReactComponent=!0;var P=Array.isArray;function L(){}var _={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function I(N,z,Z){var te=Z.ref;return{$$typeof:e,type:N,key:z,ref:te!==void 0?te:null,props:Z}}function X(N,z){return I(N.type,z,N.props)}function Y(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function q(N){var z={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return z[Z]})}var $=/\/+/g;function G(N,z){return typeof N=="object"&&N!==null&&N.key!=null?q(""+N.key):z.toString(36)}function H(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(z){N.status==="pending"&&(N.status="fulfilled",N.value=z)},function(z){N.status==="pending"&&(N.status="rejected",N.reason=z)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function K(N,z,Z,te,ue){var W=typeof N;(W==="undefined"||W==="boolean")&&(N=null);var be=!1;if(N===null)be=!0;else switch(W){case"bigint":case"string":case"number":be=!0;break;case"object":switch(N.$$typeof){case e:case t:be=!0;break;case b:return be=N._init,K(be(N._payload),z,Z,te,ue)}}if(be)return ue=ue(N),be=te===""?"."+G(N,0):te,P(ue)?(Z="",be!=null&&(Z=be.replace($,"$&/")+"/"),K(ue,z,Z,"",function(xe){return xe})):ue!=null&&(Y(ue)&&(ue=X(ue,Z+(ue.key==null||N&&N.key===ue.key?"":(""+ue.key).replace($,"$&/")+"/")+be)),z.push(ue)),1;be=0;var de=te===""?".":te+":";if(P(N))for(var fe=0;fe<N.length;fe++)te=N[fe],W=de+G(te,fe),be+=K(te,z,Z,W,ue);else if(fe=w(N),typeof fe=="function")for(N=fe.call(N),fe=0;!(te=N.next()).done;)te=te.value,W=de+G(te,fe++),be+=K(te,z,Z,W,ue);else if(W==="object"){if(typeof N.then=="function")return K(H(N),z,Z,te,ue);throw z=String(N),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return be}function B(N,z,Z){if(N==null)return N;var te=[],ue=0;return K(N,te,"","",function(W){return z.call(Z,W,ue++)}),te}function A(N){if(N._status===-1){var z=N._result,Z=z();Z.then(function(te){(N._status===0||N._status===-1)&&(N._status=1,N._result=te,Z.status===void 0&&(Z.status="fulfilled",Z.value=te))},function(te){(N._status===0||N._status===-1)&&(N._status=2,N._result=te,Z.status===void 0&&(Z.status="rejected",Z.reason=te))}),N._status===-1&&(N._status=0,N._result=Z)}if(N._status===1)return N._result.default;throw N._result}var U=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function J(N){var z=_.T,Z={};Z.types=z!==null?z.types:null,_.T=Z;try{var te=N(),ue=_.S;ue!==null&&ue(Z,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(L,U)}catch(W){U(W)}finally{z!==null&&Z.types!==null&&(z.types=Z.types),_.T=z}}function F(N){var z=_.T;if(z!==null){var Z=z.types;Z===null?z.types=[N]:Z.indexOf(N)===-1&&Z.push(N)}else J(F.bind(null,N))}var oe={map:B,forEach:function(N,z,Z){B(N,function(){z.apply(this,arguments)},Z)},count:function(N){var z=0;return B(N,function(){z++}),z},toArray:function(N){return B(N,function(z){return z})||[]},only:function(N){if(!Y(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return bt.Activity=p,bt.Children=oe,bt.Component=j,bt.Fragment=s,bt.Profiler=a,bt.PureComponent=k,bt.StrictMode=o,bt.Suspense=g,bt.ViewTransition=x,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,bt.__COMPILER_RUNTIME={__proto__:null,c:function(N){return _.H.useMemoCache(N)}},bt.addTransitionType=F,bt.cache=function(N){return function(){return N.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(N,z,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var te=R({},N.props),ue=N.key;if(z!=null)for(W in z.key!==void 0&&(ue=""+z.key),z)!V.call(z,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&z.ref===void 0||(te[W]=z[W]);var W=arguments.length-2;if(W===1)te.children=Z;else if(1<W){for(var be=Array(W),de=0;de<W;de++)be[de]=arguments[de+2];te.children=be}return I(N.type,ue,te)},bt.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:c,_context:N},N},bt.createElement=function(N,z,Z){var te,ue={},W=null;if(z!=null)for(te in z.key!==void 0&&(W=""+z.key),z)V.call(z,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=z[te]);var be=arguments.length-2;if(be===1)ue.children=Z;else if(1<be){for(var de=Array(be),fe=0;fe<be;fe++)de[fe]=arguments[fe+2];ue.children=de}if(N&&N.defaultProps)for(te in be=N.defaultProps,be)ue[te]===void 0&&(ue[te]=be[te]);return I(N,W,ue)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(N){return{$$typeof:m,render:N}},bt.isValidElement=Y,bt.lazy=function(N){return{$$typeof:b,_payload:{_status:-1,_result:N},_init:A}},bt.memo=function(N,z){return{$$typeof:v,type:N,compare:z===void 0?null:z}},bt.startTransition=J,bt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},bt.use=function(N){return _.H.use(N)},bt.useActionState=function(N,z,Z){return _.H.useActionState(N,z,Z)},bt.useCallback=function(N,z){return _.H.useCallback(N,z)},bt.useContext=function(N){return _.H.useContext(N)},bt.useDebugValue=function(){},bt.useDeferredValue=function(N,z){return _.H.useDeferredValue(N,z)},bt.useEffect=function(N,z){return _.H.useEffect(N,z)},bt.useEffectEvent=function(N){return _.H.useEffectEvent(N)},bt.useId=function(){return _.H.useId()},bt.useImperativeHandle=function(N,z,Z){return _.H.useImperativeHandle(N,z,Z)},bt.useInsertionEffect=function(N,z){return _.H.useInsertionEffect(N,z)},bt.useLayoutEffect=function(N,z){return _.H.useLayoutEffect(N,z)},bt.useMemo=function(N,z){return _.H.useMemo(N,z)},bt.useOptimistic=function(N,z){return _.H.useOptimistic(N,z)},bt.useReducer=function(N,z,Z){return _.H.useReducer(N,z,Z)},bt.useRef=function(N){return _.H.useRef(N)},bt.useState=function(N){return _.H.useState(N)},bt.useSyncExternalStore=function(N,z,Z){return _.H.useSyncExternalStore(N,z,Z)},bt.useTransition=function(){return _.H.useTransition()},bt.version="19.3.1",bt}var tT;function Wu(){return tT||(tT=1,zv.exports=d3()),zv.exports}var y=Wu();const Fe=gC(y),f3=BM({__proto__:null,default:Fe},[y]),dN=y.createContext(void 0),On=e=>{const t=y.useContext(dN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},m3=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(dN.Provider,{value:e,children:t})),h3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var ii,oy,sC,p3=(sC=class{constructor(){ct(this,ii,h3);ct(this,oy,!1)}setTimeoutProvider(e){Ke(this,ii,e)}setTimeout(e,t){return ne(this,ii).setTimeout(e,t)}clearTimeout(e){ne(this,ii).clearTimeout(e)}setInterval(e,t){return ne(this,ii).setInterval(e,t)}clearInterval(e){ne(this,ii).clearInterval(e)}},ii=new WeakMap,oy=new WeakMap,sC);const na=new p3;function g3(e){setTimeout(e,0)}const v3=typeof window>"u"||"Deno"in globalThis;function xr(){}function b3(e,t){return typeof e=="function"?e(t):e}function fN(e){return typeof e=="number"&&e>=0&&e!==1/0}function mN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gn(e,t){return typeof e=="function"?e(t):e}function nT(e,t){const{type:s="all",exact:o,fetchStatus:a,predicate:c,queryKey:u,stale:m}=e;if(u){if(o){if(t.queryHash!==xy(u,t.options))return!1}else if(!rc(t.queryKey,u))return!1}if(s!=="all"){const g=t.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof m=="boolean"&&t.isStale()!==m||a&&a!==t.state.fetchStatus||c&&!c(t))}function rT(e,t){const{exact:s,status:o,predicate:a,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(ga(t.options.mutationKey)!==ga(c))return!1}else if(!rc(t.options.mutationKey,c))return!1}return!(o&&t.state.status!==o||a&&!a(t))}function xy(e,t){return((t==null?void 0:t.queryKeyHashFn)||ga)(e)}function ga(e){return JSON.stringify(e,(t,s)=>yb(s)?Object.keys(s).sort().reduce((o,a)=>(o[a]=s[a],o),{}):s)}function rc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let o=0;o<t.length;o++)if(!rc(e[o],t[o]))return!1;return!0}const s=Object.keys(t);for(const o of s)if(!rc(e[o],t[o]))return!1;return!0}return!1}const hN=Object.prototype.hasOwnProperty;function pN(e,t,s=0){if(e===t)return e;if(s>500)return t;const o=sT(e)&&sT(t);if(!o&&!(yb(e)&&yb(t)))return t;const a=(o?e:Object.keys(e)).length,c=o?t:Object.keys(t),u=c.length,m=o?new Array(u):{};let g=0;for(let v=0;v<u;v++){const b=o?v:c[v],p=e[b],x=t[b];if(p===x){m[b]=p,(o?v<a:hN.call(e,b))&&g++;continue}if(p===null||x===null||typeof p!="object"||typeof x!="object"){m[b]=x;continue}const S=pN(p,x,s+1);m[b]=S,S===p&&g++}return a===u&&g===a?e:m}function Om(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s of Object.keys(e))if(!hN.call(t,s)||e[s]!==t[s])return!1;return!0}function sT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yb(e){if(!oT(e))return!1;const t=Object.getPrototypeOf(e),s=t==null?void 0:t.constructor;if(s===void 0)return!0;if(typeof s!="function")return!1;const o=s.prototype;return!(!oT(o)||!o.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function oT(e){return Object.prototype.toString.call(e)==="[object Object]"}function y3(e){return new Promise(t=>{na.setTimeout(t,e)})}function xb(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?pN(e,t):t}function x3(e,t,s=0){const o=[...e,t];return s&&o.length>s?o.slice(-s):o}function w3(e,t,s=0){const o=[t,...e];return s&&o.length>s?o.slice(0,s):o}const wy=Symbol();function gN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===wy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Sy(e,t){return typeof e=="function"?e(...t):!!e}const Ey=Symbol();function S3(e,t,s,o){let a=!1,c;return Object.defineProperties(e,{[Ey]:{value:o},signal:{enumerable:!0,get:()=>(c??(c=t()),a||(a=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}}),e}let E3=()=>v3;const Ty=()=>E3();var dc=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(){}},sa,ai,Hl,oC,T3=(oC=class extends dc{constructor(){super();ct(this,sa);ct(this,ai);ct(this,Hl);Ke(this,Hl,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){ne(this,ai)||this.setEventListener(ne(this,Hl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,ai))==null||t.call(this),Ke(this,ai,void 0))}setEventListener(t){var s;Ke(this,Hl,t),(s=ne(this,ai))==null||s.call(this),Ke(this,ai,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){ne(this,sa)!==t&&(Ke(this,sa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof ne(this,sa)=="boolean"?ne(this,sa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sa=new WeakMap,ai=new WeakMap,Hl=new WeakMap,oC);const Ry=new T3,R3=g3;function C3(){let e=[],t=0,s=m=>{m()},o=m=>{m()},a=R3;const c=m=>{t?e.push(m):a(()=>{s(m)})},u=()=>{const m=e;e=[],m.length&&a(()=>{o(()=>{m.forEach(g=>{s(g)})})})};return{batch:m=>{let g;t++;try{g=m()}finally{t--,t||u()}return g},batchCalls:m=>(...g)=>{c(()=>{m(...g)})},schedule:c,setNotifyFunction:m=>{s=m},setBatchNotifyFunction:m=>{o=m},setScheduler:m=>{a=m}}}const Hn=C3();var Fl,li,Vl,iC,N3=(iC=class extends dc{constructor(){super();ct(this,Fl,!0);ct(this,li);ct(this,Vl);Ke(this,Vl,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",o)}}})}onSubscribe(){ne(this,li)||this.setEventListener(ne(this,Vl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,li))==null||t.call(this),Ke(this,li,void 0))}setEventListener(t){var s;Ke(this,Vl,t),(s=ne(this,li))==null||s.call(this),Ke(this,li,t(this.setOnline.bind(this)))}setOnline(t){ne(this,Fl)!==t&&(Ke(this,Fl,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return ne(this,Fl)}},Fl=new WeakMap,li=new WeakMap,Vl=new WeakMap,iC);const Hm=new N3;function j3(e){return Math.min(1e3*2**e,3e4)}function vN(e){return(e??"online")==="online"?Hm.isOnline():!0}var wb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bN(e){let t=!1,s=0,o,a="pending",c,u;const m=new Promise((j,O)=>{c=j,u=O});m.catch(xr);const g=()=>a!=="pending",v=j=>{var O;if(!g()){const k=new wb(j);E(k),(O=e.onCancel)==null||O.call(e,k)}},b=()=>{t=!0},p=()=>{t=!1},x=()=>Ry.isFocused()&&(e.networkMode==="always"||Hm.isOnline())&&e.canRun(),S=()=>vN(e.networkMode)&&e.canRun(),w=j=>{g()||(o==null||o(),a="resolved",c(j))},E=j=>{g()||(o==null||o(),a="rejected",u(j))},R=j=>new Promise(O=>{var k;o=D=>{(g()||j())&&O(D)},(k=e.onPause)==null||k.call(e)}).then(()=>{var O;o=void 0,g()||(O=e.onContinue)==null||O.call(e)}),C=()=>{if(g())return;let j;const O=s===0?e.initialPromise:void 0;try{j=O??e.fn()}catch(k){j=Promise.reject(k)}Promise.resolve(j).then(w).catch(k=>{var V;if(g())return;const D=e.retry??(Ty()?0:3),P=e.retryDelay??j3,L=typeof P=="function"?P(s,k):P,_=D===!0||typeof D=="number"&&s<D||typeof D=="function"&&D(s,k);if(t||!_){E(k);return}s++,(V=e.onFail)==null||V.call(e,s,k),y3(L).then(()=>g()||x()?void 0:R(x)).then(()=>{t?E(k):C()})})};return{promise:m,status:()=>a,cancel:v,continue:()=>(o==null||o(),m),cancelRetry:b,continueRetry:p,canStart:S,start:()=>(S()?C():R(S).then(C),m)}}function O3(e){return{onFetch:(t,s)=>{var b,p,x,S,w;const o=t.options,a=(x=(p=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:p.fetchMore)==null?void 0:x.direction,c=((S=t.state.data)==null?void 0:S.pages)||[],u=((w=t.state.data)==null?void 0:w.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const v=async()=>{let E=!1;const R=t,C=k=>{S3(k,()=>t.signal,()=>E=!0,R[Ey])},j=gN(t.options,t.fetchOptions),O=async(k,D,P)=>{if(E)return Promise.reject(t.signal.reason);if(D==null&&k.pages.length)return Promise.resolve(k);const _=(()=>{const Y={client:t.client,queryKey:t.queryKey,pageParam:D,direction:P?"backward":"forward",meta:t.options.meta};return C(Y),Y})(),V=await j(_),{maxPages:I}=t.options,X=P?w3:x3;return{pages:X(k.pages,V,I),pageParams:X(k.pageParams,D,I)}};if(a&&c.length){const k=a==="backward",D=k?yN:Sb,P={pages:c,pageParams:u};m=await O(P,D(o,P),k)}else{const k=e??c.length;do{const D=g===0?u[0]===void 0?o.initialPageParam:u[0]:Sb(o,m);if(g>0&&D==null)break;m=await O(m,D),g++}while(g<k)}return m};t.options.persister?t.fetchFn=()=>{var E,R;return(R=(E=t.options).persister)==null?void 0:R.call(E,v,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=v}}}function Sb(e,{pages:t,pageParams:s}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,s[o],s):void 0}function yN(e,{pages:t,pageParams:s}){var o;return t.length>0?(o=e.getPreviousPageParam)==null?void 0:o.call(e,t[0],t,s[0],s):void 0}function k3(e,t){return t?Sb(e,t)!=null:!1}function _3(e,t){return!t||!e.getPreviousPageParam?!1:yN(e,t)!=null}var oa,aC,xN=(aC=class{constructor(){ct(this,oa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fN(this.gcTime)&&Ke(this,oa,na.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ty()?1/0:3e5))}clearGcTimeout(){ne(this,oa)!==void 0&&(na.clearTimeout(ne(this,oa)),Ke(this,oa,void 0))}},oa=new WeakMap,aC),ql,ia,$l,es,aa,Yn,uo,Ku,la,ds,lo,lC,A3=(lC=class extends xN{constructor(t){super();ct(this,ds);ct(this,ql);ct(this,ia);ct(this,$l);ct(this,es);ct(this,aa);ct(this,Yn);ct(this,uo);ct(this,Ku);ct(this,la);Ke(this,la,!1),Ke(this,Ku,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ke(this,aa,t.client),Ke(this,es,ne(this,aa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ke(this,ia,aT(this.options)),this.state=t.state??ne(this,ia),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ne(this,ql)}get promise(){var t;return(t=ne(this,Yn))==null?void 0:t.promise}setOptions(t){if(this.options={...ne(this,Ku),...t},t!=null&&t._type&&Ke(this,ql,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=aT(this.options);s.data!==void 0&&(this.setState(iT(s.data,s.dataUpdatedAt)),Ke(this,ia,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ne(this,es).remove(this)}setData(t,s){const o=xb(this.state.data,t,this.options);return St(this,ds,lo).call(this,{data:o,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),o}setState(t){St(this,ds,lo).call(this,{type:"setState",state:t})}cancel(t){var o,a;const s=(o=ne(this,Yn))==null?void 0:o.promise;return(a=ne(this,Yn))==null||a.cancel(t),s?s.then(xr).catch(xr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ne(this,ia)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>gn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(t=>gn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!mN(this.state.dataUpdatedAt,t)}onFocus(){var t,s;(t=this.observers.find(o=>o.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(s=ne(this,Yn))==null||s.continue()}onOnline(){var t,s;(t=this.observers.find(o=>o.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(s=ne(this,Yn))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ne(this,es).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const s=this.observers.indexOf(t);s!==-1&&(this.observers.splice(s,1),this.observers.length||(ne(this,Yn)&&(ne(this,la)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ne(this,Yn).cancel({revert:!0}):ne(this,Yn).cancelRetry()),this.scheduleGc()),ne(this,es).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||St(this,ds,lo).call(this,{type:"invalidate"})}async fetch(t,s){var b,p,x,S;if(this.state.fetchStatus!=="idle"&&((b=ne(this,Yn))==null?void 0:b.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(ne(this,Yn)&&ne(this,uo))return ne(this,Yn).continueRetry(),ne(this,uo)}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(E=>E.options.queryFn);w&&this.setOptions(w.options)}const o=new AbortController,a=w=>{Object.defineProperties(w,{[Ey]:{value:o.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(Ke(this,la,!0),o.signal)}})},c=()=>{const w=gN(this.options,s),R=(()=>{const C={client:ne(this,aa),queryKey:this.queryKey,meta:this.meta};return a(C),C})();return Ke(this,la,!1),this.options.persister?this.options.persister(w,R,this):w(R)},m=(()=>{const w={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:ne(this,aa),state:this.state,fetchFn:c};return a(w),w})();(p=ne(this,ql)==="infinite"?O3(this.options.pages):this.options.behavior)==null||p.onFetch(m,this),Ke(this,$l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=m.fetchOptions)==null?void 0:x.meta))&&St(this,ds,lo).call(this,{type:"fetch",meta:(S=m.fetchOptions)==null?void 0:S.meta});const g=Ke(this,Yn,bN({initialPromise:s==null?void 0:s.initialPromise,fn:m.fetchFn,onCancel:w=>{w instanceof wb&&w.revert&&this.setState({...ne(this,$l),fetchStatus:"idle"}),o.abort()},onFail:(w,E)=>{St(this,ds,lo).call(this,{type:"failed",failureCount:w,error:E})},onPause:()=>{St(this,ds,lo).call(this,{type:"pause"})},onContinue:()=>{St(this,ds,lo).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0})),v=(async()=>{var w,E,R,C,j,O,k,D;try{const P=await g.promise;if(P===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(P),(E=(w=ne(this,es).config).onSuccess)==null||E.call(w,P,this),(C=(R=ne(this,es).config).onSettled)==null||C.call(R,P,this.state.error,this),P}catch(P){if(P instanceof wb){if(P.silent){if(ne(this,Yn)!==g&&ne(this,uo))return ne(this,uo);throw P}else if(P.revert){if(this.state.data===void 0)throw P;return this.state.data}}throw St(this,ds,lo).call(this,{type:"error",error:P}),(O=(j=ne(this,es).config).onError)==null||O.call(j,P,this),(D=(k=ne(this,es).config).onSettled)==null||D.call(k,this.state.data,P,this),P}finally{ne(this,Yn)===g&&(Ke(this,Yn,void 0),Ke(this,uo,void 0)),this.scheduleGc()}})();return Ke(this,uo,v),g.start(),v}},ql=new WeakMap,ia=new WeakMap,$l=new WeakMap,es=new WeakMap,aa=new WeakMap,Yn=new WeakMap,uo=new WeakMap,Ku=new WeakMap,la=new WeakMap,ds=new WeakSet,lo=function(t){const s=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...wN(o.data,this.options),fetchMeta:t.meta??null};case"success":{const a={...o,...iT(t.data,t.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ke(this,$l,t.manual?a:void 0),a}case"error":{const a=t.error;return{...o,error:a,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0}}case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=s(this.state),Hn.batch(()=>{this.observers.slice().forEach(o=>{o.onQueryUpdate()}),ne(this,es).notify({query:this,type:"updated",action:t})})},lC);function wN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function iT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function aT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,o=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var br,Lt,Yu,yr,ca,Zl,fo,Gu,Kl,Yl,ua,da,ci,Gl,$t,Su,Eb,Tb,Rb,Cb,Nb,jb,Ob,kb,cC,SN=(cC=class extends dc{constructor(t,s){super();ct(this,$t);ct(this,br);ct(this,Lt);ct(this,Yu);ct(this,yr);ct(this,ca);ct(this,Zl);ct(this,fo);ct(this,Gu);ct(this,Kl);ct(this,Yl);ct(this,ua);ct(this,da);ct(this,ci);ct(this,Gl,new Set);this.options=s,Ke(this,br,t),Ke(this,fo,null),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,Lt).addObserver(this),lT(ne(this,Lt),this.options)?St(this,$t,Su).call(this):this.updateResult(),St(this,$t,Nb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _b(ne(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _b(ne(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,St(this,$t,jb).call(this),St(this,$t,Ob).call(this),ne(this,Lt).removeObserver(this)}setOptions(t){const s=this.options,o=ne(this,Lt);if(this.options=ne(this,br).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gn(this.options.enabled,ne(this,Lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");St(this,$t,kb).call(this),ne(this,Lt).setOptions(this.options),s._defaulted&&!Om(this.options,s)&&ne(this,br).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,Lt),observer:this});const a=this.hasListeners();a&&cT(ne(this,Lt),o,this.options,s)&&St(this,$t,Su).call(this),this.updateResult(),a&&(ne(this,Lt)!==o||gn(this.options.enabled,ne(this,Lt))!==gn(s.enabled,ne(this,Lt))||gn(this.options.staleTime,ne(this,Lt))!==gn(s.staleTime,ne(this,Lt)))&&St(this,$t,Tb).call(this);const c=St(this,$t,Rb).call(this);a&&(ne(this,Lt)!==o||gn(this.options.enabled,ne(this,Lt))!==gn(s.enabled,ne(this,Lt))||c!==ne(this,ci))&&St(this,$t,Cb).call(this,c)}getOptimisticResult(t){const s=ne(this,br).getQueryCache().build(ne(this,br),t),o=this.createResult(s,t);return Om(this.getCurrentResult(),o)||(Ke(this,yr,o),Ke(this,Zl,this.options),Ke(this,ca,ne(this,Lt).state)),o}getCurrentResult(){return ne(this,yr)}trackResult(t,s){return new Proxy(t,{get:(o,a)=>(this.trackProp(a),s==null||s(a),Reflect.get(o,a))})}trackProp(t){ne(this,Gl).add(t)}getCurrentQuery(){return ne(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=ne(this,br).defaultQueryOptions(t),o=ne(this,br).getQueryCache().build(ne(this,br),s);let a=()=>{},c;const u=new Promise(m=>{c=m,a=ne(this,br).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===o.queryHash&&o.state.data!==void 0&&(a(),m(this.createResult(o,s)))})});return Promise.race([o.fetch(s).then(()=>{const m=this.createResult(o,s);return c==null||c(m),m}).finally(()=>{a()}),u])}fetch(t){return St(this,$t,Su).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,yr)))}createResult(t,s){var P;const o=ne(this,Lt),a=this.options,c=ne(this,yr),u=ne(this,ca),m=ne(this,Zl),g=t!==o?t.state:ne(this,Yu),{state:v}=t;let b={...v},p=!1,x;if(s._optimisticResults){const L=this.hasListeners(),_=!L&&lT(t,s),V=L&&cT(t,o,s,a);(_||V)&&(b={...b,...wN(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:E}=b;x=b.data;let R=!1;if(s.placeholderData!==void 0&&x===void 0&&E==="pending"){let L;c!=null&&c.isPlaceholderData&&s.placeholderData===(m==null?void 0:m.placeholderData)?(L=c.data,R=!0):L=typeof s.placeholderData=="function"?s.placeholderData((P=ne(this,Yl))==null?void 0:P.state.data,ne(this,Yl)):s.placeholderData,L!==void 0&&(E="success",x=xb(c==null?void 0:c.data,L,s),p=!0)}if(s.select&&x!==void 0&&!R)if(c&&x===(u==null?void 0:u.data)&&s.select===ne(this,Gu))x=ne(this,Kl);else try{Ke(this,Gu,s.select),x=s.select(x),x=xb(c==null?void 0:c.data,x,s),Ke(this,Kl,x),Ke(this,fo,null)}catch(L){Ke(this,fo,L)}else x===void 0&&Ke(this,fo,null);ne(this,fo)&&(S=ne(this,fo),x=ne(this,Kl),w=(c==null?void 0:c.error)===S?c.errorUpdatedAt:Date.now(),E="error",p=!1);const C=b.fetchStatus==="fetching",j=E==="pending",O=E==="error",k=j&&C,D=x!==void 0;return{status:E,fetchStatus:b.fetchStatus,isPending:j,isSuccess:E==="success",isError:O,isInitialLoading:k,isLoading:k,data:x,dataUpdatedAt:b.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:b.dataUpdateCount>g.dataUpdateCount||b.errorUpdateCount>g.errorUpdateCount,isFetching:C,isRefetching:C&&!j,isLoadingError:O&&!D,isPaused:b.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:O&&D,isStale:Cy(t,s),refetch:this.refetch,isEnabled:gn(s.enabled,t)!==!1}}updateResult(){const t=ne(this,yr),s=this.createResult(ne(this,Lt),this.options);if(Ke(this,ca,ne(this,Lt).state),Ke(this,Zl,this.options),ne(this,ca).data!==void 0&&Ke(this,Yl,ne(this,Lt)),Om(s,t))return;Ke(this,yr,s);const a=(()=>{if(!t)return!0;const{notifyOnChangeProps:c}=this.options,u=typeof c=="function"?c():c;if(u==="all"||!u&&!ne(this,Gl).size||this.options.throwOnError&&ne(this,yr).error!==t.error)return!0;for(const m of u??ne(this,Gl))if(ne(this,yr)[m]!==t[m])return!0;return!1})();Hn.batch(()=>{a&&this.listeners.forEach(c=>{c(ne(this,yr))}),ne(this,br).getQueryCache().notify({query:ne(this,Lt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&St(this,$t,Nb).call(this)}},br=new WeakMap,Lt=new WeakMap,Yu=new WeakMap,yr=new WeakMap,ca=new WeakMap,Zl=new WeakMap,fo=new WeakMap,Gu=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,ua=new WeakMap,da=new WeakMap,ci=new WeakMap,Gl=new WeakMap,$t=new WeakSet,Su=function(t){St(this,$t,kb).call(this);let s=ne(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(xr)),s},Eb=function(t){return!Ty()&&gn(this.options.enabled,ne(this,Lt))!==!1&&fN(t)},Tb=function(){St(this,$t,jb).call(this);const t=gn(this.options.staleTime,ne(this,Lt));if(ne(this,yr).isStale||!St(this,$t,Eb).call(this,t))return;const s=mN(ne(this,yr).dataUpdatedAt,t)+1;Ke(this,ua,na.setTimeout(()=>{ne(this,yr).isStale||this.updateResult()},s))},Rb=function(){return gn(this.options.refetchInterval,ne(this,Lt))??!1},Cb=function(t){St(this,$t,Ob).call(this),Ke(this,ci,t),!(ne(this,ci)===0||!St(this,$t,Eb).call(this,ne(this,ci)))&&Ke(this,da,na.setInterval(()=>{(this.options.refetchIntervalInBackground||Ry.isFocused())&&St(this,$t,Su).call(this)},ne(this,ci)))},Nb=function(){St(this,$t,Tb).call(this),St(this,$t,Cb).call(this,St(this,$t,Rb).call(this))},jb=function(){ne(this,ua)!==void 0&&(na.clearTimeout(ne(this,ua)),Ke(this,ua,void 0))},Ob=function(){ne(this,da)!==void 0&&(na.clearInterval(ne(this,da)),Ke(this,da,void 0))},kb=function(){const t=ne(this,br).getQueryCache().build(ne(this,br),this.options);if(t===ne(this,Lt))return;const s=ne(this,Lt);Ke(this,Lt,t),Ke(this,Yu,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},cC);function M3(e,t){return gn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&gn(t.retryOnMount,e)===!1)}function lT(e,t){return M3(e,t)||e.state.data!==void 0&&_b(e,t,t.refetchOnMount)}function _b(e,t,s){if(gn(t.enabled,e)!==!1&&gn(t.staleTime,e)!=="static"){const o=gn(s,e);return o==="always"||o!==!1&&Cy(e,t)}return!1}function cT(e,t,s,o){return(e!==t||gn(o.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Cy(e,s)}function Cy(e,t){return gn(t.enabled,e)!==!1&&e.isStaleByTime(gn(t.staleTime,e))}var z3=class extends SN{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var S,w;const{state:s}=e,o=super.createResult(e,t),{isFetching:a,isRefetching:c,isError:u,isRefetchError:m}=o,g=(w=(S=s.fetchMeta)==null?void 0:S.fetchMore)==null?void 0:w.direction,v=u&&g==="forward",b=a&&g==="forward",p=u&&g==="backward",x=a&&g==="backward";return{...o,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:k3(t,s.data),hasPreviousPage:_3(t,s.data),isFetchNextPageError:v,isFetchingNextPage:b,isFetchPreviousPageError:p,isFetchingPreviousPage:x,isRefetchError:m&&!v&&!p,isRefetching:c&&!b&&!x}}},Qu,Ms,ur,fa,zs,oi,uC,D3=(uC=class extends xN{constructor(t){super();ct(this,zs);ct(this,Qu);ct(this,Ms);ct(this,ur);ct(this,fa);Ke(this,Qu,t.client),this.mutationId=t.mutationId,Ke(this,ur,t.mutationCache),Ke(this,Ms,[]),this.state=t.state||EN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ne(this,Ms).includes(t)||(ne(this,Ms).push(t),this.clearGcTimeout(),ne(this,ur).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ke(this,Ms,ne(this,Ms).filter(s=>s!==t)),this.scheduleGc(),ne(this,ur).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ne(this,Ms).length||(this.state.status==="pending"?this.scheduleGc():ne(this,ur).remove(this))}continue(){var t;return((t=ne(this,fa))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var m,g,v,b,p,x,S,w,E,R,C,j,O,k,D,P,L,_;const s=()=>{St(this,zs,oi).call(this,{type:"continue"})},o={client:ne(this,Qu),meta:this.options.meta,mutationKey:this.options.mutationKey},a=Ke(this,fa,bN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,o):Promise.reject(new Error("No mutationFn found")),onFail:(V,I)=>{St(this,zs,oi).call(this,{type:"failed",failureCount:V,error:I})},onPause:()=>{St(this,zs,oi).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ne(this,ur).canRun(this)})),c=this.state.status==="pending",u=!a.canStart();try{if(c)s();else{St(this,zs,oi).call(this,{type:"pending",variables:t,isPaused:u}),ne(this,ur).config.onMutate&&await ne(this,ur).config.onMutate(t,this,o);const I=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,t,o));I!==this.state.context&&St(this,zs,oi).call(this,{type:"pending",context:I,variables:t,isPaused:u})}this.state.isPaused&&a.canStart()&&s();const V=await a.start();return await((b=(v=ne(this,ur).config).onSuccess)==null?void 0:b.call(v,V,t,this.state.context,this,o)),await((x=(p=this.options).onSuccess)==null?void 0:x.call(p,V,t,this.state.context,o)),await((w=(S=ne(this,ur).config).onSettled)==null?void 0:w.call(S,V,null,this.state.variables,this.state.context,this,o)),await((R=(E=this.options).onSettled)==null?void 0:R.call(E,V,null,t,this.state.context,o)),St(this,zs,oi).call(this,{type:"success",data:V}),V}catch(V){try{await((j=(C=ne(this,ur).config).onError)==null?void 0:j.call(C,V,t,this.state.context,this,o))}catch(I){Promise.reject(I)}try{await((k=(O=this.options).onError)==null?void 0:k.call(O,V,t,this.state.context,o))}catch(I){Promise.reject(I)}try{await((P=(D=ne(this,ur).config).onSettled)==null?void 0:P.call(D,void 0,V,this.state.variables,this.state.context,this,o))}catch(I){Promise.reject(I)}try{await((_=(L=this.options).onSettled)==null?void 0:_.call(L,void 0,V,t,this.state.context,o))}catch(I){Promise.reject(I)}throw St(this,zs,oi).call(this,{type:"error",error:V}),V}finally{ne(this,fa)===a&&Ke(this,fa,void 0),ne(this,ur).runNext(this)}}},Qu=new WeakMap,Ms=new WeakMap,ur=new WeakMap,fa=new WeakMap,zs=new WeakSet,oi=function(t){const s=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Hn.batch(()=>{ne(this,Ms).forEach(o=>{o.onMutationUpdate(t)}),ne(this,ur).notify({mutation:this,type:"updated",action:t})})},uC);function EN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ui,fs,Xu,dC,I3=(dC=class extends dc{constructor(t={}){super();ct(this,ui);ct(this,fs);ct(this,Xu);this.config=t,Ke(this,ui,new Set),Ke(this,fs,new Map),Ke(this,Xu,0)}build(t,s,o){const a=new D3({client:t,mutationCache:this,mutationId:++Yf(this,Xu)._,options:t.defaultMutationOptions(s),state:o});return this.add(a),a}add(t){ne(this,ui).add(t);const s=em(t);if(typeof s=="string"){const o=ne(this,fs).get(s);o?o.push(t):ne(this,fs).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ne(this,ui).delete(t)){const s=em(t);if(typeof s=="string"){const o=ne(this,fs).get(s);if(o)if(o.length>1){const a=o.indexOf(t);a!==-1&&o.splice(a,1)}else o[0]===t&&ne(this,fs).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){var o;const s=em(t);if(typeof s=="string"){const a=(o=ne(this,fs).get(s))==null?void 0:o.find(c=>c.state.status==="pending");return!a||a===t}else return!0}runNext(t){var o,a;const s=em(t);return typeof s=="string"?((a=(o=ne(this,fs).get(s))==null?void 0:o.find(c=>c!==t&&c.state.isPaused))==null?void 0:a.continue())??Promise.resolve():Promise.resolve()}clear(){Hn.batch(()=>{const t=this.getAll();ne(this,ui).clear(),ne(this,fs).clear(),t.forEach(s=>{this.notify({type:"removed",mutation:s})})})}getAll(){return Array.from(ne(this,ui))}find(t){const s={exact:!0,...t};return this.getAll().find(o=>rT(s,o))}findAll(t={}){return this.getAll().filter(s=>rT(t,s))}notify(t){Hn.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return Hn.batch(()=>Promise.all(t.map(s=>s.continue().catch(xr))))}},ui=new WeakMap,fs=new WeakMap,Xu=new WeakMap,dC);function em(e){var t;return(t=e.options.scope)==null?void 0:t.id}var mo,di,dr,Ju,Ps,Eu,Ab,fC,P3=(fC=class extends dc{constructor(s,o){super();ct(this,Ps);ct(this,mo);ct(this,di);ct(this,dr);ct(this,Ju);Ke(this,mo,s),this.setOptions(o),this.bindMethods(),St(this,Ps,Eu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var a;const o=this.options;this.options=ne(this,mo).defaultMutationOptions(s),Om(this.options,o)||ne(this,mo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ne(this,dr),observer:this}),o!=null&&o.mutationKey&&this.options.mutationKey&&ga(o.mutationKey)!==ga(this.options.mutationKey)?this.reset():((a=ne(this,dr))==null?void 0:a.state.status)==="pending"&&ne(this,dr).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&ne(this,dr)&&(ne(this,dr).addObserver(this),St(this,Ps,Eu).call(this))}onUnsubscribe(){var s;this.hasListeners()||(s=ne(this,dr))==null||s.removeObserver(this)}onMutationUpdate(s){St(this,Ps,Eu).call(this),St(this,Ps,Ab).call(this,s)}getCurrentResult(){return ne(this,di)}reset(){var s;(s=ne(this,dr))==null||s.removeObserver(this),Ke(this,dr,void 0),St(this,Ps,Eu).call(this),St(this,Ps,Ab).call(this)}mutate(s,o){var a;return Ke(this,Ju,o),(a=ne(this,dr))==null||a.removeObserver(this),Ke(this,dr,ne(this,mo).getMutationCache().build(ne(this,mo),this.options)),ne(this,dr).addObserver(this),ne(this,dr).execute(s)}},mo=new WeakMap,di=new WeakMap,dr=new WeakMap,Ju=new WeakMap,Ps=new WeakSet,Eu=function(){var o;const s=((o=ne(this,dr))==null?void 0:o.state)??EN();Ke(this,di,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Ab=function(s){Hn.batch(()=>{var a,c,u,m;const o=ne(this,Ju);if(o&&this.hasListeners()){const g=ne(this,di).variables,v=ne(this,di).context,b={client:ne(this,mo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(a=o.onSuccess)==null||a.call(o,s.data,g,v,b)}catch(p){Promise.reject(p)}try{(c=o.onSettled)==null||c.call(o,s.data,null,g,v,b)}catch(p){Promise.reject(p)}}else if((s==null?void 0:s.type)==="error"){try{(u=o.onError)==null||u.call(o,s.error,g,v,b)}catch(p){Promise.reject(p)}try{(m=o.onSettled)==null||m.call(o,void 0,s.error,g,v,b)}catch(p){Promise.reject(p)}}}this.listeners.forEach(g=>{g(ne(this,di))})})},fC),Ds,mC,L3=(mC=class extends dc{constructor(t={}){super();ct(this,Ds);this.config=t,Ke(this,Ds,new Map)}build(t,s,o){const a=s.queryKey,c=s.queryHash??xy(a,s);let u=this.get(c);return u||(u=new A3({client:t,queryKey:a,queryHash:c,options:t.defaultQueryOptions(s),state:o,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){ne(this,Ds).has(t.queryHash)||(ne(this,Ds).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){ne(this,Ds).get(t.queryHash)===t&&(t.destroy(),ne(this,Ds).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Hn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ne(this,Ds).get(t)}getAll(){return[...ne(this,Ds).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(o=>nT(s,o))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(o=>nT(t,o)):s}notify(t){Hn.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){Hn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Hn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ds=new WeakMap,mC),xn,fi,mi,Ql,Xl,hi,Jl,Wl,hC,U3=(hC=class{constructor(e={}){ct(this,xn);ct(this,fi);ct(this,mi);ct(this,Ql);ct(this,Xl);ct(this,hi);ct(this,Jl);ct(this,Wl);Ke(this,xn,e.queryCache||new L3),Ke(this,fi,e.mutationCache||new I3),Ke(this,mi,e.defaultOptions||{}),Ke(this,Ql,new Map),Ke(this,Xl,new Map),Ke(this,hi,0)}mount(){Yf(this,hi)._++,ne(this,hi)===1&&(Ke(this,Jl,Ry.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,xn).onFocus())})),Ke(this,Wl,Hm.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,xn).onOnline())})))}unmount(){var e,t;Yf(this,hi)._--,ne(this,hi)===0&&((e=ne(this,Jl))==null||e.call(this),Ke(this,Jl,void 0),(t=ne(this,Wl))==null||t.call(this),Ke(this,Wl,void 0))}isFetching(e){return ne(this,xn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ne(this,fi).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=ne(this,xn).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=ne(this,xn).build(this,t),o=s.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(gn(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return ne(this,xn).findAll(e).map(({queryKey:t,state:s})=>[t,s.data])}setQueryData(e,t,s){var u;const o=this.defaultQueryOptions({queryKey:e}),a=(u=ne(this,xn).get(o.queryHash))==null?void 0:u.state.data,c=b3(t,a);if(c!==void 0)return ne(this,xn).build(this,o).setData(c,{...s,manual:!0})}setQueriesData(e,t,s){return Hn.batch(()=>ne(this,xn).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=ne(this,xn).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=ne(this,xn);Hn.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=ne(this,xn);return Hn.batch(()=>{const o=s.findAll(e),a=new Set(o);return o.forEach(c=>{c.reset()}),this.refetchQueries({type:"active",predicate:c=>a.has(c)},t)})}cancelQueries(e,t={}){const s={revert:!0,...t},o=Hn.batch(()=>ne(this,xn).findAll(e).map(a=>a.cancel(s)));return Promise.all(o).then(xr).catch(xr)}invalidateQueries(e,t={}){return Hn.batch(()=>(ne(this,xn).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},o=Hn.batch(()=>ne(this,xn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let c=a.fetch(void 0,s);const u=a.state.fetchStatus==="paused";return(!s.throwOnError||u)&&(c=c.catch(xr)),u?Promise.resolve():c}));return Promise.all(o).then(xr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=ne(this,xn).build(this,t),o=s.isStaleByTime(gn(t.staleTime,s))?await s.fetch(t):s.state.data,a=t.select;return a?a(o):o}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=ne(this,xn).build(this,t);return s.isStaleByTime(gn(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xr).catch(xr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xr).catch(xr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Hm.isOnline()?ne(this,fi).resumePausedMutations():Promise.resolve()}getQueryCache(){return ne(this,xn)}getMutationCache(){return ne(this,fi)}getDefaultOptions(){return ne(this,mi)}setDefaultOptions(e){Ke(this,mi,e)}setQueryDefaults(e,t){ne(this,Ql).set(ga(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ne(this,Ql).values()],s={};return t.forEach(o=>{rc(e,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(e,t){ne(this,Xl).set(ga(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ne(this,Xl).values()],s={};return t.forEach(o=>{rc(e,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ne(this,mi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xy(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===wy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ne(this,mi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ne(this,xn).clear(),ne(this,fi).clear()}},xn=new WeakMap,fi=new WeakMap,mi=new WeakMap,Ql=new WeakMap,Xl=new WeakMap,hi=new WeakMap,Jl=new WeakMap,Wl=new WeakMap,hC);const TN=y.createContext(!1),B3=()=>y.useContext(TN);TN.Provider;function H3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const F3=y.createContext(H3()),V3=()=>y.useContext(F3),q3=(e,t,s)=>{const o=(s==null?void 0:s.state.status)==="error"&&typeof e.throwOnError=="function"?Sy(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||o)&&(t.isReset()||(e.retryOnMount=!1))},$3=e=>{y.useEffect(()=>{e.clearReset()},[e])},Z3=({result:e,errorResetBoundary:t,throwOnError:s,query:o,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(a&&e.data===void 0||Sy(s,[e.error,o])),K3=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...a)=>s(o(...a)):s(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Y3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,G3=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function RN(e,t,s){const o=B3(),a=V3(),c=On(),u=c.defaultQueryOptions(e),m=c.getQueryCache().get(u.queryHash),g=e.subscribed!==!1;u._optimisticResults=o?"isRestoring":g?"optimistic":void 0,K3(u),q3(u,a,m),$3(a);const[v]=y.useState(()=>new t(c,u)),b=v.getOptimisticResult(u);y.useEffect(()=>{v.setOptions(u)},[u,v]);const p=!o&&g;if(y.useSyncExternalStore(y.useCallback(x=>{const S=p?v.subscribe(Hn.batchCalls(x)):xr;return v.updateResult(),S},[v,p]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),Y3(u,b))throw G3(u,v,a);if(Z3({result:b,errorResetBoundary:a,throwOnError:u.throwOnError,query:m,suspense:u.suspense}))throw b.error;return u.notifyOnChangeProps?b:v.trackResult(b)}function Wt(e,t){return RN(e,SN)}function kt(e,t){const s=On(),[o]=y.useState(()=>new P3(s,e));y.useEffect(()=>{o.setOptions(e)},[o,e]);const a=y.useSyncExternalStore(y.useCallback(u=>o.subscribe(Hn.batchCalls(u)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=y.useCallback((...u)=>{o.mutate(u[0],u[1]).catch(xr)},[o]);if(a.error&&Sy(o.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:c,mutateAsync:a.mutate}}function Q3(e,t){return RN(e,z3)}var Dv={exports:{}},mu={},Iv={exports:{}},Pv={};/**
|
|
75
|
+
* @license React
|
|
76
|
+
* scheduler.production.js
|
|
77
|
+
*
|
|
78
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the MIT license found in the
|
|
81
|
+
* LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/var uT;function X3(){return uT||(uT=1,(function(e){function t(H,K){var B=H.length;H.push(K);e:for(;0<B;){var A=B-1>>>1,U=H[A];if(0<a(U,K))H[A]=K,H[B]=U,B=A;else break e}}function s(H){return H.length===0?null:H[0]}function o(H){if(H.length===0)return null;var K=H[0],B=H.pop();if(B!==K){H[0]=B;e:for(var A=0,U=H.length,J=U>>>1;A<J;){var F=2*(A+1)-1,oe=H[F],N=F+1,z=H[N];if(0>a(oe,B))N<U&&0>a(z,oe)?(H[A]=z,H[N]=B,A=N):(H[A]=oe,H[F]=B,A=F);else if(N<U&&0>a(z,B))H[A]=z,H[N]=B,A=N;else break e}}return K}function a(H,K){var B=H.sortIndex-K.sortIndex;return B!==0?B:H.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,m=u.now();e.unstable_now=function(){return u.now()-m}}var g=[],v=[],b=1,p=null,x=3,S=!1,w=!1,E=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(H){for(var K=s(v);K!==null;){if(K.callback===null)o(v);else if(K.startTime<=H)o(v),K.sortIndex=K.expirationTime,t(g,K);else break;K=s(v)}}function D(H){if(E=!1,k(H),!w)if(s(g)!==null)w=!0,P||(P=!0,Y());else{var K=s(v);K!==null&&G(D,K.startTime-H)}}var P=!1,L=-1,_=5,V=-1;function I(){return R?!0:!(e.unstable_now()-V<_)}function X(){if(R=!1,P){var H=e.unstable_now();V=H;var K=!0;try{e:{w=!1,E&&(E=!1,j(L),L=-1),S=!0;var B=x;try{t:{for(k(H),p=s(g);p!==null&&!(p.expirationTime>H&&I());){var A=p.callback;if(typeof A=="function"){p.callback=null,x=p.priorityLevel;var U=A(p.expirationTime<=H);if(H=e.unstable_now(),typeof U=="function"){p.callback=U,k(H),K=!0;break t}p===s(g)&&o(g),k(H)}else o(g);p=s(g)}if(p!==null)K=!0;else{var J=s(v);J!==null&&G(D,J.startTime-H),K=!1}}break e}finally{p=null,x=B,S=!1}K=void 0}}finally{K?Y():P=!1}}}var Y;if(typeof O=="function")Y=function(){O(X)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,$=q.port2;q.port1.onmessage=X,Y=function(){$.postMessage(null)}}else Y=function(){C(X,0)};function G(H,K){L=C(function(){H(e.unstable_now())},K)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(H){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var B=x;x=K;try{return H()}finally{x=B}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(H,K){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var B=x;x=H;try{return K()}finally{x=B}},e.unstable_scheduleCallback=function(H,K,B){var A=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?A+B:A):B=A,H){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=B+U,H={id:b++,callback:K,priorityLevel:H,startTime:B,expirationTime:U,sortIndex:-1},B>A?(H.sortIndex=B,t(v,H),s(g)===null&&H===s(v)&&(E?(j(L),L=-1):E=!0,G(D,B-A))):(H.sortIndex=U,t(g,H),w||S||(w=!0,P||(P=!0,Y()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var K=x;return function(){var B=x;x=K;try{return H.apply(this,arguments)}finally{x=B}}}})(Pv)),Pv}var dT;function J3(){return dT||(dT=1,Iv.exports=X3()),Iv.exports}var Lv={exports:{}},sr={};/**
|
|
83
|
+
* @license React
|
|
84
|
+
* react-dom.production.js
|
|
85
|
+
*
|
|
86
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the MIT license found in the
|
|
89
|
+
* LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/var fT;function W3(){if(fT)return sr;fT=1;var e=Wu();function t(b){var p="https://react.dev/errors/"+b;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+b+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},a=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function m(b,p,x){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:S==null?null:S===u?u:""+S,children:b,containerInfo:p,implementation:x}}var g=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(b,p){if(b==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return sr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,sr.browser=function(b){return{$$typeof:c,_reason:b}},sr.createPortal=function(b,p){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return m(b,p,null,x)},sr.flushSync=function(b){var p=g.T,x=o.p;try{if(g.T=null,o.p=2,b)return b()}finally{g.T=p,o.p=x,o.d.f()}},sr.preconnect=function(b,p){typeof b=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(b,p))},sr.prefetchDNS=function(b){typeof b=="string"&&o.d.D(b)},sr.preinit=function(b,p){if(typeof b=="string"&&p&&typeof p.as=="string"){var x=p.as,S=v(x,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,E=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?o.d.S(b,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:S,integrity:w,fetchPriority:E}):x==="script"&&o.d.X(b,{crossOrigin:S,integrity:w,fetchPriority:E,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},sr.preinitModule=function(b,p){if(typeof b=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=v(p.as,p.crossOrigin);o.d.M(b,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&o.d.M(b)},sr.preload=function(b,p){if(typeof b=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,S=v(x,p.crossOrigin);o.d.L(b,x,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},sr.preloadModule=function(b,p){if(typeof b=="string")if(p){var x=v(p.as,p.crossOrigin);o.d.m(b,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else o.d.m(b)},sr.requestFormReset=function(b){o.d.r(b)},sr.unstable_batchedUpdates=function(b,p){return b(p)},sr.useFormState=function(b,p,x){return g.H.useFormState(b,p,x)},sr.useFormStatus=function(){return g.H.useHostTransitionStatus()},sr.version="19.3.1",sr}var mT;function CN(){if(mT)return Lv.exports;mT=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(),Lv.exports=W3(),Lv.exports}/**
|
|
91
|
+
* @license React
|
|
92
|
+
* react-dom-client.production.js
|
|
93
|
+
*
|
|
94
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the MIT license found in the
|
|
97
|
+
* LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/var hT;function e5(){if(hT)return mu;hT=1;var e=J3(),t=Wu(),s=CN();function o(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var r=n,i=r;i&&!i.alternate;)r=i,(r.flags&4098)!==0&&(n=r.return),i=r.return;for(;r.return;)r=r.return;return r.tag===3?n:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function g(n){if(c(n)!==n)throw Error(o(188))}function v(n){var r=n.alternate;if(!r){if(r=c(n),r===null)throw Error(o(188));return r!==n?null:n}for(var i=n,l=r;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return g(f),n;if(h===l)return g(f),r;h=h.sibling}throw Error(o(188))}if(i.return!==l.return)i=f,l=h;else{for(var T=!1,M=f.child;M;){if(M===i){T=!0,i=f,l=h;break}if(M===l){T=!0,l=f,i=h;break}M=M.sibling}if(!T){for(M=h.child;M;){if(M===i){T=!0,i=h,l=f;break}if(M===l){T=!0,l=h,i=f;break}M=M.sibling}if(!T)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?n:r}function b(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=b(n),r!==null)return r;n=n.sibling}return null}function p(n,r,i,l,f,h){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&i(n,l,f,h)||(n.tag!==22||n.memoizedState===null)&&(r||n.tag!==5&&n.tag!==27)&&p(n.child,r,i,l,f,h))return!0;n=n.sibling}return!1}function x(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var r=!1;for(n=n.return;n!==null&&(n.tag===4&&(r=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return r}function w(n){var r=[null,null],i=x(n);return i===null||E(r,n,i.child,{foundSelf:!1}),r}function E(n,r,i,l){for(;i!==null;){if(i===r)l.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(l.foundSelf)return n[1]=i,!0;n[0]=i}else if((i.tag!==22||i.memoizedState===null)&&E(n,r,i.child,l))return!0;i=i.sibling}return!1}function R(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(o(559))}}var C=null,j=null;function O(n,r,i){return n===i?!0:n===r?(C=n,!0):!1}function k(n,r,i){return n===i?(j=n,!1):n===r?(j!==null&&(C=n),!0):!1}function D(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function P(n,r,i){for(var l=0,f=n;f;f=i(f))l++;f=0;for(var h=r;h;h=i(h))f++;for(;0<l-f;)n=i(n),l--;for(;0<f-l;)r=i(r),f--;for(;l--;){if(n===r||r!==null&&n===r.alternate)return n;n=i(n),r=i(r)}return null}var L=Object.assign,_=Symbol.for("react.element"),V=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),G=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),F=Symbol.for("react.legacy_hidden"),oe=Symbol.for("react.memo_cache_sentinel"),N=Symbol.for("react.view_transition"),z=Symbol.for("react.recoverable"),Z=Symbol.iterator;function te(n){return n===null||typeof n!="object"?null:(n=Z&&n[Z]||n["@@iterator"],typeof n=="function"?n:null)}var ue=Symbol.for("react.client.reference");function W(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ue?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case X:return"Fragment";case q:return"Profiler";case Y:return"StrictMode";case K:return"Suspense";case B:return"SuspenseList";case J:return"Activity";case N:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case I:return"Portal";case G:return n.displayName||"Context";case $:return(n._context.displayName||"Context")+".Consumer";case H:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A:return r=n.displayName||null,r!==null?r:W(n.type)||"Memo";case U:r=n._payload,n=n._init;try{return W(n(r))}catch{}}return null}var be=Array.isArray,de=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},pe=[],we=-1;function Oe(n){return{current:n}}function ke(n){0>we||(n.current=pe[we],pe[we]=null,we--)}function Pe(n,r){we++,pe[we]=n.current,n.current=r}var Te=Oe(null),He=Oe(null),se=Oe(null),ye=Oe(null);function Ae(n,r){switch(Pe(se,r),Pe(He,n),Pe(Te,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?TS(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=TS(r),n=RS(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ke(Te),Pe(Te,n)}function Be(){ke(Te),ke(He),ke(se)}function ae(n){var r=n.memoizedState;r!==null&&(yl._currentValue=r.memoizedState,Pe(ye,n)),r=Te.current;var i=RS(r,n.type);r!==i&&(Pe(He,n),Pe(Te,i))}function ve(n){He.current===n&&(ke(Te),ke(He)),ye.current===n&&(ke(ye),yl._currentValue=xe)}var ze,_e;function Re(n){if(ze===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);ze=r&&r[1]||"",_e=-1<i.stack.indexOf(`
|
|
99
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
100
|
+
`+ze+n+_e}var Ge=!1;function Ye(n,r){if(!n||Ge)return"";Ge=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch($e){var ie=$e}Reflect.construct(n,[],Ee)}else{try{Ee.call()}catch($e){ie=$e}Ee=!1;try{var he=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Ee=!0,new n}finally{Ee&&(he!==void 0?Object.defineProperty(n.prototype,"props",he):delete n.prototype.props)}}}else{try{throw Error()}catch($e){ie=$e}(Ee=n())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch($e){if($e&&ie&&typeof $e.stack=="string")return[$e.stack,ie.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),T=h[0],M=h[1];if(T&&M){var Q=T.split(`
|
|
101
|
+
`),ce=M.split(`
|
|
102
|
+
`);for(f=l=0;l<Q.length&&!Q[l].includes("DetermineComponentFrameRoot");)l++;for(;f<ce.length&&!ce[f].includes("DetermineComponentFrameRoot");)f++;if(l===Q.length||f===ce.length)for(l=Q.length-1,f=ce.length-1;1<=l&&0<=f&&Q[l]!==ce[f];)f--;for(;1<=l&&0<=f;l--,f--)if(Q[l]!==ce[f]){if(l!==1||f!==1)do if(l--,f--,0>f||Q[l]!==ce[f]){var ge=`
|
|
103
|
+
`+Q[l].replace(" at new "," at ");return n.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",n.displayName)),ge}while(1<=l&&0<=f);break}}}finally{Ge=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?Re(i):""}function mt(n,r){switch(n.tag){case 26:case 27:case 5:return Re(n.type);case 16:return Re("Lazy");case 13:return n.child!==r&&r!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Ye(n.type,!1);case 11:return Ye(n.type.render,!1);case 1:return Ye(n.type,!0);case 31:return Re("Activity");case 30:return Re("ViewTransition");default:return""}}function nt(n){try{var r="",i=null;do r+=mt(n,i),i=n,n=n.return;while(n);return r}catch(l){return`
|
|
104
|
+
Error generating stack: `+l.message+`
|
|
105
|
+
`+l.stack}}var ut=Object.prototype.hasOwnProperty,Rt=e.unstable_scheduleCallback,At=e.unstable_cancelCallback,it=e.unstable_shouldYield,qe=e.unstable_requestPaint,at=e.unstable_now,Nt=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,Gt=e.unstable_UserBlockingPriority,Bt=e.unstable_NormalPriority,Ft=e.unstable_LowPriority,sn=e.unstable_IdlePriority,rt=e.log,Dt=e.unstable_setDisableYieldValue,je=null,ee=null;function Le(n){if(typeof rt=="function"&&Dt(n),ee&&typeof ee.setStrictMode=="function")try{ee.setStrictMode(je,n)}catch{}}var Ce=Math.clz32?Math.clz32:pt,et=Math.log,Ze=Math.LN2;function pt(n){return n>>>=0,n===0?32:31-(et(n)/Ze|0)|0}var Ct=256,un=262144,kn=4194304;function hn(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Xn(n,r,i){var l=n.pendingLanes;if(l===0)return 0;var f=0,h=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var M=l&134217727;return M!==0?(l=M&~h,l!==0?f=hn(l):(T&=M,T!==0?f=hn(T):i||(i=M&~n,i!==0&&(f=hn(i))))):(M=l&~h,M!==0?f=hn(M):T!==0?f=hn(T):i||(i=l&~n,i!==0&&(f=hn(i)))),f===0?0:r!==0&&r!==f&&(r&h)===0&&(h=f&-f,i=r&-r,h>=i||h===32&&(i&4194048)!==0)?r:f}function Vn(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function jo(n,r){(r&8)!==0&&(r|=r&32);var i=n.entangledLanes;if(i!==0)for(n=n.entanglements,i&=r;0<i;){var l=31-Ce(i),f=1<<l;r|=n[l],i&=~f}return r}function ki(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 bc(){var n=kn;return kn<<=1,(kn&62914560)===0&&(kn=4194304),n}function Aa(n){for(var r=[],i=0;31>i;i++)r.push(n);return r}function Oo(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Sd(n,r,i,l,f,h){var T=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var M=n.entanglements,Q=n.expirationTimes,ce=n.hiddenUpdates;for(i=T&~i;0<i;){var ge=31-Ce(i),Ee=1<<ge;M[ge]=0,Q[ge]=-1;var ie=ce[ge];if(ie!==null)for(ce[ge]=null,ge=0;ge<ie.length;ge++){var he=ie[ge];he!==null&&(he.lane&=-536870913)}i&=~Ee}l!==0&&yc(n,l,0),h!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=h&~(T&~r))}function yc(n,r,i){n.pendingLanes|=r,n.suspendedLanes&=~r;var l=31-Ce(r);n.entangledLanes|=r,n.entanglements[l]=n.entanglements[l]|1073741824|i&261930}function Ed(n,r){var i=n.entangledLanes|=r;for(n=n.entanglements;i;){var l=31-Ce(i),f=1<<l;f&r|n[l]&r&&(n[l]|=r),i&=~f}}function Td(n,r){var i=r&-r;return i=(i&42)!==0?1:Wh(i),(i&(n.suspendedLanes|r))!==0?0:i}function Wh(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ep(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function t0(){var n=fe.p;return n!==0?n:(n=window.event,n===void 0?32:lE(n.type))}function n0(n,r){var i=fe.p;try{return fe.p=n,r()}finally{fe.p=i}}var $s=Math.random().toString(36).slice(2),Jn="__reactFiber$"+$s,Sr="__reactProps$"+$s,Ma="__reactContainer$"+$s,r0="__reactEvents$"+$s,Xk="__reactListeners$"+$s,Jk="__reactHandles$"+$s,s0="__reactResources$"+$s,xc="__reactMarker$"+$s,Rd="__reactLoad$"+$s;function Cd(n){delete n[Jn],delete n[Sr],delete n[Xk],delete n[Jk]}function _i(n){var r;if(r=n[Jn])return r;for(var i=n.parentNode;i;){if(r=i[Ma]||i[Jn]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(n=FS(n);n!==null;){if(i=n[Jn])return i;n=FS(n)}return r}n=i,i=n.parentNode}return null}function za(n){if(n=n[Jn]||n[Ma]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function wc(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(o(33))}function Da(n){var r=n[s0];return r||(r=n[s0]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function qn(n){n[xc]=!0}function o0(n){n[Rd]=void 0}var i0=new Set,a0={};function Ai(n,r){Ia(n,r),Ia(n+"Capture",r)}function Ia(n,r){for(a0[n]=r,n=0;n<r.length;n++)i0.add(r[n])}var Wk=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]*$"),l0={},c0={};function e_(n){return ut.call(c0,n)?!0:ut.call(l0,n)?!1:Wk.test(n)?c0[n]=!0:(l0[n]=!0,!1)}var Vt=!1;function u0(){var n=Vt;return Vt=!1,n}function Nd(n,r,i){if(e_(r))if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,i)}}function jd(n,r,i){if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,i)}}function Zs(n,r,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(r,i,l)}}function _r(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function d0(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function t_(n,r,i){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return f.call(this)},set:function(T){i=""+T,h.call(this,T)}}),Object.defineProperty(n,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function tp(n){if(!n._valueTracker){var r=d0(n)?"checked":"value";n._valueTracker=t_(n,r,""+n[r])}}function f0(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return n&&(l=d0(n)?n.checked?"true":"false":n.value),n=l,n!==i?(r.setValue(n),!0):!1}var n_=/[\n"\\]/g;function $r(n){return n.replace(n_,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function np(n,r,i,l,f,h,T,M){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),r!=null?T==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+_r(r)):n.value!==""+_r(r)&&(n.value=""+_r(r)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),r!=null?T==="number"&&n.value==r?rp(n,_r(n.value)):rp(n,_r(r)):i!=null?rp(n,_r(i)):l!=null&&n.removeAttribute("value"),f==null&&h!=null&&(n.defaultChecked=!!h),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?n.name=""+_r(M):n.removeAttribute("name")}function m0(n,r,i,l,f,h,T,M){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(n.type=h),r!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||r!=null)){tp(n);return}i=i!=null?""+_r(i):"",r=r!=null?""+_r(r):i,M||r===n.value||(n.value=r),n.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=M?n.checked:!!l,n.defaultChecked=!!l,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),tp(n)}function rp(n,r){n.defaultValue!==""+r&&(n.defaultValue=""+r)}function Pa(n,r,i,l){if(n=n.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<n.length;i++)f=r.hasOwnProperty("$"+n[i].value),n[i].selected!==f&&(n[i].selected=f),f&&l&&(n[i].defaultSelected=!0)}else{for(i=""+_r(i),r=null,f=0;f<n.length;f++){if(n[f].value===i){n[f].selected=!0,l&&(n[f].defaultSelected=!0);return}r!==null||n[f].disabled||(r=n[f])}r!==null&&(r.selected=!0)}}function h0(n,r,i){if(r!=null&&(r=""+_r(r),r!==n.value&&(n.value=r),i==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=i!=null?""+_r(i):""}function p0(n,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(o(92));if(be(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),r=i}i=_r(r),n.defaultValue=i,l=n.textContent,l===i&&l!==""&&l!==null&&(n.value=l),tp(n)}function La(n,r){if(r){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=r;return}}n.textContent=r}var r_=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 g0(n,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":l?n.setProperty(r,i):typeof i!="number"||i===0||r_.has(r)?r==="float"?n.cssFloat=i:n[r]=(""+i).trim():n[r]=i+"px"}function v0(n,r,i){if(r!=null&&typeof r!="object")throw Error(o(62));if(n=n.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="",Vt=!0);for(var f in r)l=r[f],r.hasOwnProperty(f)&&i[f]!==l&&(g0(n,f,l),Vt=!0)}else for(var h in r)r.hasOwnProperty(h)&&g0(n,h,r[h])}function sp(n){if(n.indexOf("-")===-1)return!1;switch(n){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 s_=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"],["maskType","mask-type"],["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"]]),o_=/^[\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 Od(n){return o_.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ys(){}var op=null;function ip(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ua=null,Ba=null;function b0(n){var r=za(n);if(r&&(n=r.stateNode)){var i=n[Sr]||null;e:switch(n=r.stateNode,r.type){case"input":if(np(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+$r(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==n&&l.form===n.form){var f=l[Sr]||null;if(!f)throw Error(o(90));np(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===n.form&&f0(l)}break e;case"textarea":h0(n,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&Pa(n,!!i.multiple,r,!1)}}}var ap=!1;function y0(n,r,i){if(ap)return n(r,i);ap=!0;try{var l=n(r);return l}finally{if(ap=!1,(Ua!==null||Ba!==null)&&(kf(),Ua&&(r=Ua,n=Ba,Ba=Ua=null,b0(r),n)))for(r=0;r<n.length;r++)b0(n[r])}}function Sc(n,r){var i=n.stateNode;if(i===null)return null;var l=i[Sr]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(o(231,r,typeof i));return i}var Ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lp=!1;if(Ks)try{var Ec={};Object.defineProperty(Ec,"passive",{get:function(){lp=!0}}),window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{lp=!1}var ko=null,cp=null,kd=null;function x0(){if(kd)return kd;var n,r=cp,i=r.length,l,f="value"in ko?ko.value:ko.textContent,h=f.length;for(n=0;n<i&&r[n]===f[n];n++);var T=i-n;for(l=1;l<=T&&r[i-l]===f[h-l];l++);return kd=f.slice(n,1<l?1-l:void 0)}function _d(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Ad(){return!0}function w0(){return!1}function mr(n){function r(i,l,f,h,T){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=T,this.currentTarget=null;for(var M in n)n.hasOwnProperty(M)&&(i=n[M],this[M]=i?i(h):h[M]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ad:w0,this.isPropagationStopped=w0,this}return L(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ad)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ad)},persist:function(){},isPersistent:Ad}),r}var _o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Md=mr(_o),Tc=L({},_o,{view:0,detail:0}),i_=mr(Tc),up,dp,Rc,zd=L({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mp,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Rc&&(Rc&&n.type==="mousemove"?(up=n.screenX-Rc.screenX,dp=n.screenY-Rc.screenY):dp=up=0,Rc=n),up)},movementY:function(n){return"movementY"in n?n.movementY:dp}}),S0=mr(zd),a_=L({},zd,{dataTransfer:0}),l_=mr(a_),c_=L({},Tc,{relatedTarget:0}),fp=mr(c_),u_=L({},_o,{animationName:0,elapsedTime:0,pseudoElement:0}),d_=mr(u_),f_=L({},_o,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),m_=mr(f_),h_=L({},_o,{data:0}),E0=mr(h_),p_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},g_={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"},v_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b_(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=v_[n])?!!r[n]:!1}function mp(){return b_}var y_=L({},Tc,{key:function(n){if(n.key){var r=p_[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=_d(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?g_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mp,charCode:function(n){return n.type==="keypress"?_d(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_d(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),x_=mr(y_),w_=L({},zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),T0=mr(w_),S_=L({},_o,{submitter:0}),E_=mr(S_),T_=L({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mp}),R_=mr(T_),C_=L({},_o,{propertyName:0,elapsedTime:0,pseudoElement:0}),N_=mr(C_),j_=L({},zd,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),O_=mr(j_),k_=L({},_o,{newState:0,oldState:0,source:0}),__=mr(k_),A_=[9,13,27,32],hp=Ks&&"CompositionEvent"in window,Cc=null;Ks&&"documentMode"in document&&(Cc=document.documentMode);var M_=Ks&&"TextEvent"in window&&!Cc,R0=Ks&&(!hp||Cc&&8<Cc&&11>=Cc),C0=" ",N0=!1;function j0(n,r){switch(n){case"keyup":return A_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O0(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ha=!1;function z_(n,r){switch(n){case"compositionend":return O0(r);case"keypress":return r.which!==32?null:(N0=!0,C0);case"textInput":return n=r.data,n===C0&&N0?null:n;default:return null}}function D_(n,r){if(Ha)return n==="compositionend"||!hp&&j0(n,r)?(n=x0(),kd=cp=ko=null,Ha=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return R0&&r.locale!=="ko"?null:r.data;default:return null}}var I_={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 k0(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!I_[n.type]:r==="textarea"}function _0(n,r,i,l){Ua?Ba?Ba.push(l):Ba=[l]:Ua=l,r=If(r,"onChange"),0<r.length&&(i=new Md("onChange","change",null,i,l),n.push({event:i,listeners:r}))}var Nc=null,jc=null;function P_(n){bS(n,0)}function Dd(n){var r=wc(n);if(f0(r))return n}function A0(n,r){if(n==="change")return r}var M0=!1;if(Ks){var pp;if(Ks){var gp="oninput"in document;if(!gp){var z0=document.createElement("div");z0.setAttribute("oninput","return;"),gp=typeof z0.oninput=="function"}pp=gp}else pp=!1;M0=pp&&(!document.documentMode||9<document.documentMode)}function D0(){Nc&&(Nc.detachEvent("onpropertychange",I0),jc=Nc=null)}function I0(n){if(n.propertyName==="value"&&Dd(jc)){var r=[];_0(r,jc,n,ip(n)),y0(P_,r)}}function L_(n,r,i){n==="focusin"?(D0(),Nc=r,jc=i,Nc.attachEvent("onpropertychange",I0)):n==="focusout"&&D0()}function U_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Dd(jc)}function B_(n,r){if(n==="click")return Dd(r)}function H_(n,r){if(n==="input"||n==="change")return Dd(r)}function F_(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Ar=typeof Object.is=="function"?Object.is:F_;function Oc(n,r){if(Ar(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!ut.call(r,f)||!Ar(n[f],r[f]))return!1}return!0}function vp(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function P0(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function L0(n,r){var i=P0(n);n=0;for(var l;i;){if(i.nodeType===3){if(l=n+i.textContent.length,n<=r&&l>=r)return{node:i,offset:r-n};n=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=P0(i)}}function U0(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?U0(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function B0(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=vp(n.document);r instanceof n.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)n=r.contentWindow;else break;r=vp(n.document)}return r}function bp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var V_=Ks&&"documentMode"in document&&11>=document.documentMode,Fa=null,yp=null,kc=null,xp=!1;function H0(n,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;xp||Fa==null||Fa!==vp(l)||(l=Fa,"selectionStart"in l&&bp(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),kc&&Oc(kc,l)||(kc=l,l=If(yp,"onSelect"),0<l.length&&(r=new Md("onSelect","select",null,r,i),n.push({event:r,listeners:l}),r.target=Fa)))}function Mi(n,r){var i={};return i[n.toLowerCase()]=r.toLowerCase(),i["Webkit"+n]="webkit"+r,i["Moz"+n]="moz"+r,i}var Va={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},wp={},F0={};Ks&&(F0=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function zi(n){if(wp[n])return wp[n];if(!Va[n])return n;var r=Va[n],i;for(i in r)if(r.hasOwnProperty(i)&&i in F0)return wp[n]=r[i];return n}var V0=zi("animationend"),q0=zi("animationiteration"),$0=zi("animationstart"),q_=zi("transitionrun"),$_=zi("transitionstart"),Z_=zi("transitioncancel"),Z0=zi("transitionend"),K0=new Map,Sp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Sp.push("scrollEnd");function os(n,r){K0.set(n,r),Ai(r,[n])}var K_=0;function Ys(n,r){if(n.name!=null&&n.name!=="auto")return n.name;if(r.autoName!==null)return r.autoName;n=cs.identifierPrefix;var i=K_++;return n="_"+n+"t_"+i.toString(32)+"_",r.autoName=n}function Y0(n){if(n==null||typeof n=="string")return n;var r=null,i=cl;if(i!==null)for(var l=0;l<i.length;l++){var f=n[i[l]];if(f!=null){if(f==="none")return"none";r=r==null?f:r+(" "+f)}}return r??n.default}function Gs(n,r){return n=Y0(n),r=Y0(r),r==null?n==="auto"?null:n:r==="auto"?null:r}var Id=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Zr=[],qa=0,Ep=0;function Pd(){for(var n=qa,r=Ep=qa=0;r<n;){var i=Zr[r];Zr[r++]=null;var l=Zr[r];Zr[r++]=null;var f=Zr[r];Zr[r++]=null;var h=Zr[r];if(Zr[r++]=null,l!==null&&f!==null){var T=l.pending;T===null?f.next=f:(f.next=T.next,T.next=f),l.pending=f}h!==0&&G0(i,f,h)}}function Ld(n,r,i,l){Zr[qa++]=n,Zr[qa++]=r,Zr[qa++]=i,Zr[qa++]=l,Ep|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function Tp(n,r,i,l){return Ld(n,r,i,l),Ud(n)}function Di(n,r){return Ld(n,null,null,r),Ud(n)}function G0(n,r,i){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i);for(var f=!1,h=n.return;h!==null;)h.childLanes|=i,l=h.alternate,l!==null&&(l.childLanes|=i),h.tag===22&&(n=h.stateNode,n===null||n._visibility&1||(f=!0)),n=h,h=h.return;return n.tag===3?(h=n.stateNode,f&&r!==null&&(f=31-Ce(i),n=h.hiddenUpdates,l=n[f],l===null?n[f]=[r]:l.push(r),r.lane=i|536870912),h):null}function Ud(n){if(50<Jc)throw Jc=0,Of=null,Error(o(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var $a={};function Y_(n,r,i,l){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(n,r,i,l){return new Y_(n,r,i,l)}function Rp(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Qs(n,r){var i=n.alternate;return i===null?(i=Er(n.tag,r,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=r,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&1206910976,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,r=n.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Q0(n,r){n.flags&=1206910978;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,r=i.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Bd(n,r,i,l,f,h){var T=0;if(l=n,typeof l=="function")Rp(l)&&(T=1);else if(typeof l=="string")T=SM(n,i,Te.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case J:return n=Er(31,i,r,f),n.elementType=J,n.lanes=h,n;case X:return Ii(i.children,f,h,r);case Y:T=8,f|=24;break;case q:return n=Er(12,i,r,f|2),n.elementType=q,n.lanes=h,n;case K:return n=Er(13,i,r,f),n.elementType=K,n.lanes=h,n;case B:return n=Er(19,i,r,f),n.elementType=B,n.lanes=h,n;case F:case N:return n=f|32,n=Er(30,i,r,n),n.elementType=N,n.lanes=h,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case G:T=10;break e;case $:T=9;break e;case H:T=11;break e;case A:T=14;break e;case U:T=16,l=null;break e}T=29,i=Error(o(130,n===null?"null":typeof n,"")),l=null}return r=Er(T,i,r,f),r.elementType=n,r.type=l,r.lanes=h,r}function Ii(n,r,i,l){return n=Er(7,n,l,r),n.lanes=i,n}function Cp(n,r,i){return n=Er(6,n,null,r),n.lanes=i,n}function X0(n){var r=Er(18,null,null,0);return r.stateNode=n,r}function Np(n,r,i){return r=Er(4,n.children!==null?n.children:[],n.key,r),r.lanes=i,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var J0=new WeakMap;function Kr(n,r){if(typeof n=="object"&&n!==null){var i=J0.get(n);return i!==void 0?i:(r={value:n,source:r,stack:nt(r)},J0.set(n,r),r)}return{value:n,source:r,stack:nt(r)}}var Za=[],Ka=0,Hd=null,_c=0,Yr=[],Gr=0,Ao=null,xs=1,ws="";function Xs(n,r){Za[Ka++]=_c,Za[Ka++]=Hd,Hd=n,_c=r}function W0(n,r,i){Yr[Gr++]=xs,Yr[Gr++]=ws,Yr[Gr++]=Ao,Ao=n;var l=xs;n=ws;var f=32-Ce(l)-1;l&=~(1<<f),i+=1;var h=32-Ce(r)+f;if(30<h){var T=f-f%5;h=(l&(1<<T)-1).toString(32),l>>=T,f-=T,xs=1<<32-Ce(r)+f|i<<f|l,ws=h+n}else xs=1<<h|i<<f|l,ws=n}function Fd(n){n.return!==null&&(Xs(n,1),W0(n,1,0))}function jp(n){for(;n===Hd;)Hd=Za[--Ka],Za[Ka]=null,_c=Za[--Ka],Za[Ka]=null;for(;n===Ao;)Ao=Yr[--Gr],Yr[Gr]=null,ws=Yr[--Gr],Yr[Gr]=null,xs=Yr[--Gr],Yr[Gr]=null}function ew(n,r){Yr[Gr++]=xs,Yr[Gr++]=ws,Yr[Gr++]=Ao,xs=r.id,ws=r.overflow,Ao=n}var $n=null,an=null,jt=!1,Mo=null,Qr=!1,Op=Error(o(519));function zo(n){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ac(Kr(r,n)),Op}function tw(n){var r=n.stateNode,i=n.type,l=n.memoizedProps;switch(r[Jn]=n,r[Sr]=l,i){case"dialog":zt("cancel",r),zt("close",r);break;case"iframe":case"object":case"embed":zt("load",r);break;case"video":case"audio":for(i=0;i<eu.length;i++)zt(eu[i],r);break;case"source":zt("error",r);break;case"img":case"image":case"link":zt("error",r),zt("load",r);break;case"details":zt("toggle",r);break;case"input":zt("invalid",r),m0(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":zt("invalid",r);break;case"textarea":zt("invalid",r),p0(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||SS(r.textContent,i)?(l.popover!=null&&(zt("beforetoggle",r),zt("toggle",r)),l.onScroll!=null&&zt("scroll",r),l.onScrollEnd!=null&&zt("scrollend",r),l.onClick!=null&&(r.onclick=ys),r=!0):r=!1,r||zo(n,!0)}function Vd(n){for($n=n.return;$n;)switch($n.tag){case 5:case 31:case 13:Qr=!1;return;case 27:case 3:Qr=!0;return;default:$n=$n.return}}function Ya(n){if(n!==$n)return!1;if(!jt)return Vd(n),jt=!0,!1;var r=n.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||ov(n.type,n.memoizedProps)),i=!i),i&&an&&zo(n),Vd(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));an=HS(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));an=HS(n)}else r===27?(r=an,Qo(n.type)?(n=hv,hv=null,an=n):an=r):an=$n?Jr(n.stateNode.nextSibling):null;return!0}function Pi(){an=$n=null,jt=!1}function kp(){var n=Mo;return n!==null&&(Cr===null?Cr=n:Cr.push.apply(Cr,n),Mo=null),n}function Ac(n){Mo===null?Mo=[n]:Mo.push(n)}var _p=Oe(null),Li=null,Js=null;function Do(n,r,i){Pe(_p,r._currentValue),r._currentValue=i}function Ws(n){n._currentValue=_p.current,ke(_p)}function qd(n,r,i){for(;n!==null;){var l=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),n===i)break;n=n.return}}function Ap(n,r,i,l){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var h=f.dependencies;if(h!==null){var T=f.child;h=h.firstContext;e:for(;h!==null;){var M=h;h=f;for(var Q=0;Q<r.length;Q++)if(M.context===r[Q]){h.lanes|=i,M=h.alternate,M!==null&&(M.lanes|=i),qd(h.return,i,n),l||(T=null);break e}h=M.next}}else if(f.tag===18){if(T=f.return,T===null)throw Error(o(341));T.lanes|=i,h=T.alternate,h!==null&&(h.lanes|=i),qd(T,i,n),T=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=i,T=f.alternate,T!==null&&(T.lanes|=i),qd(f.return,i,n),T=f.child,T=T!==null?T.sibling:null):T=f.child;if(T!==null)T.return=f;else for(T=f;T!==null;){if(T===n){T=null;break}if(f=T.sibling,f!==null){f.return=T.return,T=f;break}T=T.return}f=T}}function Ui(n,r,i,l){n=null;for(var f=r,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var T=f.alternate;if(T===null)throw Error(o(387));if(T=T.memoizedProps,T!==null){var M=f.type;Ar(f.pendingProps.value,T.value)||(n!==null?n.push(M):n=[M])}}else if(f===ye.current){if(T=f.alternate,T===null)throw Error(o(387));T.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(yl):n=[yl])}f=f.return}return n!==null&&Ap(r,n,i,l),r.flags|=262144,n!==null}function $d(n){for(n=n.firstContext;n!==null;){if(!Ar(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Bi(n){Li=n,Js=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Wn(n){return nw(Li,n)}function Zd(n,r){return Li===null&&Bi(n),nw(n,r)}function nw(n,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},Js===null){if(n===null)throw Error(o(308));Js=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Js=Js.next=r;return i}var G_=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(i,l){n.push(l)}};this.abort=function(){r.aborted=!0,n.forEach(function(i){return i()})}},Q_=e.unstable_scheduleCallback,X_=e.unstable_NormalPriority,_n={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mp(){return{controller:new G_,data:new Map,refCount:0}}function Mc(n){n.refCount--,n.refCount===0&&Q_(X_,function(){n.controller.abort()})}function rw(n,r){if((n.pendingLanes&4194048)!==0){var i=n.transitionTypes;for(i===null&&(i=n.transitionTypes=[]),n=0;n<r.length;n++){var l=r[n];i.indexOf(l)===-1&&i.push(l)}}}var zc=null;function J_(n){var r=n.transitionTypes;return n.transitionTypes=null,r}var Dc=null,zp=0,Hi=0,Ga=null;function W_(n,r){if(Dc===null){var i=Dc=[];zp=0,Hi=Qg(),Ga={status:"pending",value:void 0,then:function(l){i.push(l)}}}return zp++,r.then(sw,sw),r}function sw(){if(--zp===0&&(zc=null,Dc!==null)){Ga!==null&&(Ga.status="fulfilled");var n=Dc;Dc=null,Hi=0,Ga=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function eA(n,r){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return n.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<i.length;f++)(0,i[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var ow=de.S;de.S=function(n,r){if(X1=at(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&W_(n,r),zc!==null)for(var i=ml;i!==null;)rw(i,zc),i=i.next;if(i=n.types,i!==null){for(var l=ml;l!==null;)rw(l,i),l=l.next;if(Hi!==0){l=zc,l===null&&(l=zc=[]);for(var f=0;f<i.length;f++){var h=i[f];l.indexOf(h)===-1&&l.push(h)}}}ow!==null&&ow(n,r)};var Fi=Oe(null);function Dp(){var n=Fi.current;return n!==null?n:on.pooledCache}function Kd(n,r){r===null?Pe(Fi,Fi.current):Pe(Fi,r.pool)}function iw(){var n=Dp();return n===null?null:{parent:_n._currentValue,pool:n}}var Qa=Error(o(460)),Ip=Error(o(474)),Yd=Error(o(542)),Gd={then:function(){}};function aw(n){return n=n.status,n==="fulfilled"||n==="rejected"}function lw(n,r,i){switch(i=n[i],i===void 0?n.push(r):i!==r&&(r.then(ys,ys),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,uw(n),n===void 0&&!("reason"in r)?Error(o(600)):n;default:if(typeof r.status=="string")r.then(ys,ys);else{if(n=on,n!==null&&100<n.shellSuspendCounter)throw Error(o(482));n=r,n.status="pending",n.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,uw(n),n}throw qi=r,Qa}}function Vi(n){try{var r=n._init;return r(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(qi=i,Qa):i}}var qi=null;function cw(){if(qi===null)throw Error(o(459));var n=qi;return qi=null,n}function uw(n){if(n===Qa||n===Yd)throw Error(o(483))}var Xa=null,Ic=0;function Qd(n){var r=Ic;return Ic+=1,Xa===null&&(Xa=[]),lw(Xa,n,r)}function Io(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Xd(n,r){throw r.$$typeof===_?Error(o(525)):(n=Object.prototype.toString.call(r),Error(o(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function dw(n){function r(le,re){if(n){var me=le.deletions;me===null?(le.deletions=[re],le.flags|=16):me.push(re)}}function i(le,re){if(!n)return null;for(;re!==null;)r(le,re),re=re.sibling;return null}function l(le){for(var re=new Map;le!==null;)le.key===null?re.set(le.index,le):re.set(le.key,le),le=le.sibling;return re}function f(le,re){return le=Qs(le,re),le.index=0,le.sibling=null,le}function h(le,re,me){return le.index=me,n?(me=le.alternate,me!==null?(me=me.index,me<re?(le.flags|=2,re):me):(le.flags|=134217730,re)):(le.flags|=1048576,re)}function T(le){return n&&le.alternate===null&&(le.flags|=134217730),le}function M(le,re,me,Se){return re===null||re.tag!==6?(re=Cp(me,le.mode,Se),re.return=le,re):(re=f(re,me),re.return=le,re)}function Q(le,re,me,Se){var Je=me.type;return Je===X?(le=ge(le,re,me.props.children,Se,me.key),Io(le,me),le):re!==null&&(re.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===U&&Vi(Je)===re.type)?(re=f(re,me.props),Io(re,me),re.return=le,re):(re=Bd(me.type,me.key,me.props,null,le.mode,Se),Io(re,me),re.return=le,re)}function ce(le,re,me,Se){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=Np(me,le.mode,Se),re.return=le,re):(re=f(re,me.children||[]),re.return=le,re)}function ge(le,re,me,Se,Je){return re===null||re.tag!==7?(re=Ii(me,le.mode,Se,Je),re.return=le,re):(re=f(re,me),re.return=le,re)}function Ee(le,re,me){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Cp(""+re,le.mode,me),re.return=le,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case V:return me=Bd(re.type,re.key,re.props,null,le.mode,me),Io(me,re),me.return=le,me;case I:return re=Np(re,le.mode,me),re.return=le,re;case U:return re=Vi(re),Ee(le,re,me)}if(be(re)||te(re))return re=Ii(re,le.mode,me,null),re.return=le,re;if(typeof re.then=="function")return Ee(le,Qd(re),me);if(re.$$typeof===G)return Ee(le,Zd(le,re),me);Xd(le,re)}return null}function ie(le,re,me,Se){var Je=re!==null?re.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return Je!==null?null:M(le,re,""+me,Se);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case V:return me.key===Je?Q(le,re,me,Se):null;case I:return me.key===Je?ce(le,re,me,Se):null;case U:return me=Vi(me),ie(le,re,me,Se)}if(be(me)||te(me))return Je!==null?null:ge(le,re,me,Se,null);if(typeof me.then=="function")return ie(le,re,Qd(me),Se);if(me.$$typeof===G)return ie(le,re,Zd(le,me),Se);Xd(le,me)}return null}function he(le,re,me,Se,Je){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(me)||null,M(re,le,""+Se,Je);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case V:return le=le.get(Se.key===null?me:Se.key)||null,Q(re,le,Se,Je);case I:return le=le.get(Se.key===null?me:Se.key)||null,ce(re,le,Se,Je);case U:return Se=Vi(Se),he(le,re,me,Se,Je)}if(be(Se)||te(Se))return le=le.get(me)||null,ge(re,le,Se,Je,null);if(typeof Se.then=="function")return he(le,re,me,Qd(Se),Je);if(Se.$$typeof===G)return he(le,re,me,Zd(re,Se),Je);Xd(re,Se)}return null}function $e(le,re,me,Se){for(var Je=null,Pt=null,lt=re,gt=re=0,zn=null;lt!==null&><me.length;gt++){lt.index>gt?(zn=lt,lt=null):zn=lt.sibling;var Ht=ie(le,lt,me[gt],Se);if(Ht===null){lt===null&&(lt=zn);break}n&<&&Ht.alternate===null&&r(le,lt),re=h(Ht,re,gt),Pt===null?Je=Ht:Pt.sibling=Ht,Pt=Ht,lt=zn}if(gt===me.length)return i(le,lt),jt&&Xs(le,gt),Je;if(lt===null){for(;gt<me.length;gt++)lt=Ee(le,me[gt],Se),lt!==null&&(re=h(lt,re,gt),Pt===null?Je=lt:Pt.sibling=lt,Pt=lt);return jt&&Xs(le,gt),Je}for(lt=l(lt);gt<me.length;gt++)zn=he(lt,le,gt,me[gt],Se),zn!==null&&(n&&(Ht=zn.alternate,Ht!==null&<.delete(Ht.key===null?gt:Ht.key)),re=h(zn,re,gt),Pt===null?Je=zn:Pt.sibling=zn,Pt=zn);return n&<.forEach(function(ti){return r(le,ti)}),jt&&Xs(le,gt),Je}function st(le,re,me,Se){if(me==null)throw Error(o(151));for(var Je=null,Pt=null,lt=re,gt=re=0,zn=null,Ht=me.next();lt!==null&&!Ht.done;gt++,Ht=me.next()){lt.index>gt?(zn=lt,lt=null):zn=lt.sibling;var ti=ie(le,lt,Ht.value,Se);if(ti===null){lt===null&&(lt=zn);break}n&<&&ti.alternate===null&&r(le,lt),re=h(ti,re,gt),Pt===null?Je=ti:Pt.sibling=ti,Pt=ti,lt=zn}if(Ht.done)return i(le,lt),jt&&Xs(le,gt),Je;if(lt===null){for(;!Ht.done;gt++,Ht=me.next())Ht=Ee(le,Ht.value,Se),Ht!==null&&(re=h(Ht,re,gt),Pt===null?Je=Ht:Pt.sibling=Ht,Pt=Ht);return jt&&Xs(le,gt),Je}for(lt=l(lt);!Ht.done;gt++,Ht=me.next())Ht=he(lt,le,gt,Ht.value,Se),Ht!==null&&(n&&(zn=Ht.alternate,zn!==null&<.delete(zn.key===null?gt:zn.key)),re=h(Ht,re,gt),Pt===null?Je=Ht:Pt.sibling=Ht,Pt=Ht);return n&<.forEach(function(zM){return r(le,zM)}),jt&&Xs(le,gt),Je}function wt(le,re,me,Se){if(typeof me=="object"&&me!==null&&me.type===X&&me.key===null&&me.props.ref===void 0&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case V:e:{for(var Je=me.key;re!==null;){if(re.key===Je){if(Je=me.type,Je===X){if(re.tag===7){i(le,re.sibling),Se=f(re,me.props.children),Io(Se,me),Se.return=le,le=Se;break e}}else if(re.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===U&&Vi(Je)===re.type){i(le,re.sibling),Se=f(re,me.props),Io(Se,me),Se.return=le,le=Se;break e}i(le,re);break}else r(le,re);re=re.sibling}me.type===X?(Se=Ii(me.props.children,le.mode,Se,me.key),Io(Se,me),Se.return=le,le=Se):(Se=Bd(me.type,me.key,me.props,null,le.mode,Se),Io(Se,me),Se.return=le,le=Se)}return T(le);case I:e:{for(Je=me.key;re!==null;){if(re.key===Je)if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){i(le,re.sibling),Se=f(re,me.children||[]),Se.return=le,le=Se;break e}else{i(le,re);break}else r(le,re);re=re.sibling}Se=Np(me,le.mode,Se),Se.return=le,le=Se}return T(le);case U:return me=Vi(me),wt(le,re,me,Se)}if(be(me))return $e(le,re,me,Se);if(te(me)){if(Je=te(me),typeof Je!="function")throw Error(o(150));return me=Je.call(me),st(le,re,me,Se)}if(typeof me.then=="function")return wt(le,re,Qd(me),Se);if(me.$$typeof===G)return wt(le,re,Zd(le,me),Se);Xd(le,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,re!==null&&re.tag===6?(i(le,re.sibling),Se=f(re,me),Se.return=le,le=Se):(i(le,re),Se=Cp(me,le.mode,Se),Se.return=le,le=Se),T(le)):i(le,re)}return function(le,re,me,Se){try{Ic=0;var Je=wt(le,re,me,Se);return Xa=null,Je}catch(lt){if(lt===Qa||lt===Yd)throw lt;var Pt=Er(29,lt,null,le.mode);return Pt.lanes=Se,Pt.return=le,Pt}finally{}}}var $i=dw(!0),fw=dw(!1),Po=!1;function Pp(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lp(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Lo(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Uo(n,r,i){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(qt&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=Ud(n),G0(n,null,i),r}return Ld(n,l,r,i),Ud(n)}function Pc(n,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Ed(n,i)}}function Up(n,r){var i=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var T={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?f=h=T:h=h.next=T,i=i.next}while(i!==null);h===null?f=h=r:h=h.next=r}else f=h=r;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=r:n.next=r,i.lastBaseUpdate=r}var Bp=!1;function Lc(){if(Bp){var n=Ga;if(n!==null)throw n}}function Uc(n,r,i,l){Bp=!1;var f=n.updateQueue;Po=!1;var h=f.firstBaseUpdate,T=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var Q=M,ce=Q.next;Q.next=null,T===null?h=ce:T.next=ce,T=Q;var ge=n.alternate;ge!==null&&(ge=ge.updateQueue,M=ge.lastBaseUpdate,M!==T&&(M===null?ge.firstBaseUpdate=ce:M.next=ce,ge.lastBaseUpdate=Q))}if(h!==null){var Ee=f.baseState;T=0,ge=ce=Q=null,M=h;do{var ie=M.lane&-536870913,he=ie!==M.lane;if(he?(It&ie)===ie:(l&ie)===ie){ie!==0&&ie===Hi&&(Bp=!0),ge!==null&&(ge=ge.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var $e=n,st=M;ie=r;var wt=i;switch(st.tag){case 1:if($e=st.payload,typeof $e=="function"){Ee=$e.call(wt,Ee,ie);break e}Ee=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=st.payload,ie=typeof $e=="function"?$e.call(wt,Ee,ie):$e,ie==null)break e;Ee=L({},Ee,ie);break e;case 2:Po=!0}}ie=M.callback,ie!==null&&(n.flags|=64,he&&(n.flags|=8192),he=f.callbacks,he===null?f.callbacks=[ie]:he.push(ie))}else he={lane:ie,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ge===null?(ce=ge=he,Q=Ee):ge=ge.next=he,T|=ie;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;he=M,M=he.next,he.next=null,f.lastBaseUpdate=he,f.shared.pending=null}}while(!0);ge===null&&(Q=Ee),f.baseState=Q,f.firstBaseUpdate=ce,f.lastBaseUpdate=ge,h===null&&(f.shared.lanes=0),Zo|=T,n.lanes=T,n.memoizedState=Ee}}function mw(n,r){if(typeof n!="function")throw Error(o(191,n));n.call(r)}function hw(n,r){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)mw(i[n],r)}var Bo=Oe(null),Jd=Oe(0);function pw(n,r){n=so,Pe(Jd,n),Pe(Bo,r),so=n|r.baseLanes}function Hp(){Pe(Jd,so),Pe(Bo,Bo.current)}function Fp(){so=Jd.current,ke(Bo),ke(Jd)}var er=Oe(null),cr=null;function Ho(n){var r=n.alternate;Pe(tr,tr.current&1),Pe(er,n),cr===null&&(r===null||Bo.current!==null||r.memoizedState!==null)&&(cr=n)}function Vp(n){Pe(tr,tr.current),Pe(er,n),cr===null&&(cr=n)}function gw(n){n.tag===22?(Pe(tr,tr.current),Pe(er,n),cr===null&&(cr=n)):Fo()}function Fo(){Pe(tr,tr.current),Pe(er,er.current)}function Mr(n){ke(er),cr===n&&(cr=null),ke(tr)}var tr=Oe(0);function Bc(n,r){Pe(er,er.current),Pe(tr,r)}function qp(n){ke(tr),ke(er),cr===n&&(cr=null)}function Wd(n){for(var r=n;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||fv(i)||mv(i)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!=="independent"){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var eo=0,xt=null,tn=null,An=null,ef=!1,Ja=!1,Zi=!1,tf=0,Hc=0,Wa=null,tA=0;function Sn(){throw Error(o(321))}function $p(n,r){if(r===null)return!1;for(var i=0;i<r.length&&i<n.length;i++)if(!Ar(n[i],r[i]))return!1;return!0}function Zp(n,r,i,l,f,h){return eo=h,xt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,de.H=n===null||n.memoizedState===null?Ww:e1,Zi=!1,h=i(l,f),Zi=!1,Ja&&(h=bw(r,i,l,f)),vw(n),h}function vw(n){de.H=cf;var r=tn!==null&&tn.next!==null;if(eo=0,An=tn=xt=null,ef=!1,Hc=0,Wa=null,r)throw Error(o(300));n===null||Mn||(n=n.dependencies,n!==null&&$d(n)&&(Mn=!0))}function bw(n,r,i,l){xt=n;var f=0;do{if(Ja&&(Wa=null),Hc=0,Ja=!1,25<=f)throw Error(o(301));if(f+=1,An=tn=null,n.updateQueue!=null){var h=n.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}de.H=cA,h=r(i,l)}while(Ja);return h}function nA(){var n=de.H,r=n.useState()[0];return r=typeof r.then=="function"?Fc(r):r,n=n.useState()[0],(tn!==null?tn.memoizedState:null)!==n&&(xt.flags|=1024),r}function Kp(){var n=tf!==0;return tf=0,n}function Yp(n,r,i){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~i}function Gp(n){if(ef){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}ef=!1}eo=0,An=tn=xt=null,Ja=!1,Hc=tf=0,Wa=null}function hr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return An===null?xt.memoizedState=An=n:An=An.next=n,An}function Tn(){if(tn===null){var n=xt.alternate;n=n!==null?n.memoizedState:null}else n=tn.next;var r=An===null?xt.memoizedState:An.next;if(r!==null)An=r,tn=n;else{if(n===null)throw xt.alternate===null?Error(o(467)):Error(o(310));tn=n,n={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},An===null?xt.memoizedState=An=n:An=An.next=n}return An}function nf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fc(n){var r=Hc;return Hc+=1,Wa===null&&(Wa=[]),n=lw(Wa,n,r),r=xt,(An===null?r.memoizedState:An.next)===null&&(r=r.alternate,de.H=r===null||r.memoizedState===null?Ww:e1),n}function rf(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Fc(n);if(n.$$typeof===z)return;if(n.$$typeof===G)return Wn(n)}throw Error(o(438,String(n)))}function Qp(n){var r=null,i=xt.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=xt.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=nf(),xt.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(n),l=0;l<n;l++)i[l]=oe;return r.index++,i}function to(n,r){return typeof r=="function"?r(n):r}function sf(n){var r=Tn();return Xp(r,tn,n)}function Xp(n,r,i){var l=n.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var f=n.baseQueue,h=l.pending;if(h!==null){if(f!==null){var T=f.next;f.next=h.next,h.next=T}r.baseQueue=f=h,l.pending=null}if(h=n.baseState,f===null)n.memoizedState=h;else{r=f.next;var M=T=null,Q=null,ce=r,ge=!1;do{var Ee=ce.lane&-536870913;if(Ee!==ce.lane?(It&Ee)===Ee:(eo&Ee)===Ee){var ie=ce.revertLane;if(ie===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),Ee===Hi&&(ge=!0);else if((eo&ie)===ie){ce=ce.next,ie===Hi&&(ge=!0);continue}else Ee={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Q===null?(M=Q=Ee,T=h):Q=Q.next=Ee,xt.lanes|=ie,Zo|=ie;Ee=ce.action,Zi&&i(h,Ee),h=ce.hasEagerState?ce.eagerState:i(h,Ee)}else ie={lane:Ee,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Q===null?(M=Q=ie,T=h):Q=Q.next=ie,xt.lanes|=Ee,Zo|=Ee;ce=ce.next}while(ce!==null&&ce!==r);if(Q===null?T=h:Q.next=M,!Ar(h,n.memoizedState)&&(Mn=!0,ge&&(i=Ga,i!==null)))throw i;n.memoizedState=h,n.baseState=T,n.baseQueue=Q,l.lastRenderedState=h}return f===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Jp(n){var r=Tn(),i=r.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=n;var l=i.dispatch,f=i.pending,h=r.memoizedState;if(f!==null){i.pending=null;var T=f=f.next;do h=n(h,T.action),T=T.next;while(T!==f);Ar(h,r.memoizedState)||(Mn=!0),r.memoizedState=h,r.baseQueue===null&&(r.baseState=h),i.lastRenderedState=h}return[h,l]}function yw(n,r,i){var l=xt,f=Tn(),h=jt;if(h){if(i===void 0)throw Error(o(407));i=i()}else i=r();var T=!Ar((tn||f).memoizedState,i);if(T&&(f.memoizedState=i,Mn=!0),f=f.queue,tg(Sw.bind(null,l,f,n),[n]),n=f.getSnapshot!==r||T||An!==null&&(An.memoizedState.tag&1)!==0,el(n?9:8,{destroy:void 0},ww.bind(null,l,f,i,r),null),n){if(l.flags|=2048,on===null)throw Error(o(349));h||(eo&127)!==0||xw(l,r,i)}return i}function xw(n,r,i){n.flags|=16384,n={getSnapshot:r,value:i},r=xt.updateQueue,r===null?(r=nf(),xt.updateQueue=r,r.stores=[n]):(i=r.stores,i===null?r.stores=[n]:i.push(n))}function ww(n,r,i,l){r.value=i,r.getSnapshot=l,Ew(r)&&Tw(n)}function Sw(n,r,i){return i(function(){Ew(r)&&Tw(n)})}function Ew(n){var r=n.getSnapshot;n=n.value;try{var i=r();return!Ar(n,i)}catch{return!0}}function Tw(n){var r=Di(n,2);r!==null&&Nr(r,n,2)}function Wp(n){var r=hr();if(typeof n=="function"){var i=n;if(n=i(),Zi){Le(!0);try{i()}finally{Le(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:n},r}function Rw(n,r,i,l){return n.baseState=i,Xp(n,tn,typeof l=="function"?l:to)}function rA(n,r,i,l,f){if(lf(n))throw Error(o(485));if(n=r.action,n!==null){var h={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){h.listeners.push(T)}};de.T!==null?i(!0):h.isTransition=!1,l(h),i=r.pending,i===null?(h.next=r.pending=h,Cw(r,h)):(h.next=i.next,r.pending=i.next=h)}}function Cw(n,r){var i=r.action,l=r.payload,f=n.state;if(r.isTransition){var h=de.T,T={};T.types=h!==null?h.types:null,de.T=T;try{var M=i(f,l),Q=de.S;Q!==null&&Q(T,M),Nw(n,r,M)}catch(ce){eg(n,r,ce)}finally{h!==null&&T.types!==null&&(h.types=T.types),de.T=h}}else try{h=i(f,l),Nw(n,r,h)}catch(ce){eg(n,r,ce)}}function Nw(n,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){jw(n,r,l)},function(l){return eg(n,r,l)}):jw(n,r,i)}function jw(n,r,i){r.status="fulfilled",r.value=i,Ow(r),n.state=i,r=n.pending,r!==null&&(i=r.next,i===r?n.pending=null:(i=i.next,r.next=i,Cw(n,i)))}function eg(n,r,i){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,Ow(r),r=r.next;while(r!==l)}n.action=null}function Ow(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function kw(n,r){return r}function _w(n,r){if(jt){var i=on.formState;if(i!==null){e:{var l=xt;if(jt){if(an){t:{for(var f=an,h=Qr;f.nodeType!==8;){if(!h){f=null;break t}if(f=Jr(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){an=Jr(f.nextSibling),l=f.data==="F!";break e}}zo(l)}l=!1}l&&(r=i[0])}}return i=hr(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kw,lastRenderedState:r},i.queue=l,i=Qw.bind(null,xt,l),l.dispatch=i,l=Wp(!1),h=ig.bind(null,xt,!1,l.queue),l=hr(),f={state:r,dispatch:null,action:n,pending:null},l.queue=f,i=rA.bind(null,xt,f,h,i),f.dispatch=i,l.memoizedState=n,[r,i,!1]}function Aw(n){var r=Tn();return Mw(r,tn,n)}function Mw(n,r,i){if(r=Xp(n,r,kw)[0],n=sf(to)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Fc(r)}catch(T){throw T===Qa?Yd:T}else l=r;r=Tn();var f=r.queue,h=f.dispatch;return i!==r.memoizedState&&(xt.flags|=2048,el(9,{destroy:void 0},sA.bind(null,f,i),null)),[l,h,n]}function sA(n,r){n.action=r}function zw(n){var r=Tn(),i=tn;if(i!==null)return Mw(r,i,n);Tn(),r=r.memoizedState,i=Tn();var l=i.queue.dispatch;return i.memoizedState=n,[r,l,!1]}function el(n,r,i,l){return n={tag:n,create:i,deps:l,inst:r,next:null},r=xt.updateQueue,r===null&&(r=nf(),xt.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=n.next=n:(l=i.next,i.next=n,n.next=l,r.lastEffect=n),n}function Dw(){return Tn().memoizedState}function of(n,r,i,l){var f=hr();xt.flags|=n,f.memoizedState=el(1|r,{destroy:void 0},i,l===void 0?null:l)}function af(n,r,i,l){var f=Tn();l=l===void 0?null:l;var h=f.memoizedState.inst;tn!==null&&l!==null&&$p(l,tn.memoizedState.deps)?f.memoizedState=el(r,h,i,l):(xt.flags|=n,f.memoizedState=el(1|r,h,i,l))}function Iw(n,r){of(8390656,8,n,r)}function tg(n,r){af(2048,8,n,r)}function oA(n){xt.flags|=4;var r=xt.updateQueue;if(r===null)r=nf(),xt.updateQueue=r,r.events=[n];else{var i=r.events;i===null?r.events=[n]:i.push(n)}}function Pw(n){var r=Tn().memoizedState;return oA({ref:r,nextImpl:n}),function(){if((qt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function Lw(n,r){return af(4,2,n,r)}function Uw(n,r){return af(4,4,n,r)}function Bw(n,r){if(typeof r=="function"){n=n();var i=r(n);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Hw(n,r,i){i=i!=null?i.concat([n]):null,af(4,4,Bw.bind(null,r,n),i)}function ng(){}function Fw(n,r){var i=Tn();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&$p(r,l[1])?l[0]:(i.memoizedState=[n,r],n)}function Vw(n,r){var i=Tn();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&$p(r,l[1]))return l[0];if(l=n(),Zi){Le(!0);try{n()}finally{Le(!1)}}return i.memoizedState=[l,r],l}function rg(n,r,i){return i===void 0||(eo&1073741824)!==0&&(It&261930)===0?n.memoizedState=r:(n.memoizedState=i,n=W1(),xt.lanes|=n,Zo|=n,i)}function qw(n,r,i,l){return Ar(i,r)?i:Bo.current!==null?(n=rg(n,i,l),Ar(n,r)||(Mn=!0),n):(eo&106)===0||(eo&1073741824)!==0&&(It&261930)===0?(Mn=!0,n.memoizedState=i):(n=W1(),xt.lanes|=n,Zo|=n,r)}function $w(n,r,i,l,f){var h=fe.p;fe.p=h!==0&&8>h?h:8;var T=de.T,M={};M.types=T!==null?T.types:null,de.T=M,ig(n,!1,r,i);try{var Q=f(),ce=de.S;if(ce!==null&&ce(M,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ge=eA(Q,l);Vc(n,r,ge,Pr(n))}else Vc(n,r,l,Pr(n))}catch(Ee){Vc(n,r,{then:function(){},status:"rejected",reason:Ee},Pr())}finally{fe.p=h,T!==null&&M.types!==null&&(T.types=M.types),de.T=T}}function iA(){}function sg(n,r,i,l){if(n.tag!==5)throw Error(o(476));var f=Zw(n).queue;$w(n,f,r,xe,i===null?iA:function(){return Kw(n),i(l)})}function Zw(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:xe},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:to,lastRenderedState:i},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Kw(n){var r=Zw(n);r.next===null&&(r=n.alternate.memoizedState),Vc(n,r.next.queue,{},Pr())}function og(){return Wn(yl)}function Yw(){return Tn().memoizedState}function Gw(){return Tn().memoizedState}function aA(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var i=Pr();n=Lo(i);var l=Uo(r,n,i);l!==null&&(Nr(l,r,i),Pc(l,r,i)),r={cache:Mp()},n.payload=r;return}r=r.return}}function lA(n,r,i){var l=Pr();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},lf(n)?Xw(r,i):(i=Tp(n,r,i,l),i!==null&&(Nr(i,n,l),Jw(i,r,l)))}function Qw(n,r,i){var l=Pr();Vc(n,r,i,l)}function Vc(n,r,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(lf(n))Xw(r,f);else{var h=n.alternate;if(n.lanes===0&&(h===null||h.lanes===0)&&(h=r.lastRenderedReducer,h!==null))try{var T=r.lastRenderedState,M=h(T,i);if(f.hasEagerState=!0,f.eagerState=M,Ar(M,T))return Ld(n,r,f,0),on===null&&Pd(),!1}catch{}finally{}if(i=Tp(n,r,f,l),i!==null)return Nr(i,n,l),Jw(i,r,l),!0}return!1}function ig(n,r,i,l){if(l={lane:2,revertLane:Qg(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},lf(n)){if(r)throw Error(o(479))}else r=Tp(n,i,l,2),r!==null&&Nr(r,n,2)}function lf(n){var r=n.alternate;return n===xt||r!==null&&r===xt}function Xw(n,r){Ja=ef=!0;var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}function Jw(n,r,i){if((i&4194048)!==0){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Ed(n,i)}}var cf={readContext:Wn,use:rf,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn,useEffectEvent:Sn},Ww={readContext:Wn,use:rf,useCallback:function(n,r){return hr().memoizedState=[n,r===void 0?null:r],n},useContext:Wn,useEffect:Iw,useImperativeHandle:function(n,r,i){i=i!=null?i.concat([n]):null,of(4194308,4,Bw.bind(null,r,n),i)},useLayoutEffect:function(n,r){return of(4194308,4,n,r)},useInsertionEffect:function(n,r){of(4,2,n,r)},useMemo:function(n,r){var i=hr();r=r===void 0?null:r;var l=n();if(Zi){Le(!0);try{n()}finally{Le(!1)}}return i.memoizedState=[l,r],l},useReducer:function(n,r,i){var l=hr();if(i!==void 0){var f=i(r);if(Zi){Le(!0);try{i(r)}finally{Le(!1)}}}else f=r;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=lA.bind(null,xt,n),[l.memoizedState,n]},useRef:function(n){var r=hr();return n={current:n},r.memoizedState=n},useState:function(n){n=Wp(n);var r=n.queue,i=Qw.bind(null,xt,r);return r.dispatch=i,[n.memoizedState,i]},useDebugValue:ng,useDeferredValue:function(n,r){var i=hr();return rg(i,n,r)},useTransition:function(){var n=Wp(!1);return n=$w.bind(null,xt,n.queue,!0,!1),hr().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,i){var l=xt,f=hr();if(jt){if(i===void 0)throw Error(o(407));i=i()}else{if(i=r(),on===null)throw Error(o(349));(It&127)!==0||xw(l,r,i)}f.memoizedState=i;var h={value:i,getSnapshot:r};return f.queue=h,Iw(Sw.bind(null,l,h,n),[n]),l.flags|=2048,el(9,{destroy:void 0},ww.bind(null,l,h,i,r),null),i},useId:function(){var n=hr(),r=on.identifierPrefix;if(jt){var i=ws,l=xs;i=(l&~(1<<32-Ce(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=tf++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=tA++,r="_"+r+"r_"+i.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:og,useFormState:_w,useActionState:_w,useOptimistic:function(n){var r=hr();r.memoizedState=r.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=ig.bind(null,xt,!0,i),i.dispatch=r,[n,r]},useMemoCache:Qp,useCacheRefresh:function(){return hr().memoizedState=aA.bind(null,xt)},useEffectEvent:function(n){var r=hr(),i={impl:n};return r.memoizedState=i,function(){if((qt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},e1={readContext:Wn,use:rf,useCallback:Fw,useContext:Wn,useEffect:tg,useImperativeHandle:Hw,useInsertionEffect:Lw,useLayoutEffect:Uw,useMemo:Vw,useReducer:sf,useRef:Dw,useState:function(){return sf(to)},useDebugValue:ng,useDeferredValue:function(n,r){var i=Tn();return qw(i,tn.memoizedState,n,r)},useTransition:function(){var n=sf(to)[0],r=Tn().memoizedState;return[typeof n=="boolean"?n:Fc(n),r]},useSyncExternalStore:yw,useId:Yw,useHostTransitionStatus:og,useFormState:Aw,useActionState:Aw,useOptimistic:function(n,r){var i=Tn();return Rw(i,tn,n,r)},useMemoCache:Qp,useCacheRefresh:Gw,useEffectEvent:Pw},cA={readContext:Wn,use:rf,useCallback:Fw,useContext:Wn,useEffect:tg,useImperativeHandle:Hw,useInsertionEffect:Lw,useLayoutEffect:Uw,useMemo:Vw,useReducer:Jp,useRef:Dw,useState:function(){return Jp(to)},useDebugValue:ng,useDeferredValue:function(n,r){var i=Tn();return tn===null?rg(i,n,r):qw(i,tn.memoizedState,n,r)},useTransition:function(){var n=Jp(to)[0],r=Tn().memoizedState;return[typeof n=="boolean"?n:Fc(n),r]},useSyncExternalStore:yw,useId:Yw,useHostTransitionStatus:og,useFormState:zw,useActionState:zw,useOptimistic:function(n,r){var i=Tn();return tn!==null?Rw(i,tn,n,r):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Qp,useCacheRefresh:Gw,useEffectEvent:Pw};function ag(n,r,i,l){r=n.memoizedState,i=i(l,r),i=i==null?r:L({},r,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var lg={enqueueSetState:function(n,r,i){n=n._reactInternals;var l=Pr(),f=Lo(l);f.payload=r,i!=null&&(f.callback=i),r=Uo(n,f,l),r!==null&&(Nr(r,n,l),Pc(r,n,l))},enqueueReplaceState:function(n,r,i){n=n._reactInternals;var l=Pr(),f=Lo(l);f.tag=1,f.payload=r,i!=null&&(f.callback=i),r=Uo(n,f,l),r!==null&&(Nr(r,n,l),Pc(r,n,l))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var i=Pr(),l=Lo(i);l.tag=2,r!=null&&(l.callback=r),r=Uo(n,l,i),r!==null&&(Nr(r,n,i),Pc(r,n,i))}};function t1(n,r,i,l,f,h,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,h,T):r.prototype&&r.prototype.isPureReactComponent?!Oc(i,l)||!Oc(f,h):!0}function n1(n,r,i,l){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==n&&lg.enqueueReplaceState(r,r.state,null)}function Ki(n,r){var i=r;if("ref"in r){i={};for(var l in r)l!=="ref"&&(i[l]=r[l])}if(n=n.defaultProps){i===r&&(i=L({},i));for(var f in n)i[f]===void 0&&(i[f]=n[f])}return i}function r1(n){Id(n)}function s1(n){console.error(n)}function o1(n){Id(n)}function uf(n,r){try{var i=n.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function i1(n,r,i){try{var l=n.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function cg(n,r,i){return i=Lo(i),i.tag=3,i.payload={element:null},i.callback=function(){uf(n,r)},i}function a1(n){return n=Lo(n),n.tag=3,n}function l1(n,r,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;n.payload=function(){return f(h)},n.callback=function(){i1(r,i,l)}}var T=i.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){i1(r,i,l),typeof f!="function"&&(Ko===null?Ko=new Set([this]):Ko.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})})}function uA(n,r,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=i.alternate,r!==null&&Ui(r,i,f,!0),i=er.current,i!==null){switch(i.tag){case 31:case 13:case 19:return cr===null?_f():i.alternate===null&&En===0&&(En=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===Gd?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Kg(n,l,f)),!1;case 22:return i.flags|=65536,l===Gd?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Kg(n,l,f)),!1}throw Error(o(435,i.tag))}return Kg(n,l,f),_f(),!1}if(jt)return r=er.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==Op&&(n=Error(o(422),{cause:l}),Ac(Kr(n,i)))):(l!==Op&&(r=Error(o(423),{cause:l}),Ac(Kr(r,i))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,l=Kr(l,i),f=cg(n.stateNode,l,f),Up(n,f),En!==4&&(En=2)),!1;var h=Error(o(520),{cause:l});if(h=Kr(h,i),Xc===null?Xc=[h]:Xc.push(h),En!==4&&(En=2),r===null)return!0;l=Kr(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,n=f&-f,i.lanes|=n,n=cg(i.stateNode,l,n),Up(i,n),!1;case 1:if(r=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ko===null||!Ko.has(h))))return i.flags|=65536,f&=-f,i.lanes|=f,f=a1(f),l1(f,n,i,l),Up(i,f),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var ug=Error(o(461)),Mn=!1;function Ln(n,r,i,l){r.child=n===null?fw(r,null,i,l):$i(r,n.child,i,l)}function c1(n,r,i,l,f){i=i.render;var h=r.ref;if("ref"in l){var T={};for(var M in l)M!=="ref"&&(T[M]=l[M])}else T=l;return Bi(r),l=Zp(n,r,i,T,h,f),M=Kp(),n!==null&&!Mn?(Yp(n,r,f),no(n,r,f)):(jt&&M&&Fd(r),r.flags|=1,Ln(n,r,l,f),r.child)}function u1(n,r,i,l,f){if(n===null){var h=i.type;return typeof h=="function"&&!Rp(h)&&h.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=h,d1(n,r,h,l,f)):(n=Bd(i.type,null,l,r,r.mode,f),n.ref=r.ref,n.return=r,r.child=n)}if(h=n.child,!bg(n,f)){var T=h.memoizedProps;if(i=i.compare,i=i!==null?i:Oc,i(T,l)&&n.ref===r.ref)return no(n,r,f)}return r.flags|=1,n=Qs(h,l),n.ref=r.ref,n.return=r,r.child=n}function d1(n,r,i,l,f){if(n!==null){var h=n.memoizedProps;if(Oc(h,l)&&n.ref===r.ref)if(Mn=!1,r.pendingProps=l=h,bg(n,f))(n.flags&131072)!==0&&(Mn=!0);else return r.lanes=n.lanes,no(n,r,f)}return dg(n,r,i,l,f)}function f1(n,r,i,l){var f=l.children,h=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(h=h!==null?h.baseLanes|i:i,n!==null){for(l=r.child=n.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,r.child=null;return m1(n,r,h,i,l)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Kd(r,h!==null?h.cachePool:null),h!==null?pw(r,h):Hp(),gw(r);else return l=r.lanes=536870912,m1(n,r,h!==null?h.baseLanes|i:i,i,l)}else h!==null?(Kd(r,h.cachePool),pw(r,h),Fo(),r.memoizedState=null):(n!==null&&Kd(r,null),Hp(),Fo());return Ln(n,r,f,i),r.child}function qc(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function m1(n,r,i,l,f){var h=Dp();return h=h===null?null:{parent:_n._currentValue,pool:h},r.memoizedState={baseLanes:i,cachePool:h},n!==null&&Kd(r,null),Hp(),gw(r),n!==null&&Ui(n,r,l,!0),r.childLanes=f,null}function df(n,r){return r=ff({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function h1(n,r,i){return $i(r,n.child,null,i),n=df(r,r.pendingProps),n.flags|=2,Mr(r),r.memoizedState=null,n}function dA(n,r,i){var l=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(jt){if(l.mode==="hidden")return n=df(r,l),r.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},qc(null,n);if(Vp(r),(n=an)?(n=BS(n,Qr),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ao!==null?{id:xs,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},i=X0(n),i.return=r,r.child=i,$n=r,an=null)):n=null,n===null)throw zo(r);return r.lanes=536870912,null}return df(r,l)}var h=n.memoizedState;if(h!==null){var T=h.dehydrated;if(Vp(r),f)if(r.flags&256)r.flags&=-257,r=h1(n,r,i);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(o(558));else if(Mn||Ui(n,r,i,!1),f=(i&n.childLanes)!==0,Mn||f){if(Bo.current===null){if(l=on,l!==null&&(T=Td(l,i),T!==0&&T!==h.retryLane))throw h.retryLane=T,Di(n,T),Nr(l,n,T),ug;_f()}r=h1(n,r,i)}else n=h.treeContext,an=Jr(T.nextSibling),$n=r,jt=!0,Mo=null,Qr=!1,n!==null&&ew(r,n),r=df(r,l),r.flags|=134221824;return r}return n=Qs(n.child,{mode:l.mode,children:l.children}),n.ref=r.ref,r.child=n,n.return=r,n}function tl(n,r){var i=r.ref;if(i===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(n===null||n.ref!==i)&&(r.flags|=4194816)}}function dg(n,r,i,l,f){return Bi(r),i=Zp(n,r,i,l,void 0,f),l=Kp(),n!==null&&!Mn?(Yp(n,r,f),no(n,r,f)):(jt&&l&&Fd(r),r.flags|=1,Ln(n,r,i,f),r.child)}function p1(n,r,i,l,f,h){return Bi(r),r.updateQueue=null,i=bw(r,l,i,f),vw(n),l=Kp(),n!==null&&!Mn?(Yp(n,r,h),no(n,r,h)):(jt&&l&&Fd(r),r.flags|=1,Ln(n,r,i,h),r.child)}function g1(n,r,i,l,f){if(Bi(r),r.stateNode===null){var h=$a,T=i.contextType;typeof T=="object"&&T!==null&&(h=Wn(T)),h=new i(l,h),r.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=lg,r.stateNode=h,h._reactInternals=r,h=r.stateNode,h.props=l,h.state=r.memoizedState,h.refs={},Pp(r),T=i.contextType,h.context=typeof T=="object"&&T!==null?Wn(T):$a,h.state=r.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(ag(r,i,T,l),h.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(T=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),T!==h.state&&lg.enqueueReplaceState(h,h.state,null),Uc(r,l,h,f),Lc(),h.state=r.memoizedState),typeof h.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(n===null){h=r.stateNode;var M=r.memoizedProps,Q=Ki(i,M);h.props=Q;var ce=h.context,ge=i.contextType;T=$a,typeof ge=="object"&&ge!==null&&(T=Wn(ge));var Ee=i.getDerivedStateFromProps;ge=typeof Ee=="function"||typeof h.getSnapshotBeforeUpdate=="function",M=r.pendingProps!==M,ge||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(M||ce!==T)&&n1(r,h,l,T),Po=!1;var ie=r.memoizedState;h.state=ie,Uc(r,l,h,f),Lc(),ce=r.memoizedState,M||ie!==ce||Po?(typeof Ee=="function"&&(ag(r,i,Ee,l),ce=r.memoizedState),(Q=Po||t1(r,i,Q,l,ie,ce,T))?(ge||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(r.flags|=4194308)):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ce),h.props=l,h.state=ce,h.context=T,l=Q):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{h=r.stateNode,Lp(n,r),T=r.memoizedProps,ge=Ki(i,T),h.props=ge,Ee=r.pendingProps,ie=h.context,ce=i.contextType,Q=$a,typeof ce=="object"&&ce!==null&&(Q=Wn(ce)),M=i.getDerivedStateFromProps,(ce=typeof M=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T!==Ee||ie!==Q)&&n1(r,h,l,Q),Po=!1,ie=r.memoizedState,h.state=ie,Uc(r,l,h,f),Lc();var he=r.memoizedState;T!==Ee||ie!==he||Po||n!==null&&n.dependencies!==null&&$d(n.dependencies)?(typeof M=="function"&&(ag(r,i,M,l),he=r.memoizedState),(ge=Po||t1(r,i,ge,l,ie,he,Q)||n!==null&&n.dependencies!==null&&$d(n.dependencies))?(ce||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,he,Q),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,he,Q)),typeof h.componentDidUpdate=="function"&&(r.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof h.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=he),h.props=l,h.state=he,h.context=Q,l=ge):(typeof h.componentDidUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&ie===n.memoizedState||(r.flags|=1024),l=!1)}return h=l,tl(n,r),l=(r.flags&128)!==0,h||l?(h=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:h.render(),r.flags|=1,n!==null&&l?(r.child=$i(r,n.child,null,f),r.child=$i(r,null,i,f)):Ln(n,r,i,f),r.memoizedState=h.state,n=r.child):n=no(n,r,f),n}function v1(n,r,i,l){return Pi(),r.flags|=256,Ln(n,r,i,l),r.child}var fg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mg(n){return{baseLanes:n,cachePool:iw()}}function hg(n,r,i){return n=n!==null?n.childLanes&~i:0,r&&(n|=Ir),n}function b1(n,r,i){var l=r.pendingProps,f=!1,h=(r.flags&128)!==0,T;if((T=h)||(T=n!==null&&n.memoizedState===null?!1:(tr.current&2)!==0),T&&(f=!0,r.flags&=-129),T=(r.flags&32)!==0,r.flags&=-33,n===null){if(jt){if(f?Ho(r):Fo(),(n=an)?(n=BS(n,Qr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Ao!==null?{id:xs,overflow:ws}:null,retryLane:536870912,hydrationErrors:null},i=X0(n),i.return=r,r.child=i,$n=r,an=null)):n=null,n===null)throw zo(r);return mv(n)?r.lanes=32:r.lanes=536870912,null}return h=l.children,l=l.fallback,f?(Fo(),f=r.mode,h=ff({mode:"hidden",children:h},f),l=Ii(l,f,i,null),h.return=r,l.return=r,h.sibling=l,r.child=h,l=r.child,l.memoizedState=mg(i),l.childLanes=hg(n,T,i),r.memoizedState=fg,qc(null,l)):(Ho(r),pg(r,h))}var M=n.memoizedState;if(M!==null){var Q=M.dehydrated;if(Q!==null)return fA(n,r,h,T,l,Q,M,i)}return f?(Fo(),f=l.fallback,h=r.mode,M=n.child,Q=M.sibling,l=Qs(M,{mode:"hidden",children:l.children}),l.subtreeFlags=M.subtreeFlags&1206910976,Q!==null?f=Qs(Q,f):(f=Ii(f,h,i,null),f.flags|=2),f.return=r,l.return=r,l.sibling=f,r.child=l,qc(null,l),l=r.child,f=n.child.memoizedState,f===null?f=mg(i):(h=f.cachePool,h!==null?(M=_n._currentValue,h=h.parent!==M?{parent:M,pool:M}:h):h=iw(),f={baseLanes:f.baseLanes|i,cachePool:h}),l.memoizedState=f,l.childLanes=hg(n,T,i),r.memoizedState=fg,qc(n.child,l)):(Ho(r),i=n.child,n=i.sibling,i=Qs(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,n!==null&&(T=r.deletions,T===null?(r.deletions=[n],r.flags|=16):T.push(n)),r.child=i,r.memoizedState=null,i)}function pg(n,r){return r=ff({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function ff(n,r){return n=Er(22,n,null,r),n.lanes=0,n}function mf(n,r,i){return $i(r,n.child,null,i),n=pg(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function fA(n,r,i,l,f,h,T,M){if(i)return r.flags&256?(Ho(r),r.flags&=-257,mf(n,r,M)):r.memoizedState!==null?(Fo(),r.child=n.child,r.flags|=128,null):(Fo(),h=f.fallback,T=r.mode,f=ff({mode:"visible",children:f.children},T),h=Ii(h,T,M,null),h.flags|=2,f.return=r,h.return=r,f.sibling=h,r.child=f,$i(r,n.child,null,M),f=r.child,f.memoizedState=mg(M),f.childLanes=hg(n,l,M),r.memoizedState=fg,qc(null,f));if(Ho(r),mv(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var Q=l.dgst;return l=Q,l!==""&&(f=Error(o(419)),f.stack="",f.digest=l,Ac({value:f,source:null,stack:null})),mf(n,r,M)}if(Mn||Ui(n,r,M,!1),l=(M&n.childLanes)!==0,Mn||l){if(Bo.current!==null)return mf(n,r,M);if(l=on,l!==null&&(f=Td(l,M),f!==0&&f!==T.retryLane))throw T.retryLane=f,Di(n,f),Nr(l,n,f),ug;return fv(h)||_f(),mf(n,r,M)}return fv(h)?(r.flags|=192,r.child=n.child,null):(n=T.treeContext,an=Jr(h.nextSibling),$n=r,jt=!0,Mo=null,Qr=!1,n!==null&&ew(r,n),r=pg(r,f.children),r.flags|=134221824,r)}function y1(n,r,i){n.lanes|=r;var l=n.alternate;l!==null&&(l.lanes|=r),qd(n.return,r,i)}function x1(n){for(var r=null;n!==null;){var i=n.alternate;i!==null&&Wd(i)===null&&(r=n),n=n.sibling}return r}function hf(n,r,i,l,f,h){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:h}:(T.isBackwards=r,T.rendering=null,T.renderingStartTime=0,T.last=l,T.tail=i,T.tailMode=f,T.treeForkCount=h)}function gg(n){var r=n.child;for(n.child=null;r!==null;){var i=r.sibling;r.sibling=n.child,n.child=r,r=i}}function vg(n,r,i){var l=r.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var T=tr.current;if(r.flags&128)return Bc(r,T),null;var M=(T&2)!==0;if(M?(T=T&1|2,r.flags|=128):T&=1,Bc(r,T),f==="backwards"&&n!==null?(gg(n),Ln(n,r,l,i),gg(n)):Ln(n,r,l,i),l=jt?_c:0,!M&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&y1(n,i,r);else if(n.tag===19)y1(n,i,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"backwards":i=x1(r.child),i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null,gg(r)),hf(r,!0,f,null,h,l);break;case"unstable_legacy-backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(n=f.alternate,n!==null&&Wd(n)===null){r.child=f;break}n=f.sibling,f.sibling=i,i=f,f=n}hf(r,!0,i,null,h,l);break;case"together":hf(r,!1,null,null,void 0,l);break;case"independent":r.memoizedState=null;break;default:i=x1(r.child),i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),hf(r,!1,f,i,h,l)}return r.child}function w1(n,r,i){var l=r.pendingProps;return Do(r,r.type,l.value),Ln(n,r,l.children,i),r.child}function no(n,r,i){if(n!==null&&(r.dependencies=n.dependencies),Zo|=r.lanes,(i&r.childLanes)===0)if(n!==null){if(Ui(n,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(o(153));if(r.child!==null){for(n=r.child,i=Qs(n,n.pendingProps),r.child=i,i.return=r;n.sibling!==null;)n=n.sibling,i=i.sibling=Qs(n,n.pendingProps),i.return=r;i.sibling=null}return r.child}function bg(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&$d(n)))}function mA(n,r,i){switch(r.tag){case 3:Ae(r,r.stateNode.containerInfo),Do(r,_n,n.memoizedState.cache),Pi();break;case 27:case 5:ae(r);break;case 4:Ae(r,r.stateNode.containerInfo);break;case 10:Do(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Vp(r),null;break;case 13:var l=r.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ho(r),r.flags|=128,null;l=Ui(n,r,i,!1);var f=r.child.childLanes;return l||(i&f)!==0?b1(n,r,i):(Ho(r),n=no(n,r,i),n!==null?n.sibling:null)}Ho(r);break;case 19:if(r.flags&128)return vg(n,r,i);if(f=(n.flags&128)!==0,l=(i&r.childLanes)!==0,l||(Ui(n,r,i,!1),l=(i&r.childLanes)!==0),f){if(l)return vg(n,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Bc(r,tr.current),l)break;return null;case 22:return r.lanes=0,f1(n,r,i,r.pendingProps);case 24:Do(r,_n,n.memoizedState.cache)}return no(n,r,i)}function S1(n,r,i){if(n!==null)if(n.memoizedProps!==r.pendingProps)Mn=!0;else{if(!bg(n,i)&&(r.flags&128)===0)return Mn=!1,mA(n,r,i);Mn=(n.flags&131072)!==0}else Mn=!1,jt&&(r.flags&1048576)!==0&&W0(r,_c,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(n=Vi(r.elementType),r.type=n,typeof n=="function")Rp(n)?(l=Ki(n,l),r.tag=1,r=g1(null,r,n,l,i)):(r.tag=0,r=dg(null,r,n,l,i));else{if(n!=null){var f=n.$$typeof;if(f===H){r.tag=11,r=c1(null,r,n,l,i);break e}else if(f===A){r.tag=14,r=u1(null,r,n,l,i);break e}else if(f===G){r.tag=10,r.type=n,r=w1(null,r,i);break e}}throw r=W(n)||n,Error(o(306,r,""))}}return r;case 0:return dg(n,r,r.type,r.pendingProps,i);case 1:return l=r.type,f=Ki(l,r.pendingProps),g1(n,r,l,f,i);case 3:e:{if(Ae(r,r.stateNode.containerInfo),n===null)throw Error(o(387));l=r.pendingProps;var h=r.memoizedState;f=h.element,Lp(n,r),Uc(r,l,null,i);var T=r.memoizedState;if(l=T.cache,Do(r,_n,l),l!==h.cache&&Ap(r,[_n],i,!0),Lc(),l=T.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:T.cache},r.updateQueue.baseState=h,r.memoizedState=h,r.flags&256){r=v1(n,r,l,i);break e}else if(l!==f){f=Kr(Error(o(424)),r),Ac(f),r=v1(n,r,l,i);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(an=Jr(n.firstChild),$n=r,jt=!0,Mo=null,Qr=!0,i=fw(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling}else{if(Pi(),l===f){r=no(n,r,i);break e}Ln(n,r,l,i)}r=r.child}return r;case 26:return tl(n,r),n===null?(i=KS(r.type,null,r.pendingProps,null))?r.memoizedState=i:jt||(r.stateNode=CS(r.type,r.pendingProps,se.current,r)):r.memoizedState=KS(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return ae(r),n===null&&jt&&(l=r.stateNode=VS(r.type,r.pendingProps,se.current),$n=r,Qr=!0,f=an,Qo(r.type)?(hv=f,an=Jr(l.firstChild)):an=f),Ln(n,r,r.pendingProps.children,i),tl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&jt&&((f=l=an)&&(l=aM(l,r.type,r.pendingProps,Qr),l!==null?(r.stateNode=l,$n=r,an=Jr(l.firstChild),Qr=!1,f=!0):f=!1),f||zo(r)),ae(r),f=r.type,h=r.pendingProps,T=n!==null?n.memoizedProps:null,l=h.children,ov(f,h)?l=null:T!==null&&ov(f,T)&&(r.flags|=32),r.memoizedState!==null&&(f=Zp(n,r,nA,null,null,i),yl._currentValue=f),tl(n,r),Ln(n,r,l,i),r.child;case 6:return n===null&&jt&&((n=i=an)&&(i=lM(i,r.pendingProps,Qr),i!==null?(r.stateNode=i,$n=r,an=null,n=!0):n=!1),n||zo(r)),null;case 13:return b1(n,r,i);case 4:return Ae(r,r.stateNode.containerInfo),l=r.pendingProps,n===null?r.child=$i(r,null,l,i):Ln(n,r,l,i),r.child;case 11:return c1(n,r,r.type,r.pendingProps,i);case 7:return l=r.pendingProps,tl(n,r),Ln(n,r,l,i),r.child;case 8:return Ln(n,r,r.pendingProps.children,i),r.child;case 12:return Ln(n,r,r.pendingProps.children,i),r.child;case 10:return w1(n,r,i);case 9:return f=r.type._context,l=r.pendingProps.children,Bi(r),f=Wn(f),l=l(f),r.flags|=1,Ln(n,r,l,i),r.child;case 14:return u1(n,r,r.type,r.pendingProps,i);case 15:return d1(n,r,r.type,r.pendingProps,i);case 19:return vg(n,r,i);case 31:return dA(n,r,i);case 22:return f1(n,r,i,r.pendingProps);case 24:return Bi(r),l=Wn(_n),n===null?(f=Dp(),f===null&&(f=on,h=Mp(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=i),f=h),r.memoizedState={parent:l,cache:f},Pp(r),Do(r,_n,f)):((n.lanes&i)!==0&&(Lp(n,r),Uc(r,null,null,i),Lc()),f=n.memoizedState,h=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Do(r,_n,l)):(l=h.cache,Do(r,_n,l),l!==f.cache&&Ap(r,[_n],i,!0))),Ln(n,r,r.pendingProps.children,i),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=r.pendingProps,l.name!=null&&l.name!=="auto"?r.flags|=n===null?18882560:18874368:jt&&Fd(r),n!==null&&n.memoizedProps.name!==l.name?r.flags|=4194816:tl(n,r),Ln(n,r,l.children,i),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function ro(n){n.flags|=4}function yg(n,r,i,l,f){var h;if((h=(n.mode&32)!==0)&&(h=i===null?XS(r,l):XS(r,l)&&(l.src!==i.src||l.srcSet!==i.srcSet)),h){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(rS())n.flags|=8192;else throw qi=Gd,Ip}else n.flags&=-16777217}function E1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!JS(r))if(rS())n.flags|=8192;else throw qi=Gd,Ip}function pf(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?bc():536870912,n.lanes|=r,il|=r)}function $c(n,r){if(!jt)switch(n.tailMode){case"visible":break;case"collapsed":for(var i=n.tail,l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null;break;default:for(r=n.tail,i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n.tail=null:i.sibling=null}}function ln(n){var r=n.alternate!==null&&n.alternate.child===n.child,i=0,l=0;if(r)for(var f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&1206910976,l|=f.flags&1206910976,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=l,n.childLanes=i,r}function hA(n,r,i){var l=r.pendingProps;switch(jp(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(r),null;case 1:return ln(r),null;case 3:return i=r.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ws(_n),Be(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(Ya(r)?ro(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,kp())),ln(r),null;case 26:var f=r.type,h=r.memoizedState;return n===null?(ro(r),h!==null?(ln(r),E1(r,h)):(ln(r),yg(r,f,null,l,i))):h?h!==n.memoizedState?(ro(r),ln(r),E1(r,h)):(ln(r),r.flags&=-16777217):(n=n.memoizedProps,n!==l&&ro(r),ln(r),yg(r,f,n,l,i)),null;case 27:if(ve(r),i=se.current,f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&ro(r);else{if(!l){if(r.stateNode===null)throw Error(o(166));return ln(r),r.subtreeFlags&=-33554433,null}n=Te.current,Ya(r)?tw(r):(n=VS(f,l,i),r.stateNode=n,ro(r))}return ln(r),r.subtreeFlags&=-33554433,null;case 5:if(ve(r),f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&ro(r);else{if(!l){if(r.stateNode===null)throw Error(o(166));return ln(r),r.subtreeFlags&=-33554433,null}if(h=Te.current,Ya(r))tw(r);else{var T=nu(se.current);switch(h){case 1:h=T.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=T.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=T.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=T.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=T.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?T.createElement("select",{is:l.is}):T.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?T.createElement(f,{is:l.is}):T.createElement(f)}}h[Jn]=r,h[Sr]=l;e:for(T=r.child;T!==null;){if(T.tag===5||T.tag===6)h.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===r)break e;for(;T.sibling===null;){if(T.return===null||T.return===r)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}r.stateNode=h;e:switch(rr(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ro(r)}}return ln(r),r.subtreeFlags&=-33554433,yg(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,i),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&ro(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(o(166));if(n=se.current,Ya(r)){if(n=r.stateNode,i=r.memoizedProps,l=null,f=$n,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[Jn]=r,n=!!(n.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||SS(n.nodeValue,i)),n||zo(r,!0)}else n=nu(n).createTextNode(l),n[Jn]=r,r.stateNode=n}return ln(r),null;case 31:if(i=r.memoizedState,n===null||n.memoizedState!==null){if(l=Ya(r),i!==null){if(n===null){if(!l)throw Error(o(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(557));n[Jn]=r}else Pi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ln(r),n=!1}else i=kp(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return r.flags&256?(Mr(r),r):(Mr(r),null);if((r.flags&128)!==0)throw Error(o(558))}return ln(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=Ya(r),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(o(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[Jn]=r}else Pi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ln(r),f=!1}else f=kp(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Mr(r),r):(Mr(r),null)}return Mr(r),(r.flags&128)!==0?(r.lanes=i,r):(i=l!==null,n=n!==null&&n.memoizedState!==null,i&&(l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),i!==n&&i&&(r.child.flags|=8192),pf(r,r.updateQueue),ln(r),null);case 4:return Be(),n===null&&ev(r.stateNode.containerInfo),r.flags|=67108864,ln(r),null;case 10:return Ws(r.type),ln(r),null;case 19:if(qp(r),l=r.memoizedState,l===null)return ln(r),null;if(f=(r.flags&128)!==0,h=l.rendering,h===null)if(f)$c(l,!1);else{if(En!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(h=Wd(n),h!==null){for(r.flags|=128,$c(l,!1),n=h.updateQueue,r.updateQueue=n,pf(r,n),r.subtreeFlags=0,n=i,i=r.child;i!==null;)Q0(i,n),i=i.sibling;return Bc(r,tr.current&1|2),jt&&Xs(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&at()>Nf&&(r.flags|=128,f=!0,$c(l,!1),r.lanes=4194304)}else{if(!f)if(n=Wd(h),n!==null){if(r.flags|=128,f=!0,n=n.updateQueue,r.updateQueue=n,pf(r,n),$c(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!jt)return ln(r),null}else 2*at()-l.renderingStartTime>Nf&&i!==536870912&&(r.flags|=128,f=!0,$c(l,!1),r.lanes=4194304);l.isBackwards?(h.sibling=r.child,r.child=h):(n=l.last,n!==null?n.sibling=h:r.child=h,l.last=h)}if(l.tail!==null){n=l.tail;e:{for(i=n;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return l.rendering=n,l.tail=n.sibling,l.renderingStartTime=at(),n.sibling=null,h=tr.current,h=f?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!i||jt?Bc(r,h):(i=h,Pe(er,r),Pe(tr,i),cr===null&&(cr=r)),jt&&Xs(r,l.treeForkCount),n}return ln(r),null;case 22:case 23:return Mr(r),Fp(),l=r.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(i&536870912)!==0&&(r.flags&128)===0&&(ln(r),r.subtreeFlags&6&&(r.flags|=8192)):ln(r),i=r.updateQueue,i!==null&&pf(r,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),n!==null&&ke(Fi),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),Ws(_n),ln(r),null;case 25:return null;case 30:return r.flags|=33554432,ln(r),null}throw Error(o(156,r.tag))}function pA(n,r){switch(jp(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Ws(_n),Be(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return ve(r),null;case 31:if(r.memoizedState!==null){if(Mr(r),r.alternate===null)throw Error(o(340));Pi()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(Mr(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Pi()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return qp(r),n=r.flags,n&65536?(r.flags=n&-65537|128,n=r.memoizedState,n!==null&&(n.rendering=null,n.tail=null),r.flags|=4,r):null;case 4:return Be(),null;case 10:return Ws(r.type),null;case 22:case 23:return Mr(r),Fp(),n!==null&&ke(Fi),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Ws(_n),null;case 25:return null;default:return null}}function T1(n,r){switch(jp(r),r.tag){case 3:Ws(_n),Be();break;case 26:case 27:case 5:ve(r);break;case 4:Be();break;case 31:r.memoizedState!==null&&Mr(r);break;case 13:Mr(r);break;case 19:qp(r);break;case 10:Ws(r.type);break;case 22:case 23:Mr(r),Fp(),n!==null&&ke(Fi);break;case 24:Ws(_n)}}function Zc(n,r){try{var i=r.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&n)===n){l=void 0;var h=i.create,T=i.inst;l=h(),T.destroy=l}i=i.next}while(i!==f)}}catch(M){Xt(r,r.return,M)}}function Vo(n,r,i){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&n)===n){var T=l.inst,M=T.destroy;if(M!==void 0){T.destroy=void 0,f=r;var Q=i,ce=M;try{ce()}catch(ge){Xt(f,Q,ge)}}}l=l.next}while(l!==h)}}catch(ge){Xt(r,r.return,ge)}}function R1(n){var r=n.updateQueue;if(r!==null){var i=n.stateNode;try{hw(r,i)}catch(l){Xt(n,n.return,l)}}}function C1(n,r,i){i.props=Ki(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(l){Xt(n,r,l)}}function Ss(n,r){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:var f=n.stateNode,h=Ys(n.memoizedProps,f);(f.ref===null||f.ref.name!==h)&&(f.ref=MS(h)),l=f.ref;break;case 7:if(n.stateNode===null){var T=new Lr(n);p(n.child,!1,oM,T,void 0,void 0),n.stateNode=T}l=n.stateNode;break;default:l=n.stateNode}typeof i=="function"?n.refCleanup=i(l):i.current=l}}catch(M){Xt(n,r,M)}}function nr(n,r){var i=n.ref,l=n.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){Xt(n,r,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Xt(n,r,f)}else i.current=null}function gf(n,r){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&r!==null)for(var i=0;i<r.length;i++)US(n.stateNode,r[i])}function N1(n){for(var r=n.return;r!==null&&(wg(r)&&US(n.stateNode,r.stateNode),!xg(r));)r=r.return}function Kc(n){for(var r=n.return;r!==null&&(wg(r)&&iM(n.stateNode,r.stateNode),!xg(r));)r=r.return}function xg(n){return n.tag===5||n.tag===3||n.tag===27}function wg(n){return n&&n.tag===7&&n.stateNode!==null}function Sg(n){var r=n.type,i=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){Xt(n,n.return,f)}}function Eg(n,r,i){try{var l=n.stateNode;HA(l,n.type,i,r),l[Sr]=r}catch(f){Xt(n,n.return,f)}}function j1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Qo(n.type)||n.tag===4}function Tg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||j1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Qo(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Rg(n,r,i,l){var f=n.tag;if(f===5||f===6)f=n.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(f,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(f),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=ys)),gf(n,l),Vt=!0;else if(f!==4&&(f===27&&(gf(n,l),l=null,Qo(n.type)&&(i=n.stateNode,r=null)),n=n.child,n!==null))for(Rg(n,r,i,l),n=n.sibling;n!==null;)Rg(n,r,i,l),n=n.sibling}function vf(n,r,i,l){var f=n.tag;if(f===5||f===6)f=n.stateNode,r?i.insertBefore(f,r):i.appendChild(f),gf(n,l),Vt=!0;else if(f!==4&&(f===27&&(gf(n,l),l=null,Qo(n.type)&&(i=n.stateNode)),n=n.child,n!==null))for(vf(n,r,i,l),n=n.sibling;n!==null;)vf(n,r,i,l),n=n.sibling}function O1(n){var r=n.stateNode,i=n.memoizedProps;try{for(var l=n.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);rr(r,l,i),r[Jn]=n,r[Sr]=i}catch(h){Xt(n,n.return,h)}}var bf=!1,zr=null;function k1(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(bf=!0)}var Es=null;function _1(){var n=Es;return Es=null,n}var Tr=0;function nl(n,r,i,l,f){return Tr=0,A1(n.child,r,i,l,f)}function A1(n,r,i,l,f){for(var h=!1;n!==null;){if(n.tag===5){var T=n.stateNode;if(l!==null){var M=lv(T);l.push(M),M.view&&(h=!0)}else h||lv(T).view&&(h=!0);bf=!0,_S(T,Tr===0?r:r+"_"+Tr,i),Tr++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&f||A1(n.child,r,i,l,f)&&(h=!0));n=n.sibling}return h}function Ts(n,r){for(;n!==null;)n.tag===5?AS(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&r||Ts(n.child,r)),n=n.sibling}function yf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(yf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var r=n.memoizedProps;if(r.name==null||r.name==="auto")throw Error(o(544));var i=r.name;r=Gs(r.default,r.share),r!=="none"&&(nl(n,i,r,null,!1)||Ts(n.child,!1))}n=n.sibling}}function Cg(n,r){if(n.tag===30){var i=n.stateNode,l=n.memoizedProps,f=Ys(l,i),h=Gs(l.default,i.paired?l.share:l.enter);h!=="none"?nl(n,f,h,null,!1)?(yf(n),i.paired||r||ul(n,l.onEnter)):Ts(n.child,!1):yf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Cg(n,r),n=n.sibling;else yf(n)}function Ng(n){if(zr!==null&&zr.size!==0){var r=zr;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var i=n.memoizedProps,l=i.name;if(l!=null&&l!=="auto"){var f=r.get(l);if(f!==void 0){var h=Gs(i.default,i.share);if(h!=="none"&&(nl(n,l,h,null,!1)?(h=n.stateNode,f.paired=h,h.paired=f,ul(n,i.onShare)):Ts(n.child,!1)),r.delete(l),r.size===0)break}}}Ng(n)}n=n.sibling}}}function jg(n){if(n.tag===30){var r=n.memoizedProps,i=Ys(r,n.stateNode),l=zr!==null?zr.get(i):void 0,f=Gs(r.default,l!==void 0?r.share:r.exit);f!=="none"&&(nl(n,i,f,null,!1)?l!==void 0?(f=n.stateNode,l.paired=f,f.paired=l,zr.delete(i),ul(n,r.onShare)):ul(n,r.onExit):Ts(n.child,!1)),zr!==null&&Ng(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)jg(n),n=n.sibling;else zr!==null&&Ng(n)}function M1(n){for(n=n.child;n!==null;){if(n.tag===30){var r=n.memoizedProps,i=Ys(r,n.stateNode);r=Gs(r.default,r.update),n.flags&=-5,r!=="none"&&nl(n,i,r,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&M1(n);n=n.sibling}}function Og(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var r=n.stateNode;r.paired!==null&&(r.paired=null,Ts(n.child,!1))}Og(n)}n=n.sibling}}function xf(n){if(n.tag===30)n.stateNode.paired=null,Ts(n.child,!1),Og(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)xf(n),n=n.sibling;else Og(n)}function z1(n){for(n=n.child;n!==null;)n.tag===30?Ts(n.child,!1):(n.subtreeFlags&33554432)!==0&&z1(n),n=n.sibling}function kg(n,r,i,l,f,h,T){for(var M=!1;r!==null;){if(r.tag===5){var Q=r.stateNode;if(h!==null&&Tr<h.length){var ce=h[Tr],ge=lv(Q);(ce.view||ge.view)&&(M=!0);var Ee;if(Ee=(n.flags&4)===0)if(ge.clip)Ee=!0;else{Ee=ce.rect;var ie=ge.rect;Ee=Ee.y!==ie.y||Ee.x!==ie.x||Ee.height!==ie.height||Ee.width!==ie.width}Ee&&(n.flags|=4),ge.abs?ge=!ce.abs:(ce=ce.rect,ge=ge.rect,ge=ce.height!==ge.height||ce.width!==ge.width),ge&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&_S(Q,Tr===0?i:i+"_"+Tr,f),M&&(n.flags&4)!==0||(Es===null&&(Es=[]),Es.push(Q,Tr===0?l:l+"_"+Tr,r.memoizedProps)),Tr++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&T?n.flags|=r.flags&32:kg(n,r.child,i,l,f,h,T)&&(M=!0));r=r.sibling}return M}function D1(n,r){for(n=n.child;n!==null;){if(n.tag===30){var i=n.memoizedProps,l=n.stateNode,f=Ys(i,l),h=Gs(i.default,i.update),T;T=n.memoizedState,n.memoizedState=null,l=n;var M=n.child;Tr=0,f=kg(l,M,f,f,h,T,!1),(n.flags&4)!==0&&f&&ul(n,i.onUpdate)}else(n.subtreeFlags&33554432)!==0&&D1(n);n=n.sibling}}var Zn=!1,Zt=!1,Rs=!1,_g=!1,I1=typeof WeakSet=="function"?WeakSet:Set,Kn=null,Cs=!1,Yc=!1,wf=!1,Ag=!1;function gA(n,r,i){if(n=n.containerInfo,rv=xl,n=B0(n),bp(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var h=f.anchorOffset,T=f.focusNode;f=f.focusOffset;try{l.nodeType,T.nodeType}catch{l=null;break e}var M=0,Q=-1,ce=-1,ge=0,Ee=0,ie=n,he=null;t:for(;;){for(var $e;ie!==l||h!==0&&ie.nodeType!==3||(Q=M+h),ie!==T||f!==0&&ie.nodeType!==3||(ce=M+f),ie.nodeType===3&&(M+=ie.nodeValue.length),($e=ie.firstChild)!==null;)he=ie,ie=$e;for(;;){if(ie===n)break t;if(he===l&&++ge===h&&(Q=M),he===T&&++Ee===f&&(ce=M),($e=ie.nextSibling)!==null)break;ie=he,he=ie.parentNode}ie=$e}l=Q===-1||ce===-1?null:{start:Q,end:ce}}else l=null}l=l||{start:0,end:0}}else l=null;for(sv={focusedElem:n,selectionRange:l},xl=!1,i=(i&335544064)===i,Kn=r,r=i?9270:1024;Kn!==null;){if(n=Kn,i&&(l=n.deletions,l!==null))for(h=0;h<l.length;h++)i&&jg(l[h]);if(n.alternate===null&&(n.flags&2)!==0)i&&k1(n),Sf(i);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&i&&jg(l),Sf(i);continue}else if(l!==null&&l.memoizedState!==null){i&&k1(n),Sf(i);continue}}l=n.child,(n.subtreeFlags&r)!==0&&l!==null?(l.return=n,Kn=l):(i&&M1(n),Sf(i))}}zr=null}function Sf(n){for(;Kn!==null;){var r=Kn,i=n,l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&l!==null){i=void 0,f=l.memoizedProps,l=l.memoizedState;var h=r.stateNode;try{var T=Ki(r.type,f);i=h.getSnapshotBeforeUpdate(T,l),h.__reactInternalSnapshotBeforeUpdate=i}catch(M){Xt(r,r.return,M)}}break;case 3:if((f&1024)!==0){if(l=r.stateNode.containerInfo,i=l.nodeType,i===9)dv(l);else if(i===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":dv(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&l!==null&&(i=Ys(l.memoizedProps,l.stateNode),f=r.memoizedProps,f=Gs(f.default,f.update),f!=="none"&&nl(l,i,f,l.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(o(163))}if(l=r.sibling,l!==null){l.return=r.return,Kn=l;break}Kn=r.return}}function P1(n,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:Ns(n,i),l&4&&Zc(5,i);break;case 1:if(Ns(n,i),l&4)if(n=i.stateNode,r===null)try{n.componentDidMount()}catch(T){Xt(i,i.return,T)}else{var f=Ki(i.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(f,r,n.__reactInternalSnapshotBeforeUpdate)}catch(T){Xt(i,i.return,T)}}l&64&&R1(i),l&512&&Ss(i,i.return);break;case 3:if(Ns(n,i),l&64&&(n=i.updateQueue,n!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{hw(n,r)}catch(T){Xt(i,i.return,T)}}break;case 27:r===null&&l&4&&O1(i);case 26:case 5:Ns(n,i),r===null&&l&4&&Sg(i),l&512&&Ss(i,i.return);break;case 12:Ns(n,i);break;case 31:Ns(n,i),l&4&&H1(n,i);break;case 13:Ns(n,i),l&4&&F1(n,i),l&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=jA.bind(null,i),cM(n,i))));break;case 22:if(l=i.memoizedState!==null||Zn,!l){var h=r!==null&&r.memoizedState!==null||Zt;r=Zn,f=Zt,Zn=l,(Zt=h)&&!f?(l=2,(i.subtreeFlags&8772)!==0&&(l|=1),ls(n,i,l)):Ns(n,i),Zn=r,Zt=f}break;case 30:Ns(n,i),l&512&&Ss(i,i.return);break;case 7:l&512&&Ss(i,i.return);default:Ns(n,i)}}function Mg(n,r){for(n=n.child;n!==null;)L1(n,r),n=n.sibling}function L1(n,r){switch(n.tag){case 5:case 26:try{var i=n.stateNode;if(r){var l=i.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var f=n.stateNode,h=n.memoizedProps.style,T=h!=null&&h.hasOwnProperty("display")?h.display:null;f.style.display=T==null||typeof T=="boolean"?"":(""+T).trim()}}catch(Q){Xt(n,n.return,Q)}zg(n,r);break;case 6:try{n.stateNode.nodeValue=r?"":n.memoizedProps,Vt=!0}catch(Q){Xt(n,n.return,Q)}break;case 18:try{var M=n.stateNode;r?kS(M,!0):kS(n.stateNode,!1)}catch(Q){Xt(n,n.return,Q)}break;case 22:case 23:n.memoizedState===null&&Mg(n,r);break;default:Mg(n,r)}}function zg(n,r){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var i=n,l=r;switch(i.tag){case 4:L1(i,l);break e;case 22:i.memoizedState===null&&zg(i,l);break e;default:zg(i,l)}}n=n.sibling}}function U1(n){var r=n.alternate;r!==null&&(n.alternate=null,U1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Cd(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var pn=null,Rr=!1;function is(n,r,i){for(i=i.child;i!==null;)B1(n,r,i),i=i.sibling}function B1(n,r,i){if(ee&&typeof ee.onCommitFiberUnmount=="function")try{ee.onCommitFiberUnmount(je,i)}catch{}switch(i.tag){case 26:Zt||nr(i,r),is(n,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!Zt&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Zt||nr(i,r),Kc(i);var l=pn,f=Rr;Qo(i.type)&&(pn=i.stateNode,Rr=!1),is(n,r,i),qS(i.stateNode,i.type,i.memoizedProps),pn=l,Rr=f;break;case 5:Zt||nr(i,r),Kc(i);case 6:if(i.tag===6&&Kc(i),l=pn,f=Rr,pn=null,is(n,r,i),pn=l,Rr=f,pn!==null)if(Rr)try{(pn.nodeType===9?pn.body:pn.nodeName==="HTML"?pn.ownerDocument.body:pn).removeChild(i.stateNode),Vt=!0}catch(h){Xt(i,r,h)}else try{pn.removeChild(i.stateNode),Vt=!0}catch(h){Xt(i,r,h)}break;case 18:pn!==null&&(Rr?(n=pn,OS(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),wl(n)):OS(pn,i.stateNode));break;case 4:l=pn,f=Rr,pn=i.stateNode.containerInfo,Rr=!0,is(n,r,i),pn=l,Rr=f;break;case 0:case 11:case 14:case 15:Vo(2,i,r),Zt||Vo(4,i,r),is(n,r,i);break;case 1:Zt||(nr(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&C1(i,r,l)),is(n,r,i);break;case 21:is(n,r,i);break;case 22:Zt=(l=Zt)||i.memoizedState!==null,is(n,r,i),Zt=l;break;case 30:nr(i,r),is(n,r,i);break;case 7:Zt||nr(i,r),is(n,r,i);break;default:is(n,r,i)}}function H1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{wl(n)}catch(i){Xt(r,r.return,i)}}}function F1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{wl(n)}catch(i){Xt(r,r.return,i)}}function vA(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new I1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new I1),r;default:throw Error(o(435,n.tag))}}function Ef(n,r){var i=vA(n);r.forEach(function(l){if(!i.has(l)){i.add(l);var f=OA.bind(null,n,l);l.then(f,f)}})}function pr(n,r,i){var l=r.deletions;if(l!==null)for(var f=0;f<l.length;f++){var h=l[f],T=n,M=r,Q=M;e:for(;Q!==null;){switch(Q.tag){case 27:if(Qo(Q.type)){pn=Q.stateNode,Rr=!1;break e}break;case 5:pn=Q.stateNode,Rr=!1;break e;case 3:case 4:pn=Q.stateNode.containerInfo,Rr=!0;break e}Q=Q.return}if(pn===null)throw Error(o(160));B1(T,M,h),pn=null,Rr=!1,T=h.alternate,T!==null&&(T.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)V1(r,n,i),r=r.sibling}var as=null;function V1(n,r,i){var l=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(f&4&&(l=n.updateQueue,l=l!==null?l.events:null,l!==null))for(var h=0;h<l.length;h++){var T=l[h];T.ref.impl=T.nextImpl}pr(r,n,i),gr(n),f&4&&(Vo(3,n,n.return),Zc(3,n),Vo(5,n,n.return));break;case 1:pr(r,n,i),gr(n),f&512&&(Zt||l===null||nr(l,l.return)),f&64&&Zn&&(n=n.updateQueue,n!==null&&(r=n.callbacks,r!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:if(h=as,pr(r,n,i),gr(n),f&512&&(Zt||l===null||nr(l,l.return)),f&4)if(f=l!==null?l.memoizedState:null,i=n.memoizedState,l===null)if(i===null)if(n.stateNode===null)if(Zn)n.stateNode=CS(n.type,n.memoizedProps,r.containerInfo,n);else{e:{r=n.type,i=n.memoizedProps,f=h.ownerDocument||h;t:switch(r){case"title":l=f.getElementsByTagName("title")[0],(!l||l[xc]||l[Jn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=f.createElement(r),f.head.insertBefore(l,f.querySelector("head > title"))),rr(l,r,i),l[Jn]=n,qn(l),r=l;break e;case"link":if(h=QS("link","href",f).get(r+(i.href||""))){for(T=0;T<h.length;T++)if(l=h[T],l.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&l.getAttribute("rel")===(i.rel==null?null:i.rel)&&l.getAttribute("title")===(i.title==null?null:i.title)&&l.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(T,1);break t}}l=f.createElement(r),rr(l,r,i),f.head.appendChild(l);break;case"meta":if(h=QS("meta","content",f).get(r+(i.content||""))){for(T=0;T<h.length;T++)if(l=h[T],l.getAttribute("content")===(i.content==null?null:""+i.content)&&l.getAttribute("name")===(i.name==null?null:i.name)&&l.getAttribute("property")===(i.property==null?null:i.property)&&l.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&l.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(T,1);break t}}l=f.createElement(r),rr(l,r,i),f.head.appendChild(l);break;default:throw Error(o(468,r))}l[Jn]=n,qn(l),r=l}n.stateNode=r}else Zn||bv(h,n.type,n.stateNode);else n.stateNode=GS(h,i,n.memoizedProps);else f!==i?(f===null?(r=l.stateNode,r===null||Zt||r.parentNode.removeChild(r)):f.count--,i===null?Zn||bv(h,n.type,n.stateNode):GS(h,i,n.memoizedProps)):i===null&&n.stateNode!==null&&Eg(n,n.memoizedProps,l.memoizedProps);break;case 27:pr(r,n,i),gr(n),f&512&&(Zt||l===null||nr(l,l.return)),l!==null&&f&4&&Eg(n,n.memoizedProps,l.memoizedProps);break;case 5:if(h=Rs,Rs=!1,pr(r,n,i),Rs=h,gr(n),f&512&&(Zt||l===null||nr(l,l.return)),n.flags&32){r=n.stateNode;try{La(r,""),Vt=!0}catch(ge){Xt(n,n.return,ge)}}f&4&&n.stateNode!=null&&(r=n.memoizedProps,Eg(n,r,l!==null?l.memoizedProps:r)),f&1024&&(_g=!0);break;case 6:if(pr(r,n,i),gr(n),f&4){if(n.stateNode===null)throw Error(o(162));r=n.memoizedProps,i=n.stateNode;try{i.nodeValue=r,Vt=!0}catch(ge){Xt(n,n.return,ge)}}break;case 3:if(Vt=!1,Lf=null,h=as,as=ru(r.containerInfo),pr(r,n,i),as=h,gr(n),f&4&&l!==null&&l.memoizedState.isDehydrated)try{wl(r.containerInfo)}catch(ge){Xt(n,n.return,ge)}_g&&(_g=!1,q1(n)),Vt=!1;break;case 4:f=Rs,Rs=Zn,l=u0(),h=as,as=ru(n.stateNode.containerInfo),pr(r,n,i),gr(n),as=h,Vt&&Yc&&(wf=!0),Vt=l,Rs=f;break;case 12:pr(r,n,i),gr(n);break;case 31:pr(r,n,i),gr(n),f&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 13:pr(r,n,i),gr(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cf=at()),f&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 22:h=n.memoizedState!==null,T=l!==null&&l.memoizedState!==null;var M=Zn,Q=Zt,ce=Rs;Zn=M||h,Rs=ce||h,Zt=Q||T,pr(r,n,i),Zt=Q,Rs=ce,Zn=M,gr(n),f&8192&&(r=n.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,!h||l===null||T||Zn||Zt||(r=T||Zt,i=Zn,l=Zt,Zn=h||Zn,Zt=r,qo(n,2),Zn=i,Zt=l),!h&&Rs||Mg(n,h)),f&4&&(r=n.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,Ef(n,i))));break;case 19:pr(r,n,i),gr(n),f&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 30:f&512&&(Zt||l===null||nr(l,l.return)),f=u0(),h=Yc,T=(i&335544064)===i,M=n.memoizedProps,Yc=T&&Gs(M.default,M.update)!=="none",pr(r,n,i),gr(n),T&&l!==null&&Vt&&(n.flags|=4),Yc=h,Vt=f;break;case 21:break;case 7:f&512&&(Zt||l===null||nr(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:pr(r,n,i),gr(n)}}function gr(n){var r=n.flags;if(r&2){try{for(var i,l=n.return;l!==null;){if(j1(l)){i=l;break}l=l.return}l=null;for(var f=n.return;f!==null;){if(wg(f)){var h=f.stateNode;l===null?l=[h]:l.push(h)}if(xg(f))break;f=f.return}var T=l;if(i==null)throw Error(o(160));switch(i.tag){case 27:var M=i.stateNode,Q=Tg(n);vf(n,Q,M,T);break;case 5:var ce=i.stateNode;i.flags&32&&(La(ce,""),i.flags&=-33);var ge=Tg(n);vf(n,ge,ce,T);break;case 3:case 4:var Ee=i.stateNode.containerInfo,ie=Tg(n);Rg(n,ie,Ee,T);break;default:throw Error(o(161))}}catch(he){Xt(n,n.return,he)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function q1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;q1(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,xl=!0,r.reset(),xl=!1),n=n.sibling}}function rl(n,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)$1(r,n),r=r.sibling;else D1(r)}function $1(n,r){var i=n.alternate;if(i===null)Cg(n,!1);else switch(n.tag){case 3:if(Ag=Cs=!1,_1(),rl(r,n),!Cs&&!wf){if(n=Es,n!==null)for(var l=0;l<n.length;l+=3){i=n[l];var f=n[l+1];AS(i,n[l+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}n=r.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ag=!0}Es=null;break;case 5:rl(r,n);break;case 4:l=Cs,Cs=!1,rl(r,n),Cs&&(wf=!0),Cs=l;break;case 22:n.memoizedState===null&&(i.memoizedState!==null?Cg(n,!1):rl(r,n));break;case 30:l=Cs,f=_1(),Cs=!1,rl(r,n),Cs&&(n.flags|=4);var h=n.memoizedProps,T=n.stateNode;r=Ys(h,T),T=Ys(i.memoizedProps,T);var M=Gs(h.default,h.update);M==="none"?r=!1:(h=i.memoizedState,i.memoizedState=null,i=n.child,Tr=0,r=kg(n,i,r,T,M,h,!0),Tr!==(h===null?0:h.length)&&(n.flags|=32)),(n.flags&4)!==0&&r?(ul(n,n.memoizedProps.onUpdate),Es=f):f!==null&&(f.push.apply(f,Es),Es=f),Cs=(n.flags&32)!==0?!0:l;break;default:rl(r,n)}}function Ns(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)P1(n,r.alternate,r),r=r.sibling}function qo(n,r){for(n=n.child;n!==null;){var i=n,l=r;switch(i.tag){case 0:case 11:case 14:case 15:Vo(4,i,i.return),qo(i,l);break;case 1:nr(i,i.return);var f=i.stateNode;typeof f.componentWillUnmount=="function"&&C1(i,i.return,f),qo(i,l);break;case 27:(l&2)!==0&&qS(i.stateNode,i.type,i.memoizedProps);case 5:nr(i,i.return),i.tag!==5&&i.tag!==27||Kc(i),qo(i,l);break;case 6:Kc(i);break;case 26:nr(i,i.return),f=i.stateNode,i.memoizedState!==null||f===null||Zt||f.parentNode.removeChild(f),qo(i,l);break;case 22:i.memoizedState===null&&qo(i,l);break;case 30:nr(i,i.return),qo(i,l);break;case 7:nr(i,i.return);default:qo(i,l)}n=n.sibling}}function ls(n,r,i){for(i=(r.subtreeFlags&8772)!==0?i:i&-2,r=r.child;r!==null;){var l=r.alternate,f=n,h=r,T=h.flags,M=(i&1)!==0;switch(h.tag){case 0:case 11:case 15:ls(f,h,i),Zc(4,h);break;case 1:if(ls(f,h,i),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ge){Xt(l,l.return,ge)}if(l=h,f=l.updateQueue,f!==null){var Q=l.stateNode;try{var ce=f.shared.hiddenCallbacks;if(ce!==null)for(f.shared.hiddenCallbacks=null,f=0;f<ce.length;f++)mw(ce[f],Q)}catch(ge){Xt(l,l.return,ge)}}M&&T&64&&R1(h),Ss(h,h.return);break;case 27:(i&2)!==0&&O1(h);case 5:h.tag!==5&&h.tag!==27||N1(h),ls(f,h,i),M&&l===null&&T&4&&Sg(h),Ss(h,h.return);break;case 6:N1(h);break;case 26:Q=h.stateNode,h.memoizedState!==null||Q===null||Zn||bv(ru(Q.ownerDocument),h.type,Q),ls(f,h,i),M&&l===null&&T&4&&Sg(h),Ss(h,h.return);break;case 12:ls(f,h,i);break;case 31:ls(f,h,i),M&&T&4&&H1(f,h);break;case 13:ls(f,h,i),M&&T&4&&F1(f,h);break;case 22:h.memoizedState===null&&ls(f,h,i),Ss(h,h.return);break;case 30:ls(f,h,i),Ss(h,h.return);break;case 7:Ss(h,h.return);default:ls(f,h,i)}r=r.sibling}}function Dg(n,r){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&Mc(i))}function Ig(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Mc(n))}function Xr(n,r,i,l){var f=(i&335544064)===i;if(r.subtreeFlags&(f?10262:10256))for(r=r.child;r!==null;)Z1(n,r,i,l),r=r.sibling;else f&&z1(r)}function Z1(n,r,i,l){var f=(i&335544064)===i;f&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&xf(r);var h=r.flags;switch(r.tag){case 0:case 11:case 15:Xr(n,r,i,l),h&2048&&Zc(9,r);break;case 1:Xr(n,r,i,l);break;case 3:Xr(n,r,i,l),f&&Ag&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),h&2048&&(h=null,r.alternate!==null&&(h=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==h&&(r.refCount++,h!=null&&Mc(h)));break;case 12:if(h&2048){Xr(n,r,i,l),h=r.stateNode;try{var T=r.memoizedProps,M=T.id,Q=T.onPostCommit;typeof Q=="function"&&Q(M,r.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(ce){Xt(r,r.return,ce)}}else Xr(n,r,i,l);break;case 31:Xr(n,r,i,l);break;case 13:Xr(n,r,i,l);break;case 23:break;case 22:T=r.stateNode,M=r.alternate,r.memoizedState!==null?(f&&M!==null&&M.memoizedState===null&&xf(M),T._visibility&2?Xr(n,r,i,l):Gc(n,r)):(f&&M!==null&&M.memoizedState!==null&&xf(r),T._visibility&2?Xr(n,r,i,l):(T._visibility|=2,sl(n,r,i,l,(r.subtreeFlags&10256)!==0||!1))),h&2048&&Dg(M,r);break;case 24:Xr(n,r,i,l),h&2048&&Ig(r.alternate,r);break;case 30:f&&(h=r.alternate,h!==null&&(Ts(h.child,!0),Ts(r.child,!0))),Xr(n,r,i,l);break;default:Xr(n,r,i,l)}}function sl(n,r,i,l,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var h=n,T=r,M=i,Q=l,ce=T.flags;switch(T.tag){case 0:case 11:case 15:sl(h,T,M,Q,f),Zc(8,T);break;case 23:break;case 22:var ge=T.stateNode;T.memoizedState!==null?ge._visibility&2?sl(h,T,M,Q,f):Gc(h,T):(ge._visibility|=2,sl(h,T,M,Q,f)),f&&ce&2048&&Dg(T.alternate,T);break;case 24:sl(h,T,M,Q,f),f&&ce&2048&&Ig(T.alternate,T);break;default:sl(h,T,M,Q,f)}r=r.sibling}}function Gc(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=n,l=r,f=l.flags;switch(l.tag){case 22:Gc(i,l),f&2048&&Dg(l.alternate,l);break;case 24:Gc(i,l),f&2048&&Ig(l.alternate,l);break;default:Gc(i,l)}r=r.sibling}}var Yi=8192;function Gi(n,r,i){if(n.subtreeFlags&Yi)for(n=n.child;n!==null;)K1(n,r,i),n=n.sibling}function K1(n,r,i){switch(n.tag){case 26:Gi(n,r,i),n.flags&Yi&&(n.memoizedState!==null?EM(i,as,n.memoizedState,n.memoizedProps):(n=n.stateNode,(r&335544128)===r&&eE(i,n)));break;case 5:Gi(n,r,i),n.flags&Yi&&(n=n.stateNode,(r&335544128)===r&&eE(i,n));break;case 3:case 4:var l=as;as=ru(n.stateNode.containerInfo),Gi(n,r,i),as=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Yi,Yi=16777216,Gi(n,r,i),Yi=l):Gi(n,r,i));break;case 30:if((n.flags&Yi)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var f=n.stateNode;f.paired=null,zr===null&&(zr=new Map),zr.set(l,f)}Gi(n,r,i);break;default:Gi(n,r,i)}}function Y1(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Qc(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Kn=l,Q1(l,n)}Y1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)G1(n),n=n.sibling}function G1(n){switch(n.tag){case 0:case 11:case 15:Qc(n),n.flags&2048&&Vo(9,n,n.return);break;case 3:Qc(n);break;case 12:Qc(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Tf(n)):Qc(n);break;default:Qc(n)}}function Tf(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];Kn=l,Q1(l,n)}Y1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Vo(8,r,r.return),Tf(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Tf(r));break;default:Tf(r)}n=n.sibling}}function Q1(n,r){for(;Kn!==null;){var i=Kn;switch(i.tag){case 0:case 11:case 15:Vo(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Mc(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Kn=l;else e:for(i=n;Kn!==null;){l=Kn;var f=l.sibling,h=l.return;if(U1(l),l===i){Kn=null;break e}if(f!==null){f.return=h,Kn=f;break e}Kn=h}}}var bA={getCacheForType:function(n){var r=Wn(_n),i=r.data.get(n);return i===void 0&&(i=n(),r.data.set(n,i)),i},cacheSignal:function(){return Wn(_n).controller.signal}},yA=typeof WeakMap=="function"?WeakMap:Map,qt=0,on=null,Mt=null,It=0,Qt=0,Dr=null,$o=!1,ol=!1,Pg=!1,so=0,En=0,Zo=0,Qi=0,Rf=0,Ir=0,il=0,Xc=null,Cr=null,Lg=!1,Cf=0,X1=0,Nf=1/0,jf=null,Ko=null,yn=0,cs=null,Xi=null,js=0,Ug=0,Bg=null,J1=null,al=null,ll=null,cl=null,Jc=0,Of=null;function Pr(){return(qt&2)!==0&&It!==0?It&-It:de.T!==null?Qg():t0()}function W1(){if(Ir===0)if((It&536870912)===0||jt){var n=un;un<<=1,(un&3932160)===0&&(un=262144),Ir=n}else Ir=536870912;return n=er.current,n!==null&&(n.flags|=32),Ir}function ul(n,r){if(r!=null){var i=n.stateNode,l=i.ref;l===null&&(l=i.ref=MS(Ys(n.memoizedProps,i))),ll===null&&(ll=[]),ll.push(r.bind(null,l))}}function Nr(n,r,i){(n===on&&(Qt===2||Qt===9)||n.cancelPendingCommit!==null)&&(dl(n,0),Yo(n,It,Ir,!1)),Oo(n,i),((qt&2)===0||n!==on)&&(n===on&&((qt&2)===0&&(Qi|=i),En===4&&Yo(n,It,Ir,!1)),Os(n))}function eS(n,r,i){if((qt&6)!==0)throw Error(o(327));var l=!i&&(r&127)===0&&(r&n.expiredLanes)===0||Vn(n,r),f=l?SA(n,r):Fg(n,r,!0),h=l;do{if(f===0){ol&&!l&&Yo(n,r,0,!1);break}else{if(i=n.current.alternate,h&&!xA(i)){f=Fg(n,r,!1),h=!1;continue}if(f===2){if(h=r,n.errorRecoveryDisabledLanes&h)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){r=T;e:{var M=n;f=Xc;var Q=M.current.memoizedState.isDehydrated;if(Q&&(dl(M,T).flags|=256),T=Fg(M,T,!1),T!==2&&T!==6){if(Pg&&!Q){M.errorRecoveryDisabledLanes|=h,Qi|=h,f=4;break e}h=Cr,Cr=f,h!==null&&(Cr===null?Cr=h:Cr.push.apply(Cr,h))}f=T}if(h=!1,f!==2)continue}}if(f===1){dl(n,0),Yo(n,r,0,!0);break}e:{switch(l=n,h=f,h){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Yo(l,r,Ir,!$o);break e;case 2:Cr=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(f=Cf+300-at(),10<f)){if(Yo(l,r,Ir,!$o),Xn(l,0,!0)!==0)break e;js=r,l.timeoutHandle=av(tS.bind(null,l,i,Cr,jf,Lg,r,Ir,Qi,il,$o,h,"Throttled",-0,0),f);break e}tS(l,i,Cr,jf,Lg,r,Ir,Qi,il,$o,h,null,-0,0)}}break}while(!0);Os(n)}function tS(n,r,i,l,f,h,T,M,Q,ce,ge,Ee,ie,he){n.timeoutHandle=-1;var $e=r.subtreeFlags,st=(h&335544064)===h;if(Ee=null,(st||$e&8192||($e&16785408)===16785408)&&(Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ys},zr=null,K1(r,h,Ee),st&&($e=Ee,st=n.containerInfo,st=(st.nodeType===9?st:st.ownerDocument).__reactViewTransition,st!=null&&($e.count++,$e.waitingForViewTransition=!0,$e=iu.bind($e),st.finished.then($e,$e))),$e=(h&62914560)===h?Cf-at():(h&4194048)===h?X1-at():0,$e=TM(Ee,$e),$e!==null)){js=h,n.cancelPendingCommit=$e(cS.bind(null,n,r,h,i,l,f,T,M,Q,ce,ge,Ee,null,ie,he)),Yo(n,h,T,!ce);return}cS(n,r,h,i,l,f,T,M,Q,ce,ge,Ee)}function xA(n){for(var r=n;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],h=f.getSnapshot;f=f.value;try{if(!Ar(h(),f))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Yo(n,r,i,l){r=jo(n,r),r&=~Rf,r&=~Qi,n.suspendedLanes|=r,n.pingedLanes&=~r,l&&(n.warmLanes|=r),l=n.expirationTimes;for(var f=r;0<f;){var h=31-Ce(f),T=1<<h;l[h]=-1,f&=~T}i!==0&&yc(n,i,r)}function kf(){return(qt&6)===0?(Wc(0),!1):!0}function Hg(){if(Mt!==null){if(Qt===0)var n=Mt.return;else n=Mt,Js=Li=null,Gp(n),Xa=null,Ic=0,n=Mt;for(;n!==null;)T1(n.alternate,n),n=n.return;Mt=null}}function dl(n,r){var i=n.timeoutHandle;return i!==-1&&(n.timeoutHandle=-1,qA(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),js=0,Hg(),on=n,Mt=i=Qs(n.current,null),It=r,Qt=0,Dr=null,$o=!1,ol=Vn(n,r),Pg=!1,il=Ir=Rf=Qi=Zo=En=0,Cr=Xc=null,Lg=!1,so=jo(n,r),Pd(),i}function nS(n,r){xt=null,de.H=cf,r===Qa||r===Yd?(r=cw(),Qt=3):r===Ip?(r=cw(),Qt=4):Qt=r===ug?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Dr=r,Mt===null&&(En=1,uf(n,Kr(r,n.current)))}function rS(){var n=er.current;return n===null?!0:(It&4194048)===It?cr===null:(It&62914560)===It||(It&536870912)!==0?n===cr:!1}function sS(){var n=de.H;return de.H=cf,n===null?cf:n}function oS(){var n=de.A;return de.A=bA,n}function _f(){En=4,$o||(It&4194048)!==It&&er.current!==null||(ol=!0),(Zo&134217727)===0&&(Qi&134217727)===0||on===null||Yo(on,It,Ir,!1)}function Fg(n,r,i){var l=qt;qt|=2;var f=sS(),h=oS();(on!==n||It!==r)&&(jf=null,dl(n,r)),r=!1;var T=En;e:do try{if(Qt!==0&&Mt!==null){var M=Mt,Q=Dr;switch(Qt){case 8:Hg(),T=6;break e;case 3:case 2:case 9:case 6:er.current===null&&(r=!0);var ce=Qt;if(Qt=0,Dr=null,fl(n,M,Q,ce),i&&ol){T=0;break e}break;default:ce=Qt,Qt=0,Dr=null,fl(n,M,Q,ce)}}wA(),T=En;break}catch(ge){nS(n,ge)}while(!0);return r&&n.shellSuspendCounter++,Js=Li=null,qt=l,de.H=f,de.A=h,Mt===null&&(on=null,It=0,Pd()),T}function wA(){for(;Mt!==null;)iS(Mt)}function SA(n,r){var i=qt;qt|=2;var l=sS(),f=oS();on!==n||It!==r?(jf=null,Nf=at()+500,dl(n,r)):ol=Vn(n,r);e:do try{if(Qt!==0&&Mt!==null){r=Mt;var h=Dr;t:switch(Qt){case 1:Qt=0,Dr=null,fl(n,r,h,1);break;case 2:case 9:if(aw(h)){Qt=0,Dr=null,aS(r);break}r=function(){Qt!==2&&Qt!==9||on!==n||(Qt=7),Os(n)},h.then(r,r);break e;case 3:Qt=7;break e;case 4:Qt=5;break e;case 7:aw(h)?(Qt=0,Dr=null,aS(r)):(Qt=0,Dr=null,fl(n,r,h,7));break;case 5:var T=null;switch(Mt.tag){case 26:T=Mt.memoizedState;case 5:case 27:var M=Mt;if(T?JS(T):M.stateNode.complete){Qt=0,Dr=null;var Q=M.sibling;if(Q!==null)Mt=Q;else{var ce=M.return;ce!==null?(Mt=ce,Af(ce)):Mt=null}break t}}Qt=0,Dr=null,fl(n,r,h,5);break;case 6:Qt=0,Dr=null,fl(n,r,h,6);break;case 8:Hg(),En=6;break e;default:throw Error(o(462))}}EA();break}catch(ge){nS(n,ge)}while(!0);return Js=Li=null,de.H=l,de.A=f,qt=i,Mt!==null?0:(on=null,It=0,Pd(),En)}function EA(){for(;Mt!==null&&!it();)iS(Mt)}function iS(n){var r=S1(n.alternate,n,so);n.memoizedProps=n.pendingProps,r===null?Af(n):Mt=r}function aS(n){var r=n,i=r.alternate;switch(r.tag){case 15:case 0:r=p1(i,r,r.pendingProps,r.type,void 0,It);break;case 11:r=p1(i,r,r.pendingProps,r.type.render,r.ref,It);break;case 5:Gp(r);var l=r;l===$n&&(jt?(Vd(l),l.tag===5&&l.stateNode!=null&&(an=l.stateNode)):(Vd(l),jt=!0));default:T1(i,r),r=Mt=Q0(r,so),r=S1(i,r,so)}n.memoizedProps=n.pendingProps,r===null?Af(n):Mt=r}function fl(n,r,i,l){Js=Li=null,Gp(r),Xa=null,Ic=0;var f=r.return;try{if(uA(n,f,r,i,It)){En=1,uf(n,Kr(i,n.current)),Mt=null;return}}catch(h){if(f!==null)throw Mt=f,h;En=1,uf(n,Kr(i,n.current)),Mt=null;return}r.flags&32768?(jt||l===1?n=!0:ol||(It&536870912)!==0?n=!1:($o=n=!0,(l===2||l===9||l===3||l===6)&&(l=er.current,l!==null&&l.tag===13&&(l.flags|=16384))),lS(r,n)):Af(r)}function Af(n){var r=n;do{if((r.flags&32768)!==0){lS(r,$o);return}n=r.return;var i=hA(r.alternate,r,so);if(i!==null){Mt=i;return}if(r=r.sibling,r!==null){Mt=r;return}Mt=r=n}while(r!==null);En===0&&(En=5)}function lS(n,r){do{var i=pA(n.alternate,n);if(i!==null){i.flags&=32767,Mt=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(n=n.sibling,n!==null)){Mt=n;return}Mt=n=i}while(n!==null);En=6,Mt=null}function cS(n,r,i,l,f,h,T,M,Q,ce,ge,Ee){n.cancelPendingCommit=null;do Mf();while(yn!==0);if((qt&6)!==0)throw Error(o(327));if(r!==null){if(r===n.current)throw Error(o(177));n===on&&(Mt=on=null,It=0),Xi=r,cs=n,js=i,Bg=f,J1=l,TA(n,r,i,T,M,Q,Ee)}}function TA(n,r,i,l,f,h,T){var M=r.lanes|r.childLanes;if(Ug=M,M|=Ep,Sd(n,i,M,l,f,h),ll=null,(i&335544064)===i?(cl=J_(n),l=10262):(cl=null,l=10256),(r.subtreeFlags&l)!==0||(r.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,kA(Bt,function(){return Zg(),null})):(n.callbackNode=null,n.callbackPriority=0),bf=!1,l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=de.T,de.T=null,f=fe.p,fe.p=2,h=qt,qt|=4;try{gA(n,r,i)}finally{qt=h,fe.p=f,de.T=l}}yn=1,bf?al=QA(T,n.containerInfo,cl,Vg,qg,CA,$g,Zg,RA):(Vg(),qg(),$g())}function RA(n){if(yn!==0){var r=cs.onRecoverableError;r(n,{componentStack:null})}}function CA(){yn===3&&(yn=0,$1(Xi,cs),yn=4)}function Vg(){if(yn===1){yn=0;var n=cs,r=Xi,i=js,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=de.T,de.T=null;var f=fe.p;fe.p=2;var h=qt;qt|=4;try{Yc=wf=!1,V1(r,n,i),i=sv;var T=B0(n.containerInfo),M=i.focusedElem,Q=i.selectionRange;if(T!==M&&M&&M.ownerDocument&&U0(M.ownerDocument.documentElement,M)){if(Q!==null&&bp(M)){var ce=Q.start,ge=Q.end;if(ge===void 0&&(ge=ce),"selectionStart"in M)M.selectionStart=ce,M.selectionEnd=Math.min(ge,M.value.length);else{var Ee=M.ownerDocument||document,ie=Ee&&Ee.defaultView||window;if(ie.getSelection){var he=ie.getSelection(),$e=M.textContent.length,st=Math.min(Q.start,$e),wt=Q.end===void 0?st:Math.min(Q.end,$e);!he.extend&&st>wt&&(T=wt,wt=st,st=T);var le=L0(M,st),re=L0(M,wt);if(le&&re&&(he.rangeCount!==1||he.anchorNode!==le.node||he.anchorOffset!==le.offset||he.focusNode!==re.node||he.focusOffset!==re.offset)){var me=Ee.createRange();me.setStart(le.node,le.offset),he.removeAllRanges(),st>wt?(he.addRange(me),he.extend(re.node,re.offset)):(me.setEnd(re.node,re.offset),he.addRange(me))}}}}for(Ee=[],he=M;he=he.parentNode;)he.nodeType===1&&Ee.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<Ee.length;M++){var Se=Ee[M];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}xl=!!rv,sv=rv=null}finally{qt=h,fe.p=f,de.T=l}}n.current=r,yn=2}}function qg(){if(yn===2){yn=0;var n=cs,r=Xi,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=de.T,de.T=null;var l=fe.p;fe.p=2;var f=qt;qt|=4;try{P1(n,r.alternate,r)}finally{qt=f,fe.p=l,de.T=i}}yn=3}}function $g(){if(yn===4||yn===3){yn=0;var n=al;al=null,qe();var r=cs,i=Xi,l=js,f=J1,h=(l&335544064)===l?10262:10256;if((i.subtreeFlags&h)!==0||(i.flags&h)!==0?yn=5:(yn=0,Xi=cs=null,uS(r,r.pendingLanes)),h=r.pendingLanes,h===0&&(Ko=null),ep(l),i=i.stateNode,ee&&typeof ee.onCommitFiberRoot=="function")try{ee.onCommitFiberRoot(je,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=de.T,h=fe.p,fe.p=2,de.T=null;try{for(var T=r.onRecoverableError,M=0;M<f.length;M++){var Q=f[M];T(Q.value,{componentStack:Q.stack})}}finally{de.T=i,fe.p=h}}if(f=ll,T=cl,cl=null,f!==null&&(ll=null,T===null&&(T=[]),n!==null))for(Q=0;Q<f.length;Q++)i=(0,f[Q])(T),i!==void 0&&n.finished.finally(i);(js&3)!==0&&Mf(),Os(r),h=r.pendingLanes,(l&261930)!==0&&(h&42)!==0?r===Of?Jc++:(Jc=0,Of=r):(Jc=0,Of=null),Wc(0)}}function uS(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Mc(r)))}function Mf(){return al!==null&&(al.skipTransition(),al=null),Vg(),qg(),$g(),Zg()}function Zg(){if(yn!==5)return!1;var n=cs,r=Ug;Ug=0;var i=ep(js),l=de.T,f=fe.p;try{fe.p=32>i?32:i,de.T=null,i=Bg,Bg=null;var h=cs,T=js;if(yn=0,Xi=cs=null,js=0,(qt&6)!==0)throw Error(o(331));var M=qt;if(qt|=4,G1(h.current),Z1(h,h.current,T,i),qt=M,Wc(0,!1),ee&&typeof ee.onPostCommitFiberRoot=="function")try{ee.onPostCommitFiberRoot(je,h)}catch{}return!0}finally{fe.p=f,de.T=l,uS(n,r)}}function dS(n,r,i){r=Kr(i,r),r=cg(n.stateNode,r,2),n=Uo(n,r,2),n!==null&&(Oo(n,2),Os(n))}function Xt(n,r,i){if(n.tag===3)dS(n,n,i);else for(;r!==null;){if(r.tag===3){dS(r,n,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ko===null||!Ko.has(l))){n=Kr(i,n),i=a1(2),l=Uo(r,i,2),l!==null&&(l1(i,l,r,n),Oo(l,2),Os(l));break}}r=r.return}}function Kg(n,r,i){var l=n.pingCache;if(l===null){l=n.pingCache=new yA;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(i)||(Pg=!0,f.add(i),n=NA.bind(null,n,r,i),r.then(n,n))}function NA(n,r,i){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,on===n&&(It&i)===i&&((En===4||En===3&&(It&62914560)===It&&300>at()-Cf)&&(qt&2)===0?dl(n,0):Rf|=i,il===It&&(il=0)),Os(n)}function fS(n,r){r===0&&(r=bc()),n=Di(n,r),n!==null&&(Oo(n,r),Os(n))}function jA(n){var r=n.memoizedState,i=0;r!==null&&(i=r.retryLane),fS(n,i)}function OA(n,r){var i=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(r),fS(n,i)}function kA(n,r){return Rt(n,r)}var ml=null,hl=null,Yg=!1,zf=!1,Gg=!1,Go=0;function Os(n){n!==hl&&n.next===null&&(hl===null?ml=hl=n:hl=hl.next=n),zf=!0,Yg||(Yg=!0,AA())}function Wc(n,r){if(!Gg&&zf){Gg=!0;do for(var i=!1,l=ml;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var T=l.suspendedLanes,M=l.pingedLanes;h=(1<<31-Ce(42|n)+1)-1,h&=f&~(T&~M),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,gS(l,h))}else h=It,h=Xn(l,l===on?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Vn(l,h)||(i=!0,gS(l,h));l=l.next}while(i);Gg=!1}}function _A(){mS()}function mS(){zf=Yg=!1;var n=0;Go!==0&&VA()&&(n=Go);for(var r=at(),i=null,l=ml;l!==null;){var f=l.next,h=hS(l,r);h===0?(l.next=null,i===null?ml=f:i.next=f,f===null&&(hl=i)):(i=l,(n!==0||(h&3)!==0)&&(zf=!0)),l=f}yn!==0&&yn!==5||Wc(n),Go!==0&&(Go=0)}function hS(n,r){for(var i=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,h=n.pendingLanes&-62914561;0<h;){var T=31-Ce(h),M=1<<T,Q=f[T];Q===-1?((M&i)===0||(M&l)!==0)&&(f[T]=ki(M,r)):Q<=r&&(n.expiredLanes|=M),h&=~M}if(r=on,i=It,i=Xn(n,n===r?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,i===0||n===r&&(Qt===2||Qt===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&At(l),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Vn(n,i)){if(r=i&-i,r===n.callbackPriority)return r;switch(l!==null&&At(l),ep(i)){case 2:case 8:i=Gt;break;case 32:i=Bt;break;case 268435456:i=sn;break;default:i=Bt}return l=pS.bind(null,n),i=Rt(i,l),n.callbackPriority=r,n.callbackNode=i,r}return l!==null&&l!==null&&At(l),n.callbackPriority=2,n.callbackNode=null,2}function pS(n,r){if(yn!==0&&yn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Mf()&&n.callbackNode!==i)return null;var l=It;return l=Xn(n,n===on?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(eS(n,l,r),hS(n,at()),n.callbackNode!=null&&n.callbackNode===i?pS.bind(null,n):null)}function gS(n,r){if(Mf())return null;eS(n,r,!0)}function AA(){$A(function(){(qt&6)!==0?Rt(ht,_A):mS()})}function Qg(){if(Go===0){var n=Hi;n===0&&(n=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),Go=n}return Go}function vS(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Od(n)}function MA(n,r,i,l,f){if(r==="submit"&&i&&i.stateNode===f){var h=vS((f[Sr]||null).action),T=l.submitter;T&&(r=(r=T[Sr]||null)?vS(r.formAction):T.getAttribute("formAction"),r!==null&&(h=r,T=null));var M=new Md("action","action",null,l,f);n.push({event:M,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Go!==0){var Q=new FormData(f,T);sg(i,{pending:!0,data:Q,method:f.method,action:h},null,Q)}}else typeof h=="function"&&(M.preventDefault(),Q=new FormData(f,T),sg(i,{pending:!0,data:Q,method:f.method,action:h},h,Q))},currentTarget:f}]})}}for(var Xg=0;Xg<Sp.length;Xg++){var Jg=Sp[Xg],zA=Jg.toLowerCase(),DA=Jg[0].toUpperCase()+Jg.slice(1);os(zA,"on"+DA)}os(V0,"onAnimationEnd"),os(q0,"onAnimationIteration"),os($0,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(q_,"onTransitionRun"),os($_,"onTransitionStart"),os(Z_,"onTransitionCancel"),os(Z0,"onTransitionEnd"),Ia("onMouseEnter",["mouseout","mouseover"]),Ia("onMouseLeave",["mouseout","mouseover"]),Ia("onPointerEnter",["pointerout","pointerover"]),Ia("onPointerLeave",["pointerout","pointerover"]),Ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="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(" "),IA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function bS(n,r){r=(r&4)!==0;for(var i=0;i<n.length;i++){var l=n[i],f=l.event;l=l.listeners;e:{var h=void 0;if(r)for(var T=l.length-1;0<=T;T--){var M=l[T],Q=M.instance,ce=M.currentTarget;if(M=M.listener,Q!==h&&f.isPropagationStopped())break e;h=M,f.currentTarget=ce;try{h(f)}catch(ge){Id(ge)}f.currentTarget=null,h=Q}else for(T=0;T<l.length;T++){if(M=l[T],Q=M.instance,ce=M.currentTarget,M=M.listener,Q!==h&&f.isPropagationStopped())break e;h=M,f.currentTarget=ce;try{h(f)}catch(ge){Id(ge)}f.currentTarget=null,h=Q}}}}function zt(n,r){var i=r[r0];i===void 0&&(i=r[r0]=new Set);var l=n+"__bubble";i.has(l)||(yS(r,n,2,!1),i.add(l))}function Wg(n,r,i){var l=0;r&&(l|=4),yS(i,n,l,r)}var Df="_reactListening"+Math.random().toString(36).slice(2);function ev(n){if(!n[Df]){n[Df]=!0,i0.forEach(function(i){i!=="selectionchange"&&(IA.has(i)||Wg(i,!1,n),Wg(i,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[Df]||(r[Df]=!0,Wg("selectionchange",!1,r))}}function yS(n,r,i,l){switch(lE(r)){case 2:var f=jM;break;case 8:f=OM;break;default:f=xv}i=f.bind(null,r,i,n),f=void 0,!lp||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?n.addEventListener(r,i,{capture:!0,passive:f}):n.addEventListener(r,i,!0):f!==void 0?n.addEventListener(r,i,{passive:f}):n.addEventListener(r,i,!1)}function tv(n,r,i,l,f){var h=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var T=l.tag;if(T===3||T===4){var M=l.stateNode.containerInfo;if(M===f)break;if(T===4)for(T=l.return;T!==null;){var Q=T.tag;if((Q===3||Q===4)&&T.stateNode.containerInfo===f)return;T=T.return}for(;M!==null;){if(T=_i(M),T===null)return;if(Q=T.tag,Q===5||Q===6||Q===26||Q===27){l=h=T;continue e}M=M.parentNode}}l=l.return}y0(function(){var ce=h,ge=ip(i),Ee=[];e:{var ie=K0.get(n);if(ie!==void 0){var he=Md,$e=n;switch(n){case"keypress":if(_d(i)===0)break e;case"keydown":case"keyup":he=x_;break;case"focusin":$e="focus",he=fp;break;case"focusout":$e="blur",he=fp;break;case"beforeblur":case"afterblur":he=fp;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=S0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=l_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=R_;break;case V0:case q0:case $0:he=d_;break;case Z0:he=N_;break;case"scroll":case"scrollend":he=i_;break;case"wheel":he=O_;break;case"copy":case"cut":case"paste":he=m_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=T0;break;case"submit":he=E_;break;case"toggle":case"beforetoggle":he=__}var st=(r&4)!==0,wt=!st&&(n==="scroll"||n==="scrollend"),le=st?ie!==null?ie+"Capture":null:ie;st=[];for(var re=ce,me;re!==null;){var Se=re;if(me=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||me===null||le===null||(Se=Sc(re,le),Se!=null&&st.push(tu(re,Se,me))),wt)break;re=re.return}0<st.length&&(ie=new he(ie,$e,null,i,ge),Ee.push({event:ie,listeners:st}))}}if((r&7)===0){e:{if(he=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",he&&i!==op&&($e=i.relatedTarget||i.fromElement)&&(_i($e)||$e[Ma]))break e;(ie||he)&&($e=ge.window===ge?ge:(he=ge.ownerDocument)?he.defaultView||he.parentWindow:window,ie?(he=i.relatedTarget||i.toElement,ie=ce,he=he?_i(he):null,he!==null&&(wt=c(he),st=he.tag,he!==wt||st!==5&&st!==27&&st!==6)&&(he=null)):(ie=null,he=ce),ie!==he&&(st=S0,Se="onMouseLeave",le="onMouseEnter",re="mouse",(n==="pointerout"||n==="pointerover")&&(st=T0,Se="onPointerLeave",le="onPointerEnter",re="pointer"),wt=ie==null?$e:wc(ie),me=he==null?$e:wc(he),$e=new st(Se,re+"leave",ie,i,ge),$e.target=wt,$e.relatedTarget=me,Se=null,_i(ge)===ce&&(st=new st(le,re+"enter",he,i,ge),st.target=me,st.relatedTarget=wt,Se=st),wt=Se,st=ie&&he?P(ie,he,PA):null,ie!==null&&xS(Ee,$e,ie,st,!1),he!==null&&wt!==null&&xS(Ee,wt,he,st,!0)))}e:{if(ie=ce?wc(ce):window,he=ie.nodeName&&ie.nodeName.toLowerCase(),he==="select"||he==="input"&&ie.type==="file")var Je=A0;else if(k0(ie))if(M0)Je=H_;else{Je=U_;var Pt=L_}else he=ie.nodeName,!he||he.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ce&&sp(ce.elementType)&&(Je=A0):Je=B_;if(Je&&(Je=Je(n,ce))){_0(Ee,Je,i,ge);break e}Pt&&Pt(n,ie,ce)}switch(Pt=ce?wc(ce):window,n){case"focusin":(k0(Pt)||Pt.contentEditable==="true")&&(Fa=Pt,yp=ce,kc=null);break;case"focusout":kc=yp=Fa=null;break;case"mousedown":xp=!0;break;case"contextmenu":case"mouseup":case"dragend":xp=!1,H0(Ee,i,ge);break;case"selectionchange":if(V_)break;case"keydown":case"keyup":H0(Ee,i,ge)}var lt;if(hp)e:{switch(n){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else Ha?j0(n,i)&&(gt="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(gt="onCompositionStart");gt&&(R0&&i.locale!=="ko"&&(Ha||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&Ha&&(lt=x0()):(ko=ge,cp="value"in ko?ko.value:ko.textContent,Ha=!0)),Pt=If(ce,gt),0<Pt.length&&(gt=new E0(gt,n,null,i,ge),Ee.push({event:gt,listeners:Pt}),lt?gt.data=lt:(lt=O0(i),lt!==null&&(gt.data=lt)))),(lt=M_?z_(n,i):D_(n,i))&&(gt=If(ce,"onBeforeInput"),0<gt.length&&(Pt=new E0("onBeforeInput","beforeinput",null,i,ge),Ee.push({event:Pt,listeners:gt}),Pt.data=lt)),MA(Ee,n,ce,i,ge)}bS(Ee,r)})}function tu(n,r,i){return{instance:n,listener:r,currentTarget:i}}function If(n,r){for(var i=r+"Capture",l=[];n!==null;){var f=n,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Sc(n,i),f!=null&&l.unshift(tu(n,f,h)),f=Sc(n,r),f!=null&&l.push(tu(n,f,h))),n.tag===3)return l;n=n.return}return[]}function PA(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function xS(n,r,i,l,f){for(var h=r._reactName,T=[];i!==null&&i!==l;){var M=i,Q=M.alternate,ce=M.stateNode;if(M=M.tag,Q!==null&&Q===l)break;M!==5&&M!==26&&M!==27||ce===null||(Q=ce,f?(ce=Sc(i,h),ce!=null&&T.unshift(tu(i,ce,Q))):f||(ce=Sc(i,h),ce!=null&&T.push(tu(i,ce,Q)))),i=i.return}T.length!==0&&n.push({event:r,listeners:T})}var LA=/\r\n?/g,UA=/\u0000|\uFFFD/g;function wS(n){return(typeof n=="string"?n:""+n).replace(LA,`
|
|
106
|
+
`).replace(UA,"")}function SS(n,r){return r=wS(r),wS(n)===r}function Jt(n,r,i,l,f,h){switch(i){case"children":if(typeof l=="string")r==="body"||r==="textarea"&&l===""||La(n,l);else if(typeof l=="number"||typeof l=="bigint")r!=="body"&&La(n,""+l);else return;break;case"className":jd(n,"class",l);break;case"tabIndex":jd(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":jd(n,i,l);break;case"style":v0(n,l,h);return;case"data":if(r!=="object"){jd(n,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){n.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=Od(l),n.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(i,"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 h=="function"&&(i==="formAction"?(r!=="input"&&Jt(n,r,"name",f.name,f,null),Jt(n,r,"formEncType",f.formEncType,f,null),Jt(n,r,"formMethod",f.formMethod,f,null),Jt(n,r,"formTarget",f.formTarget,f,null)):(Jt(n,r,"encType",f.encType,f,null),Jt(n,r,"method",f.method,f,null),Jt(n,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=Od(l),n.setAttribute(i,l);break;case"onClick":l!=null&&(n.onclick=ys);return;case"onScroll":l!=null&&zt("scroll",n);return;case"onScrollEnd":l!=null&&zt("scrollend",n);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(o(60));(h!=null?h.__html:void 0)!==i&&(n.innerHTML=i)}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}i=Od(l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,l):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":l===!0?n.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,l):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(i,l):n.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(i):n.setAttribute(i,l);break;case"popover":zt("beforetoggle",n),zt("toggle",n),Nd(n,"popover",l);break;case"xlinkActuate":Zs(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zs(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zs(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zs(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zs(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zs(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zs(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Nd(n,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=s_.get(i)||i,Nd(n,i,l);else return}Vt=!0}function nv(n,r,i,l,f,h){switch(i){case"style":v0(n,l,h);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(o(60));(h!=null?h.__html:void 0)!==i&&(n.innerHTML=i)}}break;case"children":if(typeof l=="string")La(n,l);else if(typeof l=="number"||typeof l=="bigint")La(n,""+l);else return;break;case"onScroll":l!=null&&zt("scroll",n);return;case"onScrollEnd":l!=null&&zt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=ys);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!a0.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),h=i.slice(2,f?i.length-7:void 0),r=n[Sr]||null,r=r!=null?r[i]:null,typeof r=="function"&&n.removeEventListener(h,r,f),typeof l=="function")){typeof r!="function"&&r!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(h,l,f);break e}Vt=!0,i in n?n[i]=l:l===!0?n.setAttribute(i,""):Nd(n,i,l)}return}Vt=!0}function rr(n,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":zt("error",n),zt("load",n);var l=!1,f=!1,h;for(h in i)if(i.hasOwnProperty(h)){var T=i[h];if(T!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Jt(n,r,h,T,i,null)}}f&&Jt(n,r,"srcSet",i.srcSet,i,null),l&&Jt(n,r,"src",i.src,i,null);return;case"input":zt("invalid",n);var M=h=T=f=null,Q=null,ce=null;for(l in i)if(i.hasOwnProperty(l)){var ge=i[l];if(ge!=null)switch(l){case"name":f=ge;break;case"type":T=ge;break;case"checked":Q=ge;break;case"defaultChecked":ce=ge;break;case"value":h=ge;break;case"defaultValue":M=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(o(137,r));break;default:Jt(n,r,l,ge,i,null)}}m0(n,h,M,Q,ce,T,f,!1);return;case"select":zt("invalid",n),l=T=h=null;for(f in i)if(i.hasOwnProperty(f)&&(M=i[f],M!=null))switch(f){case"value":h=M;break;case"defaultValue":T=M;break;case"multiple":l=M;default:Jt(n,r,f,M,i,null)}r=h,i=T,n.multiple=!!l,r!=null?Pa(n,!!l,r,!1):i!=null&&Pa(n,!!l,i,!0);return;case"textarea":zt("invalid",n),h=f=l=null;for(T in i)if(i.hasOwnProperty(T)&&(M=i[T],M!=null))switch(T){case"value":l=M;break;case"defaultValue":f=M;break;case"children":h=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(91));break;default:Jt(n,r,T,M,i,null)}p0(n,l,f,h);return;case"option":for(Q in i)if(i.hasOwnProperty(Q)&&(l=i[Q],l!=null))switch(Q){case"selected":n.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Jt(n,r,Q,l,i,null)}return;case"dialog":zt("beforetoggle",n),zt("toggle",n),zt("cancel",n),zt("close",n);break;case"iframe":case"object":zt("load",n);break;case"video":case"audio":for(l=0;l<eu.length;l++)zt(eu[l],n);break;case"image":zt("error",n),zt("load",n);break;case"details":zt("toggle",n);break;case"embed":case"source":case"link":zt("error",n),zt("load",n);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 i)if(i.hasOwnProperty(ce)&&(l=i[ce],l!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:Jt(n,r,ce,l,i,null)}return;default:if(sp(r)){for(ge in i)i.hasOwnProperty(ge)&&(l=i[ge],l!==void 0&&nv(n,r,ge,l,i,void 0));return}}for(M in i)i.hasOwnProperty(M)&&(l=i[M],l!=null&&Jt(n,r,M,l,i,null))}var BA={};function HA(n,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,T=null,M=null,Q=null,ce=null,ge=null;for(he in i){var Ee=i[he];if(i.hasOwnProperty(he)&&Ee!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Q=Ee;default:l.hasOwnProperty(he)||Jt(n,r,he,null,l,Ee)}}for(var ie in l){var he=l[ie];if(Ee=i[ie],l.hasOwnProperty(ie)&&(he!=null||Ee!=null))switch(ie){case"type":he!==Ee&&(Vt=!0),h=he;break;case"name":he!==Ee&&(Vt=!0),f=he;break;case"checked":he!==Ee&&(Vt=!0),ce=he;break;case"defaultChecked":he!==Ee&&(Vt=!0),ge=he;break;case"value":he!==Ee&&(Vt=!0),T=he;break;case"defaultValue":he!==Ee&&(Vt=!0),M=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,r));break;default:he!==Ee&&Jt(n,r,ie,he,l,Ee)}}np(n,T,M,Q,ce,ge,h,f);return;case"select":he=T=M=ie=null;for(h in i)if(Q=i[h],i.hasOwnProperty(h)&&Q!=null)switch(h){case"value":break;case"multiple":he=Q;default:l.hasOwnProperty(h)||Jt(n,r,h,null,l,Q)}for(f in l)if(h=l[f],Q=i[f],l.hasOwnProperty(f)&&(h!=null||Q!=null))switch(f){case"value":h!==Q&&(Vt=!0),ie=h;break;case"defaultValue":h!==Q&&(Vt=!0),M=h;break;case"multiple":h!==Q&&(Vt=!0),T=h;default:h!==Q&&Jt(n,r,f,h,l,Q)}r=M,i=T,l=he,ie!=null?Pa(n,!!i,ie,!1):!!l!=!!i&&(r!=null?Pa(n,!!i,r,!0):Pa(n,!!i,i?[]:"",!1));return;case"textarea":he=ie=null;for(M in i)if(f=i[M],i.hasOwnProperty(M)&&f!=null&&!l.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Jt(n,r,M,null,l,f)}for(T in l)if(f=l[T],h=i[T],l.hasOwnProperty(T)&&(f!=null||h!=null))switch(T){case"value":f!==h&&(Vt=!0),ie=f;break;case"defaultValue":f!==h&&(Vt=!0),he=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==h&&Jt(n,r,T,f,l,h)}h0(n,ie,he);return;case"option":for(var $e in i)if(ie=i[$e],i.hasOwnProperty($e)&&ie!=null&&!l.hasOwnProperty($e))switch($e){case"selected":n.selected=!1;break;default:Jt(n,r,$e,null,l,ie)}for(Q in l)if(ie=l[Q],he=i[Q],l.hasOwnProperty(Q)&&ie!==he&&(ie!=null||he!=null))switch(Q){case"selected":ie!==he&&(Vt=!0),n.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Jt(n,r,Q,ie,l,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 st in i)ie=i[st],i.hasOwnProperty(st)&&ie!=null&&!l.hasOwnProperty(st)&&Jt(n,r,st,null,l,ie);for(ce in l)if(ie=l[ce],he=i[ce],l.hasOwnProperty(ce)&&ie!==he&&(ie!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(o(137,r));break;default:Jt(n,r,ce,ie,l,he)}return;default:if(sp(r)){for(var wt in i)ie=i[wt],i.hasOwnProperty(wt)&&ie!==void 0&&!l.hasOwnProperty(wt)&&nv(n,r,wt,void 0,l,ie);for(ge in l)ie=l[ge],he=i[ge],!l.hasOwnProperty(ge)||ie===he||ie===void 0&&he===void 0||nv(n,r,ge,ie,l,he);return}}for(var le in i)ie=i[le],i.hasOwnProperty(le)&&ie!=null&&!l.hasOwnProperty(le)&&Jt(n,r,le,null,l,ie);for(Ee in l)ie=l[Ee],he=i[Ee],!l.hasOwnProperty(Ee)||ie===he||ie==null&&he==null||Jt(n,r,Ee,ie,l,he)}function ES(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function FA(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],h=f.transferSize,T=f.initiatorType,M=f.duration;if(h&&M&&ES(T)){for(T=0,M=f.responseEnd,l+=1;l<i.length;l++){var Q=i[l],ce=Q.startTime;if(ce>M)break;var ge=Q.transferSize,Ee=Q.initiatorType;ge&&ES(Ee)&&(Q=Q.responseEnd,T+=ge*(Q<M?1:(M-ce)/(Q-ce)))}if(--l,r+=8*(h+T)/(f.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var rv=null,sv=null;function nu(n){return n.nodeType===9?n:n.ownerDocument}function TS(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function RS(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function CS(n,r,i,l){return i=nu(i).createElement(n),i[Jn]=l,i[Sr]=r,rr(i,n,r),qn(i),i}function ov(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var iv=null;function VA(){var n=window.event;return n&&n.type==="popstate"?n===iv?!1:(iv=n,!0):(iv=null,!1)}var av=typeof setTimeout=="function"?setTimeout:void 0,qA=typeof clearTimeout=="function"?clearTimeout:void 0,NS=typeof Promise=="function"?Promise:void 0,jS=typeof requestAnimationFrame=="function"?requestAnimationFrame:av,$A=typeof queueMicrotask=="function"?queueMicrotask:typeof NS<"u"?function(n){return NS.resolve(null).then(n).catch(ZA)}:av;function ZA(n){setTimeout(function(){throw n})}function Qo(n){return n==="head"}function OS(n,r){var i=r,l=0;do{var f=i.nextSibling;if(n.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){n.removeChild(f),wl(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")pv(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,pv(i);for(var h=i.firstChild;h;){var T=h.nextSibling,M=h.nodeName;h[xc]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=T}}else i==="body"&&pv(n.ownerDocument.body);i=f}while(i);wl(r)}function kS(n,r){var i=n;n=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=l}while(i)}function _S(n,r,i){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,n.style.viewTransitionName=r,i!=null&&(n.style.viewTransitionClass=i),i=getComputedStyle(n),i.display==="inline"){if(r=n.getClientRects(),r.length===1)var l=1;else for(var f=l=0;f<r.length;f++){var h=r[f];0<h.width&&0<h.height&&l++}l===1&&(n=n.style,n.display=r.length===1?"inline-block":"block",n.marginTop="-"+i.paddingTop,n.marginBottom="-"+i.paddingBottom)}}function AS(n,r){n=n.style,r=r.style;var i=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;n.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,n.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),n.display==="inline-block"&&(r==null?n.display=n.margin="":(i=r.display,n.display=i==null||typeof i=="boolean"?"":i,i=r.margin,i!=null?n.margin=i:(i=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],n.marginTop=i==null||typeof i=="boolean"?"":i,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],n.marginBottom=r==null||typeof r=="boolean"?"":r)))}function KA(n,r,i){return i=i.ownerDocument.defaultView,{rect:n,abs:r.position==="absolute"||r.position==="fixed",clip:r.clipPath!=="none"||r.overflow!=="visible"||r.filter!=="none"||r.mask!=="none"||r.mask!=="none"||r.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=i.innerHeight&&n.left<=i.innerWidth}}function lv(n){var r=n.getBoundingClientRect(),i=getComputedStyle(n);return KA(r,i,n)}function YA(n){return n.documentElement.clientHeight}function GA(n){this.addEventListener("load",n),this.addEventListener("error",n)}function QA(n,r,i,l,f,h,T,M,Q){var ce=r.nodeType===9?r:r.ownerDocument;try{var ge=ce.startViewTransition({update:function(){var ie=ce.defaultView,he=ie.navigation&&ie.navigation.transition,$e=ce.fonts.status;l();var st=[];if($e==="loaded"&&(YA(ce),ce.fonts.status==="loading"&&st.push(ce.fonts.ready)),$e=st.length,n!==null)for(var wt=n.suspenseyImages,le=0,re=0;re<wt.length;re++){var me=wt[re];if(!me.complete){var Se=me.getBoundingClientRect();if(0<Se.bottom&&0<Se.right&&Se.top<ie.innerHeight&&Se.left<ie.innerWidth){if(le+=WS(me),le>Uf){st.length=$e;break}me=new Promise(GA.bind(me)),st.push(me)}}}if(0<st.length)return ie=Promise.race([Promise.all(st),new Promise(function(Je){return setTimeout(Je,500)})]).then(f,f),(he?Promise.allSettled([he.finished,ie]):ie).then(h,h);if(f(),he)return he.finished.then(h,h);h()},types:i});ce.__reactViewTransition=ge;var Ee=[];return ge.ready.then(function(){for(var ie=ce.documentElement.getAnimations({subtree:!0}),he=0;he<ie.length;he++){var $e=ie[he],st=$e.effect,wt=st.pseudoElement;if(wt!=null&&wt.startsWith("::view-transition")){Ee.push($e),$e=st.getKeyframes();for(var le=wt=void 0,re=!0,me=0;me<$e.length;me++){var Se=$e[me],Je=Se.width;if(wt===void 0)wt=Je;else if(wt!==Je){re=!1;break}if(Je=Se.height,le===void 0)le=Je;else if(le!==Je){re=!1;break}delete Se.width,delete Se.height,Se.transform==="none"&&delete Se.transform}re&&wt!==void 0&&le!==void 0&&(st.setKeyframes($e),re=getComputedStyle(st.target,st.pseudoElement),re.width!==wt||re.height!==le)&&(re=$e[0],re.width=wt,re.height=le,re=$e[$e.length-1],re.width=wt,re.height=le,st.setKeyframes($e))}}T()},function(ie){ce.__reactViewTransition===ge&&(ce.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&Q(ie)}finally{l(),f(),T()}}),ge.finished.finally(function(){for(var ie=0;ie<Ee.length;ie++)Ee[ie].cancel();ce.__reactViewTransition===ge&&(ce.__reactViewTransition=null),M()}),ge}catch{return l(),f(),T(),null}}function Ji(n,r){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+r+")"}Ji.prototype.animate=function(n,r){return r=typeof r=="number"?{duration:r}:L({},r),r.pseudoElement=this._selector,this._scope.animate(n,r)},Ji.prototype.getAnimations=function(){for(var n=this._scope,r=this._selector,i=n.getAnimations({subtree:!0}),l=[],f=0;f<i.length;f++){var h=i[f].effect;h!==null&&h.target===n&&h.pseudoElement===r&&l.push(i[f])}return l},Ji.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function MS(n){return{name:n,group:new Ji("group",n),imagePair:new Ji("image-pair",n),old:new Ji("old",n),new:new Ji("new",n)}}function Lr(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}Lr.prototype.addEventListener=function(n,r,i){var l=null,f=null;if(!(i!=null&&typeof i!="boolean"&&(l=i.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if(DS(h,n,r,i)===-1){var T=this,M=r;i!=null&&typeof i!="boolean"&&i.once===!0&&(M=function(Q){T.removeEventListener(n,r,i),typeof r=="function"?r.call(this,Q):r.handleEvent(Q)}),l!==null&&(f=T.removeEventListener.bind(T,n,r,i),l.addEventListener("abort",f,{once:!0}),f=l.removeEventListener.bind(l,"abort",f)),l=pl(i),h.push({type:n,listener:r,optionsOrUseCapture:i,attachedListener:M,cleanup:f}),p(this._fragmentFiber.child,!1,XA,n,M,l)}this._eventListeners=h}};function XA(n,r,i,l){return R(n).addEventListener(r,i,l),!1}Lr.prototype.removeEventListener=function(n,r,i){var l=this._eventListeners;if(l!==null&&(r=DS(l,n,r,i),r!==-1)){var f=l[r];i=f.attachedListener;var h=f.cleanup;f=pl(f.optionsOrUseCapture),p(this._fragmentFiber.child,!1,JA,n,i,f),l.splice(r,1),h!==null&&h()}};function JA(n,r,i,l){return R(n).removeEventListener(r,i,l),!1}function pl(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function zS(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function DS(n,r,i,l){if(n.length===0)return-1;l=zS(l);for(var f=0;f<n.length;f++){var h=n[f];if(h.type===r&&h.listener===i&&zS(h.optionsOrUseCapture)===l)return f}return-1}Lr.prototype.dispatchEvent=function(n){var r=x(this._fragmentFiber);if(r===null)return!0;r=R(r);var i=this._eventListeners;if(i!==null&&0<i.length||!n.bubbles){var l=r.nodeType===9?r.createComment(""):document.createTextNode("");if(i)for(var f=0;f<i.length;f++){var h=i[f];l.addEventListener(h.type,h.attachedListener,pl(h.optionsOrUseCapture))}if(r.appendChild(l),n=l.dispatchEvent(n),i)for(f=0;f<i.length;f++)h=i[f],l.removeEventListener(h.type,h.attachedListener,pl(h.optionsOrUseCapture));return r.removeChild(l),n}return r.dispatchEvent(n)},Lr.prototype.focus=function(n){p(this._fragmentFiber.child,!0,IS,n,void 0,void 0)};function IS(n,r){return n.tag===6?!1:(n=R(n),uM(n,r))}Lr.prototype.focusLast=function(n){var r=[];p(this._fragmentFiber.child,!0,cv,r,void 0,void 0);for(var i=r.length-1;0<=i&&!IS(r[i],n);i--);};function cv(n,r){return r.push(n),!1}Lr.prototype.blur=function(){var n=x(this._fragmentFiber);n!==null&&(n=R(n),n=nu(n).activeElement,n!==null&&p(this._fragmentFiber.child,!1,WA,n,void 0,void 0))};function WA(n,r){return n.tag===6?!1:(n=R(n),n===r||n.contains(r)?(r.blur(),!0):!1)}Lr.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),p(this._fragmentFiber.child,!1,eM,n,void 0,void 0)};function eM(n,r){return n.tag===6||(n=R(n),r.observe(n)),!1}Lr.prototype.unobserveUsing=function(n){var r=this._observers;if(r!==null&&r.has(n)){r.delete(n),p(this._fragmentFiber.child,!1,tM,n,void 0,void 0);for(var i=r=0;i<us.length;i++){var l=us[i];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):us[r++]=l}us.length=r}};function tM(n,r){return n.tag===6||(n=R(n),r.unobserve(n)),!1}var us=[],uv=!1;function nM(n,r,i){us.push({fragmentInstance:n,observer:r,instance:i}),uv||(uv=!0,dM(function(){uv=!1;var l=us;us=[];for(var f=0;f<l.length;f++){var h=l[f];h.observer.unobserve(h.instance)}}))}Lr.prototype.getClientRects=function(){var n=[];return p(this._fragmentFiber.child,!1,rM,n,void 0,void 0),n};function rM(n,r){if(n.tag===6){n=n.stateNode;var i=n.ownerDocument.createRange();i.selectNodeContents(n),r.push.apply(r,i.getClientRects())}else n=R(n),r.push.apply(r,n.getClientRects());return!1}Lr.prototype.getRootNode=function(n){var r=x(this._fragmentFiber);return r===null?this:R(r).getRootNode(n)},Lr.prototype.compareDocumentPosition=function(n){var r=x(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];p(this._fragmentFiber.child,!1,cv,i,void 0,void 0);var l=R(r);if(i.length===0){if(i=l,S(this._fragmentFiber)){e:{for(r=this._fragmentFiber.return;r!==null;){if(r.tag===4){r=r.stateNode.containerInfo;break e}if(r.tag===3||r.tag===5||r.tag===27)break;r=r.return}r=null}r!=null&&(i=r)}r=this._fragmentFiber;var f=l=i.compareDocumentPosition(n);return i===n?f=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=w(r)[1],i===null?f=Node.DOCUMENT_POSITION_PRECEDING:(n=R(i).compareDocumentPosition(n),f=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=R(i[0]),f=R(i[i.length-1]);var h=S(this._fragmentFiber)?r.parentElement:l;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=h.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var T=r.compareDocumentPosition(n),M=f.compareDocumentPosition(n),Q=T&Node.DOCUMENT_POSITION_CONTAINED_BY||M&Node.DOCUMENT_POSITION_CONTAINED_BY;return M=l&&h&&T&Node.DOCUMENT_POSITION_FOLLOWING&&M&Node.DOCUMENT_POSITION_PRECEDING,r=l&&r===n||h&&f===n||Q||M?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&r===n||!h&&f===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:T,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||sM(r,this._fragmentFiber,i[0],i[i.length-1],n)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sM(n,r,i,l,f){var h=_i(f);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===r||h.alternate===r)){i=!0;break e}h=h.return}i=!1}return i}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=f.ownerDocument,f===h||f===h.documentElement||f===h.body;e:{for(h=r,r=x(r);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==r&&h.alternate!==r)){h=!0;break e}h=h.return}h=!1}return h}return n&Node.DOCUMENT_POSITION_PRECEDING?((r=!!h)&&!(r=h===i)&&(r=P(i,h,D),r===null?r=!1:(p(r,!0,O,h,i),h=C,C=null,r=h!==null)),r):n&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!h)&&!(r=h===l)&&(r=P(l,h,D),r===null?r=!1:(p(r,!0,k,h,l),h=C,j=C=null,r=h!==null)),r):!1}function PS(n,r){var i=n.ownerDocument.createRange();i.selectNodeContents(n),n=i.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,r?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}Lr.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(o(566));var r=[];p(this._fragmentFiber.child,!1,cv,r,void 0,void 0);var i=n!==!1;if(r.length===0){var l=w(this._fragmentFiber);if(l=i?l[1]||l[0]||x(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=R(l),PS(n,i);return}if(l=R(l),l.nodeType!==9){if(l.nodeType===11){i="host"in l?l.host:null,i!==null&&i.scrollIntoView(n);return}l.scrollIntoView(n)}}for(l=i?r.length-1:0;l!==(i?-1:r.length);){var f=r[l];f.tag===6?(f=R(f),PS(f,i)):R(f).scrollIntoView(n),l+=i?-1:1}};function oM(n,r){return n=R(n),LS(n,r),!1}function LS(n,r){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(r)}function US(n,r){var i=r._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];n.addEventListener(f.type,f.attachedListener,pl(f.optionsOrUseCapture))}n.nodeType!==3&&(i=r._observers,i!==null&&i.forEach(function(h){for(var T=0,M=0;M<us.length;M++){var Q=us[M];(Q.fragmentInstance!==r||Q.observer!==h||Q.instance!==n)&&(us[T++]=Q)}us.length=T,h.observe(n)}),LS(n,r))}function iM(n,r){var i=r._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];n.removeEventListener(f.type,f.attachedListener,pl(f.optionsOrUseCapture))}n.nodeType!==3&&(i=r._observers,i!==null&&i.forEach(function(h){typeof h.rootMargin=="string"?nM(r,h,n):h.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(r))}function dv(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":dv(i),Cd(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function aM(n,r,i,l){for(;n.nodeType===1;){var f=i;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[xc])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(h=n.getAttribute("rel"),h==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(h!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(h=n.getAttribute("src"),(h!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===h)return n}else return n;if(n=Jr(n.nextSibling),n===null)break}return null}function lM(n,r,i){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Jr(n.nextSibling),n===null))return null;return n}function BS(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Jr(n.nextSibling),n===null))return null;return n}function fv(n){return n.data==="$?"||n.data==="$~"}function mv(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function cM(n,r){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function Jr(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var hv=null;function HS(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(r===0)return Jr(n.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}n=n.nextSibling}return null}function FS(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return n;r--}else i!=="/$"&&i!=="/&"||r++}n=n.previousSibling}return null}function uM(n,r){function i(){l=!0}if(n.ownerDocument.activeElement===n)return!0;var l=!1;try{n.ownerDocument.addEventListener("focus",i,!0),(n.focus||HTMLElement.prototype.focus).call(n,r)}finally{n.ownerDocument.removeEventListener("focus",i,!0)}return l}function dM(n){jS(function(){jS(function(r){return n(r)})})}function VS(n,r,i){switch(r=nu(i),n){case"html":if(n=r.documentElement,!n)throw Error(o(452));return n;case"head":if(n=r.head,!n)throw Error(o(453));return n;case"body":if(n=r.body,!n)throw Error(o(454));return n;default:throw Error(o(451))}}function qS(n,r,i){for(var l in i){var f=i[l];i.hasOwnProperty(l)&&f!=null&&Jt(n,r,l,null,BA,f)}i.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===ys&&(n.onclick=null),Cd(n)}function pv(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Cd(n)}var Wr=new Map,$S=new Set;function ru(n){if(typeof n.getRootNode=="function"){var r=n.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return n.nodeType===9?n:n.ownerDocument}var oo=fe.d;fe.d={f:fM,r:mM,D:hM,C:pM,L:gM,m:vM,X:yM,S:bM,M:xM};function fM(){var n=oo.f(),r=kf();return n||r}function mM(n){var r=za(n);r!==null&&r.tag===5&&r.type==="form"?Kw(r):oo.r(n)}var gl=typeof document>"u"?null:document;function ZS(n,r,i){var l=gl;if(l&&typeof r=="string"&&r){var f=$r(r);f='link[rel="'+n+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),$S.has(f)||($S.add(f),n={rel:n,crossOrigin:i,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),rr(r,"link",n),qn(r),l.head.appendChild(r)))}}function hM(n){oo.D(n),ZS("dns-prefetch",n,null)}function pM(n,r){oo.C(n,r),ZS("preconnect",n,r)}function gM(n,r,i){oo.L(n,r,i);var l=gl;if(l&&n&&r){var f='link[rel="preload"][as="'+$r(r)+'"]';r==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+$r(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+$r(i.imageSizes)+'"]')):f+='[href="'+$r(n)+'"]';var h=f;switch(r){case"style":h=vl(n);break;case"script":h=bl(n)}if(!(Wr.has(h)||(n=L({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:n,as:r},i),Wr.set(h,n),l.querySelector(f)!==null||r==="style"&&l.querySelector(su(h))||r==="script"&&l.querySelector(ou(h))))){var T=l.createElement("link");rr(T,"link",n),r==="style"&&(T[Rd]=!0,T.onload=T.onerror=function(){o0(T)}),qn(T),l.head.appendChild(T)}}}function vM(n,r){oo.m(n,r);var i=gl;if(i&&n){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+$r(l)+'"][href="'+$r(n)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=bl(n)}if(!Wr.has(h)&&(n=L({rel:"modulepreload",href:n},r),Wr.set(h,n),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ou(h)))return}l=i.createElement("link"),rr(l,"link",n),qn(l),i.head.appendChild(l)}}}function bM(n,r,i){oo.S(n,r,i);var l=gl;if(l&&n){var f=Da(l).hoistableStyles,h=vl(n);r=r||"default";var T=f.get(h);if(!T){var M={loading:0,preload:null};if(T=l.querySelector(su(h)))M.loading=5;else{n=L({rel:"stylesheet",href:n,"data-precedence":r},i),(i=Wr.get(h))&&gv(n,i);var Q=T=l.createElement("link");qn(Q),rr(Q,"link",n),Q._p=new Promise(function(ce,ge){Q.onload=ce,Q.onerror=ge}),Q.addEventListener("load",function(){M.loading|=1}),Q.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Pf(T,r,l)}T={type:"stylesheet",instance:T,count:1,state:M},f.set(h,T)}}}function yM(n,r){oo.X(n,r);var i=gl;if(i&&n){var l=Da(i).hoistableScripts,f=bl(n),h=l.get(f);h||(h=i.querySelector(ou(f)),h||(n=L({src:n,async:!0},r),(r=Wr.get(f))&&vv(n,r),h=i.createElement("script"),qn(h),rr(h,"link",n),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function xM(n,r){oo.M(n,r);var i=gl;if(i&&n){var l=Da(i).hoistableScripts,f=bl(n),h=l.get(f);h||(h=i.querySelector(ou(f)),h||(n=L({src:n,async:!0,type:"module"},r),(r=Wr.get(f))&&vv(n,r),h=i.createElement("script"),qn(h),rr(h,"link",n),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function KS(n,r,i,l){var f=(f=se.current)?ru(f):null;if(!f)throw Error(o(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=vl(i.href),r=Da(f).hoistableStyles,l=r.get(i),l||(l={type:"style",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=vl(i.href);var h=Da(f).hoistableStyles,T=h.get(n);if(T||(f=f.ownerDocument||f,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,T),(h=f.querySelector(su(n)))?h._p||(T.instance=h,T.state.loading=5):(h=Wr.get(n),h||(h={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Wr.set(n,h)),wM(f,n,h,T.state))),r&&l===null)throw Error(o(528,""));return T}if(r&&l!==null)throw Error(o(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(i=bl(i),r=Da(f).hoistableScripts,l=r.get(i),l||(l={type:"script",instance:null,count:0,state:null},r.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,n))}}function vl(n){return'href="'+$r(n)+'"'}function su(n){return'link[rel="stylesheet"]['+n+"]"}function YS(n){return L({},n,{"data-precedence":n.precedence,precedence:null})}function wM(n,r,i,l){if(r=n.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[Rd]!==!0){l.loading=1;return}}else r=n.createElement("link"),r[Rd]=!0,r.onload=r.onerror=o0.bind(null,r),rr(r,"link",i),qn(r),n.head.appendChild(r);l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2})}function bl(n){return'[src="'+$r(n)+'"]'}function ou(n){return"script[async]"+n}function GS(n,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+$r(i.href)+'"]');if(l)return r.instance=l,qn(l),l;var f=L({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),qn(l),rr(l,"style",f),Pf(l,i.precedence,n),r.instance=l;case"stylesheet":f=vl(i.href);var h=n.querySelector(su(f));if(h)return r.state.loading|=4,r.instance=h,qn(h),h;l=YS(i),(f=Wr.get(f))&&gv(l,f),h=(n.ownerDocument||n).createElement("link"),qn(h);var T=h;return T._p=new Promise(function(M,Q){T.onload=M,T.onerror=Q}),rr(h,"link",l),r.state.loading|=4,Pf(h,i.precedence,n),r.instance=h;case"script":return h=bl(i.src),(f=n.querySelector(ou(h)))?(r.instance=f,qn(f),f):(l=i,(f=Wr.get(h))&&(l=L({},i),vv(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),qn(f),rr(f,"link",l),n.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Pf(l,i.precedence,n));return r.instance}function Pf(n,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,T=0;T<l.length;T++){var M=l[T];if(M.dataset.precedence===r)h=M;else if(h!==f)break}h?h.parentNode.insertBefore(n,h.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(n,r.firstChild))}function gv(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function vv(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var Lf=null;function QS(n,r,i){if(Lf===null){var l=new Map,f=Lf=new Map;f.set(i,l)}else f=Lf,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(n))return l;for(l.set(n,null),i=i.getElementsByTagName(n),f=0;f<i.length;f++){var h=i[f];if(!(h[xc]||h[Jn]||n==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var T=h.getAttribute(r)||"";T=n+T;var M=l.get(T);M?M.push(h):l.set(T,[h])}}return l}function bv(n,r,i){n=n.ownerDocument||n,n.head.insertBefore(i,r==="title"?n.querySelector("head > title"):null)}function SM(n,r,i){if(i===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function XS(n,r){return n==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function JS(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function WS(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function eE(n,r){typeof r.decode=="function"&&(n.imgCount++,r.complete||(n.imgBytes+=WS(r),n.suspenseyImages.push(r)),n=RM.bind(n),r.decode().then(n,n))}function EM(n,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=vl(l.href),h=r.querySelector(su(f));if(h){r=h._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=iu.bind(n),r.then(n,n)),i.state.loading|=4,i.instance=h,qn(h);return}h=r.ownerDocument||r,l=YS(l),(f=Wr.get(f))&&gv(l,f),h=h.createElement("link"),qn(h);var T=h;T._p=new Promise(function(M,Q){T.onload=M,T.onerror=Q}),rr(h,"link",l),i.instance=h}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=iu.bind(n),r.addEventListener("load",i),r.addEventListener("error",i))}}var Uf=0;function TM(n,r){return n.stylesheets&&n.count===0&&Hf(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var l=setTimeout(function(){if(n.stylesheets&&Hf(n,n.stylesheets),n.unsuspend){var h=n.unsuspend;n.unsuspend=null,h()}},6e4+r);0<n.imgBytes&&Uf===0&&(Uf=62500*FA());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Hf(n,n.stylesheets),n.unsuspend)){var h=n.unsuspend;n.unsuspend=null,h()}},(n.imgBytes>Uf?50:800)+r);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function tE(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Hf(n,n.stylesheets);else if(n.unsuspend){var r=n.unsuspend;n.unsuspend=null,r()}}}function iu(){this.count--,tE(this)}function RM(){this.imgCount--,tE(this)}var Bf=null;function Hf(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Bf=new Map,r.forEach(CM,n),Bf=null,iu.call(n))}function CM(n,r){if(!(r.state.loading&4)){var i=Bf.get(n);if(i)var l=i.get(null);else{i=new Map,Bf.set(n,i);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var T=f[h];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(i.set(T.dataset.precedence,T),l=T)}l&&i.set(null,l)}f=r.instance,T=f.getAttribute("data-precedence"),h=i.get(T)||l,h===l&&i.set(null,f),i.set(T,f),this.count++,l=iu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),r.state.loading|=4}}var yl={$$typeof:G,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function NM(n,r,i,l,f,h,T,M,Q){this.tag=1,this.containerInfo=n,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=Aa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Aa(0),this.hiddenUpdates=Aa(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.transitionTypes=null,this.incompleteTransitions=new Map}function nE(n,r,i,l,f,h,T,M,Q,ce,ge,Ee){return n=new NM(n,r,i,T,Q,ce,ge,Ee,M),r=1,h===!0&&(r|=24),h=Er(3,null,null,r),n.current=h,h.stateNode=n,r=Mp(),r.refCount++,n.pooledCache=r,r.refCount++,h.memoizedState={element:l,isDehydrated:i,cache:r},Pp(h),n}function rE(n){return n?(n=$a,n):$a}function sE(n,r,i,l,f,h){f=rE(f),l.context===null?l.context=f:l.pendingContext=f,l=Lo(r),l.payload={element:i},h=h===void 0?null:h,h!==null&&(l.callback=h),i=Uo(n,l,r),i!==null&&(Nr(i,n,r),Pc(i,n,r))}function oE(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<r?i:r}}function yv(n,r){oE(n,r),(n=n.alternate)&&oE(n,r)}function iE(n){if(n.tag===13||n.tag===31){var r=Di(n,67108864);r!==null&&Nr(r,n,67108864),yv(n,67108864)}}function aE(n){if(n.tag===13||n.tag===31){var r=Pr();r=Wh(r);var i=Di(n,r);i!==null&&Nr(i,n,r),yv(n,r)}}var xl=!0;function jM(n,r,i,l){var f=de.T;de.T=null;var h=fe.p;try{fe.p=2,xv(n,r,i,l)}finally{fe.p=h,de.T=f}}function OM(n,r,i,l){var f=de.T;de.T=null;var h=fe.p;try{fe.p=8,xv(n,r,i,l)}finally{fe.p=h,de.T=f}}function xv(n,r,i,l){if(xl){var f=wv(l);if(f===null)tv(n,r,l,Ff,i),cE(n,l);else if(_M(f,n,r,i,l))l.stopPropagation();else if(cE(n,l),r&4&&-1<kM.indexOf(n)){for(;f!==null;){var h=za(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var T=hn(h.pendingLanes);if(T!==0){var M=h;for(M.pendingLanes|=2,M.entangledLanes|=2;T;){var Q=1<<31-Ce(T);M.entanglements[1]|=Q,T&=~Q}Os(h),(qt&6)===0&&(Nf=at()+500,Wc(0))}}break;case 31:case 13:M=Di(h,2),M!==null&&Nr(M,h,2),kf(),yv(h,2)}if(h=wv(l),h===null&&tv(n,r,l,Ff,i),h===f)break;f=h}f!==null&&l.stopPropagation()}else tv(n,r,l,null,i)}}function wv(n){return n=ip(n),Sv(n)}var Ff=null;function Sv(n){if(Ff=null,n=_i(n),n!==null){var r=c(n);if(r===null)n=null;else{var i=r.tag;if(i===13){if(n=u(r),n!==null)return n;n=null}else if(i===31){if(n=m(r),n!==null)return n;n=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Ff=n,null}function lE(n){switch(n){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Nt()){case ht:return 2;case Gt:return 8;case Bt:case Ft:return 32;case sn:return 268435456;default:return 32}default:return 32}}var Ev=!1,Xo=null,Jo=null,Wo=null,au=new Map,lu=new Map,ei=[],kM="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 cE(n,r){switch(n){case"focusin":case"focusout":Xo=null;break;case"dragenter":case"dragleave":Jo=null;break;case"mouseover":case"mouseout":Wo=null;break;case"pointerover":case"pointerout":au.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":lu.delete(r.pointerId)}}function cu(n,r,i,l,f,h){return n===null||n.nativeEvent!==h?(n={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},r!==null&&(r=za(r),r!==null&&iE(r)),n):(n.eventSystemFlags|=l,r=n.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),n)}function _M(n,r,i,l,f){switch(r){case"focusin":return Xo=cu(Xo,n,r,i,l,f),!0;case"dragenter":return Jo=cu(Jo,n,r,i,l,f),!0;case"mouseover":return Wo=cu(Wo,n,r,i,l,f),!0;case"pointerover":var h=f.pointerId;return au.set(h,cu(au.get(h)||null,n,r,i,l,f)),!0;case"gotpointercapture":return h=f.pointerId,lu.set(h,cu(lu.get(h)||null,n,r,i,l,f)),!0}return!1}function uE(n){var r=_i(n.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=u(i),r!==null){n.blockedOn=r,n0(n.priority,function(){aE(i)});return}}else if(r===31){if(r=m(i),r!==null){n.blockedOn=r,n0(n.priority,function(){aE(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Vf(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var i=wv(n.nativeEvent);if(i===null){i=n.nativeEvent;var l=new i.constructor(i.type,i);op=l,i.target.dispatchEvent(l),op=null}else return r=za(i),r!==null&&iE(r),n.blockedOn=i,!1;r.shift()}return!0}function dE(n,r,i){Vf(n)&&i.delete(r)}function AM(){Ev=!1,Xo!==null&&Vf(Xo)&&(Xo=null),Jo!==null&&Vf(Jo)&&(Jo=null),Wo!==null&&Vf(Wo)&&(Wo=null),au.forEach(dE),lu.forEach(dE)}function qf(n,r){n.blockedOn===r&&(n.blockedOn=null,Ev||(Ev=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AM)))}var $f=null;function fE(n){$f!==n&&($f=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){$f===n&&($f=null);for(var r=0;r<n.length;r+=3){var i=n[r],l=n[r+1],f=n[r+2];if(typeof l!="function"){if(Sv(l||i)===null)continue;break}var h=za(i);h!==null&&(n.splice(r,3),r-=3,sg(h,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function wl(n){function r(Q){return qf(Q,n)}Xo!==null&&qf(Xo,n),Jo!==null&&qf(Jo,n),Wo!==null&&qf(Wo,n),au.forEach(r),lu.forEach(r);for(var i=0;i<ei.length;i++){var l=ei[i];l.blockedOn===n&&(l.blockedOn=null)}for(;0<ei.length&&(i=ei[0],i.blockedOn===null);)uE(i),i.blockedOn===null&&ei.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],h=i[l+1],T=f[Sr]||null;if(typeof h=="function")T||fE(i);else if(T){var M=null;if(h&&h.hasAttribute("formAction")){if(f=h,T=h[Sr]||null)M=T.formAction;else if(Sv(f)!==null)continue}else M=T.action;typeof M=="function"?i[l+1]=M:(i.splice(l,3),l-=3),fE(i)}}}function mE(){function n(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(T){return f=T})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function Tv(n){this._internalRoot=n}Zf.prototype.render=Tv.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(o(409));var i=r.current,l=Pr();sE(i,l,n,r,null,null)},Zf.prototype.unmount=Tv.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;sE(n.current,2,null,n,null,null),kf(),r[Ma]=null}};function Zf(n){this._internalRoot=n}Zf.prototype.unstable_scheduleHydration=function(n){if(n){var r=t0();n={blockedOn:null,target:n,priority:r};for(var i=0;i<ei.length&&r!==0&&r<ei[i].priority;i++);ei.splice(i,0,n),i===0&&uE(n)}};var hE=t.version;if(hE!=="19.3.1")throw Error(o(527,hE,"19.3.1"));fe.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(o(188)):(n=Object.keys(n).join(","),Error(o(268,n)));return n=v(r),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var MM={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{je=Kf.inject(MM),ee=Kf}catch{}}return mu.createRoot=function(n,r){if(!a(n))throw Error(o(299));var i=!1,l="",f=r1,h=s1,T=o1;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(h=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError)),r=nE(n,1,!1,null,null,i,l,null,f,h,T,mE),n[Ma]=r.current,ev(n),new Tv(r)},mu.hydrateRoot=function(n,r,i){if(!a(n))throw Error(o(299));var l=!1,f="",h=r1,T=s1,M=o1,Q=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(T=i.onCaughtError),i.onRecoverableError!==void 0&&(M=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),r=nE(n,1,!0,r,i??null,l,f,Q,h,T,M,mE),r.context=rE(null),i=r.current,l=Pr(),l=Wh(l),f=Lo(l),f.callback=null,Uo(i,f,l),i=l,r.current.lanes=i,Oo(r,i),Os(r),n[Ma]=r.current,ev(n),new Zf(r)},mu.version="19.3.1",mu}var pT;function t5(){if(pT)return Dv.exports;pT=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(),Dv.exports=e5(),Dv.exports}var n5=t5();/**
|
|
107
|
+
* @license lucide-react v1.78.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const r5=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();/**
|
|
112
|
+
* @license lucide-react v1.78.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/function s5(e,t,s=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:r5(e),size:24,node:t,...s.length>0?{aliases:s}:{}}}/**
|
|
117
|
+
* @license lucide-react v1.78.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const o5=e=>{let t="",s=!1;for(const o of e){if(o==="-"||o==="_"||o<=" "){s=t.length>0;continue}t.length===0?t+=o.toLowerCase():t+=s?o.toUpperCase():o,s=!1}return t};/**
|
|
122
|
+
* @license lucide-react v1.78.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const i5=e=>{const t=o5(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
127
|
+
* @license lucide-react v1.78.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Mb=(...e)=>{const t=new Set;for(const s of e)if(typeof s=="string")for(const o of s.split(/\s+/))o&&t.add(o);return[...t].join(" ")};/**
|
|
132
|
+
* @license lucide-react v1.78.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Sl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
137
|
+
* @license lucide-react v1.78.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/function Uv(e){return e!=null}function a5(e,t={}){var x,S;const s=t.attributeNames??{},o=w=>s[w]??w,a=e.size??e.width??Sl.width,c=e.size??e.height??Sl.height,u=((x=e.aliases)==null?void 0:x.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],m=[...e.name?[`lucide-${e.name}`]:[],...u],g=((S=t.className)==null?void 0:S.split(" ").filter(Boolean))??[],v=t.includeDefaultClasses===!1?Mb(...g):Mb("lucide",...m,...g);let b=t.strokeWidth??Sl["stroke-width"];if(t.absoluteStrokeWidth){const w=Number(b)*Number(e.size??e.width??Sl.width)/Number(t.size??t.width??Sl.width);Number.isFinite(w)&&(b=w)}return["svg",{...Object.entries(Sl).reduce((w,[E,R])=>(w[o(E)]=R,w),{}),..."color"in t&&t.color&&{[o("stroke")]:t.color},..."size"in t&&Uv(t.size)&&{[o("width")]:t.size,[o("height")]:t.size},..."width"in t&&Uv(t.width)&&{[o("width")]:t.width},..."height"in t&&Uv(t.height)&&{[o("height")]:t.height},[o("stroke-width")]:b,...v&&{[o("class")]:v},[o("viewBox")]:`0 0 ${a} ${c}`,...t.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(w=>{const[E,R,C]=w,j=t.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...R}:R;return C?[E,j,C]:[E,j]})]}/**
|
|
142
|
+
* @license lucide-react v1.78.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/function l5(e,t={}){return a5(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
147
|
+
* @license lucide-react v1.78.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const c5=e=>{if(e==null||typeof e!="object")return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith("aria-")||t==="role"||t==="title")&&e[t]!=null)return!0;return!1},u5=y.createContext({}),d5=()=>y.useContext(u5),f5=y.forwardRef(({color:e,size:t,width:s,height:o,strokeWidth:a,absoluteStrokeWidth:c,nonScalingStroke:u,className:m="",children:g,iconNode:v=[],icon:b={node:v,aliases:[],size:24},...p},x)=>{const{size:S=24,strokeWidth:w=2,absoluteStrokeWidth:E=!1,nonScalingStroke:R=!1,color:C="currentColor",className:j=""}=d5()??{},O=!!g||c5(p),[k,D,P=[]]=l5(b,{color:e??C,width:s??t??S,height:o??t??S,strokeWidth:a??w,absoluteStrokeWidth:c??E,nonScalingStroke:u??R,className:Mb(j,m),hasA11yProp:O,attributes:p});return y.createElement(k,{ref:x,...D},[...P.map(([L,_])=>y.createElement(L,_)),...Array.isArray(g)?g:[g]])});/**
|
|
152
|
+
* @license lucide-react v1.78.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/function Yt(e,t=[],s=[]){const o=typeof e=="string"?s5(e,t,s):e,a=y.forwardRef(({className:c,...u},m)=>y.createElement(f5,{ref:m,icon:o,className:c,...u}));return o.name&&(a.displayName=i5(o.name)),a}/**
|
|
157
|
+
* @license lucide-react v1.78.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const NN={name:"brush",size:24,node:[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]]};NN.node;const m5=Yt(NN);/**
|
|
162
|
+
* @license lucide-react v1.78.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const jN={name:"carets-to-axis-dashed-horizontal",size:24,node:[["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M7.298 20.288A1 1 0 0 0 8 22h8a1 1 0 0 0 .703-1.712l-3.991-3.99a1 1 0 0 0-1.424-.001z",key:"8e5jlf"}],["path",{d:"M7.298 3.712A1 1 0 0 1 8 2h8a1 1 0 0 1 .703 1.712l-3.991 3.99a1 1 0 0 1-1.424.001z",key:"13b1h1"}]],aliases:["flip-horizontal-2","triangles-centerline-dashed-horizontal"]};jN.node;const h5=Yt(jN);/**
|
|
167
|
+
* @license lucide-react v1.78.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const ON={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};ON.node;const kN=Yt(ON);/**
|
|
172
|
+
* @license lucide-react v1.78.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const _N={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};_N.node;const gh=Yt(_N);/**
|
|
177
|
+
* @license lucide-react v1.78.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const AN={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};AN.node;const p5=Yt(AN);/**
|
|
182
|
+
* @license lucide-react v1.78.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const MN={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};MN.node;const g5=Yt(MN);/**
|
|
187
|
+
* @license lucide-react v1.78.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const zN={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};zN.node;const DN=Yt(zN);/**
|
|
192
|
+
* @license lucide-react v1.78.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const IN={name:"download",size:24,node:[["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"}]]};IN.node;const v5=Yt(IN);/**
|
|
197
|
+
* @license lucide-react v1.78.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const PN={name:"ellipsis",size:24,node:[["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"}]],aliases:["more-horizontal"]};PN.node;const b5=Yt(PN);/**
|
|
202
|
+
* @license lucide-react v1.78.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const LN={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};LN.node;const y5=Yt(LN);/**
|
|
207
|
+
* @license lucide-react v1.78.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const UN={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};UN.node;const x5=Yt(UN);/**
|
|
212
|
+
* @license lucide-react v1.78.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const BN={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};BN.node;const HN=Yt(BN);/**
|
|
217
|
+
* @license lucide-react v1.78.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const FN={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};FN.node;const VN=Yt(FN);/**
|
|
222
|
+
* @license lucide-react v1.78.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const qN={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};qN.node;const $N=Yt(qN);/**
|
|
227
|
+
* @license lucide-react v1.78.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const ZN={name:"log-out",size:24,node:[["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"}]]};ZN.node;const w5=Yt(ZN);/**
|
|
232
|
+
* @license lucide-react v1.78.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const KN={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};KN.node;const S5=Yt(KN);/**
|
|
237
|
+
* @license lucide-react v1.78.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const YN={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};YN.node;const E5=Yt(YN);/**
|
|
242
|
+
* @license lucide-react v1.78.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const GN={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};GN.node;const T5=Yt(GN);/**
|
|
247
|
+
* @license lucide-react v1.78.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const QN={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};QN.node;const R5=Yt(QN);/**
|
|
252
|
+
* @license lucide-react v1.78.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const XN={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],aliases:["edit-3"]};XN.node;const C5=Yt(XN);/**
|
|
257
|
+
* @license lucide-react v1.78.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const JN={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};JN.node;const zb=Yt(JN);/**
|
|
262
|
+
* @license lucide-react v1.78.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const WN={name:"rotate-ccw",size:24,node:[["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"}]]};WN.node;const N5=Yt(WN);/**
|
|
267
|
+
* @license lucide-react v1.78.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const e2={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};e2.node;const j5=Yt(e2);/**
|
|
272
|
+
* @license lucide-react v1.78.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const t2={name:"settings",size:24,node:[["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"}]]};t2.node;const n2=Yt(t2);/**
|
|
277
|
+
* @license lucide-react v1.78.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const r2={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};r2.node;const O5=Yt(r2);/**
|
|
282
|
+
* @license lucide-react v1.78.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const s2={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};s2.node;const k5=Yt(s2);/**
|
|
287
|
+
* @license lucide-react v1.78.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const o2={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};o2.node;const _5=Yt(o2);/**
|
|
292
|
+
* @license lucide-react v1.78.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const i2={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]};i2.node;const a2=Yt(i2);/**
|
|
297
|
+
* @license lucide-react v1.78.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const l2={name:"triangle-exclamation-point",size:24,node:[["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"}]],aliases:["alert-triangle","triangle-alert"]};l2.node;const c2=Yt(l2);/**
|
|
302
|
+
* @license lucide-react v1.78.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const u2={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};u2.node;const Oa=Yt(u2);var Hs=CN();const A5=gC(Hs);function M5(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const z5=e=>{switch(e){case"success":return P5;case"info":return U5;case"warning":return L5;case"error":return B5;default:return null}},D5=Array(12).fill(0),I5=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},D5.map((s,o)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),P5=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Fe.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"})),L5=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Fe.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"})),U5=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Fe.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"})),B5=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Fe.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"})),H5=Fe.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","aria-hidden":"true"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),F5=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[]),e};let V5=1;const q5=100,gT=e=>{var t;return typeof(e==null?void 0:e.id)=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:V5++};class $5{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(s=>t(s)),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-q5;t<=0||(this.toasts=this.toasts.filter(s=>t>0&&this.dismissedToasts.has(s.id)?(this.dismissedToasts.delete(s.id),t--,!1):!0))},this.create=t=>{const{message:s,...o}=t,a=gT(t),c=this.pendingDismissals.get(a);c!==void 0&&(cancelAnimationFrame(c),this.pendingDismissals.delete(a),this.dismissedToasts.delete(a));const u=this.dismissedToasts.has(a),m=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(a),this.toasts=this.toasts.filter(v=>v.id!==a)),(u?void 0:this.toasts.find(v=>v.id===a))?this.toasts=this.toasts.map(v=>v.id===a?(this.publish({...v,...t,id:a,title:s}),{...v,...t,id:a,dismissible:m,title:s}):v):this.addToast({title:s,...o,dismissible:m,id:a}),a},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(o=>{this.dismissedToasts.add(o.id),this.subscribers.forEach(a=>a({id:o.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const s=this.pendingDismissals.get(t);return s!==void 0&&cancelAnimationFrame(s),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(o=>o({id:t,dismiss:!0}))})),t},this.message=(t,s)=>this.create({...s,message:t,type:void 0}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let c=o!==void 0,u;const m=a.then(async v=>{if(u=["resolve",v],Fe.isValidElement(v))c=!1,this.create({id:o,type:"default",message:v});else if(K5(v)&&!v.ok){c=!1;const p=typeof s.error=="function"?await s.error(`HTTP error! status: ${v.status}`):s.error,x=typeof s.description=="function"?await s.description(`HTTP error! status: ${v.status}`):s.description,w=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:x,...w})}else if(v instanceof Error){c=!1;const p=typeof s.error=="function"?await s.error(v):s.error,x=typeof s.description=="function"?await s.description(v):s.description,w=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:x,...w})}else if(s.success!==void 0){c=!1;const p=typeof s.success=="function"?await s.success(v):s.success,x=typeof s.description=="function"?await s.description(v):s.description,w=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:o,type:"success",description:x,...w})}}).catch(async v=>{if(u=["reject",v],s.error!==void 0){c=!1;const b=typeof s.error=="function"?await s.error(v):s.error,p=typeof s.description=="function"?await s.description(v):s.description,S=typeof b=="object"&&!Fe.isValidElement(b)?b:{message:b};this.create({id:o,type:"error",description:p,...S})}}).finally(()=>{c&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),g=()=>new Promise((v,b)=>m.then(()=>u[0]==="reject"?b(u[1]):v(u[1])).catch(b));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(t,s)=>{const o=gT(s);return this.create({...s,jsx:t(o),id:o,type:void 0}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const jr=new $5,Z5=(e,t)=>jr.message(e,t),K5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Y5=Z5,G5=()=>jr.toasts,Q5=()=>jr.getActiveToasts(),Au=Object.assign(Y5,{success:jr.success,info:jr.info,warning:jr.warning,error:jr.error,custom:jr.custom,message:jr.message,promise:jr.promise,dismiss:jr.dismiss,loading:jr.loading},{getHistory:G5,getToasts:Q5});M5("[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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 tm(e){return e.label!==void 0}const X5=3,J5="24px",W5="16px",vT=4e3,e6=356,t6=14,n6=45,r6=200;function ks(...e){return e.filter(Boolean).join(" ")}function s6(e){const[t,s]=e.split("-"),o=[];return t&&o.push(t),s&&o.push(s),o}const o6=e=>{var t,s,o,a,c,u,m,g,v;const{invert:b,toast:p,unstyled:x,interacting:S,setHeights:w,visibleToasts:E,heights:R,index:C,toasts:j,expanded:O,removeToast:k,defaultRichColors:D,closeButton:P,style:L,cancelButtonStyle:_,actionButtonStyle:V,className:I="",descriptionClassName:X="",duration:Y,position:q,gap:$,expandByDefault:G,classNames:H,icons:K,closeButtonAriaLabel:B="Close toast"}=e,[A,U]=Fe.useState(null),[J,F]=Fe.useState(null),[oe,N]=Fe.useState(!1),[z,Z]=Fe.useState(!1),[te,ue]=Fe.useState(!1),[W,be]=Fe.useState(!1),[de,fe]=Fe.useState(!1),[xe,pe]=Fe.useState(0),[we,Oe]=Fe.useState(0),ke=Fe.useRef(p.duration||Y||vT),Pe=Fe.useRef(null),Te=Fe.useRef(null),He=C===0,se=C+1<=E,ye=p.type,Ae=ye??"default",Be=p.dismissible!==!1,ae=p.className||"",ve=p.descriptionClassName||"",ze=Fe.useMemo(()=>R.findIndex(rt=>rt.toastId===p.id)||0,[R,p.id]),_e=Fe.useMemo(()=>{var rt;return(rt=p.closeButton)!=null?rt:P},[p.closeButton,P]),Re=Fe.useMemo(()=>p.duration||Y||vT,[p.duration,Y]),Ge=Fe.useRef(0),Ye=Fe.useRef(0),mt=Fe.useRef(0),nt=Fe.useRef(null),[ut,Rt]=q.split("-"),At=Fe.useMemo(()=>R.reduce((rt,Dt,je)=>je>=ze?rt:rt+Dt.height,0),[R,ze]),it=F5(),qe=Fe.useMemo(()=>{var rt;return(rt=e.swipeDirections)!=null?rt:s6(q)},[e.swipeDirections,q]),at=p.invert||b,Nt=ye==="loading";Ye.current=Fe.useMemo(()=>ze*$+At,[ze,At]),Fe.useEffect(()=>{ke.current=Re},[Re]),Fe.useEffect(()=>{N(!0)},[]),Fe.useEffect(()=>{const rt=Te.current;if(rt){const Dt=rt.getBoundingClientRect().height;return Oe(Dt),w(je=>[{toastId:p.id,height:Dt,position:p.position},...je]),()=>w(je=>je.filter(ee=>ee.toastId!==p.id))}},[w,p.id]),Fe.useLayoutEffect(()=>{if(!oe)return;const rt=Te.current,Dt=rt.style.height;rt.style.height="auto";const je=rt.getBoundingClientRect().height;rt.style.height=Dt,Oe(je),w(ee=>ee.find(Ce=>Ce.toastId===p.id)?ee.map(Ce=>Ce.toastId===p.id?{...Ce,height:je}:Ce):[{toastId:p.id,height:je,position:p.position},...ee])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const ht=Fe.useCallback(()=>{Z(!0),pe(Ye.current),w(rt=>rt.filter(Dt=>Dt.toastId!==p.id)),setTimeout(()=>{k(p)},r6)},[p,k,w,Ye]);Fe.useEffect(()=>{if(p.promise&&ye==="loading"||p.duration===1/0||p.type==="loading")return;let rt;return O||S||it?(()=>{if(mt.current<Ge.current){const ee=new Date().getTime()-Ge.current;ke.current=ke.current-ee}mt.current=new Date().getTime()})():(()=>{ke.current!==1/0&&(Ge.current=new Date().getTime(),rt=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),ht()},ke.current))})(),()=>clearTimeout(rt)},[O,S,p,ye,it,ht]),Fe.useEffect(()=>{p.delete&&(ht(),p.onDismiss==null||p.onDismiss.call(p,p))},[ht,p.delete]);function Gt(){var rt;if(K!=null&&K.loading){var Dt;return Fe.createElement("div",{className:ks(H==null?void 0:H.loader,p==null||(Dt=p.classNames)==null?void 0:Dt.loader,"sonner-loader"),"data-visible":ye==="loading"},K.loading)}return Fe.createElement(I5,{className:ks(H==null?void 0:H.loader,p==null||(rt=p.classNames)==null?void 0:rt.loader),visible:ye==="loading"})}const Bt=p.icon||(K==null?void 0:K[ye])||z5(ye);var Ft,sn;return Fe.createElement("li",{tabIndex:0,ref:Te,className:ks(I,ae,H==null?void 0:H.toast,p==null||(t=p.classNames)==null?void 0:t.toast,H==null?void 0:H[Ae],p==null||(s=p.classNames)==null?void 0:s[Ae]),"data-sonner-toast":"","data-rich-colors":(Ft=p.richColors)!=null?Ft:D,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":de,"data-removed":z,"data-visible":se,"data-y-position":ut,"data-x-position":Rt,"data-index":C,"data-front":He,"data-swiping":te,"data-dismissible":Be,"data-type":ye,"data-invert":at,"data-swipe-out":W,"data-swipe-direction":J,"data-expanded":!!(O||G&&oe),"data-testid":p.testId,style:{"--index":C,"--toasts-before":C,"--z-index":j.length-C,"--offset":`${z?xe:Ye.current}px`,"--initial-height":G?"auto":`${we}px`,...L,...p.style},onDragEnd:()=>{ue(!1),U(null),nt.current=null},onPointerDown:rt=>{rt.button!==2&&(Nt||!Be||(Pe.current=new Date,pe(Ye.current),rt.target.setPointerCapture(rt.pointerId),rt.target.tagName!=="BUTTON"&&(ue(!0),nt.current={x:rt.clientX,y:rt.clientY})))},onPointerUp:()=>{var rt,Dt,je;if(W||!Be)return;nt.current=null;const ee=Number(((rt=Te.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Le=Number(((Dt=Te.current)==null?void 0:Dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ce=new Date().getTime()-((je=Pe.current)==null?void 0:je.getTime()),et=A==="x"?ee:Le,Ze=Math.abs(et)/Ce;if((A==="x"?qe.includes(ee>0?"right":"left"):qe.includes(Le>0?"bottom":"top"))&&(Math.abs(et)>=n6||Ze>.11)){pe(Ye.current),p.onDismiss==null||p.onDismiss.call(p,p),F(A==="x"?ee>0?"right":"left":Le>0?"down":"up"),ht(),be(!0);return}else{var Ct,un;(Ct=Te.current)==null||Ct.style.setProperty("--swipe-amount-x","0px"),(un=Te.current)==null||un.style.setProperty("--swipe-amount-y","0px")}fe(!1),ue(!1),U(null)},onPointerMove:rt=>{var Dt,je,ee;if(!nt.current||!Be||((Dt=window.getSelection())==null?void 0:Dt.toString().length)>0)return;const Ce=rt.clientY-nt.current.y,et=rt.clientX-nt.current.x;!A&&(Math.abs(et)>1||Math.abs(Ce)>1)&&U(Math.abs(et)>Math.abs(Ce)?"x":"y");let Ze={x:0,y:0};const pt=Ct=>1/(1.5+Math.abs(Ct)/20);if(A==="y"){if(qe.includes("top")||qe.includes("bottom"))if(qe.includes("top")&&Ce<0||qe.includes("bottom")&&Ce>0)Ze.y=Ce;else{const Ct=Ce*pt(Ce);Ze.y=Math.abs(Ct)<Math.abs(Ce)?Ct:Ce}}else if(A==="x"&&(qe.includes("left")||qe.includes("right")))if(qe.includes("left")&&et<0||qe.includes("right")&&et>0)Ze.x=et;else{const Ct=et*pt(et);Ze.x=Math.abs(Ct)<Math.abs(et)?Ct:et}(Math.abs(Ze.x)>0||Math.abs(Ze.y)>0)&&fe(!0),(je=Te.current)==null||je.style.setProperty("--swipe-amount-x",`${Ze.x}px`),(ee=Te.current)==null||ee.style.setProperty("--swipe-amount-y",`${Ze.y}px`)}},_e&&!p.jsx&&ye!=="loading"?Fe.createElement("button",{"aria-label":B,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!Be?()=>{}:()=>{ht(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ks(H==null?void 0:H.closeButton,p==null||(o=p.classNames)==null?void 0:o.closeButton)},(sn=K==null?void 0:K.close)!=null?sn:H5):null,(ye||p.icon||p.promise)&&p.icon!==null&&((K==null?void 0:K[ye])!==null||p.icon)?Fe.createElement("div",{"data-icon":"",className:ks(H==null?void 0:H.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},ye==="loading"?p.icon||Gt():p.promise?Gt():null,ye!=="loading"?Bt:null):null,Fe.createElement("div",{"data-content":"",className:ks(H==null?void 0:H.content,p==null||(c=p.classNames)==null?void 0:c.content)},Fe.createElement("div",{"data-title":"",className:ks(H==null?void 0:H.title,p==null||(u=p.classNames)==null?void 0:u.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Fe.createElement("div",{"data-description":"",className:ks(X,ve,H==null?void 0:H.description,p==null||(m=p.classNames)==null?void 0:m.description)},typeof p.description=="function"?p.description():p.description):null),Fe.isValidElement(p.cancel)?p.cancel:p.cancel&&tm(p.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||_,onClick:rt=>{tm(p.cancel)&&Be&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,rt),ht())},className:ks(H==null?void 0:H.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,Fe.isValidElement(p.action)?p.action:p.action&&tm(p.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||V,onClick:rt=>{tm(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,rt),!rt.defaultPrevented&&ht())},className:ks(H==null?void 0:H.actionButton,p==null||(v=p.classNames)==null?void 0:v.actionButton)},p.action.label):null)};function bT(){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 i6(e,t){const s={};return[e,t].forEach((o,a)=>{const c=a===1,u=c?"--mobile-offset":"--offset",m=c?W5:J5;function g(v){["top","right","bottom","left"].forEach(b=>{s[`${u}-${b}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?s[`${u}-${v}`]=m:s[`${u}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(m)}),s}const a6=Fe.forwardRef(function(t,s){const{id:o,invert:a,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:m,closeButton:g,className:v,offset:b,mobileOffset:p,theme:x="light",richColors:S,duration:w,style:E,visibleToasts:R=X5,toastOptions:C,dir:j=bT(),gap:O=t6,icons:k,customAriaLabel:D,containerAriaLabel:P="Notifications"}=t,[L,_]=Fe.useState([]),V=Fe.useMemo(()=>o?L.filter(N=>N.toasterId===o):L.filter(N=>!N.toasterId),[L,o]),I=Fe.useMemo(()=>Array.from(new Set([c].concat(V.filter(N=>N.position).map(N=>N.position)))),[V,c]),[X,Y]=Fe.useState([]),[q,$]=Fe.useState(!1),[G,H]=Fe.useState(!1),[K,B]=Fe.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=Fe.useRef(null),U=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=Fe.useRef(null),F=Fe.useRef(!1),oe=Fe.useCallback(N=>{_(z=>{var Z;return(Z=z.find(te=>te.id===N.id))!=null&&Z.delete||jr.dismiss(N.id),z.filter(({id:te})=>te!==N.id)})},[]);return Fe.useEffect(()=>jr.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{_(z=>z.map(Z=>Z.id===N.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{A5.flushSync(()=>{_(z=>{const Z=z.findIndex(te=>te.id===N.id);return Z!==-1?[...z.slice(0,Z),{...z[Z],...N},...z.slice(Z+1)]:[N,...z]})})})}),[]),Fe.useEffect(()=>{if(x!=="system"){B(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const N=window.matchMedia("(prefers-color-scheme: dark)");try{N.addEventListener("change",({matches:z})=>{B(z?"dark":"light")})}catch{N.addListener(({matches:Z})=>{try{B(Z?"dark":"light")}catch(te){console.error(te)}})}},[x]),Fe.useEffect(()=>{L.length<=1&&$(!1)},[L]),Fe.useEffect(()=>{const N=z=>{var Z;if(u.length>0&&u.every(W=>z[W]||z.code===W)){var ue;$(!0),(ue=A.current)==null||ue.focus()}z.code==="Escape"&&(document.activeElement===A.current||(Z=A.current)!=null&&Z.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[u]),Fe.useEffect(()=>{if(A.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,F.current=!1)}},[A.current]),Fe.createElement("section",{ref:s,"aria-label":D??`${P} ${U}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},I.map((N,z)=>{var Z;const[te,ue]=N.split("-");return V.length?Fe.createElement("ol",{key:N,dir:j==="auto"?bT():j,tabIndex:-1,ref:A,className:v,"data-sonner-toaster":!0,"data-sonner-theme":K,"data-y-position":te,"data-x-position":ue,style:{"--front-toast-height":`${((Z=X[0])==null?void 0:Z.height)||0}px`,"--width":`${e6}px`,"--gap":`${O}px`,...E,...i6(b,p)},onBlur:W=>{F.current&&!W.currentTarget.contains(W.relatedTarget)&&(F.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||F.current||(F.current=!0,J.current=W.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{G||$(!1)},onDragEnd:()=>$(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},V.filter(W=>!W.position&&z===0||W.position===N).map((W,be)=>{var de,fe;return Fe.createElement(o6,{key:W.id,icons:k,index:be,toast:W,defaultRichColors:S,duration:(de=C==null?void 0:C.duration)!=null?de:w,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:a,visibleToasts:R,closeButton:(fe=C==null?void 0:C.closeButton)!=null?fe:g,interacting:G,position:N,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:oe,toasts:V.filter(xe=>xe.position==W.position),heights:X.filter(xe=>xe.position==W.position),setHeights:Y,expandByDefault:m,gap:O,expanded:q,swipeDirections:t.swipeDirections})})):null}))}),l6="open-reel",yT="hatchlight",c6=e=>e.startsWith(yT)?l6+e.slice(yT.length):e;function Ny(e,t){return e.getItem(t)??e.getItem(c6(t))}const h$=e=>e in ib,u6={en:{},"pt-BR":UM},d2=[{code:"en",name:"English"},{code:"pt-BR",name:"Português (Brasil)"}],f2="hatchlight.language",Db=d2.map(e=>e.code);function d6(){try{const e=Ny(localStorage,f2);if(e&&Db.includes(e))return e}catch{}return PM(navigator.languages??[],Db,"en")}const m2=y.createContext(null);function f6({children:e}){const[t,s]=y.useState(d6);y.useEffect(()=>{document.documentElement.lang=t},[t]);const o=y.useMemo(()=>{const a=m=>{if(Db.includes(m)){s(m);try{localStorage.setItem(f2,m)}catch{}}},c=LM(t,ib,u6[t]);return{...c,explain:m=>{if(m==null)return"";const{message:g,code:v,params:b}=typeof m=="object"&&"message"in m?m:{message:String(m),code:null,params:null},p=`errors.${v}`;if(!v||!(p in ib))return g;const x=Object.fromEntries(Object.entries(b??{}).map(([S,w])=>[S,S.endsWith("Bytes")&&typeof w=="number"?c.bytes(w):w]));return c.t(p,x)},language:t,setLanguage:a,languages:d2}},[t]);return d.jsx(m2.Provider,{value:o,children:e})}function Xe(){const e=y.useContext(m2);if(!e)throw new Error("useI18n must be used inside an I18nProvider");return e}const m6=({...e})=>{const{t}=Xe();return d.jsx(a6,{theme:"dark",containerAriaLabel:t("ui.notifications"),className:"toaster group",icons:{success:d.jsx(g5,{className:"size-4"}),info:d.jsx(VN,{className:"size-4"}),warning:d.jsx(c2,{className:"size-4"}),error:d.jsx(T5,{className:"size-4"}),loading:d.jsx($N,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})},xT={};function In(e,t){const s=y.useRef(xT);return s.current===xT&&(s.current=e(t)),s}const Ib=[];let Pb;function h6(){return Pb}function p6(e){Ib.push(e)}function vh(e){const t=(s,o)=>{const a=In(g6).current;let c;try{Pb=a;for(const u of Ib)u.before(a);c=e(s,o);for(const u of Ib)u.after(a);a.didInitialize=!0}finally{Pb=void 0}return c};return t.displayName=e.displayName||e.name,t}function jy(e){return y.forwardRef(vh(e))}function g6(){return{didInitialize:!1}}function vn(){}const ns=Object.freeze([]),Ut=Object.freeze({}),v6=()=>{},Me=typeof document<"u"?y.useLayoutEffect:v6;function b6(e,t){return function(o,...a){const c=new URL(e);return c.searchParams.set("code",o.toString()),a.forEach(u=>c.searchParams.append("args[]",u)),`${t} error #${o}; visit ${c} for the full message.`}}const mn=b6("https://base-ui.com/production-error","Base UI"),h2=y.createContext(void 0);function ed(e){const t=y.useContext(h2);if(t===void 0&&!e)throw new Error(mn(72));return t}function Oy(e){y.useEffect(e,ns)}const hu=0;class bs{constructor(){yt(this,"currentId",hu);yt(this,"clear",()=>{this.currentId!==hu&&(clearTimeout(this.currentId),this.currentId=hu)});yt(this,"disposeEffect",()=>this.clear)}static create(){return new bs}start(t,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=hu,s()},t)}isStarted(){return this.currentId!==hu}}function Rn(){const e=In(bs.create).current;return Oy(e.disposeEffect),e}function y6(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:x6,platform:w6,maxTouchPoints:S6}=y6(),bh=x6.toLowerCase(),Uu=w6.toLowerCase(),yh=/^i(os$|p)/.test(Uu)||Uu==="macintel"&&S6>1,wT="android",Lb=Uu===wT||bh.includes(wT),ky=!yh&&Uu.startsWith("mac");Uu.startsWith("win");const E6=ky||yh;var pC;const Fs=typeof CSS<"u"&&!!((pC=CSS.supports)!=null&&pC.call(CSS,"-webkit-backdrop-filter:none"));!Fs&&bh.includes("firefox");!Fs&&bh.includes("chrom");const T6=E6,_y=/jsdom|happydom/.test(bh);function As(e){e.preventDefault(),e.stopPropagation()}function R6(e){return"nativeEvent"in e}function sc(e){return e.pointerType===""&&e.isTrusted?!0:Lb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ay(e){return _y?!1:!Lb&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(Lb||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function gi(e,t){const s=["mouse","pen"];return t||s.push("",void 0),s.includes(e)}function C6(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function xh(){return typeof window<"u"}function ar(e){return My(e)?(e.nodeName||"").toLowerCase():"#document"}function Kt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function To(e){var t;return(t=(My(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function My(e){return xh()?e instanceof Node||e instanceof Kt(e).Node:!1}function _t(e){return xh()?e instanceof Element||e instanceof Kt(e).Element:!1}function rn(e){return xh()?e instanceof HTMLElement||e instanceof Kt(e).HTMLElement:!1}function va(e){return!xh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kt(e).ShadowRoot}function td(e){const{overflow:t,overflowX:s,overflowY:o,display:a}=Fr(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+s)&&a!=="inline"&&a!=="contents"}function N6(e){return/^(table|td|th)$/.test(ar(e))}function wh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const j6=/transform|translate|scale|rotate|perspective|filter/,O6=/paint|layout|strict|content/,Wi=e=>!!e&&e!=="none";let Bv;function zy(e){const t=_t(e)?Fr(e):e;return Wi(t.transform)||Wi(t.translate)||Wi(t.scale)||Wi(t.rotate)||Wi(t.perspective)||!Dy()&&(Wi(t.backdropFilter)||Wi(t.filter))||j6.test(t.willChange||"")||O6.test(t.contain||"")}function k6(e){let t=wo(e);for(;rn(t)&&!po(t);){if(zy(t))return t;if(wh(t))return null;t=wo(t)}return null}function Dy(){return Bv==null&&(Bv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bv}function po(e){return/^(html|body|#document)$/.test(ar(e))}function Fr(e){return Kt(e).getComputedStyle(e)}function Sh(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wo(e){if(ar(e)==="html")return e;const t=e.assignedSlot||e.parentNode||va(e)&&e.host||To(e);return va(t)?t.host:t}function p2(e){const t=wo(e);return po(t)?(e.ownerDocument||e).body:rn(t)&&td(t)?t:p2(t)}function Bu(e,t,s){var o;t===void 0&&(t=[]),s===void 0&&(s=!0);const a=p2(e),c=a===((o=e.ownerDocument)==null?void 0:o.body),u=Kt(a);if(c){const m=Ub(u);return t.concat(u,u.visualViewport||[],td(a)?a:[],m&&s?Bu(m):[])}else return t.concat(a,Bu(a,[],s))}function Ub(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function or(e){var s;let t=e.activeElement;for(;((s=t==null?void 0:t.shadowRoot)==null?void 0:s.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ot(e,t){var o;if(!e||!t)return!1;const s=(o=t.getRootNode)==null?void 0:o.call(t);if(e.contains(t))return!0;if(s&&va(s)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Hu(e,t){let s=e;for(;s;){if(_t(s)&&s.matches(t))return s;s=s.assignedSlot??s.parentNode??(va(s)?s.host:null)}return null}function Pn(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Bb="data-base-ui-focusable",g2="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Eh="ArrowLeft",Th="ArrowRight",v2="ArrowUp",Iy="ArrowDown",Py="data-starting-style",_6="data-ending-style",A6={[Py]:""},M6={[_6]:""},Ti={transitionStatus(e){return e==="starting"?A6:e==="ending"?M6:null}},z6="data-open",D6="data-closed",I6="data-anchor-hidden",b2="data-popup-open",P6="data-pressed",L6={[b2]:""},U6={[b2]:"",[P6]:""},B6={[z6]:""},H6={[D6]:""},F6={[I6]:""},Ly={open(e){return e?L6:null}},Hb={open(e){return e?U6:null}},nd={open(e){return e?B6:H6},anchorHidden(e){return e?F6:null}},Uy={...nd,...Ti},Fb="data-trigger-disabled";function Fm(e,t){if(!_t(e))return!1;const s=e;if(t.hasElement(s))return!s.hasAttribute(Fb);for(const[,o]of t.entries())if(ot(o,s))return!o.hasAttribute(Fb);return!1}function Hv(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const s=e;return s.target!=null&&t.contains(s.target)}function V6(e){return e.matches("html,body")}function rd(e){return rn(e)&&e.matches(g2)}function q6(e){return Hu(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${g2}`)!=null}function Vb(e){return e?e.getAttribute("role")==="combobox"&&rd(e):!1}function y2(e){if(!e||_y)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Vm(e){return e?e.hasAttribute(Bb)?e:e.querySelector(`[${Bb}]`)||e:null}function $6(e,t){return t!=null&&!gi(t)?0:typeof e=="function"?e():e}function ba(e,t,s){const o=$6(e,s);return typeof o=="number"?o:o==null?void 0:o[t]}function ST(e){return typeof e=="function"?e():e}function x2(e,t){return t||e==="click"||e==="mousedown"}function Z6(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}function dt(e,t,s,o){let a=!1,c=!1;const u=o??Ut;return{reason:e,event:t??new Event("base-ui"),cancel(){a=!0},allowPropagation(){c=!0},get isCanceled(){return a},get isPropagationAllowed(){return c},trigger:s,...u}}function By(e,t,s){const o=s??Ut;return{reason:e,event:t??new Event("base-ui"),...o}}const lr="none",ka="trigger-press",Bn="trigger-hover",Ol="trigger-focus",Rh="outside-press",kl="item-press",K6="close-press",ET="track-press",Y6="input-change",ya="focus-out",Ch="escape-key",qm="list-navigation",Hy="keyboard",G6="pointer",Q6="drag",w2="cancel-open",Tu="sibling-open",S2="disabled",TT="missing",RT="initial",Nh="imperative-action",X6="window-resize",E2=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new bs,currentIdRef:{current:null},currentContextRef:{current:null}});function J6(e,t){e.current=t.current}function W6(e){const{children:t,delay:s,timeoutMs:o=0}=e,a=y.useRef(s),c=y.useRef(s),u=y.useRef(null),m=y.useRef(null),g=Rn();return Me(()=>{if(c.current=s,!u.current){a.current=s;return}a.current={open:ba(a.current,"open"),close:ba(s,"close")}},[s,u,a,c]),d.jsx(E2.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:c,currentIdRef:u,timeoutMs:o,currentContextRef:m,timeout:g}),[o,g]),children:t})}function eL(e,t={open:!1}){const{open:s}=t,o=e.useState("floatingId"),a=y.useContext(E2),{currentIdRef:c,delayRef:u,timeoutMs:m,initialDelayRef:g,currentContextRef:v,hasProvider:b,timeout:p}=a,[x,S]=y.useState(!1),w=y.useRef(s);return Me(()=>{w.current=s},[s]),Me(()=>{function E(){var R;(R=v.current)==null||R.setIsInstantPhase(!1),c.current=null,v.current=null,u.current=g.current,p.clear()}if(c.current&&!s&&c.current===o){if(S(!1),m){const R=o;return p.start(m,()=>{e.select("open")||c.current&&c.current!==R||E()}),()=>{(w.current||c.current!==R)&&p.clear()}}E()}},[s,o,c,u,m,g,v,p,e]),Me(()=>{if(!s)return;const E=v.current,R=c.current;p.clear(),v.current={onOpenChange:e.setOpen,setIsInstantPhase:S},c.current=o,u.current={open:0,close:ba(g.current,"close")},R!==null&&R!==o?(S(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,dt(lr))):(S(!1),E==null||E.setIsInstantPhase(!1))},[s,o,e,c,u,g,v,p]),Me(()=>()=>{if(c.current===o){if(v.current=null,!w.current)return;c.current=null,J6(u,g),p.clear()}},[v,c,u,o,g,p]),y.useMemo(()=>({activeIdRef:c,hasProvider:b,delayRef:u,isInstantPhase:x}),[c,b,u,x])}function Et(e,t,s,o){return e.addEventListener(t,s,o),()=>{e.removeEventListener(t,s,o)}}function Ls(...e){return()=>{for(let t=0;t<e.length;t+=1){const s=e[t];s&&s()}}}function Vr(e,t,s,o){const a=In(T2).current;return nL(a,e,t,s,o)&&R2(a,[e,t,s,o]),a.callback}function tL(e){const t=In(T2).current;return rL(t,e)&&R2(t,e),t.callback}function T2(){return{callback:null,cleanup:null,refs:[]}}function nL(e,t,s,o,a){return e.refs[0]!==t||e.refs[1]!==s||e.refs[2]!==o||e.refs[3]!==a}function rL(e,t){return e.refs.length!==t.length||e.refs.some((s,o)=>s!==t[o])}function R2(e,t){if(e.refs=t,t.every(s=>s==null)){e.callback=null;return}e.callback=s=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),s!=null){const o=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){const c=t[a];if(c!=null)switch(typeof c){case"function":{const u=c(s);typeof u=="function"&&(o[a]=u);break}case"object":{c.current=s;break}}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){const c=t[a];if(c!=null)switch(typeof c){case"function":{const u=o[a];typeof u=="function"?u():c(null);break}case"object":{c.current=null;break}}}}}}}function fn(e){const t=In(sL,e).current;return t.next=e,Me(t.effect),t}function sL(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Fy={...f3},Fv=Fy.useInsertionEffect,oL=Fv&&Fv!==Fy.useLayoutEffect?Fv:e=>e();function Ie(e){const t=In(iL).current;return t.next=e,oL(t.effect),t.trampoline}function iL(){const e={next:void 0,callback:aL,trampoline:(...t)=>{var s;return(s=e.callback)==null?void 0:s.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function aL(){}const nm=null;class lL{constructor(){yt(this,"callbacks",[]);yt(this,"callbacksCount",0);yt(this,"nextId",1);yt(this,"startId",1);yt(this,"isScheduled",!1);yt(this,"tick",t=>{var a;this.isScheduled=!1;const s=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let c=0;c<s.length;c+=1)(a=s[c])==null||a.call(s,t)})}request(t){const s=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(t){const s=t-this.startId;s<0||s>=this.callbacks.length||this.callbacks[s]!==null&&(this.callbacks[s]=null,this.callbacksCount-=1)}}let rm=new lL;class fr{constructor(){yt(this,"currentId",nm);yt(this,"cancel",()=>{this.currentId!==nm&&(rm.cancel(this.currentId),this.currentId=nm)});yt(this,"disposeEffect",()=>this.cancel)}static create(){return new fr}static request(t){return rm.request(t)}static cancel(t){return rm.cancel(t)}request(t){this.cancel(),this.currentId=rm.request(()=>{this.currentId=nm,t()})}}function xa(){const e=In(fr.create).current;return Oy(e.disposeEffect),e}function Tt(e){return(e==null?void 0:e.ownerDocument)||document}const C2={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},wa={...C2,position:"fixed",margin:0,top:0,left:0},Vy={...C2,position:"absolute"},oc=y.forwardRef(function(t,s){const[o,a]=y.useState();Me(()=>{T6&&Fs&&a("button")},[]);const c={tabIndex:0,role:o};return d.jsx("span",{...t,ref:s,style:wa,"aria-hidden":o?void 0:!0,...c,"data-base-ui-focus-guard":""})}),ic=Math.min,go=Math.max,$m=Math.round,sm=Math.floor,vo=e=>({x:e,y:e}),cL={left:"right",right:"left",bottom:"top",top:"bottom"};function N2(e,t,s){return go(e,ic(t,s))}function yi(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function Us(e){return e.split("-")[1]}function qy(e){return e==="x"?"y":"x"}function $y(e){return e==="y"?"height":"width"}function ts(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Zy(e){return qy(ts(e))}function uL(e,t,s){s===void 0&&(s=!1);const o=Us(e),a=Zy(e),c=$y(a);let u=a==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=Zm(u)),[u,Zm(u)]}function dL(e){const t=Zm(e);return[qb(e),t,qb(t)]}function qb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const CT=["left","right"],NT=["right","left"],fL=["top","bottom"],mL=["bottom","top"];function hL(e,t,s){switch(e){case"top":case"bottom":return s?t?NT:CT:t?CT:NT;case"left":case"right":return t?fL:mL;default:return[]}}function pL(e,t,s,o){const a=Us(e);let c=hL(Br(e),s==="start",o);return a&&(c=c.map(u=>u+"-"+a),t&&(c=c.concat(c.map(qb)))),c}function Zm(e){const t=Br(e);return cL[t]+e.slice(t.length)}function gL(e){var t,s,o,a;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function j2(e){return typeof e!="number"?gL(e):{top:e,right:e,bottom:e,left:e}}function Fu(e){const{x:t,y:s,width:o,height:a}=e;return{width:o,height:a,top:s,left:t,right:t+o,bottom:s+a,x:t,y:s}}function _l(e,t){return t<0||t>=e.length}function km(e,t){return Al(e.current,{disabledIndices:t})}function $b(e,t){return Al(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function vL(e,t,s){const{decrement:o,loopFocus:a,allowEscape:c,disabledIndices:u,minIndex:m,maxIndex:g}=s,v=()=>Al(e,{startingIndex:t,decrement:o,disabledIndices:u});let b,p=!1;if(!a)b=o?Math.max(m,v()):Math.min(g,v());else if(o?t<=m:t>=g){const x=o?-1:e.length;c&&t!==x?b=-1:(b=o?g:m,p=!0)}else b=v();return{index:_l(e,b)?-1:b,wrapped:p}}function Al(e,{startingIndex:t=-1,decrement:s=!1,disabledIndices:o,amount:a=1}={}){let c=t;do c+=s?-a:a;while(c>=0&&c<=e.length-1&&Ml(e,c,o));return c}function Ml(e,t,s){if(typeof s=="function"?s(t):(s==null?void 0:s.includes(t))??!1)return!0;const a=e[t];return a?!jh(a)||a.matches(":disabled")?!0:!s&&(a.hasAttribute("disabled")||a.getAttribute("aria-disabled")==="true"):!1}function bL(e){return e.visibility==="hidden"||e.visibility==="collapse"}function jh(e,t=e?Fr(e):null){return!e||!e.isConnected||!t||bL(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const yL='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function xL(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return va(s)?s.host:null}function Zb(e){for(const t of Array.from(e.children))if(ar(t)==="summary")return t;return null}function wL(e,t){const s=Zb(t);return!!s&&(e===s||ot(s,e))}function O2(e){const t=e?ar(e):"";return e!=null&&e.matches(yL)&&(t!=="summary"||e.parentElement!=null&&ar(e.parentElement)==="details"&&Zb(e.parentElement)===e)&&(t!=="details"||Zb(e)==null)&&(t!=="input"||e.type!=="hidden")}function Ky(e){if(!O2(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=xL(t)){const s=t!==e,o=ar(t)==="slot";if(t.hasAttribute("inert")||s&&ar(t)==="details"&&!t.open&&!wL(e,t)||t.hasAttribute("hidden")||!o&&!SL(t,s))return!1}return!0}function SL(e,t){const s=Fr(e);return t?s.display!=="none":jh(e,s)}function k2(e){const t=e.tabIndex;if(t<0){const s=ar(e);if(s==="details"||s==="audio"||s==="video"||rn(e)&&e.isContentEditable)return 0}return t}function Vv(e){if(ar(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function _2(e,t){const s=Vv(e);if(!s)return!0;const o=t.find(a=>{const c=Vv(a);return(c==null?void 0:c.name)===s.name&&c.form===s.form&&c.checked});return o?o===s:t.find(a=>{const c=Vv(a);return(c==null?void 0:c.name)===s.name&&c.form===s.form})===s}function A2(e){if(rn(e)&&ar(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return rn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Yy(e,t){A2(e).forEach(s=>{O2(s)&&t.push(s),Yy(s,t)})}function M2(e,t,s){A2(e).forEach(o=>{rn(o)&&o.matches(t)&&s.push(o),M2(o,t,s)})}function Oh(e){return Ky(e)&&k2(e)>=0}function z2(e){const t=[];return Yy(e,t),t.filter(Ky)}function kh(e){const t=z2(e);return t.filter(s=>k2(s)>=0&&_2(s,t))}function D2(e,t){const s=kh(e),o=s.length;if(o===0)return;const a=or(Tt(e)),c=s.indexOf(a),u=c===-1?t===1?0:o-1:c+t;return s[u]}function I2(e){return D2(Tt(e).body,1)||e}function P2(e){return D2(Tt(e).body,-1)||e}function EL(e,t,s){if(!e)return null;const o=[];Yy(Tt(e).body,o);const a=o.indexOf(e);if(a===-1)return null;const c=o.filter(Ky);for(let u=1;u<o.length;u+=1){const m=o[(a+t*u+o.length)%o.length];if(!ot(s,m)&&Oh(m)&&_2(m,c))return m}return o[a]}function zl(e,t){const s=t||e.currentTarget,o=e.relatedTarget;return!o||!ot(s,o)}function TL(e){kh(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function jT(e){const t=[];M2(e,"[data-tabindex]",t),t.forEach(s=>{const o=s.dataset.tabindex;delete s.dataset.tabindex,o?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")})}function xi(e,t,s=!0){return e.filter(a=>a.parentId===t).flatMap(a=>{var c;return[...!s||(c=a.context)!=null&&c.open?[a]:[],...xi(e,a.id,s)]})}function OT(e,t){var a;let s=[],o=(a=e.find(c=>c.id===t))==null?void 0:a.parentId;for(;o;){const c=e.find(u=>u.id===o);o=c==null?void 0:c.parentId,c&&(s=s.concat(c))}return s}function Dl(e){return`data-base-ui-${e}`}let om=0;function _m(e,t={}){const{preventScroll:s=!1,sync:o=!1,shouldFocus:a}=t;cancelAnimationFrame(om);function c(){a&&!a()||e==null||e.focus({preventScroll:s})}if(o)return c(),vn;const u=requestAnimationFrame(c);return om=u,()=>{om===u&&(cancelAnimationFrame(u),om=0)}}const kT="data-base-ui-inert";let pu=new WeakMap,im=new WeakSet,gu=new WeakMap,qv=0;function L2(e){return e?va(e)?e.host:L2(e.parentNode):null}const _T=(e,t)=>t.map(s=>{if(e.contains(s))return s;const o=L2(s);return e.contains(o)?o:null}).filter(s=>s!=null),AT=e=>{const t=new Set;return e.forEach(s=>{let o=s;for(;o&&!t.has(o);)t.add(o),o=o.parentNode}),t},MT=(e,t,s)=>{const o=[],a=c=>{!c||s.has(c)||Array.from(c.children).forEach(u=>{ar(u)!=="script"&&(t.has(u)?a(u):o.push(u))})};return a(e),o};function RL(e,t,s,{mark:o=!0}){const a=_T(t,e),c=o?MT(t,AT(a),new Set(a)):[],u=[],m=[];if(s){const g=_T(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(g);MT(t,AT(v),new Set(v)).forEach(p=>{const x=p.getAttribute("aria-hidden"),S=x!==null&&x!=="false",w=(pu.get(p)||0)+1;pu.set(p,w),u.push(p),w===1&&S&&im.add(p),S||p.setAttribute("aria-hidden","true")})}return o&&c.forEach(g=>{const v=(gu.get(g)||0)+1;gu.set(g,v),m.push(g),v===1&&g.setAttribute(kT,"")}),qv+=1,()=>{u.forEach(g=>{const v=(pu.get(g)||0)-1;pu.set(g,v),v||(im.has(g)||g.removeAttribute("aria-hidden"),im.delete(g))}),o&&m.forEach(g=>{const v=(gu.get(g)||0)-1;gu.set(g,v),v||g.removeAttribute(kT)}),qv-=1,qv||(pu=new WeakMap,im=new WeakSet,gu=new WeakMap)}}function zT(e,t={}){const{ariaHidden:s=!1,mark:o=!0}=t,a=Tt(e[0]).body;return RL(e,a,s,{mark:o})}function U2(){const[,e]=y.useState({});return y.useCallback(()=>{e({})},[])}let DT=0;function CL(e,t="mui"){const s=y.useRef(void 0),o=U2(),a=e??s.current;return y.useEffect(()=>{s.current==null&&(DT+=1,s.current=`${t}-${DT}`,e==null&&o())},[e,t,o]),a}const IT=Fy.useId;function sd(e,t){if(IT!==void 0){const s=IT();return e??(t?`${t}-${s}`:s)}return CL(e,t)}const NL=parseInt(y.version,10);function _h(e){return NL>=e}function PT(e){if(!y.isValidElement(e))return null;const t=e,s=t.props;return(_h(19)?s==null?void 0:s.ref:t.ref)??null}function Kb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function jL(e,t){const s={};for(const o in e){const a=e[o];if(t!=null&&t.hasOwnProperty(o)){const c=t[o](a);c!=null&&Object.assign(s,c);continue}a===!0?s[`data-${o.toLowerCase()}`]="":a&&(s[`data-${o.toLowerCase()}`]=a.toString())}return s}function OL(e,t){return typeof e=="function"?e(t):e}function B2(e,t){return typeof e=="function"?e(t):e}const H2={};function Gn(e,t,s,o,a){if(!s&&!o&&!a&&!e)return Km(t);let c=Km(e);return t&&(c=Ru(c,t)),s&&(c=Ru(c,s)),o&&(c=Ru(c,o)),a&&(c=Ru(c,a)),c}function kL(e){if(e.length===0)return H2;if(e.length===1)return Km(e[0]);let t=Km(e[0]);for(let s=1;s<e.length;s+=1)t=Ru(t,e[s]);return t}function Km(e){return V2(e)?{...e(H2)}:_L(e)}function Ru(e,t){return V2(t)?t(e):AL(e,t)}function _L(e){const t={...e};for(const s in t){const o=t[s];F2(s,o)&&(t[s]=q2(o))}return t}function AL(e,t){if(!t)return e;for(const s in t){const o=t[s];switch(s){case"style":{e[s]=Kb(e.style,o);break}case"className":{e[s]=$2(e.className,o);break}default:F2(s,o)?e[s]=ML(e[s],o):e[s]=o}}return e}function F2(e,t){const s=e.charCodeAt(0),o=e.charCodeAt(1),a=e.charCodeAt(2);return s===111&&o===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function V2(e){return typeof e=="function"}function ML(e,t){return t?e?(...s)=>{const o=s[0];if(Z2(o)){const c=o;Ym(c);const u=t(...s);return c.baseUIHandlerPrevented||e==null||e(...s),u}const a=t(...s);return e==null||e(...s),a}:q2(t):e}function q2(e){return e&&((...t)=>{const s=t[0];return Z2(s)&&Ym(s),e(...t)})}function Ym(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function $2(e,t){return t?e?t+" "+e:t:e}function Z2(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function vt(e,t,s={}){let o=t.render;s.enabled!==!1&&(o=Gy(o));const a=zL(t,s,o);if(s.enabled===!1)return null;const c=s.state??Ut;return PL(e,o,a,c)}function zL(e,t,s){const{className:o,style:a}=e,{state:c=Ut,ref:u,props:m,stateAttributesMapping:g,enabled:v=!0}=t,b=v?OL(o,c):void 0,p=v?B2(a,c):void 0,x=v?jL(c,g):Ut,S=v&&m?DL(m):void 0,w=v?Kb(x,S)??{}:Ut;return typeof document<"u"&&(v?Array.isArray(u)?w.ref=tL([w.ref,PT(s),...u]):w.ref=Vr(w.ref,PT(s),u):Vr(null,null)),v?(b!==void 0&&(w.className=$2(w.className,b)),p!==void 0&&(w.style=Kb(w.style,p)),w):Ut}function DL(e){return Array.isArray(e)?kL(e):Gn(void 0,e)}const IL=Symbol.for("react.lazy");function Gy(e){if((e==null?void 0:e.$$typeof)!==IL)return e;const t=y.Children.toArray(e)[0];return y.isValidElement(t)?t:e}function PL(e,t,s,o){if(t){if(typeof t=="function")return t(s,o);const a=Gn(s,t.props);return a.ref=s.ref,y.cloneElement(t,a)}return LL(e,s)}function LL(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}const UL=500,BL=500,HL={style:{transition:"none"}},K2="data-base-ui-click-trigger",Y2={fallbackAxisSide:"none"},G2={fallbackAxisSide:"end"},FL={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Q2=y.createContext(null),X2=()=>y.useContext(Q2),VL=Dl("portal");function J2(e={}){const{ref:t,container:s,componentProps:o=Ut,elementProps:a}=e,c=sd(),u=X2(),m=u==null?void 0:u.portalNode,[g,v]=y.useState(null),[b,p]=y.useState(null),x=Ie(R=>{R!==null&&p(R)}),S=y.useRef(null);Me(()=>{if(s===null){S.current&&(S.current=null,p(null),v(null));return}const R=(s&&(My(s)?s:s.current))??m??document.body;if(R==null){S.current&&(S.current=null,p(null),v(null));return}S.current!==R&&(S.current=R,p(null),v(R))},[s,m]);const w=vt("div",o,{ref:[t,x],props:[{id:c,[VL]:""},a]}),E=g&&w?Hs.createPortal(w,g):null;return{node:b,nodeId:y.isValidElement(w)?w.props.id:void 0,subtree:E}}const Qy=y.forwardRef(function(t,s){const{render:o,className:a,style:c,children:u,container:m,portalOwnerRole:g,...v}=t,{node:b,nodeId:p,subtree:x}=J2({container:m,ref:s,componentProps:t,elementProps:v}),S=y.useRef(null),w=y.useRef(null),E=y.useRef(null),R=y.useRef(null),[C,j]=y.useState(null),O=y.useRef(!1),k=C==null?void 0:C.modal,D=C==null?void 0:C.open,P=!!C&&!C.modal&&C.open&&!!b;y.useEffect(()=>{if(!b||k)return;function _(V){b&&V.relatedTarget&&zl(V)&&(V.type==="focusin"?O.current&&(jT(b),O.current=!1):(TL(b),O.current=!0))}return Ls(Et(b,"focusin",_,!0),Et(b,"focusout",_,!0))},[b,k]),Me(()=>{!b||D!==!0||!O.current||(jT(b),O.current=!1)},[D,b]);const L=y.useMemo(()=>({beforeOutsideRef:S,afterOutsideRef:w,beforeInsideRef:E,afterInsideRef:R,portalNode:b,setFocusManagerState:j}),[b]);return d.jsxs(y.Fragment,{children:[x,d.jsxs(Q2.Provider,{value:L,children:[P&&b&&d.jsx(oc,{"data-type":"outside",ref:S,onFocus:_=>{var V;if(zl(_,b))(V=E.current)==null||V.focus();else{const I=C?C.domReference:null,X=P2(I);X==null||X.focus()}}}),P&&b&&d.jsx("span",{role:g,"aria-owns":p,style:FL}),b&&Hs.createPortal(u,b),P&&b&&d.jsx(oc,{"data-type":"outside",ref:w,onFocus:_=>{var V;if(zl(_,b))(V=R.current)==null||V.focus();else{const I=C?C.domReference:null,X=I2(I);X==null||X.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,dt(ya,_.nativeEvent)))}}})]})]})});function W2(){const e=new Map;return{emit(t,s){var o;(o=e.get(t))==null||o.forEach(a=>a(s))},on(t,s){e.has(t)||e.set(t,new Set),e.get(t).add(s)},off(t,s){var o;(o=e.get(t))==null||o.delete(s)}}}class Xy{constructor(){yt(this,"nodesRef",{current:[]});yt(this,"events",W2())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const s=this.nodesRef.current.findIndex(o=>o===t);s!==-1&&this.nodesRef.current.splice(s,1)}}const ej=y.createContext(null),tj=y.createContext(null),Ri=()=>{var e;return((e=y.useContext(ej))==null?void 0:e.id)||null},Ci=e=>{const t=y.useContext(tj);return e??t};function nj(e){const t=sd(),s=Ci(e),o=Ri();return Me(()=>{if(!t)return;const a={id:t,parentId:o};return s==null||s.addNode(a),()=>{s==null||s.removeNode(a)}},[s,t,o]),t}function qL(e){const{children:t,id:s}=e,o=Ri();return d.jsx(ej.Provider,{value:y.useMemo(()=>({id:s,parentId:o}),[s,o]),children:t})}function $L(e){const{children:t,externalTree:s}=e,o=In(()=>s??new Xy).current;return d.jsx(tj.Provider,{value:o,children:t})}function co(e){return e==null?e:"current"in e?e.current:e}function ZL(e,t){const s=Kt(Pn(e));return e instanceof s.KeyboardEvent?"keyboard":e instanceof s.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(sc(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof s.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const LT=20;let pi=[];function Jy(){pi=pi.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function UT(e){Jy(),e&&ar(e)!=="body"&&(pi.push(new WeakRef(e)),pi.length>LT&&(pi=pi.slice(-LT)))}function BT(){var e;return Jy(),(e=pi[pi.length-1])==null?void 0:e.deref()}function KL(e){return e?Oh(e)?e:kh(e)[0]||e:null}function HT(e){var a;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((a=e.getAttribute("role"))!=null&&a.includes("dialog")))return;const s=z2(e).filter(c=>{const u=c.getAttribute("data-tabindex")||"";return Oh(c)||c.hasAttribute("data-tabindex")&&!u.startsWith("-")}),o=e.getAttribute("tabindex");s.length===0?o!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Wy(e){const{context:t,children:s,disabled:o=!1,initialFocus:a=!0,returnFocus:c=!0,explicitReturnFocus:u,restoreFocus:m=!1,modal:g=!0,closeOnFocusOut:v=!0,openInteractionType:b="",nextFocusableElement:p,previousFocusableElement:x,beforeContentFocusGuardRef:S,externalTree:w,getInsideElements:E}=e,R=t.useState("open"),C=t.useState("domReferenceElement"),j=t.useState("floatingElement"),{events:O,dataRef:k}=t.context,D=Ie(()=>{var pe;return(pe=k.current.floatingContext)==null?void 0:pe.nodeId}),P=a===!1,L=Vb(C)&&P,_=fn(a),V=fn(c),I=fn(u),X=fn(b),Y=fn(R),q=Ci(w),$=X2(),G=y.useRef(!1),H=y.useRef(!1),K=y.useRef(!1),B=y.useRef(null),A=y.useRef(""),U=y.useRef(""),J=y.useRef(null),F=y.useRef(null),oe=Vr(J,S,$==null?void 0:$.beforeInsideRef),N=Vr(F,$==null?void 0:$.afterInsideRef),z=Rn(),Z=Rn(),te=xa(),ue=$!=null,W=Vm(j),be=Ie((pe=W)=>pe?kh(pe):[]),de=Ie(()=>(E==null?void 0:E().filter(pe=>pe!=null))??[]);y.useEffect(()=>{if(o||!g)return;function pe(Oe){Oe.key==="Tab"&&ot(W,or(Tt(W)))&&be().length===0&&!L&&As(Oe)}const we=Tt(W);return Et(we,"keydown",pe)},[o,W,g,L,be]),y.useEffect(()=>{if(o||!R)return;const pe=Tt(W);function we(){K.current=!1}function Oe(Pe){const Te=Pn(Pe),He=de(),se=ot(j,Te)||ot(C,Te)||ot($==null?void 0:$.portalNode,Te)||He.some(ye=>ye===Te||ot(ye,Te));K.current=!se,U.current=Pe.pointerType||"keyboard",Hu(Te,`[${K2}]`)&&(H.current=!0,Z.start(0,()=>{H.current=!1}))}function ke(){U.current="keyboard"}return Ls(Et(pe,"pointerdown",Oe,!0),Et(pe,"pointerup",we,!0),Et(pe,"pointercancel",we,!0),Et(pe,"keydown",ke,!0),we)},[o,j,C,W,R,$,Z,de]),y.useEffect(()=>{if(o||!v)return;const pe=Tt(W);function we(){H.current=!0,Z.start(0,()=>{H.current=!1})}function Oe(He){const se=Pn(He);Oh(se)&&(B.current=se)}function ke(He){const se=He.relatedTarget,ye=He.currentTarget,Ae=Pn(He);g&&se==null&&Ae!=null&&ot(j,Ae)&&UT(Ae),queueMicrotask(()=>{const Be=D(),ae=t.context.triggerElements,ve=de(),ze=(se==null?void 0:se.hasAttribute(Dl("focus-guard")))&&[J.current,F.current,$==null?void 0:$.beforeInsideRef.current,$==null?void 0:$.afterInsideRef.current,$==null?void 0:$.beforeOutsideRef.current,$==null?void 0:$.afterOutsideRef.current,co(x),co(p)].includes(se),_e=!(ot(C,se)||ot(j,se)||ot(se,j)||ot($==null?void 0:$.portalNode,se)||ve.some(Re=>Re===se||ot(Re,se))||ae.hasMatchingElement(Re=>ot(Re,se))||ze||q&&(xi(q.nodesRef.current,Be).find(Re=>{var Ge,Ye;return ot((Ge=Re.context)==null?void 0:Ge.elements.floating,se)||ot((Ye=Re.context)==null?void 0:Ye.elements.domReference,se)})||OT(q.nodesRef.current,Be).find(Re=>{var Ge,Ye,mt;return[(Ge=Re.context)==null?void 0:Ge.elements.floating,Vm((Ye=Re.context)==null?void 0:Ye.elements.floating)].includes(se)||((mt=Re.context)==null?void 0:mt.elements.domReference)===se})));if(ye===C&&W&&HT(W),m&&ye!==C&&!jh(Ae)&&or(pe)===pe.body){if(rn(W)&&(W.focus(),m==="popup")){te.request(()=>{W.focus()});return}const Re=be(),Ge=B.current,Ye=(Ge&&Re.includes(Ge)?Ge:null)||Re[Re.length-1]||W;rn(Ye)&&Ye.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(L||!g)&&se&&_e&&!H.current&&(L||se!==BT())&&(G.current=!0,t.setOpen(!1,dt(ya,He)))})}function Pe(){K.current||(k.current.insideReactTree=!0,z.start(0,()=>{k.current.insideReactTree=!1}))}const Te=rn(C)?C:null;if(!(!j&&!Te))return Ls(Te&&Et(Te,"focusout",ke),Te&&Et(Te,"pointerdown",we),j&&Et(j,"focusin",Oe),j&&Et(j,"focusout",ke),j&&$&&Et(j,"focusout",Pe,!0))},[o,C,j,W,g,q,$,t,v,m,be,L,D,k,z,Z,te,p,x,de]),y.useEffect(()=>{var ye,Ae,Be;if(o||!j||!R)return;const pe=Array.from(((ye=$==null?void 0:$.portalNode)==null?void 0:ye.querySelectorAll(`[${Dl("portal")}]`))||[]),Oe=(Be=(Ae=(q?OT(q.nodesRef.current,D()):[]).find(ae=>{var ve;return Vb(((ve=ae.context)==null?void 0:ve.elements.domReference)||null)}))==null?void 0:Ae.context)==null?void 0:Be.elements.domReference,Pe=[...[j,...pe,J.current,F.current,$==null?void 0:$.beforeOutsideRef.current,$==null?void 0:$.afterOutsideRef.current,...de()],Oe,co(x),co(p),L?C:null].filter(ae=>ae!=null),Te=zT(Pe,{ariaHidden:g||L,mark:!1}),He=[j,...pe].filter(ae=>ae!=null),se=zT(He);return()=>{se(),Te()}},[R,o,C,j,g,$,L,q,D,p,x,de]),Me(()=>{if(!R||o||!rn(W))return;A.current="",U.current="";const pe=Tt(W),we=or(pe);queueMicrotask(()=>{const Oe=_.current,ke=typeof Oe=="function"?Oe(X.current||""):Oe;if(ke===void 0||ke===!1||ot(W,we))return;let Te=null;const He=()=>(Te==null&&(Te=be(W)),Te[0]||W);let se;ke===!0||ke===null?se=He():se=co(ke),se=se||He();const ye=ot(W,or(pe)),Ae=k.current.openEvent,Be=(Ae==null?void 0:Ae.type)==="mousedown"&&sc(Ae);_m(se,{sync:Be,preventScroll:se===W,shouldFocus(){if(!Y.current)return!1;if(ye)return!0;const ae=or(pe);return!(ae!==se&&ot(W,ae))}})})},[o,R,W,be,_,X,Y,k]);const fe=y.useRef(null);Me(()=>{if(o||!W){fe.current=null;return}fe.current&&(fe.current.cancelled=!0,fe.current=null);const pe=Tt(W),we=or(pe),Oe=X.current==null;UT(we);function ke(Te){var He;if(Te.open||(A.current=ZL(Te.nativeEvent,U.current)),(Te.reason===ya&&((He=Te.triggerElement)!=null&&He.hasAttribute(Dl("focus-guard")))||Te.reason===Bn&&Te.nativeEvent.type==="mouseleave")&&(G.current=!0),Te.reason===Rh)if(Te.nested)G.current=!1;else if(sc(Te.nativeEvent)||Ay(Te.nativeEvent))G.current=!1;else{let se=!1;Tt(W).createElement("div").focus({get preventScroll(){return se=!0,!1}}),se?G.current=!1:G.current=!0}}O.on("openchange",ke);function Pe(Te){const He=V.current;let se=typeof He=="function"?He(Te):He;if(se===void 0||se===!1)return null;se===null&&(se=!0);const ye=C!=null&&C.isConnected?C:null,Ae=we!=null&&we.isConnected&&ar(we)!=="body"?we:null;let Be=Oe?Ae||ye:ye||Ae;return Be||(Be=BT()||null),typeof se=="boolean"?Be:co(se)||Be||null}return()=>{O.off("openchange",ke);const Te=or(pe),He=de(),se=ot(j,Te)||He.some(ve=>ve===Te||ot(ve,Te))||q&&xi(q.nodesRef.current,D(),!1).some(ve=>{var ze;return ot((ze=ve.context)==null?void 0:ze.elements.floating,Te)}),ye=V.current,Ae=A.current,Be=Pe(Ae),ae={cancelled:!1};fe.current=ae,queueMicrotask(()=>{fe.current===ae&&(fe.current=null);const ve=KL(Be),ze=I.current??typeof ye!="boolean";if(!ae.cancelled&&ye&&!G.current&&rn(ve)&&(!(!ze&&ve!==Te&&Te!==pe.body)||se)){const _e={preventScroll:!0};Ae==="keyboard"&&(_e.focusVisible=!0),ve.focus(_e)}G.current=!1})}},[o,j,W,V,I,X,O,q,C,D,de]),Me(()=>{if(!Fs||R||!j)return;const pe=or(Tt(j));!rn(pe)||!rd(pe)||ot(j,pe)&&pe.blur()},[R,j]),Me(()=>{if(!(o||!$))return $.setFocusManagerState({modal:g,closeOnFocusOut:v,open:R,onOpenChange:t.setOpen,domReference:C}),()=>{$.setFocusManagerState(null)}},[o,$,g,R,t,v,C]),Me(()=>{if(!(o||!W))return HT(W),()=>{queueMicrotask(Jy)}},[o,W]);const xe=!o&&(g?!L:!0)&&(ue||g);return d.jsxs(y.Fragment,{children:[xe&&d.jsx(oc,{"data-type":"inside",ref:oe,onFocus:pe=>{var we;if(g){const Oe=be();_m(Oe[Oe.length-1])}else if($!=null&&$.portalNode)if(G.current=!1,zl(pe,$.portalNode)){const Oe=I2(C);Oe==null||Oe.focus()}else(we=co(x??$.beforeOutsideRef))==null||we.focus()}}),s,xe&&d.jsx(oc,{"data-type":"inside",ref:N,onFocus:pe=>{var we;if(g)_m(be()[0]);else if($!=null&&$.portalNode)if(v&&(G.current=!0),zl(pe,$.portalNode)){const Oe=P2(C);Oe==null||Oe.focus()}else(we=co(p??$.afterOutsideRef))==null||we.focus()}})]})}function ex(e,t={}){const{enabled:s=!0,event:o="click",toggle:a=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:m=0,reason:g=ka}=t,v=e.context.dataRef,b=y.useRef(void 0),p=xa(),x=Rn(),S=y.useMemo(()=>{function w(R,C,j,O){const k=dt(g,C,j);R&&O==="touch"&&m>0?x.start(m,()=>{e.setOpen(!0,k)}):e.setOpen(R,k)}function E(R,C,j){const O=v.current.openEvent,k=e.select("domReferenceElement")!==C;return R&&k||!R||!a?!0:O&&(typeof u=="function"?u():u)?!j(O.type):!1}return{onPointerDown(R){b.current=gi(R.pointerType,!0)&&Ay(R.nativeEvent)?"virtual":R.pointerType},onMouseDown(R){const C=b.current,j=R.nativeEvent,O=e.select("open");if(R.button!==0||o==="click"||gi(C,!0)&&c)return;const k=E(O,R.currentTarget,_=>_==="click"||_==="mousedown"),D=Pn(j),P=rd(D);if(P||C==="virtual"){w(k,j,P?D:R.currentTarget,C);return}const L=R.currentTarget;p.request(()=>{w(k,j,L,C)})},onClick(R){if(o==="mousedown-only")return;const C=b.current;if(o==="mousedown"&&C){b.current=void 0;return}if(gi(C,!0)&&c)return;const j=e.select("open"),O=E(j,R.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");w(O,R.nativeEvent,R.currentTarget,C)},onKeyDown(){b.current=void 0}}},[v,o,c,g,e,u,a,p,x,m]);return y.useMemo(()=>s?{reference:S}:Ut,[s,S])}function YL(e,t){let s=null,o=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){var S;const c=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",m=t.axis==="y"||t.axis==="both",g=["mouseenter","mousemove"].includes(((S=t.dataRef.current.openEvent)==null?void 0:S.type)||"")&&t.pointerType!=="touch",v=t.axis==="y"?c.width:0,b=t.axis==="x"?c.height:0;let p=c.x,x=c.y;return s==null&&t.x&&u&&(s=c.x-t.x),o==null&&t.y&&m&&(o=c.y-t.y),p-=s||0,x-=o||0,(!a||g)&&(p=u&&t.x!=null?t.x:p,x=m&&t.y!=null?t.y:x),a=!0,{width:v,height:b,x:p,y:x,top:x,right:p+v,bottom:x+b,left:p}}}}function FT(e){return e!=null&&e.clientX!=null}function GL(e,t={}){const{enabled:s=!0,axis:o="both"}=t,a=e.useState("open"),c=e.useState("floatingElement"),u=e.useState("domReferenceElement"),m=e.context.dataRef,g=y.useRef(!1),v=y.useRef(null),[b,p]=y.useState(),[x,S]=y.useState([]),w=Ie(O=>{e.set("positionReference",O)}),E=Ie((O,k,D)=>{g.current||m.current.openEvent&&!FT(m.current.openEvent)||e.set("positionReference",YL(D??u,{x:O,y:k,axis:o,dataRef:m,pointerType:b}))}),R=Ie(O=>{a?v.current||(E(O.clientX,O.clientY,O.currentTarget),S([])):E(O.clientX,O.clientY,O.currentTarget)}),C=gi(b)?c:a;y.useEffect(()=>{if(!s){w(u);return}if(!C)return;function O(){var P;(P=v.current)==null||P.call(v),v.current=null}const k=Kt(c);function D(P){const L=Pn(P);ot(c,L)?O():E(P.clientX,P.clientY)}return!m.current.openEvent||FT(m.current.openEvent)?v.current=Et(k,"mousemove",D):w(u),O},[C,s,c,m,u,e,E,w,x]),y.useEffect(()=>()=>{e.set("positionReference",null)},[e]),y.useEffect(()=>{s&&!c&&(g.current=!1)},[s,c]),y.useEffect(()=>{!s&&a&&(g.current=!0)},[s,a]);const j=y.useMemo(()=>{function O(k){p(k.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:R,onMouseEnter:R}},[R]);return y.useMemo(()=>s?{reference:j,trigger:j}:{},[s,j])}function QL(){return!1}function XL(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Ah(e,t={}){const{enabled:s=!0,escapeKey:o=!0,outsidePress:a=!0,outsidePressEvent:c="sloppy",referencePress:u=QL,bubbles:m,externalTree:g}=t,v=e.useState("open"),b=e.useState("floatingElement"),{dataRef:p,events:x}=e.context,S=Ci(g),w=Ie(typeof a=="function"?a:()=>!1),E=typeof a=="function"?w:a,R=E!==!1,C=Ie(()=>c),{escapeKey:j,outsidePress:O}=XL(m),k=y.useRef(!1),D=y.useRef(!1),P=y.useRef(!1),L=y.useRef(!1),_=y.useRef(!1),V=y.useRef(""),I=y.useRef(null),X=Rn(),Y=Rn(),q=Rn(),$=Ie(()=>{Y.clear(),p.current.insideReactTree=!1}),G=Ie(N=>{var te;const z=(te=p.current.floatingContext)==null?void 0:te.nodeId;return(S?xi(S.nodesRef.current,z):[]).some(ue=>{var W;return((W=ue.context)==null?void 0:W.open)&&!ue.context.dataRef.current[N]})}),H=Ie(N=>Hv(N,e.select("floatingElement"))||Hv(N,e.select("domReferenceElement"))),K=Ie(N=>{u()&&e.setOpen(!1,dt(ka,N.nativeEvent))}),B=Ie(N=>{if(!v||!s||!o||N.key!=="Escape")return;const z=R6(N)?N.nativeEvent:N;if(_.current||z.isComposing||!j&&G("__escapeKeyBubbles"))return;const Z=dt(Ch,z);e.setOpen(!1,Z),Z.isCanceled||N.preventDefault(),!j&&!Z.isPropagationAllowed&&N.stopPropagation()}),A=Ie(()=>{p.current.insideReactTree=!0,Y.start(0,$)}),U=Ie(N=>{if(!v||!s||N.button!==0)return;const z=Pn(N.nativeEvent);ot(e.select("floatingElement"),z)&&(k.current||(k.current=!0,D.current=!1))}),J=Ie(N=>{!v||!s||(N.defaultPrevented||N.nativeEvent.defaultPrevented)&&k.current&&(D.current=!0)});y.useEffect(()=>{function N(z){z.open||(L.current=!1)}return x.on("openchange",N),()=>{x.off("openchange",N)}},[x]),y.useEffect(()=>$,[$]),y.useEffect(()=>{if(!v||!s)return v||(L.current=!1,_.current=!1,V.current="",I.current=null),$;p.current.__escapeKeyBubbles=j,p.current.__outsidePressBubbles=O;const N=new bs,z=Tt(b);function Z(){q.clear(),_.current=!0}function te(){_.current=!0,q.start(Fs?5:0,()=>{_.current=!1})}function ue(){P.current=!0,N.start(0,()=>{P.current=!1})}function W(){k.current=!1,D.current=!1}function be(){const ae=V.current,ve=ae==="pen"||!ae?"mouse":ae,ze=C(),_e=typeof ze=="function"?ze():ze;return typeof _e=="string"?_e:_e[ve]}function de(ae){const ve=be();return ve==="intentional"&&ae.type!=="click"||ve==="sloppy"&&ae.type==="click"}function fe(ae){var _e;const ve=(_e=p.current.floatingContext)==null?void 0:_e.nodeId,ze=S&&xi(S.nodesRef.current,ve).some(Re=>{var Ge;return Hv(ae,(Ge=Re.context)==null?void 0:Ge.elements.floating)});return H(ae)||ze}function xe(ae){if(de(ae)){ae.type!=="click"&&!H(ae)&&(N.clear(),P.current=!1),$();return}if(p.current.insideReactTree){$();return}const ve=Pn(ae),ze=`[${Dl("inert")}]`,_e=_t(ve)?ve.getRootNode():null,Re=Array.from((va(_e)?_e:Tt(e.select("floatingElement"))).querySelectorAll(ze)),Ge=e.context.triggerElements;if(ve&&(Ge.hasElement(ve)||Ge.hasMatchingElement(mt=>ot(mt,ve))))return;let Ye=_t(ve)?ve:null;for(;Ye&&!po(Ye);){const mt=wo(Ye);if(po(mt)||!_t(mt))break;Ye=mt}if(!(Re.length&&_t(ve)&&!V6(ve)&&!ot(ve,e.select("floatingElement"))&&Re.every(mt=>!ot(Ye,mt)))){if(rn(ve)&&!("touches"in ae)){const mt=po(ve),nt=Fr(ve),ut=/auto|scroll/,Rt=mt||ut.test(nt.overflowX),At=mt||ut.test(nt.overflowY),it=Rt&&ve.clientWidth>0&&ve.scrollWidth>ve.clientWidth,qe=At&&ve.clientHeight>0&&ve.scrollHeight>ve.clientHeight,at=nt.direction==="rtl",Nt=qe&&(at?ae.offsetX<=ve.offsetWidth-ve.clientWidth:ae.offsetX>ve.clientWidth),ht=it&&ae.offsetY>ve.clientHeight;if(Nt||ht)return}if(!fe(ae)){if(be()==="intentional"){if(ae.detail!==0&&!sc(ae)&&!L.current)return;if(P.current){N.clear(),P.current=!1;return}}typeof E=="function"&&!E(ae)||G("__outsidePressBubbles")||(e.setOpen(!1,dt(Rh,ae)),$())}}}function pe(ae){be()!=="sloppy"||ae.pointerType==="touch"||!e.select("open")||!s||H(ae)||xe(ae)}function we(ae){if(be()!=="sloppy"||!e.select("open")||!s||H(ae))return;const ve=ae.touches[0];ve&&(I.current={startTime:Date.now(),startX:ve.clientX,startY:ve.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Oe(ae,ve){const ze=Pn(ae);if(!ze)return;const _e=Et(ze,ae.type,()=>{ve(ae),_e()})}function ke(ae){V.current="touch",Oe(ae,we)}function Pe(ae){X.clear(),ae.type==="pointerdown"&&(ae.button===0&&(L.current=!0),V.current=ae.pointerType),!(ae.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Oe(ae,ve=>{ve.type==="pointerdown"?pe(ve):xe(ve)})}function Te(ae){if(ae.type==="pointercancel"&&(L.current=!1),!k.current)return;const ve=D.current;if(W(),be()==="intentional"){if(ae.type==="pointercancel"){ve&&ue();return}if(!fe(ae)){if(ve){ue();return}typeof E=="function"&&!E(ae)||(N.clear(),P.current=!0,$())}}}function He(ae){if(be()!=="sloppy"||!I.current||H(ae))return;const ve=ae.touches[0];if(!ve)return;const ze=Math.abs(ve.clientX-I.current.startX),_e=Math.abs(ve.clientY-I.current.startY),Re=Math.sqrt(ze*ze+_e*_e);Re>5&&(I.current.dismissOnTouchEnd=!0),Re>10&&(xe(ae),X.clear(),I.current=null)}function se(ae){Oe(ae,He)}function ye(ae){be()!=="sloppy"||!I.current||H(ae)||(I.current.dismissOnTouchEnd&&xe(ae),X.clear(),I.current=null)}function Ae(ae){Oe(ae,ye)}const Be=Ls(o&&Ls(Et(z,"keydown",B),Et(z,"compositionstart",Z),Et(z,"compositionend",te)),R&&Ls(Et(z,"click",Pe,!0),Et(z,"pointerdown",Pe,!0),Et(z,"pointerup",Te,!0),Et(z,"pointercancel",Te,!0),Et(z,"mousedown",Pe,!0),Et(z,"mouseup",Te,!0),Et(z,"touchstart",ke,{capture:!0,passive:!0}),Et(z,"touchmove",se,{capture:!0,passive:!0}),Et(z,"touchend",Ae,{capture:!0,passive:!0})));return()=>{Be(),N.clear(),W(),P.current=!1}},[p,b,o,R,E,v,s,j,O,B,$,C,G,H,S,e,X,q]);const F=y.useMemo(()=>({onKeyDown:B,onPointerDown:K,onClick:K}),[B,K]),oe=y.useMemo(()=>({onKeyDown:B,onPointerDown:J,onMouseDown:J,onClickCapture:A,onMouseDownCapture(N){A(),U(N)},onPointerDownCapture(N){A(),U(N)},onMouseUpCapture:A,onTouchEndCapture:A,onTouchMoveCapture:A}),[B,A,U,J]);return y.useMemo(()=>s?{reference:F,floating:oe,trigger:F}:{},[s,F,oe])}function rj(e){const{popupStore:t,treatPopupAsFloatingElement:s=!1,floatingRootContext:o,floatingId:a,nested:c,onOpenChange:u}=e,m=t.useState("open"),g=t.useState("activeTriggerElement"),v=t.useState(s?"popupElement":"positionerElement"),b=u;return t.useSyncedValue("floatingId",a),Me(()=>{const p={open:m,floatingId:a,referenceElement:g,floatingElement:v};_t(g)&&(p.domReferenceElement=g),o.state.positionReference===o.state.referenceElement&&(p.positionReference=g),o.update(p)},[m,a,g,v,o]),o.context.onOpenChange=b,o.context.nested=c,o}function od(e,t=!1,s=!1,o=!1){const[a,c]=y.useState(e&&t?"idle":void 0),[u,m]=y.useState(e&&!o);return e&&!u&&(m(!0),c("starting")),!e&&u&&a!=="ending"&&!s&&c("ending"),!e&&!u&&a==="ending"&&c(void 0),Me(()=>{if(!e&&u&&a!=="ending"&&s){const g=fr.request(()=>{c("ending")});return()=>{fr.cancel(g)}}},[e,u,a,s]),Me(()=>{if(!e||t||a===void 0)return;const g=fr.request(()=>{c(void 0)});return()=>{fr.cancel(g)}},[t,e,a]),Me(()=>{if(!e||!t)return;e&&u&&a!=="idle"&&c("starting");const g=fr.request(()=>{c("idle")});return()=>{fr.cancel(g)}},[t,e,u,a]),{mounted:u,setMounted:m,transitionStatus:a}}function VT(e,t){return e.getAnimations(t).filter(s=>{var a;const o=(a=s.effect)==null?void 0:a.getTiming();return(o==null?void 0:o.duration)!==1/0&&(o==null?void 0:o.iterations)!==1/0})}let am=null;function JL(e){if(!am){const t=[];am=t,queueMicrotask(()=>{am=null,Hs.flushSync(()=>{for(const s of t)s()})})}am.push(e)}function Mh(e,t=!1,s=!1){const o=xa();return Ie((a,c=null)=>{o.cancel();const u=co(e);if(u==null)return;const m=u,g=()=>{if(!s){Hs.flushSync(a);return}JL(()=>{c!=null&&c.aborted||a()})};if(typeof m.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){a();return}function v(){Promise.all(VT(m).map(b=>b.finished.then(vn))).then(()=>{c!=null&&c.aborted||g()},()=>{if(c!=null&&c.aborted)return;if(VT(m).some(p=>p.pending||p.playState!=="finished")){v();return}g()})}if(t){const b=Py;if(!m.hasAttribute(b)){o.request(v);return}const p=new MutationObserver(()=>{m.hasAttribute(b)||(p.disconnect(),v())});p.observe(m,{attributes:!0,attributeFilter:[b]}),c==null||c.addEventListener("abort",()=>p.disconnect(),{once:!0});return}o.request(v)})}function Ro(e){const{enabled:t=!0,open:s,ref:o,batch:a=!1,onComplete:c}=e,u=Ie(c),m=Mh(o,s,a);y.useEffect(()=>{if(!t)return;const g=new AbortController;return m(u,g.signal),()=>{g.abort()}},[t,s,u,m])}function sj(e){const{open:t,ref:s,preventUnmountOnClose:o,setPreventUnmountOnClose:a,onUnmount:c,animateInitialOpen:u}=e,m=Ie(a),{mounted:g,setMounted:v,transitionStatus:b}=od(t,!1,!1,u),p=t?!1:o;Me(()=>{t&&m(!1)},[t,m]);const x=y.useRef(g),S=y.useRef(!1),w=U2(),E=()=>{x.current=!1,v(!1),c()};Me(()=>{x.current=g,S.current&&(S.current=!1,!t&&g&&E())});const R=Ie(()=>{if(x.current){if(t){S.current=!0,w();return}E()}});return Ro({enabled:g&&!t&&!p,open:t,ref:s,onComplete(){t||R()}}),{mounted:g,transitionStatus:b,preventUnmountingOnClose:p,forceUnmount:R}}const zh={tabIndex:-1,[Bb]:""};function WL(e){return t=>t==="touch"?e.current:!0}function oj(e,t=!1){const s=sd(),o=Ri()!=null,a=In(()=>e(s,o)).current;return rj({popupStore:a,treatPopupAsFloatingElement:t,floatingRootContext:a.state.floatingRootContext,floatingId:s,nested:o,onOpenChange:a.setOpen}),a}function tx({handle:e,store:t}){return Me(()=>e.attachStore(t),[e,t]),null}function qT(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function eU(e,t){const s=y.useRef(null);return Ie(o=>{const a=s.current;if(a!==null){if(a.element===o&&a.store===t&&a.id===e)return;s.current=null;const c=a.store;c.context.triggerElements.getById(a.id)===a.element&&(c.context.triggerElements.delete(a.id),qT(c))}o!==null&&e!==void 0&&(s.current={store:t,id:e,element:o},t.context.triggerElements.add(e,o),qT(t))})}function nx(e,t,s,o=!1){let a=e.preventUnmountingOnClose;t?a=!1:o&&(a=!0);const c=(s==null?void 0:s.id)??null;let u=e.activeTriggerId,m=e.activeTriggerElement;return(c||t)&&(u=c,m=s??null),{open:t,preventUnmountingOnClose:a,activeTriggerId:u,activeTriggerElement:m,openedWithoutTrigger:t?s==null:e.openedWithoutTrigger}}function rx(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function tU(e,t,s,o={}){var b,p,x;const a=s.reason,c=a===Bn,u=t&&a===Ol,m=!t&&(a===ka||a===Ch),g=rx(s);if((p=(b=e.context).onOpenChange)==null||p.call(b,t,s),s.isCanceled)return;(x=o.onBeforeDispatch)==null||x.call(o),e.state.floatingRootContext.dispatchOpenChange(t,s);const v=()=>{const S=nx(e.state,t,s.trigger,g()),w={...o.extraState,...S};u?w.instantType="focus":m?w.instantType="dismiss":c&&(w.instantType=void 0),e.update(w)};c?Hs.flushSync(v):v()}function sx(e,t,s,o){const a=s.useState("isMountedByTrigger",e),c=eU(e,s),u=Ie(g=>{const v=s.select("open"),b=s.select("activeTriggerId");if(b===e){const p={activeTriggerElement:g,...v?o:null};s.update(p);return}if(b==null&&v&&!s.state.openedWithoutTrigger){const p={activeTriggerId:e??null,activeTriggerElement:g,...o};s.update(p)}}),m=Ie(g=>{c(g),g&&u(g)});return Me(()=>(m(t.current),()=>m(null)),[m,t,s,e]),Me(()=>{if(a){const g={activeTriggerElement:t.current,...o};s.update(g)}},[a,s,t,...Object.values(o)]),{registerTrigger:m,isMountedByThisTrigger:a}}function ox(e,t={}){const{closeOnActiveTriggerUnmount:s=!1}=t,o=y.useRef(null),a=e.useState("open"),c=e.useState("triggerCount"),u=e.useState("activeTriggerId"),m=e.useState("activeTriggerElement");Me(()=>{if(!a){o.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const g=e.context.triggerElements.size,v={};e.state.triggerCount!==g&&(v.triggerCount=g);const b=e.select("activeTriggerId");let p=null;if(b){const x=e.context.triggerElements.getById(b);if(x)o.current=b,x!==e.state.activeTriggerElement&&(v.activeTriggerElement=x);else{for(const[S,w]of e.context.triggerElements.entries())if(w===e.state.activeTriggerElement){v.activeTriggerId=S,v.activeTriggerElement=w,o.current=S;break}v.activeTriggerId===void 0&&(o.current===b?p=b:o.current=null)}}else o.current=null;if(!p&&!b&&!e.state.openedWithoutTrigger&&g===1){const x=e.context.triggerElements.entries().next();if(!x.done){const[S,w]=x.value;v.activeTriggerId=S,v.activeTriggerElement=w,o.current=S}}(v.triggerCount!==void 0||v.activeTriggerId!==void 0||v.activeTriggerElement!==void 0)&&e.update(v),p&&s&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===p&&!e.context.triggerElements.getById(p)){const x=dt(lr);e.setOpen(!1,x),x.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[a,e,c,u,m,s])}function ix(e,t,s,o){const{mounted:a,transitionStatus:c,forceUnmount:u}=sj({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:m=>t.set("preventUnmountingOnClose",m),animateInitialOpen:o,onUnmount(){var m,g;t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),s==null||s(),(g=(m=t.context).onOpenChangeComplete)==null||g.call(m,!1)}});return In(()=>(t.set("mounted",a),null)),t.useSyncedValues({mounted:a,transitionStatus:c}),{forceUnmount:u,transitionStatus:c}}function ax(e,t){e.useSyncedValues(t),Me(()=>()=>{e.update({activeTriggerProps:Ut,inactiveTriggerProps:Ut,popupProps:Ut})},[e])}function nU(e,t){Me(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Me(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Dh{constructor(){yt(this,"idMap",new Map)}add(t,s){this.idMap.set(t,s)}delete(t){this.idMap.delete(t)}hasElement(t){for(const s of this.idMap.values())if(s===t)return!0;return!1}hasMatchingElement(t){for(const s of this.idMap.values())if(t(s))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var $v={exports:{}},Zv={};/**
|
|
307
|
+
* @license React
|
|
308
|
+
* use-sync-external-store-shim.production.js
|
|
309
|
+
*
|
|
310
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the MIT license found in the
|
|
313
|
+
* LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/var $T;function rU(){if($T)return Zv;$T=1;var e=Wu();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var s=typeof Object.is=="function"?Object.is:t,o=e.useState,a=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function m(p,x){var S=x(),w=o({inst:{value:S,getSnapshot:x}}),E=w[0].inst,R=w[1];return c(function(){E.value=S,E.getSnapshot=x,g(E)&&R({inst:E})},[p,S,x]),a(function(){return g(E)&&R({inst:E}),p(function(){g(E)&&R({inst:E})})},[p]),u(S),S}function g(p){var x=p.getSnapshot;p=p.value;try{var S=x();return!s(p,S)}catch{return!0}}function v(p,x){return x()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:m;return Zv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,Zv}var ZT;function ij(){return ZT||(ZT=1,$v.exports=rU()),$v.exports}var Ih=ij(),Kv={exports:{}},Yv={};/**
|
|
315
|
+
* @license React
|
|
316
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
317
|
+
*
|
|
318
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the MIT license found in the
|
|
321
|
+
* LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/var KT;function sU(){if(KT)return Yv;KT=1;var e=Wu(),t=ij();function s(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var o=typeof Object.is=="function"?Object.is:s,a=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,m=e.useMemo,g=e.useDebugValue;return Yv.useSyncExternalStoreWithSelector=function(v,b,p,x,S){var w=c(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=m(function(){function C(P){if(!j){if(j=!0,O=P,P=x(P),S!==void 0&&E.hasValue){var L=E.value;if(S(L,P))return k=L}return k=P}if(L=k,o(O,P))return L;var _=x(P);return S!==void 0&&S(L,_)?(O=P,L):(O=P,k=_)}var j=!1,O,k,D=p===void 0?null:p;return[function(){return C(b())},D===null?void 0:function(){return C(D())}]},[b,p,x,S]);var R=a(v,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=R},[R]),g(R),R},Yv}var YT;function oU(){return YT||(YT=1,Kv.exports=sU()),Kv.exports}var iU=oU();const aU=_h(19),lU=aU?uU:dU;function aj(e,t,s,o,a){return lU(e,t,s,o,a)}function cU(e,t,s,o,a){const c=y.useCallback(()=>t(e.getSnapshot(),s,o,a),[e,t,s,o,a]);return Ih.useSyncExternalStore(e.subscribe,c,c)}p6({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let s=0;s<e.syncHooks.length;s+=1){const o=e.syncHooks[s],a=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,a)||(t=!0,o.value=a)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const s=new Set;for(const a of e.syncHooks)s.add(a.store);const o=[];for(const a of s)o.push(a.subscribe(t));return()=>{for(const a of o)a()}}),Ih.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function uU(e,t,s,o,a){const c=h6();if(!c)return cU(e,t,s,o,a);const u=c.syncIndex;c.syncIndex+=1;let m;return c.didInitialize?(m=c.syncHooks[u],(m.store!==e||m.selector!==t||!Object.is(m.a1,s)||!Object.is(m.a2,o)||!Object.is(m.a3,a))&&(m.store!==e&&(c.didChangeStore=!0),m.store=e,m.selector=t,m.a1=s,m.a2=o,m.a3=a,m.value=t(e.getSnapshot(),s,o,a))):(m={store:e,selector:t,a1:s,a2:o,a3:a,value:t(e.getSnapshot(),s,o,a)},c.syncHooks.push(m)),m.value}function dU(e,t,s,o,a){return iU.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,c=>t(c,s,o,a))}class fU{constructor(t){yt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));yt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const s=this.updateTick;for(const o of this.listeners){if(s!==this.updateTick)return;o(t)}}update(t){for(const s in t)if(!Object.is(this.state[s],t[s])){this.setState({...this.state,...t});return}}set(t,s){Object.is(this.state[t],s)||this.setState({...this.state,[t]:s})}notifyAll(){const t={...this.state};this.setState(t)}use(t,s,o,a){return aj(this,t,s,o,a)}}class id extends fU{constructor(t,s={},o){super(t),this.context=s,this.selectors=o}useSyncedValue(t,s){y.useDebugValue(t);const o=this;Me(()=>{o.state[t]!==s&&o.set(t,s)},[o,t,s])}useSyncedValueWithCleanup(t,s){const o=this;Me(()=>(o.state[t]!==s&&o.set(t,s),()=>{o.set(t,void 0)}),[o,t,s])}useSyncedValues(t){const s=this,o=Object.values(t);Me(()=>{s.update(t)},[s,...o])}useControlledProp(t,s){y.useDebugValue(t);const o=this,a=s!==void 0;Me(()=>{a&&!Object.is(o.state[t],s)&&o.setState({...o.state,[t]:s})},[o,t,s,a])}select(t,s,o,a){const c=this.selectors[t];return c(this.state,s,o,a)}useState(t,s,o,a){return y.useDebugValue(t),aj(this,this.selectors[t],s,o,a)}useContextCallback(t,s){y.useDebugValue(t);const o=Ie(s??vn);this.context[t]=o}useStateSetter(t){const s=y.useRef(void 0);return s.current===void 0&&(s.current=o=>{this.set(t,o)}),s.current}observe(t,s){let o;typeof t=="function"?o=t:o=this.selectors[t];let a=o(this.state);return s(a,a,this),this.subscribe(c=>{const u=o(c);if(!Object.is(a,u)){const m=a;a=u,s(u,m,this)}})}}const mU={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class lj extends id{constructor(s){const{syncOnly:o,nested:a,onOpenChange:c,triggerElements:u,...m}=s;super({...m,positionReference:m.referenceElement,domReferenceElement:m.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:W2(),nested:a,triggerElements:u},mU);yt(this,"syncOpenEvent",(s,o)=>{(!s||!this.state.open||o!=null&&C6(o))&&(this.context.dataRef.current.openEvent=s?o:void 0)});yt(this,"dispatchOpenChange",(s,o)=>{this.syncOpenEvent(s,o.event);const a={open:s,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",a)});yt(this,"setOpen",(s,o)=>{var a,c,u,m;if(this.syncOnly){(c=(a=this.context).onOpenChange)==null||c.call(a,s,o);return}this.dispatchOpenChange(s,o),(m=(u=this.context).onOpenChange)==null||m.call(u,s,o)});this.syncOnly=o}}function lx(e,t,s=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new lj({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:s,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ut,inactiveTriggerProps:Ut,popupProps:Ut}}const Mu=e=>e.triggerIdProp??e.activeTriggerId,Gm=e=>e.openProp??e.open,GT=e=>{var s;return(((s=e.popupElement)==null?void 0:s.id)??e.floatingId)||void 0};function cj(e,t){return t!==void 0&&Gm(e)&&Mu(e)===t}function hU(e,t){return cj(e,t)?!0:t!==void 0&&Gm(e)&&Mu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const zu={open:Gm,mounted:e=>e.mounted,transitionStatus:e=>Gm(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Mu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:GT,isTriggerActive:(e,t)=>t!==void 0&&Mu(e)===t,isOpenedByTrigger:(e,t)=>cj(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Mu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>hU(e,t)?GT(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function cx(e){const t=y.useCallback(o=>e===void 0?vn:e.subscribeStore(o),[e]),s=y.useCallback(()=>e===void 0?void 0:e.store,[e]);return Ih.useSyncExternalStore(t,s,()=>e==null?void 0:e.serverStore)}function pU(e){const{open:t=!1,onOpenChange:s,elements:o={}}=e,a=sd(),c=Ri()!=null,u=In(()=>new lj({open:t,transitionStatus:void 0,onOpenChange:s,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new Dh,floatingId:a,syncOnly:!1,nested:c})).current;return Me(()=>{const m={open:t,floatingId:a};o.reference!==void 0&&(m.referenceElement=o.reference,m.domReferenceElement=_t(o.reference)?o.reference:null),o.floating!==void 0&&(m.floatingElement=o.floating),u.update(m)},[t,a,o.reference,o.floating,u]),u.context.onOpenChange=s,u.context.nested=c,u}const Gv=ky&&Fs;function uj(e,t={}){const{enabled:s=!0,delay:o}=t,{events:a,dataRef:c}=e.context,u=y.useRef(!1),m=y.useRef(null),g=y.useRef(!0),v=Rn();y.useEffect(()=>{const p=e.select("domReferenceElement");if(!s)return;const x=Kt(p);function S(){const R=e.select("domReferenceElement");!e.select("open")&&rn(R)&&R===or(Tt(R))&&(u.current=!0,m.current=R)}function w(){g.current=!0}function E(){g.current=!1}return Ls(Et(x,"blur",S),Gv&&Et(x,"keydown",w,!0),Gv&&Et(x,"pointerdown",E,!0))},[e,s]),y.useEffect(()=>{if(!s)return;function p(x){if(x.reason===ka||x.reason===Ch){const S=e.select("domReferenceElement");_t(S)&&(m.current=S,u.current=!0)}}return a.on("openchange",p),()=>{a.off("openchange",p)}},[a,s,e]);const b=y.useMemo(()=>{function p(){u.current=!1,m.current=null}return{onMouseLeave(){p()},onFocus(x){const S=x.currentTarget;if(u.current){if(m.current===S)return;p()}const w=Pn(x.nativeEvent);if(_t(w)){if(Gv&&!x.relatedTarget){if(!g.current&&!rd(w))return}else if(!y2(w))return}const E=Fm(x.relatedTarget,e.context.triggerElements),{nativeEvent:R,currentTarget:C}=x;if(e.select("open")&&E||!o){e.setOpen(!0,dt(Ol,R,C));return}v.start(o,()=>{u.current||e.setOpen(!0,dt(Ol,R,C))})},onBlur(x){p();const S=x.relatedTarget,w=x.nativeEvent,E=_t(S)&&S.hasAttribute(Dl("focus-guard"))&&S.getAttribute("data-type")==="outside";v.start(0,()=>{var O;const R=e.select("domReferenceElement"),C=or(Tt(R));!S&&C===R||ot((O=c.current.floatingContext)==null?void 0:O.refs.floating.current,C)||ot(R,C)||E||Fm(S??C,e.context.triggerElements)||e.setOpen(!1,dt(Ol,w))})}}},[c,o,e,v]);return y.useMemo(()=>s?{reference:b,trigger:b}:{},[s,b])}class ux{constructor(){yt(this,"pointerType");yt(this,"interactedInside",!1);yt(this,"handler");yt(this,"blockMouseMove",!0);yt(this,"performedPointerEventsMutation",!1);yt(this,"pointerEventsScopeElement",null);yt(this,"pointerEventsReferenceElement",null);yt(this,"pointerEventsFloatingElement",null);yt(this,"restTimeoutPending",!1);yt(this,"openChangeTimeout",new bs);yt(this,"restTimeout",new bs);yt(this,"handleCloseOptions");yt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});yt(this,"disposeEffect",()=>this.dispose)}static create(){return new ux}}const Qm=new WeakMap;function Xm(e){var s,o,a;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Qm.get(t)===e&&((s=e.pointerEventsScopeElement)==null||s.style.removeProperty("pointer-events"),(o=e.pointerEventsReferenceElement)==null||o.style.removeProperty("pointer-events"),(a=e.pointerEventsFloatingElement)==null||a.style.removeProperty("pointer-events"),Qm.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function dj(e,t){const{scopeElement:s,referenceElement:o,floatingElement:a}=t,c=Qm.get(s);c&&c!==e&&Xm(c),Xm(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=a,Qm.set(s,e),s.style.pointerEvents="none",o.style.pointerEvents="auto",a.style.pointerEvents="auto"}function dx(e){const t=e.context.dataRef.current,s=In(()=>t.hoverInteractionState??ux.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=s),Oy(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function fj(e,t={}){const{enabled:s=!0,closeDelay:o=0,nodeId:a}=t,c=e.useState("open"),u=e.useState("floatingElement"),m=e.useState("domReferenceElement"),{dataRef:g}=e.context,v=Ci(),b=Ri(),p=dx(e),x=Rn(),S=Ie(()=>{var R;return x2((R=g.current.openEvent)==null?void 0:R.type,p.interactedInside)}),w=Ie(()=>{var R;return Z6((R=g.current.openEvent)==null?void 0:R.type)}),E=Ie(()=>{Xm(p)});Me(()=>{c||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,E())},[c,p,E]),y.useEffect(()=>E,[E]),Me(()=>{var R,C,j,O,k;if(s&&c&&(R=p.handleCloseOptions)!=null&&R.blockPointerEvents&&w()&&_t(m)&&u){const D=m,P=u,L=Tt(u),_=(j=(C=v==null?void 0:v.nodesRef.current.find(Y=>Y.id===b))==null?void 0:C.context)==null?void 0:j.elements.floating;_&&(_.style.pointerEvents="");const V=p.pointerEventsScopeElement!==P?p.pointerEventsScopeElement:null,I=_!==P?_:null,X=((k=(O=p.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??V??I??Hu(D,"[data-rootownerid]")??L.body;return dj(p,{scopeElement:X,referenceElement:D,floatingElement:P}),()=>{E()}}},[s,c,m,u,p,w,v,b,E]),y.useEffect(()=>{if(!s)return;function R(){return!!(v&&b&&xi(v.nodesRef.current,b).length>0)}function C(L){const _=ba(o,"close",p.pointerType),V=()=>{e.setOpen(!1,dt(Bn,L)),v==null||v.events.emit("floating.closed",L)};_?p.openChangeTimeout.start(_,V):(p.openChangeTimeout.clear(),V())}function j(L){const _=Pn(L);if(!q6(_)){p.interactedInside=!1;return}p.interactedInside=Hu(_,"[aria-haspopup]")!=null}function O(){p.openChangeTimeout.clear(),x.clear(),v==null||v.events.off("floating.closed",D),E()}function k(L){var X;if(R()&&v){v.events.on("floating.closed",D);return}if(Fm(L.relatedTarget,e.context.triggerElements))return;const _=((X=g.current.floatingContext)==null?void 0:X.nodeId)??a,V=L.relatedTarget;if(!(v&&_&&_t(V)&&xi(v.nodesRef.current,_,!1).some(Y=>{var q;return ot((q=Y.context)==null?void 0:q.elements.floating,V)}))){if(p.handler){p.handler(L);return}E(),w()&&!S()&&C(L)}}function D(L){!v||!b||R()||x.start(0,()=>{v.events.off("floating.closed",D),e.setOpen(!1,dt(Bn,L)),v.events.emit("floating.closed",L)})}const P=u;return Ls(P&&Et(P,"mouseenter",O),P&&Et(P,"mouseleave",k),P&&Et(P,"pointerdown",j,!0),()=>{v==null||v.events.off("floating.closed",D)})},[s,u,e,g,o,a,w,S,E,p,v,b,x])}const gU={current:null};function mj(e,t={}){const{enabled:s=!0,delay:o=0,handleClose:a=null,mouseOnly:c=!1,restMs:u=0,move:m=!0,triggerElementRef:g=gU,externalTree:v,isActiveTrigger:b=!0,getHandleCloseContext:p,isClosing:x,shouldOpen:S,guardStaleOpen:w=!1}=t,{dataRef:E,events:R}=e.context,C=Ci(v),j=dx(e),O=y.useRef(!1),k=fn(a),D=fn(o),P=fn(u),L=fn(s),_=fn(S),V=fn(x),I=Ie(()=>{var G;return x2((G=E.current.openEvent)==null?void 0:G.type,j.interactedInside)}),X=Ie(()=>{var G;return((G=_.current)==null?void 0:G.call(_))!==!1}),Y=Ie((G,H,K)=>{const B=e.context.triggerElements;if(B.hasElement(H))return!G||!ot(G,H);if(!_t(K))return!1;const A=K;return B.hasMatchingElement(U=>ot(U,A))&&(!G||!ot(G,A))}),q=Ie(()=>{if(!j.handler)return;Tt(e.select("domReferenceElement")).removeEventListener("mousemove",j.handler),j.handler=void 0}),$=Ie(()=>{Xm(j)});return b&&(j.handleCloseOptions=a==null?void 0:a.__options),y.useEffect(()=>q,[q]),y.useEffect(()=>{if(!s)return;function G(H){H.open?O.current=!1:(O.current=H.reason===Bn,q(),j.openChangeTimeout.clear(),j.restTimeout.clear(),j.blockMouseMove=!0,j.restTimeoutPending=!1)}return R.on("openchange",G),()=>{R.off("openchange",G)}},[s,R,j,q]),y.useEffect(()=>{if(!s)return;function G(J,F=!0){const oe=ba(D.current,"close",j.pointerType);oe?j.openChangeTimeout.start(oe,()=>{e.setOpen(!1,dt(Bn,J)),C==null||C.events.emit("floating.closed",J)}):F&&(j.openChangeTimeout.clear(),e.setOpen(!1,dt(Bn,J)),C==null||C.events.emit("floating.closed",J))}const H=g.current??(b?e.select("domReferenceElement"):null);if(!_t(H))return;function K(J){var Oe;if(j.openChangeTimeout.clear(),j.blockMouseMove=!1,c&&!gi(j.pointerType))return;const F=ST(P.current),oe=ba(D.current,"open",j.pointerType),N=Pn(J),z=J.currentTarget??null,Z=e.select("domReferenceElement");let te=z;if(_t(N)&&!e.context.triggerElements.hasElement(N)){for(const ke of e.context.triggerElements.elements())if(ot(ke,N)){te=ke;break}}_t(z)&&_t(Z)&&!e.context.triggerElements.hasElement(z)&&ot(z,Z)&&(te=Z);const ue=te==null?!1:Y(Z,te,N),W=e.select("open"),be=((Oe=V.current)==null?void 0:Oe.call(V))??e.select("transitionStatus")==="ending",de=!W&&be&&O.current,fe=!ue&&_t(te)&&_t(Z)&&ot(Z,te)&&de,xe=F>0&&!oe,pe=ue&&(W||de)||fe,we=!W||ue;if(pe){X()&&e.setOpen(!0,dt(Bn,J,te));return}xe||(oe?j.openChangeTimeout.start(oe,()=>{we&&X()&&e.setOpen(!0,dt(Bn,J,te))}):we&&X()&&e.setOpen(!0,dt(Bn,J,te)))}function B(J){if(I()){$();return}q();const F=e.select("domReferenceElement"),oe=Tt(F);j.restTimeout.clear(),j.restTimeoutPending=!1;const N=E.current.floatingContext??(p==null?void 0:p());if(Fm(J.relatedTarget,e.context.triggerElements))return;if(k.current&&N){e.select("open")||j.openChangeTimeout.clear();const Z=g.current;j.handler=k.current({...N,tree:C,x:J.clientX,y:J.clientY,onClose(){$(),q(),L.current&&!I()&&Z===e.select("domReferenceElement")&&G(J,!0)}}),oe.addEventListener("mousemove",j.handler),j.handler(J);return}(j.pointerType==="touch"?!ot(e.select("floatingElement"),J.relatedTarget):!0)&&G(J)}function A(J){ot(H,J.relatedTarget)||(j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1)}const U=w?Et(H,"mouseout",A):void 0;return m?Ls(Et(H,"mousemove",K,{once:!0}),Et(H,"mouseenter",K),Et(H,"mouseleave",B),U):Ls(Et(H,"mouseenter",K),Et(H,"mouseleave",B),U)},[q,$,E,D,e,s,k,j,b,Y,I,c,m,P,g,C,L,p,V,X,w]),y.useMemo(()=>{if(!s)return;function G(H){j.pointerType=H.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(H){var N,z,Z;const{nativeEvent:K}=H,B=H.currentTarget,A=e.select("domReferenceElement"),U=e.select("open"),J=Y(A,B,H.target);if(c&&!gi(j.pointerType))return;if(U&&J&&((N=j.handleCloseOptions)!=null&&N.blockPointerEvents)){const te=e.select("floatingElement");if(te){const ue=((Z=(z=j.handleCloseOptions)==null?void 0:z.getScope)==null?void 0:Z.call(z))??B.ownerDocument.body;dj(j,{scopeElement:ue,referenceElement:B,floatingElement:te})}}const F=ST(P.current);if(U&&!J||F===0||!J&&j.restTimeoutPending&&H.movementX**2+H.movementY**2<2)return;j.restTimeout.clear();function oe(){if(j.restTimeoutPending=!1,I())return;const te=e.select("open");!j.blockMouseMove&&(!te||J)&&X()&&e.setOpen(!0,dt(Bn,K,B))}j.pointerType==="touch"?Hs.flushSync(()=>{oe()}):J&&U?oe():(j.restTimeoutPending=!0,j.restTimeout.start(F,oe))}}},[s,j,I,Y,c,e,P,X])}function QT(e){return Fs&&e.movementX===0&&e.movementY===0}function Ph(e,t,s){switch(e){case"vertical":return t;case"horizontal":return s;default:return t||s}}function lm(e,t){return Ph(t,e===v2||e===Iy,e===Eh||e===Th)}function Qv(e,t,s){return Ph(t,e===Iy,s?e===Eh:e===Th)||e==="Enter"||e===" "||e===""}function vU(e,t,s){return Ph(t,s?e===Eh:e===Th,e===Iy)}function bU(e,t,s,o){const a=s?e===Th:e===Eh,c=e===v2;return t==="both"||t==="horizontal"&&o?e==="Escape":Ph(t,a,c)}function hj(e,t){const{listRef:s,activeIndex:o,onNavigate:a=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:m=!1,loopFocus:g=!1,nested:v=!1,rtl:b=!1,virtual:p=!1,focusItemOnOpen:x="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:E=void 0,orientation:R="vertical",triggerOrientation:C=R,parentOrientation:j,id:O,resetOnPointerLeave:k=!0,externalTree:D,nestedReturnFocusRef:P,grid:L}=t,_=L!=null,V=e.useState("open"),I=e.useState("floatingElement"),X=e.useState("domReferenceElement"),Y=e.context.dataRef,q=Vm(I),$=Vb(X),G=fn(q),H=Ri(),K=Ci(D),B=y.useRef(x),A=y.useRef(u??-1),U=y.useRef(null),J=y.useRef(!0),F=Ie(ae=>{a(A.current===-1?null:A.current,ae)}),oe=y.useRef(!!I),N=y.useRef(V),z=y.useRef(!1),Z=y.useRef(!1),te=y.useRef(null),ue=fn(E),W=fn(V),be=fn(u),de=fn(k),fe=xa(),xe=xa(),pe=Ie(()=>{fe.cancel();function ae(Re){p||(te.current=_m(Re,{sync:z.current,preventScroll:!0}))}const ve=s.current[A.current],ze=Z.current;ve&&ae(ve),(z.current?Re=>Re():Re=>fe.request(Re))(()=>{var Ye;const Re=s.current[A.current]||ve;if(!Re)return;ve||ae(Re),He&&(ze||!J.current)&&((Ye=Re.scrollIntoView)==null||Ye.call(Re,{block:"nearest",inline:"nearest"}))})});Me(()=>{Y.current.orientation=R},[Y,R]),Me(()=>{V||(U.current=null),(!V||x!=="auto")&&(B.current=x)},[V,x]),Me(()=>{c&&(V&&I?(A.current=u??-1,B.current&&u!=null&&(Z.current=!0,F())):oe.current&&(A.current=-1,F()))},[c,V,I,u,F]),Me(()=>{if(c){if(!V){z.current=!1;return}if(I)if(o==null){if(z.current=!1,be.current!=null)return;if(oe.current&&(A.current=-1,pe()),(!N.current||!oe.current)&&B.current&&(U.current!=null||B.current===!0&&U.current==null)){let ae=0;const ve=()=>{s.current[0]==null?(ae<2&&(ae?_e=>xe.request(_e):queueMicrotask)(ve),ae+=1):(A.current=U.current==null||Qv(U.current,C,b)||v?km(s):$b(s),U.current=null,F())};ve()}}else _l(s.current,o)||(A.current=o,pe(),Z.current=!1)}},[c,V,I,o,be,v,s,C,b,F,pe,xe]),Me(()=>{var Re,Ge;if(!c||I||!K||p||!oe.current)return;const ae=K.nodesRef.current,ve=(Ge=(Re=ae.find(Ye=>Ye.id===H))==null?void 0:Re.context)==null?void 0:Ge.elements.floating,ze=or(Tt(X??ve??null)),_e=ae.some(Ye=>Ye.context&&ot(Ye.context.elements.floating,ze));ve&&!_e&&J.current&&ve.focus({preventScroll:!0})},[c,I,X,K,H,p]),Me(()=>{N.current=V,oe.current=!!I});const we=o!=null,Oe=Ie(ae=>{if(!W.current)return;const ve=s.current.indexOf(ae.currentTarget);ve!==-1&&(A.current!==ve||o!==ve)&&(A.current=ve,F(ae))}),ke=Ie(()=>{var ae,ve,ze;return j??((ze=(ve=(ae=K==null?void 0:K.nodesRef.current.find(_e=>_e.id===H))==null?void 0:ae.context)==null?void 0:ve.dataRef)==null?void 0:ze.current.orientation)}),Pe=Ie(()=>km(s,ue.current)),Te=Ie(ae=>{if(J.current=!1,z.current=!0,ae.which===229||!W.current&&ae.currentTarget===G.current)return;if(v&&bU(ae.key,R,b,_)){lm(ae.key,ke())||As(ae),e.setOpen(!1,dt(qm,ae.nativeEvent));const Re=(P==null?void 0:P.current)??X;rn(Re)&&Re.focus();return}o!=null&&o!==A.current&&!_l(s.current,o)&&(A.current=o);const ve=A.current,ze=km(s,E),_e=$b(s,E);if($||(ae.key==="Home"&&(As(ae),A.current=ze,F(ae)),ae.key==="End"&&(As(ae),A.current=_e,F(ae))),L!=null){const Re=L(ae,A.current,s,R,g,b,E,ze,_e);if(Re!=null&&Re!==A.current&&(A.current=Re,F(ae)),R==="both")return}if(lm(ae.key,R)){As(ae);const Re=or(ae.currentTarget.ownerDocument);if(V&&!p&&ot(ae.currentTarget,Re)&&!s.current.some(mt=>mt!=null&&ot(mt,Re))){A.current=Qv(ae.key,R,b)?ze:_e,F(ae),o===A.current&&pe();return}const{index:Ge,wrapped:Ye}=vL(s.current,ve,{decrement:!Qv(ae.key,R,b),loopFocus:g,allowEscape:m,disabledIndices:E,minIndex:ze,maxIndex:_e});Ye&&(z.current=!1),A.current=Ge,F(ae)}}),He=y.useMemo(()=>({onFocus(ve){z.current=!0,Oe(ve)},onClick({currentTarget:ve}){p||ve.focus({preventScroll:!0})},onMouseMove(ve){QT(ve)||(z.current=!0,Z.current=!1,S&&Oe(ve))},onPointerLeave(ve){var _e;if(!W.current||!J.current||ve.pointerType==="touch")return;z.current=!0;const ze=ve.relatedTarget;if(!(!S||s.current.includes(ze))&&de.current&&((_e=te.current)==null||_e.call(te),te.current=null,A.current=-1,F(ve),!p)){const Re=G.current,Ge=or(Tt(Re));Re&&ot(Re,Ge)&&Re.focus({preventScroll:!0})}}}),[Oe,W,G,S,s,F,de,p]),se=y.useMemo(()=>p&&V&&we&&{"aria-activedescendant":`${O}-${o}`},[p,V,we,O,o]),ye=y.useMemo(()=>({...$?{}:se,onKeyDown(ae){if(ae.key==="Tab"&&ae.shiftKey&&V&&!p){const ve=Pn(ae.nativeEvent);if(ve&&!ot(G.current,ve))return;As(ae);const ze=dt(ya,ae.nativeEvent);e.setOpen(!1,ze);const _e=(P==null?void 0:P.current)??X;!ze.isCanceled&&rn(_e)&&_e.focus();return}Te(ae)},onPointerMove(ae){QT(ae)||(J.current=!0)}}),[se,Te,G,$,e,V,p,X,P]),Ae=y.useMemo(()=>{function ae(_e){e.setOpen(!0,dt(qm,_e.nativeEvent,_e.currentTarget))}function ve(_e){x==="auto"&&sc(_e.nativeEvent)&&(B.current=!p)}function ze(_e){B.current=x,x==="auto"&&Ay(_e.nativeEvent)&&(B.current=!0)}return{onKeyDown(_e){var ut;const Re=e.select("open");J.current=!1;const Ge=_e.key.startsWith("Arrow"),Ye=vU(_e.key,ke(),b),mt=lm(_e.key,Re?R:C),nt=(v?Ye:mt)||_e.key==="Enter"||_e.key.trim()==="";if(p&&Re&&(!v||rd(_e.currentTarget)))return Te(_e);if(!(!Re&&!w&&Ge)){if(nt){const Rt=lm(_e.key,ke());U.current=v&&Rt?null:_e.key}if(v){Ye&&(As(_e),Re?(A.current=Pe(),F(_e),p&&((ut=G.current)==null||ut.focus())):ae(_e));return}mt&&(be.current!=null&&(A.current=be.current),As(_e),!Re&&w?ae(_e):Te(_e),Re&&F(_e))}},onFocus(_e){_e.target===_e.currentTarget&&e.select("open")&&!p&&(A.current=-1,F(_e))},onPointerDown:ze,onPointerEnter:ze,onMouseDown:ve,onClick:ve}},[Te,x,Pe,v,F,e,w,R,C,ke,b,be,p,G]),Be=y.useMemo(()=>({...se,...Ae}),[se,Ae]);return y.useMemo(()=>c?{reference:Be,floating:ye,item:He,trigger:Ae}:{},[c,Be,ye,Ae,He])}function pj(e,t){const{listRef:s,elementsRef:o,activeIndex:a,onMatch:c,disabledIndices:u,onTyping:m,enabled:g=!0,resetMs:v=750,selectedIndex:b=null}=t,p=Ie(m),x=e.useState("open"),S=Rn(),w=y.useRef(""),E=y.useRef(b??a??-1),R=y.useRef(null),C=Ie(k=>{function D($){return o==null?void 0:o.current[$]}function P($){const G=D($);return G&&!jh(G)||G!=null&&G.matches(":disabled")?!1:u==null||!Ml(ns,$,u)}function L($,G,H=0){if($.length===0)return-1;const K=(H%$.length+$.length)%$.length,B=G.toLowerCase();for(let A=0;A<$.length;A+=1){const U=(K+A)%$.length,J=$[U];if(!(!(J!=null&&J.toLowerCase().startsWith(B))||!P(U)))return U}return-1}const _=s.current;if(w.current.length>0&&k.key===" "&&(As(k),p==null||p(!0)),w.current.length>0&&w.current[0]!==" "&&L(_,w.current)===-1&&k.key!==" "&&(p==null||p(!1)),_==null||k.key.length!==1||k.ctrlKey||k.metaKey||k.altKey)return;x&&k.key!==" "&&(As(k),p==null||p(!0));const V=w.current==="";V&&(E.current=b??a??-1),_.every(($,G)=>{var H,K;return $&&P(G)?((H=$[0])==null?void 0:H.toLowerCase())!==((K=$[1])==null?void 0:K.toLowerCase()):!0})&&w.current===k.key&&(w.current="",E.current=R.current),w.current+=k.key,S.start(v,()=>{w.current="",E.current=R.current,p==null||p(!1)});const Y=((V?b??a??-1:E.current)??0)+1,q=L(_,w.current,Y);q!==-1?(c==null||c(q,k),R.current=q):k.key!==" "&&(w.current="",p==null||p(!1))}),j=Ie(k=>{const D=k.relatedTarget,P=e.select("domReferenceElement"),L=e.select("floatingElement");ot(P,D)||ot(L,D)||(S.clear(),w.current="",E.current=R.current,p==null||p(!1))});Me(()=>{!x&&b!==null||(S.clear(),R.current=null,w.current!==""&&(w.current="",p==null||p(!1)))},[x,b,S,p]);const O=y.useMemo(()=>({onKeyDown:C,onBlur:j}),[C,j]);return y.useMemo(()=>g?{reference:O,floating:O}:{},[g,O])}const XT=.1,yU=XT*XT,nn=.5;function cm(e,t,s,o,a,c){return o>=t!=c>=t&&e<=(a-s)*(t-o)/(c-o)+s}function um(e,t,s,o,a,c,u,m,g,v){let b=!1;return cm(e,t,s,o,a,c)&&(b=!b),cm(e,t,a,c,u,m)&&(b=!b),cm(e,t,u,m,g,v)&&(b=!b),cm(e,t,g,v,s,o)&&(b=!b),b}function xU(e,t,s){return e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height}function dm(e,t,s,o,a,c){const u=Math.min(s,a),m=Math.max(s,a),g=Math.min(o,c),v=Math.max(o,c);return e>=u&&e<=m&&t>=g&&t<=v}function gj(e={}){const{blockPointerEvents:t=!1}=e,s=new bs,o=({x:a,y:c,placement:u,elements:m,onClose:g,nodeId:v,tree:b})=>{const p=u==null?void 0:u.split("-")[0];let x=!1,S=null,w=null,E=typeof performance<"u"?performance.now():0;function R(j,O){const k=performance.now(),D=k-E;if(S===null||w===null||D===0)return S=j,w=O,E=k,!1;const P=j-S,L=O-w,_=P*P+L*L,V=D*D*yU;return S=j,w=O,E=k,_<V}function C(){s.clear(),g()}return function(O){s.clear();const k=m.domReference,D=m.floating;if(!k||!D||p==null||a==null||c==null)return;const{clientX:P,clientY:L}=O,_=Pn(O),V=O.type==="mouseleave",I=ot(D,_),X=ot(k,_);if(I&&(x=!0,!V))return;if(X&&(x=!1,!V)){x=!0;return}if(V&&_t(O.relatedTarget)&&ot(D,O.relatedTarget))return;function Y(){return!!(b&&xi(b.nodesRef.current,v).length>0)}function q(){Y()||C()}if(Y())return;const $=k.getBoundingClientRect(),G=D.getBoundingClientRect(),H=a>G.right-G.width/2,K=c>G.bottom-G.height/2,B=G.width>$.width,A=G.height>$.height,U=(B?$:G).left,J=(B?$:G).right,F=(A?$:G).top,oe=(A?$:G).bottom;if(p==="top"&&c>=$.bottom-1||p==="bottom"&&c<=$.top+1||p==="left"&&a>=$.right-1||p==="right"&&a<=$.left+1){q();return}let N=!1;switch(p){case"top":N=dm(P,L,U,$.top+1,J,G.bottom-1);break;case"bottom":N=dm(P,L,U,G.top+1,J,$.bottom-1);break;case"left":N=dm(P,L,G.right-1,oe,$.left+1,F);break;case"right":N=dm(P,L,$.right-1,oe,G.left+1,F);break}if(N)return;if(x&&!xU(P,L,$)){q();return}if(!V&&R(P,L)){q();return}let z=!1;switch(p){case"top":{const Z=B?nn/2:nn*4,te=B||H?a+Z:a-Z,ue=B?a-Z:H?a+Z:a-Z,W=c+nn+1,be=H||B?G.bottom-nn:G.top,de=H?B?G.bottom-nn:G.top:G.bottom-nn;z=um(P,L,te,W,ue,W,G.left,be,G.right,de);break}case"bottom":{const Z=B?nn/2:nn*4,te=B||H?a+Z:a-Z,ue=B?a-Z:H?a+Z:a-Z,W=c-nn,be=H||B?G.top+nn:G.bottom,de=H?B?G.top+nn:G.bottom:G.top+nn;z=um(P,L,te,W,ue,W,G.left,be,G.right,de);break}case"left":{const Z=A?nn/2:nn*4,te=A||K?c+Z:c-Z,ue=A?c-Z:K?c+Z:c-Z,W=a+nn+1,be=K||A?G.right-nn:G.left,de=K?A?G.right-nn:G.left:G.right-nn;z=um(P,L,be,G.top,de,G.bottom,W,te,W,ue);break}case"right":{const Z=A?nn/2:nn*4,te=A||K?c+Z:c-Z,ue=A?c-Z:K?c+Z:c-Z,W=a-nn,be=K||A?G.left+nn:G.right,de=K?A?G.left+nn:G.right:G.left+nn;z=um(P,L,W,te,W,ue,be,G.top,de,G.bottom);break}}z?x||s.start(40,q):q()}};return o.__options={...e,blockPointerEvents:t},o}function JT(e,t,s){let{reference:o,floating:a}=e;const c=ts(t),u=Zy(t),m=$y(u),g=Br(t),v=c==="y",b=o.x+o.width/2-a.width/2,p=o.y+o.height/2-a.height/2,x=o[m]/2-a[m]/2;let S;switch(g){case"top":S={x:b,y:o.y-a.height};break;case"bottom":S={x:b,y:o.y+o.height};break;case"right":S={x:o.x+o.width,y:p};break;case"left":S={x:o.x-a.width,y:p};break;default:S={x:o.x,y:o.y}}const w=Us(t);return w&&(S[u]+=x*(w==="end"?1:-1)*(s&&v?-1:1)),S}async function wU(e,t){var s;t===void 0&&(t={});const{x:o,y:a,platform:c,rects:u,elements:m,strategy:g}=e,{boundary:v="clippingAncestors",rootBoundary:b="viewport",elementContext:p="floating",altBoundary:x=!1,padding:S=0}=yi(t,e),w=j2(S),R=m[x?p==="floating"?"reference":"floating":p],C=Fu(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(R)))==null||s?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(m.floating)),boundary:v,rootBoundary:b,strategy:g})),j=p==="floating"?{x:o,y:a,width:u.floating.width,height:u.floating.height}:u.reference,O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m.floating)),k=await(c.isElement==null?void 0:c.isElement(O))&&await(c.getScale==null?void 0:c.getScale(O))||{x:1,y:1},D=Fu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:j,offsetParent:O,strategy:g}):j);return{top:(C.top-D.top+w.top)/k.y,bottom:(D.bottom-C.bottom+w.bottom)/k.y,left:(C.left-D.left+w.left)/k.x,right:(D.right-C.right+w.right)/k.x}}const SU=50,EU=async(e,t,s)=>{const{placement:o="bottom",strategy:a="absolute",middleware:c=[],platform:u}=s,m=u.detectOverflow?u:{...u,detectOverflow:wU},g=await(u.isRTL==null?void 0:u.isRTL(t));let v=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:b,y:p}=JT(v,o,g),x=o,S=0;const w={};for(let E=0;E<c.length;E++){const R=c[E];if(!R)continue;const{name:C,fn:j}=R,{x:O,y:k,data:D,reset:P}=await j({x:b,y:p,initialPlacement:o,placement:x,strategy:a,middlewareData:w,rects:v,platform:m,elements:{reference:e,floating:t}});b=O??b,p=k??p,w[C]={...w[C],...D},P&&S<SU&&(S++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(v=P.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):P.rects),{x:b,y:p}=JT(v,x,g)),E=-1)}return{x:b,y:p,placement:x,strategy:a,middlewareData:w}},TU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,o;const{placement:a,middlewareData:c,rects:u,initialPlacement:m,platform:g,elements:v}=t,{mainAxis:b=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:E=!0,...R}=yi(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const C=Br(a),j=ts(m),O=Br(m)===m,k=await(g.isRTL==null?void 0:g.isRTL(v.floating)),D=x||(O||!E?[Zm(m)]:dL(m)),P=w!=="none";!x&&P&&D.push(...pL(m,E,w,k));const L=[m,...D],_=await g.detectOverflow(t,R),V=[];let I=((o=c.flip)==null?void 0:o.overflows)||[];if(b&&V.push(_[C]),p){const $=uL(a,u,k);V.push(_[$[0]],_[$[1]])}if(I=[...I,{placement:a,overflows:V}],!V.every($=>$<=0)){var X,Y;const $=(((X=c.flip)==null?void 0:X.index)||0)+1,G=L[$];if(G&&(!(p==="alignment"?j!==ts(G):!1)||I.every(B=>ts(B.placement)===j?B.overflows[0]>0:!0)))return{data:{index:$,overflows:I},reset:{placement:G}};let H=(Y=I.filter(K=>K.overflows[0]<=0).sort((K,B)=>K.overflows[1]-B.overflows[1])[0])==null?void 0:Y.placement;if(!H)switch(S){case"bestFit":{var q;const K=(q=I.filter(B=>{if(P){const A=ts(B.placement);return A===j||A==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(A=>A>0).reduce((A,U)=>A+U,0)]).sort((B,A)=>B[1]-A[1])[0])==null?void 0:q[0];K&&(H=K);break}case"initialPlacement":H=m;break}if(a!==H)return{reset:{placement:H}}}return{}}}},vj=new Set(["left","top"]);async function RU(e,t){const{placement:s,platform:o,elements:a}=e,c=await(o.isRTL==null?void 0:o.isRTL(a.floating)),u=Br(s),m=Us(s),g=ts(s)==="y",v=vj.has(u)?-1:1,b=c&&g?-1:1,p=yi(t,e);let{mainAxis:x,crossAxis:S,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return m&&typeof w=="number"&&(S=m==="end"?w*-1:w),g?{x:S*b,y:x*v}:{x:x*v,y:S*b}}const CU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,o;const{x:a,y:c,placement:u,middlewareData:m}=t,g=await RU(t,e);return u===((s=m.offset)==null?void 0:s.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:a+g.x,y:c+g.y,data:{...g,placement:u}}}}},NU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:o,placement:a,platform:c}=t,{mainAxis:u=!0,crossAxis:m=!1,limiter:g={fn:j=>{let{x:O,y:k}=j;return{x:O,y:k}}},...v}=yi(e,t),b={x:s,y:o},p=await c.detectOverflow(t,v),x=ts(a),S=qy(x);let w=b[S],E=b[x];const R=(j,O)=>N2(O+p[j==="y"?"top":"left"],O,O-p[j==="y"?"bottom":"right"]);u&&(w=R(S,w)),m&&(E=R(x,E));const C=g.fn({...t,[S]:w,[x]:E});return{...C,data:{x:C.x-s,y:C.y-o,enabled:{[S]:u,[x]:m}}}}}},jU=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,o;const{x:a,y:c,placement:u,rects:m,middlewareData:g}=t,{offset:v=0,mainAxis:b=!0,crossAxis:p=!0}=yi(e,t),x={x:a,y:c},S=ts(u),w=qy(S);let E=x[w],R=x[S];const C=yi(v,t),j=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(s=C.mainAxis)!=null?s:0,crossAxis:(o=C.crossAxis)!=null?o:0};if(b){const D=w==="y"?"height":"width",P=m.reference[w]-m.floating[D]+j.mainAxis,L=m.reference[w]+m.reference[D]-j.mainAxis;E<P?E=P:E>L&&(E=L)}if(p){var O,k;const D=w==="y"?"width":"height",P=vj.has(Br(u)),L=m.reference[S]-m.floating[D]+(P&&((O=g.offset)==null?void 0:O[S])||0)+(P?0:j.crossAxis),_=m.reference[S]+m.reference[D]+(P?0:((k=g.offset)==null?void 0:k[S])||0)-(P?j.crossAxis:0);R<L?R=L:R>_&&(R=_)}return{[w]:E,[S]:R}}}},OU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...m}=yi(e,t),g=await a.detectOverflow(t,m),v=Br(s),b=Us(s),p=ts(s)==="y",{width:x,height:S}=o.floating;let w,E;v==="top"||v==="bottom"?(w=v,E=b===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=v,w=b==="end"?"top":"bottom");const R=S-g.top-g.bottom,C=x-g.left-g.right,j=ic(S-g[w],R),O=ic(x-g[E],C),k=t.middlewareData.shift,D=!k;let P=j,L=O;k!=null&&k.enabled.x&&(L=C),k!=null&&k.enabled.y&&(P=R),D&&!b&&(p?L=x-2*go(g.left,g.right):P=S-2*go(g.top,g.bottom)),await u({...t,availableWidth:L,availableHeight:P});const _=await a.getDimensions(c.floating);return x!==_.width||S!==_.height?{reset:{rects:!0}}:{}}}};function bj(e){const t=Fr(e);let s=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const a=rn(e),c=a?e.offsetWidth:s,u=a?e.offsetHeight:o,m=$m(s)!==c||$m(o)!==u;return m&&(s=c,o=u),{width:s,height:o,$:m}}function fx(e){return _t(e)?e:e.contextElement}function Il(e){const t=fx(e);if(!rn(t))return vo(1);const s=t.getBoundingClientRect(),{width:o,height:a,$:c}=bj(t);let u=(c?$m(s.width):s.width)/o,m=(c?$m(s.height):s.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!m||!Number.isFinite(m))&&(m=1),{x:u,y:m}}const kU=vo(0);function yj(e){const t=Kt(e);return!Dy()||!t.visualViewport?kU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _U(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===Kt(e)}function Sa(e,t,s,o){t===void 0&&(t=!1),s===void 0&&(s=!1);const a=e.getBoundingClientRect(),c=fx(e);let u=vo(1);t&&(o?_t(o)&&(u=Il(o)):u=Il(e));const m=_U(c,s,o)?yj(c):vo(0);let g=(a.left+m.x)/u.x,v=(a.top+m.y)/u.y,b=a.width/u.x,p=a.height/u.y;if(c&&o){const x=Kt(c),S=_t(o)?Kt(o):o;let w=x,E=Ub(w);for(;E&&S!==w;){const R=Il(E),C=E.getBoundingClientRect(),j=Fr(E),O=C.left+(E.clientLeft+parseFloat(j.paddingLeft))*R.x,k=C.top+(E.clientTop+parseFloat(j.paddingTop))*R.y;g*=R.x,v*=R.y,b*=R.x,p*=R.y,g+=O,v+=k,w=Kt(E),E=Ub(w)}}return Fu({width:b,height:p,x:g,y:v})}function Lh(e,t){const s=Sh(e).scrollLeft;return t?t.left+s:Sa(To(e)).left+s}function xj(e,t){const s=e.getBoundingClientRect(),o=s.left+t.scrollLeft-Lh(e,s),a=s.top+t.scrollTop;return{x:o,y:a}}function AU(e){let{elements:t,rect:s,offsetParent:o,strategy:a}=e;const c=a==="fixed",u=To(o),m=t?wh(t.floating):!1;if(o===u||m&&c)return s;let g={scrollLeft:0,scrollTop:0},v=vo(1);const b=vo(0),p=rn(o);if((p||!c)&&((ar(o)!=="body"||td(u))&&(g=Sh(o)),p)){const S=Sa(o);v=Il(o),b.x=S.x+o.clientLeft,b.y=S.y+o.clientTop}const x=u&&!p&&!c?xj(u,g):vo(0);return{width:s.width*v.x,height:s.height*v.y,x:s.x*v.x-g.scrollLeft*v.x+b.x+x.x,y:s.y*v.y-g.scrollTop*v.y+b.y+x.y}}function MU(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function zU(e){const t=Sh(e),s=e.ownerDocument.body,o=go(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=go(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let c=-t.scrollLeft+Lh(e);const u=-t.scrollTop;return Fr(s).direction==="rtl"&&(c+=go(e.clientWidth,s.clientWidth)-o),{width:o,height:a,x:c,y:u}}const DU=25;function IU(e,t,s){s===void 0&&(s="viewport");const o=s==="layoutViewport",a=Kt(e),c=To(e),u=a.visualViewport;let m=c.clientWidth,g=c.clientHeight,v=0,b=0;if(u){const x=!Dy()||t==="fixed";o?x||(v=-u.offsetLeft,b=-u.offsetTop):(m=u.width,g=u.height,x&&(v=u.offsetLeft,b=u.offsetTop))}if(Lh(c)<=0){const x=c.ownerDocument,S=x.body,w=getComputedStyle(S),E=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,R=Math.abs(c.clientWidth-S.clientWidth-E),C=getComputedStyle(c).scrollbarGutter==="stable both-edges"?R/2:R;C<=DU&&(m-=C)}return{width:m,height:g,x:v,y:b}}function PU(e,t){const s=Sa(e,!0,t==="fixed"),o=s.top+e.clientTop,a=s.left+e.clientLeft,c=Il(e),u=e.clientWidth*c.x,m=e.clientHeight*c.y,g=a*c.x,v=o*c.y;return{width:u,height:m,x:g,y:v}}function WT(e,t,s){let o;if(t==="viewport"||t==="layoutViewport")o=IU(e,s,t);else if(t==="document")o=zU(To(e));else if(_t(t))o=PU(t,s);else{const a=yj(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Fu(o)}function LU(e,t){const s=t.get(e);if(s)return s;let o=Bu(e,[],!1).filter(m=>_t(m)&&ar(m)!=="body"),a=null;const c=Fr(e).position==="fixed";let u=c?wo(e):e;for(;_t(u)&&!po(u);){const m=Fr(u),g=zy(u),v=a?a.position:c?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&m.position==="static")?o=o.filter(p=>p!==u):a=m,u=wo(u)}return t.set(e,o),o}function UU(e){let{element:t,boundary:s,rootBoundary:o,strategy:a}=e;const u=[...s==="clippingAncestors"?wh(t)?[]:LU(t,this._c):[].concat(s),o],m=WT(t,u[0],a);let g=m.top,v=m.right,b=m.bottom,p=m.left;for(let x=1;x<u.length;x++){const S=WT(t,u[x],a);g=go(S.top,g),v=ic(S.right,v),b=ic(S.bottom,b),p=go(S.left,p)}return{width:v-p,height:b-g,x:p,y:g}}function BU(e){const{width:t,height:s}=bj(e);return{width:t,height:s}}function HU(e,t,s){const o=rn(t),a=To(t),c=s==="fixed",u=Sa(e,!0,c,t);let m={scrollLeft:0,scrollTop:0};const g=vo(0);if((o||!c)&&((ar(t)!=="body"||td(a))&&(m=Sh(t)),o)){const x=Sa(t,!0,c,t);g.x=x.x+t.clientLeft,g.y=x.y+t.clientTop}!o&&a&&(g.x=Lh(a));const v=a&&!o&&!c?xj(a,m):vo(0),b=u.left+m.scrollLeft-g.x-v.x,p=u.top+m.scrollTop-g.y-v.y;return{x:b,y:p,width:u.width,height:u.height}}function Xv(e){return Fr(e).position==="static"}function eR(e,t){if(!rn(e)||Fr(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return To(e)===s&&(s=s.ownerDocument.body),s}function wj(e,t){const s=Kt(e);if(wh(e))return s;if(!rn(e)){let a=wo(e);for(;a&&!po(a);){if(_t(a)&&!Xv(a))return a;a=wo(a)}return s}let o=eR(e,t);for(;o&&N6(o)&&Xv(o);)o=eR(o,t);return o&&po(o)&&Xv(o)&&!zy(o)?s:o||k6(e)||s}const FU=async function(e){const t=this.getOffsetParent||wj,s=this.getDimensions,o=await s(e.floating);return{reference:HU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function VU(e){return Fr(e).direction==="rtl"}const Sj={convertOffsetParentRelativeRectToViewportRelativeRect:AU,getDocumentElement:To,getClippingRect:UU,getOffsetParent:wj,getElementRects:FU,getClientRects:MU,getDimensions:BU,getScale:Il,isElement:_t,isRTL:VU};function Ej(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qU(e,t,s){let o=null,a;const c=To(e);function u(){var b;clearTimeout(a),(b=o)==null||b.disconnect(),o=null}function m(b,p){b===void 0&&(b=!1),p===void 0&&(p=1),u();const x=e.getBoundingClientRect(),{left:S,top:w,width:E,height:R}=x;if(b||t(),!E||!R)return;const C=sm(w),j=sm(c.clientWidth-(S+E)),O=sm(c.clientHeight-(w+R)),k=sm(S),P={rootMargin:-C+"px "+-j+"px "+-O+"px "+-k+"px",threshold:go(0,ic(1,p))||1};let L=!0;function _(V){const I=V[0].intersectionRatio;if(!Ej(x,e.getBoundingClientRect()))return m();if(I!==p){if(!L)return m();I?m(!1,I):a=setTimeout(()=>{m(!1,1e-7)},1e3)}L=!1}try{o=new IntersectionObserver(_,{...P,root:c.ownerDocument})}catch{o=new IntersectionObserver(_,P)}o.observe(e)}const g=Kt(e),v=()=>m(s);return g.addEventListener("resize",v),m(!0),()=>{g.removeEventListener("resize",v),u()}}function tR(e,t,s,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=fx(e),b=a||c?[...v?Bu(v):[],...t?Bu(t):[]]:[];b.forEach(C=>{a&&C.addEventListener("scroll",s),c&&C.addEventListener("resize",s)});const p=v&&m?qU(v,s,c):null;let x=-1,S=null;u&&(S=new ResizeObserver(C=>{let[j]=C;j&&j.target===v&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var O;(O=S)==null||O.observe(t)})),s()}),v&&!g&&S.observe(v),t&&S.observe(t));let w,E=g?Sa(e):null;g&&R();function R(){const C=Sa(e);E&&!Ej(E,C)&&s(),E=C,w=requestAnimationFrame(R)}return s(),()=>{var C;b.forEach(j=>{a&&j.removeEventListener("scroll",s),c&&j.removeEventListener("resize",s)}),p==null||p(),(C=S)==null||C.disconnect(),S=null,g&&cancelAnimationFrame(w)}}const $U=CU,ZU=NU,KU=TU,YU=OU,GU=jU,QU=(e,t,s)=>{const o=new Map,a=s??{},c={...Sj,...a.platform,_c:o};return EU(e,t,{...a,platform:c})};var XU=typeof document<"u",JU=function(){},Am=XU?y.useLayoutEffect:JU;function Jm(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 s,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(o=s;o--!==0;)if(!Jm(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),s=a.length,s!==Object.keys(t).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=s;o--!==0;){const c=a[o];if(!(c==="_owner"&&e.$$typeof)&&!Jm(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function Tj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nR(e,t){const s=Tj(e);return Math.round(t*s)/s}function Jv(e){const t=y.useRef(e);return Am(()=>{t.current=e}),t}function WU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:o=[],platform:a,elements:{reference:c,floating:u}={},transform:m=!0,whileElementsMounted:g,open:v}=e,[b,p]=y.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=y.useState(o);Jm(x,o)||S(o);const[w,E]=y.useState(null),[R,C]=y.useState(null),j=y.useCallback(B=>{B!==P.current&&(P.current=B,E(B))},[]),O=y.useCallback(B=>{B!==L.current&&(L.current=B,C(B))},[]),k=c||w,D=u||R,P=y.useRef(null),L=y.useRef(null),_=y.useRef(b),V=g!=null,I=Jv(g),X=Jv(a),Y=Jv(v),q=y.useCallback(()=>{if(!P.current||!L.current)return;const B={placement:t,strategy:s,middleware:x};X.current&&(B.platform=X.current),QU(P.current,L.current,B).then(A=>{const U={...A,isPositioned:Y.current!==!1};$.current&&!Jm(_.current,U)&&(_.current=U,Hs.flushSync(()=>{p(U)}))})},[x,t,s,X,Y]);Am(()=>{v===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(B=>({...B,isPositioned:!1})))},[v]);const $=y.useRef(!1);Am(()=>($.current=!0,()=>{$.current=!1}),[]),Am(()=>{if(k&&(P.current=k),D&&(L.current=D),k&&D){if(I.current)return I.current(k,D,q);q()}},[k,D,q,I,V]);const G=y.useMemo(()=>({reference:P,floating:L,setReference:j,setFloating:O}),[j,O]),H=y.useMemo(()=>({reference:k,floating:D}),[k,D]),K=y.useMemo(()=>{const B={position:s,left:0,top:0};if(!H.floating)return B;const A=nR(H.floating,b.x),U=nR(H.floating,b.y);return m?{...B,transform:"translate("+A+"px, "+U+"px)",...Tj(H.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:A,top:U}},[s,m,H.floating,b.x,b.y]);return y.useMemo(()=>({...b,update:q,refs:G,elements:H,floatingStyles:K}),[b,q,G,H,K])}const e8=(e,t)=>{const s=$U(e);return{name:s.name,fn:s.fn,options:[e,t]}},t8=(e,t)=>{const s=ZU(e);return{name:s.name,fn:s.fn,options:[e,t]}},n8=(e,t)=>({fn:GU(e).fn,options:[e,t]}),r8=(e,t)=>{const s=KU(e);return{name:s.name,fn:s.fn,options:[e,t]}},s8=(e,t)=>{const s=YU(e);return{name:s.name,fn:s.fn,options:[e,t]}},o8={...zu,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class i8 extends id{constructor(s,o,a){const c=new Dh;super(a8(s,c,o,a),l8(c),o8);yt(this,"setOpen",(s,o)=>{tU(this,s,o,{extraState:{openChangeReason:o.reason}})})}cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,dt(ka,s))}}function a8(e,t,s,o=!1){return{...lx(t,s,o),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function l8(e){return{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const c8=vh(function(t){const{disabled:s=!1,defaultOpen:o=!1,open:a,disableHoverablePopup:c=!1,trackCursorAxis:u="none",actionsRef:m,onOpenChange:g,onOpenChangeComplete:v,handle:b,triggerId:p,defaultTriggerId:x=null,children:S}=t,w=oj((X,Y)=>new i8({open:o,openProp:a,activeTriggerId:x,triggerIdProp:p},X,Y));w.useControlledProp("openProp",a),w.useControlledProp("triggerIdProp",p),w.useContextCallback("onOpenChange",g),w.useContextCallback("onOpenChangeComplete",v);const E=w.useState("open"),R=!s&&E,C=w.useState("activeTriggerId"),j=w.useState("mounted"),O=w.useState("payload");w.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:c,disabled:s}),ox(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:k,transitionStatus:D}=ix(R,w),P=w.useState("isInstantPhase"),L=w.useState("instantType"),_=w.useState("lastOpenChangeReason"),V=y.useRef(null);Me(()=>{E&&s&&w.setOpen(!1,dt(S2))},[E,s,w]),Me(()=>{D==="ending"&&_===lr||D!=="ending"&&P?(L!=="delay"&&(V.current=L),w.set("instantType","delay")):V.current!==null&&(w.set("instantType",V.current),V.current=null)},[D,P,_,L,w]),Me(()=>{R&&C==null&&w.set("payload",void 0)},[w,C,R]),y.useImperativeHandle(m,()=>({unmount:k,close:()=>w.setOpen(!1,dt(Nh))}),[k,w]);const I=R||j||!s&&u!=="none";return d.jsxs(h2.Provider,{value:w,children:[b&&d.jsx(tx,{handle:b,store:w}),I&&d.jsx(u8,{store:w,disabled:s,trackCursorAxis:u}),typeof S=="function"?S({payload:O}):S]})});function u8({store:e,disabled:t,trackCursorAxis:s}){const o=e.useState("floatingRootContext"),a=Ah(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),c=GL(o,{enabled:!t&&s!=="none",axis:s==="none"?void 0:s}),u=y.useMemo(()=>Gn(c.reference,a.reference),[c.reference,a.reference]);return ax(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:a.floating??Ut}),null}function Qn(e){return sd(e,"base-ui")}const Rj=y.createContext(void 0);function d8(){return y.useContext(Rj)}const f8=600,rR="data-base-ui-tooltip-trigger";function sR(e){const t=Pn(e);return _t(t)?t:null}const m8=jy(function(t,s){const{render:o,className:a,style:c,handle:u,payload:m,disabled:g,delay:v,closeOnClick:b=!0,closeDelay:p,id:x,...S}=t,w=ed(!0),R=cx(u)??w;if(!R)throw new Error(mn(82));const C=Qn(x),j=R.useState("isTriggerActive",C),O=R.useState("isOpenedByTrigger",C),k=R.useState("floatingRootContext"),D=y.useRef(null),P=p??0,{registerTrigger:L,isMountedByThisTrigger:_}=sx(C,D,R,{payload:m,closeOnClick:b,closeDelay:P}),V=d8(),{activeIdRef:I,delayRef:X,isInstantPhase:Y,hasProvider:q}=eL(k,{open:O}),$=dx(k);R.useSyncedValue("isInstantPhase",Y);const G=R.useState("disabled"),H=g??G,K=fn(H),B=R.useState("trackCursorAxis"),A=R.useState("disableHoverablePopup"),U=y.useRef(!1),J=Rn(),F=y.useRef(void 0);function oe(){return q&&I.current!=null?0:v??V??f8}function N(fe){const xe=D.current;if(!xe||!fe)return!1;const pe=Hu(fe,`[${rR}]`);return pe!==null&&pe!==xe&&ot(xe,pe)}function z(fe){const xe=N(fe);return U.current=xe,xe&&($.openChangeTimeout.clear(),$.restTimeout.clear(),$.restTimeoutPending=!1,J.clear()),xe}const Z=mj(k,{enabled:!H,mouseOnly:!0,move:!1,handleClose:!A&&B!=="both"?gj():null,restMs:oe,delay(){return p==null&&q?{close:ba(X.current,"close")}:{close:P}},triggerElementRef:D,isActiveTrigger:j,isClosing:()=>R.select("transitionStatus")==="ending",shouldOpen(){return!U.current}}),te=uj(k,{enabled:!H}).reference,ue=fe=>{const xe=U.current,pe=sR(fe),we=z(pe),Oe=D.current,ke=Oe&&pe&&ot(Oe,pe);if(we&&R.select("open")&&R.select("lastOpenChangeReason")===Bn){R.setOpen(!1,dt(Bn,fe));return}if(xe&&!we&&ke&&!K.current&&!R.select("open")&&Oe&&gi(F.current)){const Pe=()=>{!U.current&&!K.current&&!R.select("open")&&R.setOpen(!0,dt(Bn,fe,Oe))},Te=oe();Te===0?(J.clear(),Pe()):J.start(Te,Pe)}},W=R.useState("appliedTriggerProps",_||B!=="none");return vt("button",t,{state:{open:O},ref:[s,L,D],props:[Z,te,W,{onMouseOver(fe){ue(fe.nativeEvent)},onFocus(fe){N(sR(fe.nativeEvent))&&fe.preventBaseUIHandler()},onMouseLeave(){U.current=!1,J.clear(),F.current=void 0},onPointerEnter(fe){F.current=fe.pointerType},onPointerDown(fe){F.current=fe.pointerType,R.set("closeOnClick",b),b&&!R.select("open")&&R.cancelPendingOpen(fe.nativeEvent)},onClick(fe){b&&!R.select("open")&&R.cancelPendingOpen(fe.nativeEvent)},id:C,[Fb]:H?"":void 0,[rR]:H?void 0:""},S],stateAttributesMapping:Ly})}),Cj=y.createContext(void 0);function h8(){const e=y.useContext(Cj);if(e===void 0)throw new Error(mn(70));return e}const p8=y.forwardRef(function(t,s){const{children:o,container:a,className:c,render:u,style:m,...g}=t,{node:v,subtree:b}=J2({container:a,ref:s,componentProps:t,elementProps:g});return!b&&!v?null:d.jsxs(y.Fragment,{children:[b,v&&Hs.createPortal(o,v)]})}),g8=y.forwardRef(function(t,s){const{keepMounted:o=!1,...a}=t;return ed().useState("mounted")||o?d.jsx(Cj.Provider,{value:o,children:d.jsx(p8,{ref:s,...a})}):null}),Nj=y.createContext(void 0);function jj(){const e=y.useContext(Nj);if(e===void 0)throw new Error(mn(71));return e}function v8(e){const{nodeId:t,externalTree:s,rootContext:o}=e,a=o.useState("referenceElement"),c=o.useState("floatingElement"),u=o.useState("domReferenceElement"),m=o.useState("open"),g=o.useState("floatingId"),[v,b]=y.useState(null),p=y.useRef(null),x=Ci(s),S=y.useMemo(()=>({reference:a,floating:c,domReference:u}),[a,c,u]),w=WU({...e,elements:{...S,...v&&{reference:v}}}),E=y.useCallback(O=>{const k=_t(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;b(k),w.refs.setReference(k)},[w.refs]),R=y.useMemo(()=>({...w.refs,setPositionReference:E,domReference:p}),[w.refs,E]),C=y.useMemo(()=>({...w.elements,domReference:u}),[w.elements,u]),j=y.useMemo(()=>({...w,dataRef:o.context.dataRef,open:m,onOpenChange:o.setOpen,events:o.context.events,floatingId:g,refs:R,elements:C,nodeId:t,rootStore:o}),[w,R,C,t,o,m,g]);return Me(()=>{u&&(p.current=u)},[u]),Me(()=>{o.context.dataRef.current.floatingContext=j;const O=x==null?void 0:x.nodesRef.current.find(k=>k.id===t);O&&(O.context=j)}),y.useMemo(()=>({...w,context:j,refs:R,elements:C,rootStore:o}),[w,R,C,j,o])}const b8=y.createContext(void 0);function fc(){const e=y.useContext(b8);return(e==null?void 0:e.direction)??"ltr"}const y8=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:o,placement:a,rects:c,platform:u,elements:m,middlewareData:g}=t,{element:v,padding:b=0}=yi(e,t)||{};if(v==null)return{};const p=j2(b),x={x:s,y:o},S=Zy(a),w=$y(S),E=await u.getDimensions(v),R=S==="y",C=R?"top":"left",j=R?"bottom":"right",O=R?"clientHeight":"clientWidth",k=c.reference[w]+c.reference[S]-x[S]-c.floating[w],D=x[S]-c.reference[S],P=m.floating[O]||c.floating[w],L=k/2-D/2,_=P/2-E[w]/2-1,V=Math.min(p[C],_),I=Math.min(p[j],_),X=V,Y=P-E[w]-I,q=P/2-E[w]/2+L,$=N2(X,q,Y),G=!g.arrow&&Us(a)!=null&&q!==$&&c.reference[w]/2-(q<X?V:I)-E[w]/2<0,H=G?q<X?q-X:q-Y:0;return{[S]:x[S]+H,data:{[S]:$,centerOffset:q-$-H,...G&&{alignmentOffset:H}},reset:G}}}),x8=(e,t)=>{const{name:s,fn:o}=y8(e);return{name:s,fn:o,options:[e,t]}},w8={name:"hide",async fn(e){const{width:t,height:s,x:o,y:a}=e.rects.reference,c=t===0&&s===0&&o===0&&a===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-s>=0||u.right-t>=0||u.bottom-s>=0||u.left-t>=0||c}}}},S8={sideX:"left",sideY:"top"},E8="--available-width",T8="--available-height",R8="--anchor-width",C8="--anchor-height",N8="--transform-origin",oR=E8,iR=T8;function Oj(e,t,s){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?s?"inline-start":"inline-end":"right",bottom:"bottom",left:o?s?"inline-end":"inline-start":"left"}[t]}function aR(e,t,s){const{rects:o,placement:a}=e;return{side:Oj(t,Br(a),s),align:Us(a)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function mx(e){return j8(e,v8)}function j8(e,t){var rt,Dt;const{anchor:s,positionMethod:o="absolute",side:a="bottom",sideOffset:c=0,align:u="center",alignOffset:m=0,collisionBoundary:g,collisionPadding:v=5,sticky:b=!1,arrowPadding:p=5,disableAnchorTracking:x=!1,inline:S,keepMounted:w=!1,floatingRootContext:E,mounted:R,collisionAvoidance:C,shift:j,nodeId:O,adaptiveOrigin:k,lazyFlip:D=!1,externalTree:P}=e,L=C.side||"flip",_=C.align||"flip",V=C.fallbackAxisSide||"end",I=(j==null?void 0:j.crossAxis)??!1,X=j==null?void 0:j.rootBoundary,Y=typeof s=="function"?s:void 0,q=Ie(Y),$=Y?q:s,G=fn(s),H=fn(R),B=fc()==="rtl",[A,U]=y.useState(null);!R&&A!==null&&U(null);const J=D==="placement",F=A?Br(A):null,oe=A&&J?Us(A)||"center":null,N=F||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[a],z=oe||u,Z=z==="center"?N:`${N}-${z}`;let te=v;typeof te=="number"?te={top:te,right:te,bottom:te,left:te}:te&&(te={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0});const ue=1,W=a==="bottom"?ue:0,be=a==="top"?ue:0,de=a==="right"?ue:0,fe=a==="left"?ue:0,xe={boundary:g==="clipping-ancestors"?"clippingAncestors":g,padding:te},pe=y.useRef(null),we=fn(c),Oe=fn(m),ke=typeof c!="function"?c:0,Pe=typeof m!="function"?m:0,Te=[];S&&Te.push(S),Te.push(e8(je=>{const ee=aR(je,a,B),Le=typeof we.current=="function"?we.current(ee):we.current,Ce=typeof Oe.current=="function"?Oe.current(ee):Oe.current;return{mainAxis:Le,crossAxis:Ce,alignmentAxis:Ce}},[ke,Pe,B,a]));const He=_==="none"&&L!=="shift",se=!He&&(b||I||L==="shift"),ye=L==="none"?null:r8({...xe,padding:{top:te.top+ue+W,right:te.right+ue+fe,bottom:te.bottom+ue+be,left:te.left+ue+de},mainAxis:!I&&L==="flip",crossAxis:_==="flip"?"alignment":!1,fallbackAxisSideDirection:V}),Ae=He?null:t8({...xe,rootBoundary:X,mainAxis:_!=="none",crossAxis:se,limiter:b||I?void 0:n8(je=>{if(!pe.current)return{};const{width:ee,height:Le}=pe.current.getBoundingClientRect(),Ce=ts(Br(je.placement)),et=Ce==="y"?ee:Le,Ze=Ce==="y"?te.left+te.right:te.top+te.bottom;return{offset:et/2+Ze/2}})},[xe,b,I,X,te,_]);L==="shift"||_==="shift"||z==="center"?Te.push(Ae,ye):Te.push(ye,Ae),Te.push(s8({...xe,apply({elements:{floating:je},availableWidth:ee,availableHeight:Le,rects:Ce}){if(!H.current)return;const et=je.style;et.setProperty(oR,`${ee}px`),et.setProperty(iR,`${Le}px`);const Ze=Kt(je).devicePixelRatio||1,{x:pt,y:Ct,width:un,height:kn}=Ce.reference,hn=(Math.round((pt+un)*Ze)-Math.round(pt*Ze))/Ze,Xn=(Math.round((Ct+kn)*Ze)-Math.round(Ct*Ze))/Ze;et.setProperty(R8,`${hn}px`),et.setProperty(C8,`${Xn}px`)}}),x8(je=>({element:pe.current||Tt(je.elements.floating).createElement("div"),padding:pe.current?p:0}),[p]),{name:"transformOrigin",fn(je){var ki,bc,Aa,Oo,Sd,yc;const{elements:{floating:ee},middlewareData:Le,placement:Ce,platform:et,rects:Ze,y:pt}=je,Ct=Br(Ce),un=Us(Ce),kn=ts(Ct)==="y",hn=pe.current,Xn=typeof c=="function"?c(aR(je,a,B)):c;let Vn;if(!hn&&un&&Math.abs(kn?((ki=Le.shift)==null?void 0:ki.x)||0:((bc=Le.shift)==null?void 0:bc.y)||0)<=1)Vn=un==="start"===(kn&&((Aa=et.isRTL)==null?void 0:Aa.call(et,ee))===!0)?"100%":"0%";else{const Ed=kn?((Oo=Le.arrow)==null?void 0:Oo.x)||0:((Sd=Le.arrow)==null?void 0:Sd.y)||0,Td=kn?(hn==null?void 0:hn.clientWidth)||0:(hn==null?void 0:hn.clientHeight)||0;Vn=`${Ed+Td/2}px`}let jo=Ct==="top"||Ct==="left"?`calc(100% + ${Xn}px)`:`${-Xn}px`;return se&&kn&&Math.abs(((yc=Le.shift)==null?void 0:yc.y)||0)>Xn&&(jo=`${Ze.reference.y+Ze.reference.height/2-pt}px`),ee.style.setProperty(N8,kn?`${Vn} ${jo}`:`${jo} ${Vn}`),{}}},w8,k),Me(()=>{!R&&E&&E.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[R,E]);const Be=y.useMemo(()=>({ancestorScroll:!x,elementResize:!x&&typeof ResizeObserver<"u",layoutShift:!x&&typeof IntersectionObserver<"u"}),[x]),{refs:ae,elements:ve,x:ze,y:_e,middlewareData:Re,update:Ge,placement:Ye,context:mt,isPositioned:nt,floatingStyles:ut}=t({rootContext:E,open:w?R:void 0,placement:Z,middleware:Te,strategy:o,whileElementsMounted:w?void 0:(...je)=>tR(...je,Be),nodeId:O,externalTree:P}),{sideX:Rt,sideY:At}=Re.adaptiveOrigin||S8,it=nt?o:"fixed",qe=y.useMemo(()=>{let je;return nt?k?je={position:it,[Rt]:ze,[At]:_e}:je={...ut,position:it}:je={position:it,top:0,left:0},je[oR]="100vw",je[iR]="100vh",nt||(je.opacity=0),je},[k,it,Rt,ze,At,_e,ut,nt]),at=y.useRef(null);Me(()=>{if(!R)return;const je=G.current,ee=typeof je=="function"?je():je,Ce=(lR(ee)?ee.current:ee)||null||null;Ce!==at.current&&(ae.setPositionReference(Ce),at.current=Ce)},[R,ae,$,G]),y.useEffect(()=>{if(!R)return;const je=G.current;typeof je!="function"&&lR(je)&&je.current!==at.current&&(ae.setPositionReference(je.current),at.current=je.current)},[R,ae,$,G]),y.useEffect(()=>{if(w&&R&&ve.reference&&ve.floating)return tR(ve.reference,ve.floating,Ge,Be)},[w,R,ve,Ge,Be]);const Nt=Br(Ye),ht=Oj(a,Nt,B),Gt=Us(Ye)||"center",Bt=!!((rt=Re.hide)!=null&&rt.referenceHidden);Me(()=>{D&&R&&nt&&(Nt!==N||J&&Gt!==z)&&U(Ye)},[D,J,R,nt,Ye,Nt,Gt,N,z]);const Ft=y.useMemo(()=>{var je,ee;return{position:"absolute",top:(je=Re.arrow)==null?void 0:je.y,left:(ee=Re.arrow)==null?void 0:ee.x}},[Re.arrow]),sn=((Dt=Re.arrow)==null?void 0:Dt.centerOffset)!==0;return y.useMemo(()=>({positionerStyles:qe,arrowStyles:Ft,arrowRef:pe,arrowUncentered:sn,side:ht,align:Gt,physicalSide:Nt,anchorHidden:Bt,refs:ae,context:mt,isPositioned:nt,update:Ge}),[qe,Ft,pe,sn,ht,Gt,Nt,Bt,ae,mt,nt,Ge])}function lR(e){return e!=null&&"current"in e}function Uh(e){return e==="starting"?HL:Ut}function hx(e,t,{styles:s,transitionStatus:o,props:a,refs:c,hidden:u,inert:m=!1}){const g={...s};return m&&(g.pointerEvents="none"),vt("div",e,{state:t,ref:c,props:[{role:"presentation",hidden:u,style:g},Uh(o),a],stateAttributesMapping:nd})}const O8=y.forwardRef(function(t,s){const{render:o,className:a,anchor:c,positionMethod:u="absolute",side:m="top",align:g="center",sideOffset:v=0,alignOffset:b=0,collisionBoundary:p="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=G2,style:C,...j}=t,O=ed(),k=h8(),D=O.useState("open"),P=O.useState("mounted"),L=O.useState("trackCursorAxis"),_=O.useState("disableHoverablePopup"),V=O.useState("floatingRootContext"),I=O.useState("instantType"),X=O.useState("transitionStatus"),Y=O.useState("adaptiveOrigin"),q=mx({anchor:c,positionMethod:u,floatingRootContext:V,mounted:P,side:m,sideOffset:v,align:g,alignOffset:b,collisionBoundary:p,collisionPadding:x,sticky:w,arrowPadding:S,disableAnchorTracking:E,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:Y}),$=y.useMemo(()=>({open:D,side:q.side,align:q.align,anchorHidden:q.anchorHidden,instant:L!=="none"?"tracking-cursor":I}),[D,q.side,q.align,q.anchorHidden,L,I]),G=hx(t,$,{styles:q.positionerStyles,transitionStatus:X,props:j,refs:[s,O.useStateSetter("positionerElement")],hidden:!P,inert:!D||L==="both"||_});return d.jsx(Nj.Provider,{value:q,children:G})}),k8=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,m=ed(),{side:g,align:v}=jj(),b=m.useState("open"),p=m.useState("instantType"),x=m.useState("transitionStatus"),S=m.useState("popupProps"),w=m.useState("floatingRootContext"),E=m.useState("disabled"),R=m.useState("closeDelay");Ro({open:b,ref:m.context.popupRef,onComplete(){var k,D;b&&((D=(k=m.context).onOpenChangeComplete)==null||D.call(k,!0))}}),fj(w,{enabled:!E,closeDelay:R});const C=m.useStateSetter("popupElement");return vt("div",t,{state:{open:b,side:g,align:v,instant:p,transitionStatus:x},ref:[s,m.context.popupRef,C],props:[zh,S,Uh(x),u],stateAttributesMapping:Uy})}),_8=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,m=ed(),{arrowRef:g,side:v,align:b,arrowUncentered:p,arrowStyles:x}=jj(),S=m.useState("open"),w=m.useState("instantType");return vt("div",t,{state:{open:S,side:v,align:b,uncentered:p,instant:w},ref:[s,g],props:[{style:x,"aria-hidden":!0},u],stateAttributesMapping:nd})}),A8=function(t){const{delay:s,closeDelay:o,timeout:a=400}=t,c=y.useMemo(()=>({open:s,close:o}),[s,o]);return d.jsx(Rj.Provider,{value:s,children:d.jsx(W6,{delay:c,timeoutMs:a,children:t.children})})};function px(e){return _h(19)?e:e?"true":void 0}function M8(e){const[t,s]=y.useState({current:e,previous:null});return Object.is(e,t.current)||s({current:e,previous:t.current}),t.previous}function kj(e){var t,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(s=kj(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}function _j(){for(var e,t,s=0,o="",a=arguments.length;s<a;s++)(e=arguments[s])&&(t=kj(e))&&(o&&(o+=" "),o+=t);return o}const z8=(e,t)=>{const s=new Array(e.length+t.length);for(let o=0;o<e.length;o++)s[o]=e[o];for(let o=0;o<t.length;o++)s[e.length+o]=t[o];return s},D8=(e,t)=>({classGroupId:e,validator:t}),Aj=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Wm="-",cR=[],I8="arbitrary..",P8=e=>{const t=U8(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return L8(u);const m=u.split(Wm),g=m[0]===""&&m.length>1?1:0;return Mj(m,g,t)},getConflictingClassGroupIds:(u,m)=>{if(m){const g=o[u],v=s[u];return g?v?z8(v,g):g:v||cR}return s[u]||cR}}},Mj=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const a=e[t],c=s.nextPart.get(a);if(c){const v=Mj(e,t+1,c);if(v)return v}const u=s.validators;if(u===null)return;const m=t===0?e.join(Wm):e.slice(t).join(Wm),g=u.length;for(let v=0;v<g;v++){const b=u[v];if(b.validator(m))return b.classGroupId}},L8=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),o=t.slice(0,s);return o?I8+o:void 0})(),U8=e=>{const{theme:t,classGroups:s}=e;return B8(s,t)},B8=(e,t)=>{const s=Aj();for(const o in e){const a=e[o];gx(a,s,o,t)}return s},gx=(e,t,s,o)=>{const a=e.length;for(let c=0;c<a;c++){const u=e[c];H8(u,t,s,o)}},H8=(e,t,s,o)=>{if(typeof e=="string"){F8(e,t,s);return}if(typeof e=="function"){V8(e,t,s,o);return}q8(e,t,s,o)},F8=(e,t,s)=>{const o=e===""?t:zj(t,e);o.classGroupId=s},V8=(e,t,s,o)=>{if($8(e)){gx(e(o),t,s,o);return}t.validators===null&&(t.validators=[]),t.validators.push(D8(s,e))},q8=(e,t,s,o)=>{const a=Object.entries(e),c=a.length;for(let u=0;u<c;u++){const[m,g]=a[u];gx(g,zj(t,m),s,o)}},zj=(e,t)=>{let s=e;const o=t.split(Wm),a=o.length;for(let c=0;c<a;c++){const u=o[c];let m=s.nextPart.get(u);m||(m=Aj(),s.nextPart.set(u,m)),s=m}return s},$8=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Z8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),o=Object.create(null);const a=(c,u)=>{s[c]=u,t++,t>e&&(t=0,o=s,s=Object.create(null))};return{get(c){let u=s[c];if(u!==void 0)return u;if((u=o[c])!==void 0)return a(c,u),u},set(c,u){c in s?s[c]=u:a(c,u)}}},Cu="!",uR=":",K8=[],dR=(e,t,s,o,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:o,isExternal:a}),Y8=e=>{const{prefix:t,experimentalParseClassName:s}=e;let o=a=>{const c=[];let u=0,m=0,g=0,v;const b=a.length;for(let R=0;R<b;R++){const C=a[R];if(u===0&&m===0){if(C===uR){c.push(a.slice(g,R)),g=R+1;continue}if(C==="/"){v=R;continue}}if(C==="[")u++;else if(C==="]")u--;else if(C==="(")m++;else if(C===")")m--;else if(C==="\\")R++;else if(C==='"'||C==="'")for(;++R<b;){const j=a[R];if(j==="\\")R++;else if(j===C)break}}const p=c.length===0?a:a.slice(g);let x=p,S=!1;p.endsWith(Cu)?(x=p.slice(0,-1),S=!0):p.startsWith(Cu)&&(x=p.slice(1),S=!0);const w=S&&p.startsWith(Cu)?Cu.length:0,E=v&&v>g?v-g-w:void 0;return dR(c,S,x,E)};if(t){const a=t+uR,c=o;o=u=>u.startsWith(a)?c(u.slice(a.length)):dR(K8,!1,u,void 0,!0)}if(s){const a=o;o=c=>s({className:c,parseClassName:a})}return o},G8=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{t.set(s,1e6+o)}),s=>{const o=[];let a=[];for(let c=0;c<s.length;c++){const u=s[c],m=u[0]==="[",g=t.has(u);m||g?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(u)):a.push(u)}return a.length>0&&(a.sort(),o.push(...a)),o}},Q8=e=>({cache:Z8(e.cacheSize),parseClassName:Y8(e),sortModifiers:G8(e),postfixLookupClassGroupIds:X8(e),...P8(e)}),X8=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let o=0;o<s.length;o++)t[s[o]]=!0;return t},J8=/\s+/,W8=(e,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:c,postfixLookupClassGroupIds:u}=t,m=[],g=e.trim().split(J8);let v="";for(let b=g.length-1;b>=0;b-=1){const p=g[b],{isExternal:x,modifiers:S,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:R}=s(p);if(x){v=p+(v.length>0?" "+v:v);continue}let C=!!R,j;if(C){const L=E.substring(0,R);j=o(L);const _=j&&u[j]?o(E):void 0;_&&_!==j&&(j=_,C=!1)}else j=o(E);if(!j){if(!C){v=p+(v.length>0?" "+v:v);continue}if(j=o(E),!j){v=p+(v.length>0?" "+v:v);continue}C=!1}const O=S.length===0?"":S.length===1?S[0]:c(S).join(":"),k=w?O+Cu:O,D=k+j;if(m.indexOf(D)>-1)continue;m.push(D);const P=a(j,C);for(let L=0;L<P.length;++L){const _=P[L];m.push(k+_)}v=p+(v.length>0?" "+v:v)}return v},eB=(...e)=>{let t=0,s,o,a="";for(;t<e.length;)(s=e[t++])&&(o=Dj(s))&&(a&&(a+=" "),a+=o);return a},Dj=e=>{if(typeof e=="string")return e;let t,s="";for(let o=0;o<e.length;o++)e[o]&&(t=Dj(e[o]))&&(s&&(s+=" "),s+=t);return s},tB=(e,...t)=>{let s,o,a,c;const u=g=>{const v=t.reduce((b,p)=>p(b),e());return s=Q8(v),o=s.cache.get,a=s.cache.set,c=m,m(g)},m=g=>{const v=o(g);if(v)return v;const b=W8(g,s);return a(g,b),b};return c=u,(...g)=>c(eB(...g))},nB=[],Un=e=>{const t=s=>s[e]||nB;return t.isThemeGetter=!0,t.themeKey=e,t},Ij=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|Q|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^--spacing\(.+\)|^0$/,Lj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark|contrast-color|device-cmyk|--alpha)\(.+\)$/i,iB=/^(?:_*[+-]?(?:\d|\.\d)|[\w-]+\(|_*(?:inherit|initial|revert(?:-layer)?|unset)_*$)/i,aB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ni=e=>rB.test(e),Ot=e=>!!e&&!Number.isNaN(Number(e)),_s=e=>!!e&&Number.isInteger(Number(e)),Wv=e=>e.endsWith("%")&&Ot(e.slice(0,-1)),io=e=>sB.test(e),Uj=()=>!0,cB=e=>oB.test(e)&&!Lj.test(e),uB=e=>iB.test(e)&&!Lj.test(e),vx=()=>!1,dB=e=>aB.test(e),fB=e=>lB.test(e),mB=e=>!We(e)&&!tt(e),hB=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),pB=e=>Co(e,Fj,vx),We=e=>Ij.test(e),ea=e=>Co(e,Vj,cB),gB=e=>Co(e,qj,uB),vB=e=>Co(e,NB,Ot),bB=e=>Co(e,Zj,Uj),yB=e=>Co(e,$j,vx),xB=e=>Co(e,Bj,vx),wB=e=>Co(e,Hj,fB),fm=e=>Co(e,Kj,dB),tt=e=>Pj.test(e),El=e=>Ni(e,Vj),SB=e=>Ni(e,qj,!0),EB=e=>Ni(e,$j),fR=e=>Ni(e,Bj),TB=e=>Ni(e,Fj),RB=e=>Ni(e,Hj),mm=e=>Ni(e,Kj,!0),CB=e=>Ni(e,Zj,!0),Co=(e,t,s)=>{const o=Ij.exec(e);return o?o[1]?t(o[1]):s(o[2]):!1},Ni=(e,t,s=!1)=>{const o=Pj.exec(e);return o?o[1]?t(o[1]):s:!1},Bj=e=>e==="position"||e==="percentage",Hj=e=>e==="image"||e==="url",Fj=e=>e==="length"||e==="size"||e==="bg-size",Vj=e=>e==="length",qj=e=>e!=="color",NB=e=>e==="number",$j=e=>e==="family-name",Zj=e=>e==="number"||e==="weight",Kj=e=>e==="shadow",jB=()=>{const e=Un("color"),t=Un("font"),s=Un("text"),o=Un("font-weight"),a=Un("tracking"),c=Un("leading"),u=Un("breakpoint"),m=Un("container"),g=Un("spacing"),v=Un("radius"),b=Un("shadow"),p=Un("inset-shadow"),x=Un("text-shadow"),S=Un("drop-shadow"),w=Un("blur"),E=Un("perspective"),R=Un("aspect"),C=Un("ease"),j=Un("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...k(),tt,We],P=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],_=()=>[tt,We,g],V=()=>[ni,"full","auto",..._()],I=()=>[_s,"none","subgrid",tt,We],X=()=>["auto",{span:["full",_s,tt,We]},_s,tt,We],Y=()=>[_s,"auto",tt,We],q=()=>["auto","min","max","fr",tt,We],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",..._()],K=()=>[ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],B=()=>[m,ni,"screen","full","dvw","lvw","svw","min","max","fit",..._()],A=()=>[ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",..._()],U=()=>[e,tt,We],J=()=>[...k(),fR,xB,{position:[tt,We]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",TB,pB,{size:[tt,We]}],N=()=>[Wv,El,ea],z=()=>["","none","full",v,tt,We],Z=()=>["",Ot,El,ea],te=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[Ot,Wv,SB,gB],be=()=>["","none",w,tt,We],de=()=>["none",Ot,tt,We],fe=()=>["none",Ot,tt,We],xe=()=>[Ot,tt,We],pe=()=>[ni,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[io],breakpoint:[io],color:[Uj],container:[io],"drop-shadow":[io],ease:["in","out","in-out"],font:[mB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[io],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[io],shadow:[io],spacing:["px",Ot],text:[io],"text-shadow":[io],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ni,We,tt,R]}],container:["container"],"container-type":[{"@container":["","normal","size",tt,We]}],"container-named":[hB],columns:[{columns:[Ot,"auto",We,tt,m]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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":["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:D()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[_s,"auto",tt,We]}],basis:[{basis:[ni,"full","auto",m,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ot,ni,"auto","initial","none",tt,We]}],grow:[{grow:["",Ot,tt,We]}],shrink:[{shrink:["",Ot,tt,We]}],order:[{order:[_s,"first","last","none",tt,We]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pbs:[{pbs:_()}],pbe:[{pbe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...A()]}],"min-block-size":[{"min-block":["auto",...A()]}],"max-block-size":[{"max-block":["none",...A()]}],w:[{w:[m,"screen",...K()]}],"min-w":[{"min-w":[m,"screen","none",...K()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[u]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh","none",...K()]}],"font-size":[{text:["base",s,El,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,CB,bB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wv,We]}],"font-family":[{font:[EB,yB,t]}],"font-features":[{"font-features":[We]}],"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:[a,tt,We]}],"line-clamp":[{"line-clamp":[Ot,"none",tt,We]}],leading:[{leading:["none",c,..._()]}],"list-image":[{"list-image":["none",tt,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ot,"from-font","auto",El,fR,ea]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Ot,"auto",tt,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"tab-size":[{tab:[_s,tt,We]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,We]}],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",tt,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_s,tt,We],radial:["",tt,We],conic:["",_s,tt,We]},RB,wB]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-bs":[{"border-bs":Z()}],"border-w-be":[{"border-be":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ot,tt,We]}],"outline-w":[{outline:["",Ot,El,ea]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","inner","none",b,mm,fm]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,mm,fm]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Ot,ea]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",x,mm,fm]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Ot,tt,We]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[Ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[tt,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{mask:["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,We]}],filter:[{filter:["","none",tt,We]}],blur:[{blur:be()}],brightness:[{brightness:[Ot,tt,We]}],contrast:[{contrast:[Ot,tt,We]}],"drop-shadow":[{"drop-shadow":["","none",S,mm,fm]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Ot,tt,We]}],"hue-rotate":[{"hue-rotate":[Ot,tt,We]}],invert:[{invert:["",Ot,tt,We]}],saturate:[{saturate:[Ot,tt,We]}],sepia:[{sepia:["",Ot,tt,We]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,We]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[Ot,tt,We]}],"backdrop-contrast":[{"backdrop-contrast":[Ot,tt,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ot,tt,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ot,tt,We]}],"backdrop-invert":[{"backdrop-invert":["",Ot,tt,We]}],"backdrop-opacity":[{"backdrop-opacity":[Ot,tt,We]}],"backdrop-saturate":[{"backdrop-saturate":[Ot,tt,We]}],"backdrop-sepia":[{"backdrop-sepia":["",Ot,tt,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ot,"initial",tt,We]}],ease:[{ease:["linear","initial",C,tt,We]}],delay:[{delay:[Ot,tt,We]}],animate:[{animate:["none",j,tt,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,tt,We]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[tt,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],zoom:[{zoom:[_s,tt,We]}],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",tt,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":U()}],"scrollbar-track-color":[{"scrollbar-track":U()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mbs":[{"scroll-mbs":_()}],"scroll-mbe":[{"scroll-mbe":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pbs":[{"scroll-pbs":_()}],"scroll-pbe":[{"scroll-pbe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",tt,We]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Ot,El,ea,vB]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],"place-content":["align-content","justify-content"],"place-items":["align-items","justify-items"],"place-self":["align-self","justify-self"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"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"],sr:["not-sr","position","size","w","h","p","px","py","ps","pe","pbs","pbe","pt","pr","pb","pl","m","mx","my","ms","me","mbs","mbe","mt","mr","mb","ml","overflow","overflow-x","overflow-y","whitespace"],"not-sr":["sr"],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-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],"mask-image-x-from-pos":["mask-image-r-from-pos","mask-image-l-from-pos"],"mask-image-x-to-pos":["mask-image-r-to-pos","mask-image-l-to-pos"],"mask-image-x-from-color":["mask-image-r-from-color","mask-image-l-from-color"],"mask-image-x-to-color":["mask-image-r-to-color","mask-image-l-to-color"],"mask-image-y-from-pos":["mask-image-t-from-pos","mask-image-b-from-pos"],"mask-image-y-to-pos":["mask-image-t-to-pos","mask-image-b-to-pos"],"mask-image-y-from-color":["mask-image-t-from-color","mask-image-b-from-color"],"mask-image-y-to-color":["mask-image-t-to-color","mask-image-b-to-color"],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-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},OB=tB(jB);function De(...e){return OB(_j(e))}function kB({delay:e=0,...t}){return d.jsx(A8,{"data-slot":"tooltip-provider",delay:e,...t})}function Yj({...e}){return d.jsx(c8,{"data-slot":"tooltip",...e})}function Gj({...e}){return d.jsx(m8,{"data-slot":"tooltip-trigger",...e})}function Qj({className:e,side:t="top",sideOffset:s=4,align:o="center",alignOffset:a=0,children:c,...u}){return d.jsx(g8,{children:d.jsx(O8,{align:o,alignOffset:a,side:t,sideOffset:s,className:"isolate z-50",children:d.jsxs(k8,{"data-slot":"tooltip-content",className:De("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...u,children:[c,d.jsx(_8,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const _B="M28 10 C 40 10, 44 24, 44 32 C 44 42, 37 47, 28 47 C 19 47, 12 42, 12 32 C 12 24, 16 10, 28 10 Z",AB="M14 30 L 21 25 L 27 31 L 34 24 L 42 30";function Bh({className:e,crack:t="var(--bg)",label:s}){const o=y.useId();return d.jsxs("svg",{viewBox:"10 8 36 41",className:De("h-7 w-auto shrink-0",e),role:s?"img":void 0,"aria-label":s||void 0,"aria-hidden":s?void 0:!0,children:[s&&d.jsx("title",{children:s}),d.jsx("defs",{children:d.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"1",y2:"1",children:[d.jsx("stop",{offset:"0",stopColor:"#ff3d8b"}),d.jsx("stop",{offset:"0.55",stopColor:"#ff8a3d"}),d.jsx("stop",{offset:"1",stopColor:"#ffc861"})]})}),d.jsx("path",{d:_B,fill:`url(#${o})`}),d.jsx("path",{d:AB,fill:"none",stroke:t,strokeWidth:"3",strokeLinejoin:"round"})]})}function bx({className:e,crack:t}){return d.jsxs("span",{className:De("flex items-center gap-2.5",e),children:[d.jsx(Bh,{crack:t}),d.jsx("span",{className:"font-display text-[22px] font-extrabold tracking-[-0.02em] text-ink",children:"Hatchlight"})]})}function Hh(e){return vt(e.defaultTagName??"div",e,e)}const mR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hR=_j,ad=(e,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return hR(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:a,defaultVariants:c}=t,u=Object.keys(a).map(v=>{const b=s==null?void 0:s[v],p=c==null?void 0:c[v];if(b===null)return null;const x=mR(b)||mR(p);return a[v][x]}),m=s&&Object.entries(s).reduce((v,b)=>{let[p,x]=b;return x===void 0||(v[p]=x),v},{}),g=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((v,b)=>{let{class:p,className:x,...S}=b;return Object.entries(S).every(w=>{let[E,R]=w;return Array.isArray(R)?R.includes({...c,...m}[E]):{...c,...m}[E]===R})?[...v,p,x]:v},[]);return hR(e,u,g,s==null?void 0:s.class,s==null?void 0:s.className)},MB=ad("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ac({className:e,variant:t="default",render:s,...o}){return Hh({defaultTagName:"span",props:Gn({className:De(MB({variant:t}),e)},o),render:s,state:{slot:"badge",variant:t}})}const Xj=y.createContext(void 0);function Fh(e=!1){const t=y.useContext(Xj);if(t===void 0&&!e)throw new Error(mn(16));return t}function zB(e){const{focusableWhenDisabled:t,disabled:s,composite:o=!1,tabIndex:a=0,isNativeButton:c}=e,u=o&&t!==!1,m=o&&t===!1;return{props:y.useMemo(()=>{const v={onKeyDown(b){s&&t&&b.key!=="Tab"&&b.preventDefault()}};return o||(v.tabIndex=a,!c&&s&&(v.tabIndex=t?a:-1)),(c&&(t||u)||!c&&s)&&(v["aria-disabled"]=s),c&&(!t||m)&&(v.disabled=s),v},[o,s,t,u,m,c,a])}}function Pl(e,t,{detail:s=0,pointerType:o=""}={}){e.dispatchEvent(new(Kt(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:s,pointerType:o,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function ss(e={}){const{disabled:t=!1,focusableWhenDisabled:s,tabIndex:o=0,native:a=!0,composite:c}=e,u=y.useRef(null),m=Fh(!0),g=c??m!==void 0,{props:v}=zB({focusableWhenDisabled:s,disabled:t,composite:g,tabIndex:o,isNativeButton:a}),b=y.useCallback(()=>{const S=u.current;eb(S)&&g&&t&&v.disabled===void 0&&S.disabled&&(S.disabled=!1)},[t,v.disabled,g]);Me(b,[b]);const p=y.useCallback((S={})=>{const{onClick:w,onMouseDown:E,onKeyUp:R,onKeyDown:C,onPointerDown:j,...O}=S;return Gn({onClick(k){if(t){k.preventDefault();return}w==null||w(k)},onMouseDown(k){t||E==null||E(k)},onKeyDown(k){if(t||(Ym(k),C==null||C(k),k.baseUIHandlerPrevented))return;const D=k.target===k.currentTarget,P=k.currentTarget,L=eb(P),_=!a&&DB(P),V=D&&(a?L:!_),I=k.key==="Enter",X=k.key===" ",Y=P.getAttribute("role"),q=(Y==null?void 0:Y.startsWith("menuitem"))||Y==="option"||Y==="gridcell";if(D&&g&&X){if(k.defaultPrevented&&q)return;k.preventDefault(),(!a||L)&&(k.preventBaseUIHandler(),Pl(P,k));return}if(!V||a||!X&&!I){D&&_&&X&&k.preventDefault();return}k.defaultPrevented||(k.preventDefault(),I&&(k.preventBaseUIHandler(),Pl(P,k)))},onKeyUp(k){if(!t){if(Ym(k),R==null||R(k),k.target===k.currentTarget&&a&&g&&eb(k.currentTarget)&&k.key===" "){k.preventDefault();return}k.baseUIHandlerPrevented||k.target===k.currentTarget&&!a&&!g&&!k.defaultPrevented&&k.key===" "&&(k.preventBaseUIHandler(),Pl(k.currentTarget,k))}},onPointerDown(k){if(t){k.preventDefault();return}j==null||j(k)}},a?{type:"button"}:{role:"button"},v,O)},[t,v,g,a]),x=Ie(S=>{u.current=S,b()});return{getButtonProps:p,buttonRef:x}}function eb(e){return rn(e)&&e.tagName==="BUTTON"}function DB(e){return rn(e)&&e.tagName==="A"&&!!e.href}const IB=y.forwardRef(function(t,s){const{render:o,className:a,disabled:c=!1,focusableWhenDisabled:u=!1,nativeButton:m=!0,style:g,...v}=t,{getButtonProps:b,buttonRef:p}=ss({disabled:c,focusableWhenDisabled:u,native:m});return vt("button",t,{state:{disabled:c},ref:[s,p],props:[v,b]})}),yx=ad("group/button inline-flex shrink-0 items-center justify-center rounded-xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline",aurora:"cta font-semibold text-on-aurora"},size:{default:"h-10 gap-2 px-4 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-[min(var(--radius-md),12px)] px-3 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-12 gap-2 px-5 text-[15px] has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-10","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-12"}},defaultVariants:{variant:"default",size:"default"}});function Ue({className:e,variant:t="default",size:s="default",...o}){return d.jsx(IB,{"data-slot":"button",className:De(yx({variant:t,size:s,className:e})),...o})}function ld({className:e,size:t="default",...s}){return d.jsx("div",{"data-slot":"card","data-size":t,className:De("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...s})}function xx({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:De("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function cd({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:De("px-(--card-spacing)",e),...t})}function So({controlled:e,default:t,name:s,state:o="value"}){const{current:a}=y.useRef(e!==void 0),[c,u]=y.useState(()=>t),m=a&&e!==void 0?e:c,g=y.useCallback(v=>{a||u(v)},[]);return[m,g]}function PB(e){if(!e)return null;for(const t of e.elements){const s=t.tagName;if(s==="BUTTON"||s==="INPUT"){const o=t;if(o.type==="submit")return o}}return null}const LB="data-valid",UB="data-invalid",BB={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},HB={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},FB={disabled:!1,...HB},ud={valid(e){return e===null?null:e?{[LB]:""}:{[UB]:""}}},VB="data-checked",qB="data-unchecked";function Jj(e){return{checked(t){return e.indeterminate?{}:t?{[VB]:""}:{[qB]:""}},...ud}}const $B={invalid:void 0,name:void 0,validityData:{state:BB,errors:[],error:"",value:"",initialValue:null},setValidityData:vn,disabled:void 0,setTouched:vn,setDirty:vn,setFilled:vn,setFocused:vn,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:FB,registerFieldControl:vn,validation:{getValidationProps:(e,t=Ut)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:vn,getInputControl:()=>null,commit:async()=>{},change:vn}},ZB=y.createContext($B);function No(e=!0){const t=y.useContext(ZB);if(t.setValidityData===vn&&!e)throw new Error(mn(28));return t}function dd(e,t,s){const{setFocused:o,focusOwnerRef:a}=No(),c=Ie(u=>{(u?!e:a.current===c)&&(a.current=u&&c,o(u))});return Me(()=>{const u=t.current,m=u==null?void 0:u.getRootNode();return(m==null?void 0:m.activeElement)===u&&c(!0),()=>c(!1)},[e,t,c]),c}function fd(e,t,s,o,a=!0,c){const{registerFieldControl:u}=No(),m=In(()=>Symbol());Me(()=>{const g=m.current;if(!a){u(g,void 0);return}u(g,{controlRef:e,getValue:o,id:t,name:c,value:s})},[e,a,o,t,c,u,m,s]),Me(()=>{const g=m.current;return()=>{u(g,void 0)}},[u,m])}const KB=y.createContext({disabled:!1});function YB(){return y.useContext(KB)}const GB=y.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:vn,validationMode:"onSubmit",submitCountRef:{current:0}});function md(){return y.useContext(GB)}const QB=y.createContext({controlId:void 0,registerControlId:vn,resetControlId:vn,labelId:void 0,setLabelId:vn,messageIds:[],setMessageIds:vn,getDescriptionProps:e=>e});function mc(){return y.useContext(QB)}function Wj(e,t,s,o=!0,a,c){const[u,m]=y.useState(),g=Qn(a?`${a}-label`:void 0),v=!!(c!=null&&c.trim()),p=e??(v?void 0:t)??u;return Me(()=>{const x=e||t||v||!o?void 0:XB(s.current,g);u!==x&&m(x)}),p}function XB(e,t){const s=JB(e);if(s)return!s.id&&t&&(s.id=t),s.id||void 0}function JB(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const s=e.id;if(s){const a=e.nextElementSibling;if(a&&a.htmlFor===s)return a}const o=e.labels;return o&&o[0]}function hc(e={}){const{id:t,enabled:s=!0}=e,{controlId:o,registerControlId:a,resetControlId:c}=mc(),u=Qn(),m=In(()=>Symbol()),g=y.useRef(!1),v=y.useRef(!1),b=Ie(()=>{!g.current||a===vn||(g.current=!1,a(m.current,void 0))});return Me(()=>{if(!s||a===vn){b();return}let p;if(t!==void 0)v.current=!0,p=t;else if(v.current)p=u;else{c();return}if(p===void 0){b();return}g.current=!0,a(m.current,p)},[t,s,a,c,u,m,b]),Me(()=>b,[b]),(s?o:void 0)??t??u}const WB=y.createContext(void 0);function eH(){return y.useContext(WB)}const eO=y.createContext(void 0);function tH(){const e=y.useContext(eO);if(e===void 0)throw new Error(mn(14));return e}function pc(e,t){const s=y.useRef(e),o=Ie(t);Me(()=>{s.current!==e&&o(s.current),s.current=e},[e,o])}const nH="data-parent",rH=y.forwardRef(function(t,s){const{checked:o,className:a,defaultChecked:c=!1,"aria-labelledby":u,disabled:m=!1,form:g,id:v,indeterminate:b=!1,inputRef:p,name:x,onCheckedChange:S,parent:w=!1,readOnly:E=!1,render:R,required:C=!1,uncheckedValue:j,value:O,nativeButton:k=!1,style:D,...P}=t,{clearErrors:L}=md(),{disabled:_,name:V,setDirty:I,setFilled:X,setTouched:Y,state:q,validationMode:$,validityData:G,validation:H}=No(),K=YB(),{labelId:B,registerControlId:A,getDescriptionProps:U}=mc(),J=eH(),F=(J==null?void 0:J.allValues)===void 0?void 0:J.parent,oe=F!==void 0,N=_||K.disabled||(J==null?void 0:J.disabled)||m,z=V??x,Z=O??z,te=Qn(),ue=(J==null?void 0:J.registerControlId)!==A,W=hc({id:v||void 0,enabled:ue}),be=k?W:te;let de={};oe&&(w?de=F.getParentProps():Z!==void 0&&(de=F.getChildProps(Z)));const{checked:fe=o,indeterminate:xe=b,onCheckedChange:pe,...we}=de,Oe=J==null?void 0:J.value,ke=y.useRef(null),Pe=dd(N,ke),{getButtonProps:Te,buttonRef:He}=ss({disabled:N,native:k}),se=(J==null?void 0:J.validation)??H,[ye,Ae]=So({controlled:Z!==void 0&&Oe!==void 0&&!w?Oe.includes(Z):fe,default:c,name:"Checkbox",state:"checked"}),Be=oe?!!fe:ye,ae=oe&&xe||b;fd(ke,te,ye,void 0,!J&&!N,x);const ve=F==null?void 0:F.registerChildId,ze=y.useRef(null),_e=se.registerInput,Re=J?Z:void 0,Ge=y.useCallback(qe=>_e(qe,{controlRef:ke,value:Re}),[_e,Re]),Ye=Vr(p,ze,w?void 0:Ge),mt=Wj(u,B,ze,!k,W,P["aria-label"]);Me(()=>{ze.current&&(ze.current.indeterminate=ae),J||X(ye)},[ye,ae,J,X]),pc(ye,()=>{J||(L(z),I(ye!==G.initialValue),se.change(ye))});const nt=Gn({checked:ye,disabled:N,form:g,name:w?void 0:z,id:k?void 0:W,required:C,ref:Ye,style:z?Vy:wa,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(qe){if(qe.nativeEvent.defaultPrevented)return;if(E){qe.preventDefault();return}const at=qe.currentTarget.checked,Nt=dt(lr,qe.nativeEvent);if(S==null||S(at,Nt),!Nt.isCanceled&&(pe==null||pe(at,Nt),!Nt.isCanceled&&(Ae(at),Z!==void 0&&J!==void 0&&!w&&!oe))){const ht=at?[...J.value,Z]:J.value.filter(Gt=>Gt!==Z);J.setValue(ht,Nt)}},onClick(qe){qe.stopPropagation()},onFocus(){var qe;(qe=ke.current)==null||qe.focus()}},O!==void 0?{value:(J?ye&&O:O)||""}:Ut,U,qe=>se.getValidationProps(N,qe));y.useEffect(()=>{if(!F||Z===void 0)return;const qe=F.disabledStatesRef.current;return qe.set(Z,N),()=>{qe.delete(Z)}},[F,N,Z]);const ut=y.useMemo(()=>({...q,checked:Be,disabled:N,readOnly:E,required:C,indeterminate:ae}),[q,Be,N,E,C,ae]),Rt=Jj(ut),At=vt("span",t,{state:ut,ref:[He,ke,s],props:[{id:be,role:"checkbox","aria-checked":ae?"mixed":Be,"aria-readonly":E||void 0,"aria-required":C||void 0,"aria-labelledby":mt,[nH]:w?"":void 0,onFocus(){Pe(!0)},onBlur(){const qe=ze.current;qe&&(Y(!0),Pe(!1),$==="onBlur"&&se.commit(J?Oe:qe.checked))},onKeyDown(qe){var sn;if(qe.key!=="Enter"||(qe.preventBaseUIHandler(),qe.defaultPrevented))return;const at=((sn=ze.current)==null?void 0:sn.form)??null,Nt=qe.currentTarget,ht=qe.nativeEvent,Gt=qe.preventDefault,Bt=ht.preventDefault;let Ft=!1;qe.preventDefault=()=>{Ft=!0,Gt.call(qe)},ht.preventDefault=()=>{Ft=!0,Bt.call(ht)},Bt.call(ht),Kt(Nt).queueMicrotask(()=>{var rt;qe.preventDefault=Gt,ht.preventDefault=Bt,Ft||(rt=PB(at))==null||rt.click()})},onClick(qe){if(E||N)return;qe.preventDefault();const at=ze.current;at&&Pl(at,qe)}},P,we,Te,U,qe=>se.getValidationProps(N,qe)],stateAttributesMapping:Rt}),it=At.props.id;return Me(()=>{if(!(!ve||w||Z===void 0||it===void 0))return ve(Z,it)},[ve,w,Z,it]),d.jsxs(eO.Provider,{value:ut,children:[At,!ye&&!J&&z&&!w&&j!==void 0&&d.jsx("input",{type:"hidden",form:g,name:z,value:j,disabled:N}),d.jsx("input",{...nt,suppressHydrationWarning:!0})]})}),sH=y.forwardRef(function(t,s){const{render:o,className:a,style:c,keepMounted:u=!1,...m}=t,g=tH(),v=g.checked||g.indeterminate,{mounted:b,transitionStatus:p,setMounted:x}=od(v),S=y.useRef(null),w={...g,transitionStatus:p};Ro({batch:!0,enabled:!v,open:v,ref:S,onComplete(){v||x(!1)}});const R={...Jj(g),...Ti},C=u||b,j=vt("span",t,{ref:[s,S],state:w,stateAttributesMapping:R,props:m});return C?j:null});function tO({className:e,...t}){return d.jsx(rH,{"data-slot":"checkbox",className:De("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",e),...t,children:d.jsx(sH,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:d.jsx(kN,{})})})}const oH=y.forwardRef(function(t,s){const{render:o,className:a,id:c,name:u,value:m,disabled:g=!1,onValueChange:v,defaultValue:b,autoFocus:p=!1,style:x,...S}=t,{state:w,name:E,disabled:R,setTouched:C,setDirty:j,validityData:O,setFilled:k,validationMode:D,validation:P}=No(),{clearErrors:L,elementRef:_,submitCountRef:V}=md(),I=R||g,X=E??u,Y={...w,disabled:I},{labelId:q}=mc(),$=hc({id:c}),G=m!==void 0,H=m==null?void 0:String(m),K=Ie(()=>{var F;return(F=P.inputRef.current)==null?void 0:F.value});fd(P.inputRef,$,H,K,!I,u),Me(()=>{var oe;const F=H??((oe=P.inputRef.current)==null?void 0:oe.value);F!==void 0&&k(F!=="")},[H,b,P.inputRef,k]),pc(H,()=>{H!==void 0&&(L(X),j(H!==(O.initialValue??"")),P.change(H))});const B=y.useRef(null),A=dd(I,B),U=Rn();return vt("input",t,{ref:[s,B],state:Y,props:[{id:$,disabled:I,name:X,ref:P.inputRef,"aria-labelledby":q,autoFocus:p,...G?{value:m}:{defaultValue:b},onChange(F){const oe=F.currentTarget.value,N=dt(lr,F.nativeEvent);v==null||v(oe,N),!G&&(j(oe!==(O.initialValue??"")),k(oe!==""),!F.nativeEvent.defaultPrevented&&!N.isCanceled&&(L(X),P.change(oe)))},onFocus(){A(!0)},onBlur(F){if(C(!0),A(!1),D==="onBlur"){const oe=F.currentTarget.value;P.commit(oe),G&&queueMicrotask(()=>{var z;const N=(z=P.inputRef.current)==null?void 0:z.value;N!==void 0&&N!==oe&&N!==(O.initialValue??"")&&P.commit(N)})}},onKeyDown(F){if(F.currentTarget.tagName==="INPUT"&&F.key==="Enter"){C(!0);const oe=F.currentTarget.value,N=F.currentTarget.form;if(N&&N===_.current&&!F.defaultPrevented){const z=F.currentTarget,Z=V.current;U.start(0,()=>{V.current===Z&&P.commit(z.value)})}else P.commit(oe)}}},S,F=>P.getValidationProps(I,F)],stateAttributesMapping:ud})}),iH=y.forwardRef(function(t,s){return d.jsx(oH,{ref:s,...t})});function Cn({className:e,type:t,...s}){return d.jsx(iH,{type:t,"data-slot":"input",className:De("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}function Or({className:e,...t}){return d.jsx("label",{"data-slot":"label",className:De("flex items-center gap-2 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 aH(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}function nO(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const rO=y.createContext(void 0),sO=y.createContext(void 0);function Vs(){const e=y.useContext(rO);if(e===void 0)throw new Error(mn(60));return e}function oO(){const e=y.useContext(sO);if(e===void 0)throw new Error(mn(61));return e}function wx(e,t,s=Object.is){const{length:o}=e;if(o!==t.length)return!1;for(let a=0;a<o;a+=1)if(!s(e[a],t[a]))return!1;return!0}const iO=(e,t)=>Object.is(e,t);function Ea(e,t,s){return e==null||t==null?Object.is(e,t):s(e,t)}function lH(e,t,s){return Array.isArray(e)&&Array.isArray(t)?!wx(e,t,(o,a)=>Ea(o,a,s)):e!==t}function Yb(e,t,s){return e?e.some(o=>o===void 0?!1:Ea(t,o,s)):!1}function Mm(e,t,s){return e?e.findIndex(o=>o===void 0?!1:Ea(o,t,s)):-1}function cH(e,t){if(t!==iO)return o=>Yb(e,o,t);const s=new Set(e);return s.delete(void 0),o=>s.has(o)&&(o!==0||e.some(a=>Object.is(o,a)))}function aO(e,t,s,o){const a=o&&Array.isArray(t)?e.findIndex(cH(t,s)):Mm(e,t,s);return a===-1?null:a}function uH(e,t,s,o,a,c){return Yb(o,t,a)?c!=null&&e>c&&Yb(o,s[c],a)?c:e:e===c?aO(s,o,a,!0):c}function dH(e,t,s){return e.filter(o=>!Ea(t,o,s))}function Gb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function fH(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function lO(e){return fH(e==null?void 0:e[0])}function mH(e){return lO(e)?e.flatMap(t=>t.items):e}function hH(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(lO(t)){for(const s of t)for(const o of s.items)if(o&&o.value==null&&o.label!=null)return!0;return!1}for(const s of t)if(s&&s.value==null&&s.label!=null)return!0;return!1}function cO(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Gb(e)}function Nl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Gb(e.value):Gb(e)}function uO(e,t,s){function o(){return cO(e,s)}if(s&&e!=null)return s(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??o();if(Array.isArray(t)){const c=mH(t);if(e==null||typeof e!="object"){const u=c.find(m=>m.value===e);return u&&u.label!=null?u.label:o()}if("value"in e){const u=c.find(m=>m&&m.value===e.value);if(u&&u.label!=null)return u.label}}return o()}function pH(e,t,s){return e.reduce((o,a,c)=>(c>0&&o.push(", "),o.push(d.jsx(y.Fragment,{children:uO(a,t,s)},c)),o),[])}const gH={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:s,itemToStringValue:o}=e;return t==null?!1:s&&Array.isArray(t)?t.length>0:Nl(t,o)!==""},hasNullItemLabel:(e,t)=>t?hH(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const s=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(a=>Ea(t,a,s)):Ea(t,o,s)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function vH(e){const t=y.useRef(""),s=y.useCallback(a=>{a.defaultPrevented||(t.current=a.pointerType,e(a,a.pointerType))},[e]);return{onClick:y.useCallback(a=>{if(a.detail===0){e(a,"keyboard");return}"pointerType"in a?e(a,a.pointerType):e(a,t.current),t.current=""},[e]),onPointerDown:s}}function dO(e,t){const s=Ie((c,u)=>{(typeof e=="function"?e():e)||t(u||(yh?"touch":""))}),{onClick:o,onPointerDown:a}=vH(s);return y.useMemo(()=>({onClick:o,onPointerDown:a}),[o,a])}function fO(e){const[t,s]=y.useState(null),o=dO(e,s);return pc(e,a=>{a&&!e&&s(null)}),y.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}function Fn(e,t=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,s))}const ms=1;function Sx(e,t){return Math.max(0,e-t)}function eh(e,t){if(t<=0)return 0;const s=Fn(e,0,t),o=s,a=t-s,c=o<=ms,u=a<=ms;return c&&u?o<=a?0:t:c?0:u?t:s}function bH(e){const{id:t,value:s,defaultValue:o=null,onValueChange:a,open:c,defaultOpen:u=!1,onOpenChange:m,name:g,form:v,autoComplete:b,disabled:p=!1,readOnly:x=!1,required:S=!1,modal:w=!0,actionsRef:E,inputRef:R,onOpenChangeComplete:C,items:j,multiple:O=!1,itemToStringLabel:k,itemToStringValue:D,isItemEqualToValue:P=iO,highlightItemOnHover:L=!0,children:_}=e,{clearErrors:V}=md(),{setDirty:I,setTouched:X,setFocused:Y,validityData:q,setFilled:$,name:G,disabled:H,validation:K,validationMode:B}=No(),A=hc({id:t}),U=H||p,J=G??g,[F,oe]=So({controlled:s,default:O?o??ns:o,name:"Select",state:"value"}),[N,z]=So({controlled:c,default:u,name:"Select",state:"open"}),Z=y.useRef([]),te=y.useRef([]),ue=y.useRef(null),W=y.useRef(null),be=y.useRef(0),de=y.useRef(null),fe=y.useRef([]),xe=y.useRef(!1),pe=y.useRef(null),we=y.useRef(null),Oe=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ke=y.useRef(!1),Pe=y.useRef(F),{openMethod:Te,triggerProps:He}=fO(N),se=In(()=>new id({id:A,labelId:void 0,modal:w,multiple:O,disabled:U,readOnly:x,required:S,highlightItemOnHover:L,itemToStringLabel:k,itemToStringValue:D,isItemEqualToValue:P,value:F,open:N,mounted:N,transitionStatus:void 0,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Ut,triggerProps:Ut,itemRoot:{props:Ut,multiple:O,disabled:U,readOnly:x,isItemEqualToValue:P},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:vn,setOpen:vn,handleScrollArrowVisibility:vn,onOpenChangeComplete:vn,listRef:Z,popupRef:ue,scrollHandlerRef:W,scrollArrowsMountedCountRef:be,valueRef:de,valuesRef:fe,labelsRef:te,typingRef:xe,selectionRef:Oe,firstItemTextRef:pe,selectedItemTextRef:we,alignItemWithTriggerActiveRef:ke,initialValueRef:Pe},gH)).current,[ye,Ae]=y.useState(!1),{mounted:Be,transitionStatus:ae,forceUnmount:ve}=sj({open:N,ref:ue,preventUnmountOnClose:ye,setPreventUnmountOnClose:Ae,onUnmount(){se.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C==null||C(!1)}}),ze=se.useState("activeIndex"),_e=se.useState("selectedIndex"),Re=se.useState("triggerElement"),Ge=se.useState("positionerElement"),Ye=M8(Te),mt=Te??Ye,nt=y.useMemo(()=>O?"":Nl(F,D),[O,F,D]),ut=y.useMemo(()=>O&&Array.isArray(F)?F.map(Ze=>Nl(Ze,D)):Nl(F,D),[O,F,D]),Rt=fn(Re),At=Ie(()=>ut);fd(Rt,A,F,At,!U,g);const it=O?Array.isArray(F)&&F.length>0:F!=null&&nt!=="";Me(()=>{$(it)},[it,$]),Me(function(){const pt=aO(fe.current,F,P,O);pt===null&&(we.current=null),!N&&se.set("selectedIndex",pt)},[O,N,F,P,se]),pc(F,()=>{V(J),I(lH(F,q.initialValue,P)),K.change(F)});const qe=Ie((Ze,pt)=>{const Ct=pt,un=rx(Ct);m==null||m(Ze,Ct),!pt.isCanceled&&(Ze||Ae(un()),z(Ze),!Ze&&(pt.reason===ya||pt.reason===Rh)&&(X(!0),Y(!1),B==="onBlur"&&K.commit(F)))});y.useImperativeHandle(E,()=>({unmount:ve,close:()=>{se.state.open&&qe(!1,dt(Nh))}}),[ve,qe,se]);const at=Ie((Ze,pt)=>{a==null||a(Ze,pt),!pt.isCanceled&&oe(Ze)}),Nt=Ie(Ze=>{const pt=Sx(Ze.scrollHeight,Ze.clientHeight),Ct=eh(Ze.scrollTop,pt),un=Ct>0,kn=Ct<pt;se.set("scrollUpArrowVisible",un),se.set("scrollDownArrowVisible",kn)}),ht=pU({open:N,onOpenChange:qe,elements:{reference:Re,floating:Ge}}),Gt=ex(ht,{enabled:!U,event:"mousedown"}),Bt=Ah(ht),Ft=hj(ht,{enabled:!U,listRef:Z,activeIndex:ze,selectedIndex:_e,disabledIndices:ns,onNavigate(Ze){Ze===null&&!N||se.set("activeIndex",Ze)},focusItemOnHover:L}),sn=pj(ht,{enabled:!U&&(N||!x&&!O),listRef:te,activeIndex:ze,selectedIndex:_e,disabledIndices:Ze=>nO(Z.current[Ze]),onMatch(Ze){N?se.set("activeIndex",Ze):at(fe.current[Ze],dt(lr))},onTyping(Ze){xe.current=Ze}}),rt=y.useMemo(()=>Gn(sn.reference,Ft.reference,Bt.reference,Gt.reference,He),[Gt.reference,sn.reference,Ft.reference,Bt.reference,He]),Dt=y.useMemo(()=>Gn(zh,sn.floating,Ft.floating,Bt.floating),[sn.floating,Ft.floating,Bt.floating]),je=Ft.item??Ut,ee=y.useMemo(()=>({props:je,multiple:O,disabled:U,readOnly:x,isItemEqualToValue:P}),[je,O,U,x,P]);se.useContextCallback("setValue",at),se.useContextCallback("setOpen",qe),se.useContextCallback("handleScrollArrowVisibility",Nt),se.useContextCallback("onOpenChangeComplete",C),aH(()=>{se.update({popupProps:Dt,triggerProps:rt,itemRoot:ee})}),se.useSyncedValues({id:A,modal:w,multiple:O,disabled:U,readOnly:x,required:S,highlightItemOnHover:L,value:F,open:N,mounted:Be,transitionStatus:ae,popupProps:Dt,triggerProps:rt,itemRoot:ee,items:j,itemToStringLabel:k,itemToStringValue:D,isItemEqualToValue:P,openMethod:mt});const Le=Vr(R,K.inputRef),Ce=O?void 0:J,et=y.useMemo(()=>!O||!Array.isArray(F)||!J?null:F.map(Ze=>{const pt=Nl(Ze,D);return d.jsx("input",{type:"hidden",form:v,name:J,value:pt,disabled:U},pt)}),[O,F,v,J,D,U]);return d.jsxs(rO.Provider,{value:se,children:[d.jsx(sO.Provider,{value:ht,children:_}),d.jsx("input",{...K.getValidationProps(U,{onFocus(){var Ze;(Ze=se.state.triggerElement)==null||Ze.focus({focusVisible:!0})},onChange(Ze){if(Ze.nativeEvent.defaultPrevented||U||x)return;const pt=Ze.currentTarget.value,Ct=dt(lr,Ze.nativeEvent);function un(){if(O)return;const kn=pt.toLowerCase();let hn=fe.current.findIndex(Vn=>Nl(Vn,D).toLowerCase()===kn||cO(Vn,k).toLowerCase()===kn);hn===-1&&(hn=fe.current.findIndex((Vn,jo)=>{const ki=te.current[jo];return ki!=null&&ki.toLowerCase()===kn}));const Xn=fe.current[hn];Xn!=null&&at(Xn,Ct)}se.set("forceMount",!0),queueMicrotask(un)}}),id:A&&Ce==null?`${A}-hidden-input`:void 0,form:v,name:Ce,autoComplete:b,value:nt,disabled:U,required:S&&!(O&&it),readOnly:x,ref:Le,style:J?Vy:wa,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),et]})}function yH(e){return e==null?void 0:`${e}-label`}function mO(e,t){return e??t}const hm=5;function hO(e,t){const s=xH(t);return e.clientX>=s.left-hm&&e.clientX<=s.right+hm&&e.clientY>=s.top-hm&&e.clientY<=s.bottom+hm}function xH(e){const t=e.getBoundingClientRect(),s=Kt(e);if(_y)return t;const o=s.getComputedStyle(e,"::before"),a=s.getComputedStyle(e,"::after");if(!(o.content!=="none"||a.content!=="none"))return t;const u=parseFloat(o.width)||0,m=parseFloat(o.height)||0,g=parseFloat(a.width)||0,v=parseFloat(a.height)||0,b=Math.max(t.width,u,g),p=Math.max(t.height,m,v),x=b-t.width,S=p-t.height;return{left:t.left-x/2,right:t.right+x/2,top:t.top-S/2,bottom:t.bottom+S/2}}const wH="data-popup-side",SH=400,EH={...Hb,...ud,popupSide:e=>e?{[wH]:e}:null,value:()=>null},TH=y.forwardRef(function(t,s){var be;const{render:o,className:a,id:c,disabled:u=!1,nativeButton:m=!0,style:g,...v}=t,{setTouched:b,validationMode:p,validation:x,state:S,disabled:w}=No(),{labelId:E}=mc(),R=Vs(),C=R.useState("readOnly"),j=R.useState("required"),O=R.useState("disabled"),k=w||O||u,D=R.useState("open"),P=R.useState("mounted"),L=R.useState("value"),_=R.useState("triggerProps"),V=R.useState("positionerElement"),I=R.useState("listElement"),X=R.useState("popupSide"),Y=R.useState("id"),q=R.useState("labelId"),$=R.useState("hasSelectedValue"),G=P&&V?X:null,H=c??Y,K=mO(E,q);hc({id:c});const B=fn(V),A=y.useRef(null),U=dd(k,A),{getButtonProps:J,buttonRef:F}=ss({disabled:k,native:m}),oe=R.useStateSetter("triggerElement"),N=Rn(),z=Rn(),Z=Rn();y.useEffect(()=>{if(D)return Z.start(SH,()=>{R.context.selectionRef.current.allowUnselectedMouseUp=!0,R.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{Z.clear()};R.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},z.clear()},[D,R,z,Z]);const te=Gn(_,{id:H,role:"combobox","aria-expanded":D,"aria-haspopup":"listbox","aria-controls":D?(I==null?void 0:I.id)??((be=Vm(V))==null?void 0:be.id):void 0,"aria-labelledby":K,"aria-readonly":C||void 0,"aria-required":j||void 0,tabIndex:k?-1:0,onFocus(de){U(!0),D&&R.context.alignItemWithTriggerActiveRef.current&&R.context.setOpen(!1,dt(lr,de.nativeEvent)),N.start(0,()=>{R.set("forceMount",!0)})},onBlur(de){ot(V,de.relatedTarget)||(b(!0),U(!1),p==="onBlur"&&x.commit(L))},onMouseDown(de){if(D)return;const fe=Tt(de.currentTarget);function xe(pe){if(!A.current)return;const we=pe.target;ot(A.current,we)||ot(B.current,we)||hO(pe,A.current)||R.context.setOpen(!1,dt(w2,pe))}z.start(0,()=>{fe.addEventListener("mouseup",xe,{once:!0})})}},v,J),ue=x.getValidationProps(k,te);ue.role="combobox";const W={...S,open:D,disabled:k,value:L,readOnly:C,popupSide:G,placeholder:!$};return vt("button",t,{ref:[s,A,F,oe],state:W,stateAttributesMapping:EH,props:ue})}),RH={value:()=>null},CH=y.forwardRef(function(t,s){const{className:o,render:a,children:c,placeholder:u,style:m,...g}=t,v=Vs(),b=v.useState("value"),p=v.useState("items"),x=v.useState("itemToStringLabel"),S=v.useState("hasSelectedValue"),w=!S&&u!=null&&c==null,E=v.useState("hasNullItemLabel",w),R={value:b,placeholder:!S};let C=null;return typeof c=="function"?C=c(b):c!=null?C=c:w&&!E?C=u:Array.isArray(b)?C=pH(b,p,x):C=uO(b,p,x),vt("span",t,{state:R,ref:[s,v.context.valueRef],props:[{children:C},g],stateAttributesMapping:RH})}),NH=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,v={open:Vs().useState("open")};return vt("span",t,{state:v,ref:s,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:Ly})}),jH=y.forwardRef(function(t,s){const o=Vs(),a=o.useState("mounted"),c=o.useState("forceMount");return a||c?d.jsx(Qy,{ref:s,...t}):null}),pO=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function OH(){return y.useContext(pO)}function hd(e){const{children:t,elementsRef:s,labelsRef:o,onMapChange:a}=e,c=Ie(a),[,u]=y.useState(0),m=In(_H).current,g=In(kH).current,v=y.useRef(0),b=y.useRef(!0),p=y.useRef(null),x=y.useRef(null),S=Ie(()=>{b.current||(b.current=!0,u(D=>D+1))}),w=Ie((D,P)=>{g.set(D,P),S()}),E=Ie(D=>{g.delete(D),S()}),R=Ie(D=>{const P=new Map;return s.current.length=0,o&&(o.current.length=0),D.forEach(L=>{var _,V;P.set(L.element,{...L.registration.metadata??{},index:L.index}),s.current[L.index]=L.element,o&&(o.current[L.index]=L.registration.label!==void 0?L.registration.label:((V=(_=L.registration.textRef)==null?void 0:_.current)==null?void 0:V.textContent)??L.element.textContent)}),v.current=s.current.length,P});function C(D){var _;if((_=x.current)==null||_.disconnect(),x.current=null,typeof MutationObserver!="function"||D.length<2)return;const P=new MutationObserver(V=>{if(!zH(V))return;let I=null;for(const X of D)if(X.isConnected){if(I&&gO(I,X)>0){P.disconnect(),S();return}I=X}});x.current=P;const L=new Set;for(let V=1;V<D.length;V+=1){const I=MH(D[V-1],D[V]);I&&L.add(I)}L.forEach(V=>P.observe(V,{childList:!0}))}const j=Ie(()=>{const[D,P]=AH(g),L=R(D),_=p.current,V=!_||_.length!==D.length||D.some((I,X)=>{const Y=_[X];return I.index!==Y.index||I.element!==Y.element||I.registration.index!==Y.registration.index||I.registration.metadata!==Y.registration.metadata});C(P),p.current=D,b.current=!1,V&&(m.forEach(I=>I(L)),c(L))});Me(()=>(!b.current&&p.current&&R(p.current),()=>{s.current=[],o&&(o.current=[])}),[s,o,R]),Me(()=>{b.current&&j()}),Me(()=>()=>{var D;(D=x.current)==null||D.disconnect(),b.current=!0},[]);const O=Ie(D=>(m.add(D),()=>{m.delete(D)})),k=y.useMemo(()=>({register:w,unregister:E,subscribeMapChange:O,nextIndexRef:v}),[w,E,O,v]);return d.jsx(pO.Provider,{value:k,children:t})}function kH(){return new Map}function _H(){return new Set}function AH(e){const t=new Set,s=[],o=[];e.forEach((c,u)=>{if(!u.isConnected)return;const m=c.index,g={index:m??-1,element:u,registration:c};m===null?o.push(g):m>=0&&(t.add(m),s.push(g))});let a=0;return o.sort((c,u)=>gO(c.element,u.element)),o.forEach(c=>{for(;t.has(a);)a+=1;c.index=a,s.push(c),a+=1}),t.size>0&&s.sort((c,u)=>c.index-u.index),[s,o.map(c=>c.element)]}function MH(e,t){let s=e.parentElement;for(;s&&!s.contains(t);)s=s.parentElement;return s}function zH(e){for(const t of e)for(let s=0;s<t.removedNodes.length;s+=1)if(t.removedNodes[s].isConnected)return!0;return!1}function gO(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const vO=y.createContext(void 0);function Ex(){const e=y.useContext(vO);if(!e)throw new Error(mn(59));return e}const Tx=y.forwardRef(function(t,s){const{cutout:o,...a}=t;let c;if(o){const u=o.getBoundingClientRect();c=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${u.left}px ${u.top}px,${u.left}px ${u.bottom}px,${u.right}px ${u.bottom}px,${u.right}px ${u.top}px,${u.left}px ${u.top}px)`}return d.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});function th(e,t){e&&Object.assign(e.style,t)}const bO={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};let pR={},gR={},vR="";function Vh(e,t){return td(e)?e:t}function bR(e,t,s){return/hidden|clip/.test(e.getComputedStyle(Vh(t,s)).overflowY)}function DH(e){if(typeof document>"u")return!1;const t=Tt(e);return Kt(t).innerWidth-t.documentElement.clientWidth>0}function IH(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=Tt(e),o=s.documentElement,a=s.body,c=Vh(o,a),u=c.style.overflowY,m=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",c.style.overflowY="scroll";const g=c.offsetWidth;c.style.overflowY="hidden";const v=c.offsetWidth;return c.style.overflowY=u,o.style.scrollbarGutter=m,g===v}function PH(e){const t=Tt(e),s=t.documentElement,o=t.body,a=Vh(s,o),c={overflowY:a.style.overflowY,overflowX:a.style.overflowX};return Object.assign(a.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(a.style,c)}}function LH(e){var S;const t=Tt(e),s=t.documentElement,o=t.body,a=Kt(s);let c=0,u=0,m=!1;const g=fr.create();if(Fs&&(((S=a.visualViewport)==null?void 0:S.scale)??1)!==1)return()=>{};function v(){const w=a.getComputedStyle(s),E=a.getComputedStyle(o),j=(w.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=s.scrollTop,u=s.scrollLeft,pR={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},vR=s.style.scrollBehavior,gR={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const O=s.scrollHeight>s.clientHeight,k=s.scrollWidth>s.clientWidth,D=w.overflowY==="scroll"||E.overflowY==="scroll",P=w.overflowX==="scroll"||E.overflowX==="scroll",L=Math.max(0,a.innerWidth-o.clientWidth),_=Math.max(0,a.innerHeight-o.clientHeight),V=parseFloat(E.marginTop)+parseFloat(E.marginBottom),I=parseFloat(E.marginLeft)+parseFloat(E.marginRight),X=Vh(s,o);if(m=IH(e),m){s.style.scrollbarGutter=j,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:j,overflowY:"hidden",overflowX:"hidden"}),(O||D)&&(s.style.overflowY="scroll"),(k||P)&&(s.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:V||_?`calc(100dvh - ${V+_}px)`:"100dvh",width:I||L?`calc(100vw - ${I+L}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),o.scrollTop=c,o.scrollLeft=u,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function b(){Object.assign(s.style,pR),Object.assign(o.style,gR),m||(s.scrollTop=c,s.scrollLeft=u,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=vR)}function p(){b(),g.request(v)}v();const x=Et(a,"resize",p);return()=>{g.cancel(),b(),typeof a.removeEventListener=="function"&&x()}}class UH{constructor(){yt(this,"lockCount",0);yt(this,"restore",null);yt(this,"timeoutLock",bs.create());yt(this,"timeoutUnlock",bs.create());yt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});yt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const s=Tt(t),o=s.documentElement,a=s.body,c=Kt(o);if(bR(c,o,a)){const m=new c.MutationObserver(()=>{bR(c,o,a)||(m.disconnect(),this.restore=null,this.lock(t))}),g={attributes:!0};m.observe(o,g),m.observe(a,g),this.restore=()=>m.disconnect();return}const u=yh||!DH(t);this.restore=u?PH(t):LH(t)}}const BH=new UH;function yO(e=!0,t=null){Me(()=>{if(e)return BH.acquire(t)},[e,t])}const HH=20;function xO(e,t,s,o){const[a,c]=y.useState(!1);Me(()=>{if(!e||!t||s==null){c(!1);return}const u=Tt(s).documentElement.clientWidth,m=s.offsetWidth;c(u>0&&m>0&&m>=u-HH)},[e,t,s]),yO(e&&(!t||a),o)}const FH={position:"fixed"},VH=y.forwardRef(function(t,s){const{anchor:o,className:a,render:c,positionMethod:u,side:m,align:g,sideOffset:v,alignOffset:b,collisionBoundary:p="clipping-ancestors",collisionPadding:x,arrowPadding:S,sticky:w,disableAnchorTracking:E,alignItemWithTrigger:R=!0,collisionAvoidance:C=Y2,style:j,...O}=t,k=Vs(),D=oO(),P=k.useState("open"),L=k.useState("mounted"),_=k.useState("modal"),V=k.useState("value"),I=k.useState("openMethod"),X=k.useState("positionerElement"),Y=k.useState("triggerElement"),q=k.useState("isItemEqualToValue"),$=k.useState("transitionStatus"),G=y.useRef(null),H=y.useRef(null),[K,B]=y.useState(R),A=L&&K&&I!=="touch";!L&&K!==R&&B(R),y.useImperativeHandle(k.context.alignItemWithTriggerActiveRef,()=>A),xO((A||_)&&P,I==="touch",X,Y);const U=mx({anchor:o,floatingRootContext:D,positionMethod:u,mounted:L,side:m,sideOffset:v,align:g,alignOffset:b,arrowPadding:S,collisionBoundary:p,collisionPadding:x,sticky:w,disableAnchorTracking:E??A,collisionAvoidance:C,keepMounted:!0}),J=A?"none":U.side,F=A?FH:U.positionerStyles,oe={open:P,side:J,align:U.align,anchorHidden:U.anchorHidden};Me(()=>{k.set("popupSide",U.side)},[k,U.side]);const N=k.useStateSetter("positionerElement"),z=hx(t,oe,{styles:F,transitionStatus:$,props:O,refs:[s,N],hidden:!L,inert:!P}),Z=y.useRef(0),te=Ie(W=>{if(k.context.valuesRef.current.length===0)return;const be=Z.current;Z.current=W.size;const de=dt(lr);if(be!==0&&!k.state.multiple&&V!==null&&Mm(k.context.valuesRef.current,V,q)===-1){const xe=k.context.initialValueRef.current,we=xe!=null&&Mm(k.context.valuesRef.current,xe,q)!==-1?xe:null;k.context.setValue(we,de),we===null&&(k.set("selectedIndex",null),k.context.selectedItemTextRef.current=null)}if(be!==0&&k.state.multiple&&Array.isArray(V)){const fe=V.filter(xe=>Mm(k.context.valuesRef.current,xe,q)!==-1);fe.length!==V.length&&(k.context.setValue(fe,de),fe.length===0&&(k.set("selectedIndex",null),k.context.selectedItemTextRef.current=null))}if(P&&A){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const fe={height:""};th(X,fe),th(k.context.popupRef.current,fe)}}),ue=y.useMemo(()=>({...U,side:J,alignItemWithTriggerActive:A,setControlledAlignItemWithTrigger:B,scrollUpArrowRef:G,scrollDownArrowRef:H}),[U,J,A,B]);return d.jsx(hd,{elementsRef:k.context.listRef,labelsRef:k.context.labelsRef,onMapChange:te,children:d.jsxs(vO.Provider,{value:ue,children:[L&&_&&d.jsx(Tx,{inert:px(!P),cutout:Y}),z]})})}),pm="base-ui-disable-scrollbar",Qb={className:pm,getElement(e){return d.jsx("style",{nonce:e,href:pm,precedence:"base-ui:low",children:`.${pm}{scrollbar-width:none}.${pm}::-webkit-scrollbar{display:none}`})}},qH=y.createContext(void 0);function Rx(e){return y.useContext(qH)}const nh="ArrowUp",rh="ArrowDown",sh="ArrowLeft",oh="ArrowRight",ih="Home",ah="End",wO="PageUp",SO="PageDown",gc=new Set([nh,rh,sh,oh,ih,ah]),$H="Shift",ZH=[$H,"Control","Alt","Meta"];function KH(e){return rn(e)&&e.tagName==="INPUT"}function yR(e){return!!(KH(e)&&e.selectionStart!=null||rn(e)&&e.tagName==="TEXTAREA")}function xR(e,t,s,o){if(!e||!t||!t.scrollTo)return;let a=e.scrollLeft,c=e.scrollTop;const u=e.clientWidth<e.scrollWidth,m=e.clientHeight<e.scrollHeight;if(u&&o!=="vertical"){const g=wR(e,t,"left"),v=gm(e),b=gm(t);s==="ltr"&&(g+t.offsetWidth+b.scrollMarginRight>e.scrollLeft+e.clientWidth-v.scrollPaddingRight?a=g+t.offsetWidth+b.scrollMarginRight-e.clientWidth+v.scrollPaddingRight:g-b.scrollMarginLeft<e.scrollLeft+v.scrollPaddingLeft&&(a=g-b.scrollMarginLeft-v.scrollPaddingLeft)),s==="rtl"&&(g-b.scrollMarginLeft<e.scrollLeft+v.scrollPaddingLeft?a=g-b.scrollMarginLeft-v.scrollPaddingLeft:g+t.offsetWidth+b.scrollMarginRight>e.scrollLeft+e.clientWidth-v.scrollPaddingRight&&(a=g+t.offsetWidth+b.scrollMarginRight-e.clientWidth+v.scrollPaddingRight))}if(m&&o!=="horizontal"){const g=wR(e,t,"top"),v=gm(e),b=gm(t);g-b.scrollMarginTop<e.scrollTop+v.scrollPaddingTop?c=g-b.scrollMarginTop-v.scrollPaddingTop:g+t.offsetHeight+b.scrollMarginBottom>e.scrollTop+e.clientHeight-v.scrollPaddingBottom&&(c=g+t.offsetHeight+b.scrollMarginBottom-e.clientHeight+v.scrollPaddingBottom)}e.scrollTo({left:a,top:c,behavior:"auto"})}function wR(e,t,s){const o=s==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[o],t.offsetParent!==e);)t=t.offsetParent;return a}function gm(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const YH=y.createContext(void 0),GH={disableStyleElements:!1};function EO(){return y.useContext(YH)??GH}const SR="--transform-origin",QH={...nd,...Ti},XH=y.forwardRef(function(t,s){const{render:o,className:a,style:c,finalFocus:u,...m}=t,g=Vs(),v=g.useState("multiple"),b=g.useState("readOnly"),p=g.useState("highlightItemOnHover"),x=oO(),{side:S,align:w,alignItemWithTriggerActive:E,isPositioned:R,setControlledAlignItemWithTrigger:C}=Ex(),j=Rx()!=null,O=fc(),{nonce:k,disableStyleElements:D}=EO(),P=g.useState("id"),L=g.useState("open"),_=g.useState("openMethod"),V=g.useState("mounted"),I=g.useState("popupProps"),X=g.useState("transitionStatus"),Y=g.useState("triggerElement"),q=g.useState("positionerElement"),$=g.useState("listElement"),G=y.useRef(!1),H=y.useRef(!1),K=y.useRef({}),B=xa(),A=Ie(oe=>{if(!q||!g.context.popupRef.current||!H.current)return;const N=q.style.top==="0px",z=q.style.bottom==="0px";if(G.current||!E||!N&&!z){g.context.handleScrollArrowVisibility(oe);return}const Z=TR(q),te=Nu(q.getBoundingClientRect().height,"y",Z),ue=Tt(q),W=Kt(q),be=W.getComputedStyle(q),de=parseFloat(be.marginTop),fe=parseFloat(be.marginBottom),xe=ER(W.getComputedStyle(g.context.popupRef.current)),pe=Math.min(ue.documentElement.clientHeight-de-fe,xe),we=oe.scrollTop,Oe=vm(oe);let ke=null;const Pe=ye=>{q.style.height=`${ye}px`},Te=N?Oe-we:we,He=Math.min(te+Te,pe);if(Te<=ms){const ye=Fn(Te,0,pe-te);ye>0&&Pe(te+ye),oe.scrollTop=N?Oe:0,pe-(te+ye)<=ms&&(G.current=!0),g.context.handleScrollArrowVisibility(oe);return}if(pe-He>ms)ke=N?1/0:0;else if(z&&we<Oe){const ye=te+Te-pe;ke=we-(Te-ye)}const se=Math.ceil(He);if(se!==0&&Pe(se),ke!=null){const ye=Fn(ke,0,vm(oe));Math.abs(oe.scrollTop-ye)>ms&&(oe.scrollTop=ye)}se>=pe-ms&&(G.current=!0),g.context.handleScrollArrowVisibility(oe)});y.useImperativeHandle(g.context.scrollHandlerRef,()=>A,[A]),Ro({open:L,ref:g.context.popupRef,onComplete(){L&&g.context.onOpenChangeComplete(!0)}});const U={open:L,transitionStatus:X,side:S,align:w};Me(()=>{!q||!g.context.popupRef.current||Object.keys(K.current).length||(K.current={top:q.style.top||"0",left:q.style.left||"0",right:q.style.right,height:q.style.height,bottom:q.style.bottom,minHeight:q.style.minHeight,maxHeight:q.style.maxHeight,marginTop:q.style.marginTop,marginBottom:q.style.marginBottom})},[g,q]),Me(()=>{L||E||(H.current=!1,G.current=!1,th(q,K.current))},[L,E,q]),Me(()=>{var z,Z;const oe=g.context.popupRef.current;if(!L||!Y||!q||!oe||E&&!R||g.state.transitionStatus==="ending")return;if(H.current=!0,oe.style.removeProperty(SR),!E){B.request(()=>g.context.handleScrollArrowVisibility($||oe));return}const N=JH(oe);try{let te=g.context.selectedItemTextRef.current;te!=null&&te.isConnected||(te=!g.select("hasSelectedValue")&&((z=g.context.firstItemTextRef.current)!=null&&z.isConnected)?g.context.firstItemTextRef.current:null);const ue=g.context.valueRef.current,W=Kt(q),be=W.getComputedStyle(q),de=W.getComputedStyle(oe),fe=Tt(Y),xe=TR(Y),pe=bm(Y.getBoundingClientRect(),xe),we=bm(q.getBoundingClientRect(),xe),Oe=pe.height,ke=$||oe,Pe=ke.scrollHeight,Te=parseFloat(de.borderBottomWidth),He=parseFloat(be.marginTop)||10,se=parseFloat(be.marginBottom)||10,ye=parseFloat(be.minHeight)||100,Ae=ER(de),Be=5,ae=5,ve=20,ze=fe.documentElement.clientHeight-He-se,_e=fe.documentElement.clientWidth,Re=ze-pe.bottom+Oe;let Ge,Ye=O==="rtl"?pe.right-we.width:pe.left,mt=0;if(te&&ue){const Bt=bm(ue.getBoundingClientRect(),xe);Ge=bm(te.getBoundingClientRect(),xe),Ye=we.left+(O==="rtl"?Bt.right-Ge.right:Bt.left-Ge.left);const Ft=Bt.top-pe.top+Bt.height/2;mt=Ge.top-we.top+Ge.height/2-Ft}const nt=Re+mt+se+Te;let ut=Math.min(ze,nt);const Rt=ze-He-se,At=nt-ut,it=_e-ae;q.style.left=`${Fn(Ye,Be,it-we.width)}px`,q.style.height=`${ut}px`,q.style.maxHeight="none",q.style.marginTop=`${He}px`,q.style.marginBottom=`${se}px`,oe.style.height="100%";const qe=vm(ke),at=At>=qe-ms;at&&(ut=Math.min(ze,we.height)-(At-qe));const Nt=pe.top<ve||pe.bottom>ze-ve||Math.ceil(ut)+ms<Math.min(Pe,ye),ht=(((Z=W.visualViewport)==null?void 0:Z.scale)??1)!==1&&Fs;if(Nt||ht){th(q,K.current),C(!1);return}const Gt=Math.max(ye,ut);if(at){const Bt=Math.max(0,ze-nt);q.style.top=we.height>=Rt?"0":`${Bt}px`,q.style.height=`${ut}px`,ke.scrollTop=vm(ke)}else q.style.bottom="0",ke.scrollTop=At;if(Ge){const Bt=we.top,Ft=we.height,sn=Ge.top+Ge.height/2,rt=Fn(Ft>0?(sn-Bt)/Ft*100:50,0,100);oe.style.setProperty(SR,`50% ${rt}%`)}(Gt===ze||ut>=Ae)&&(G.current=!0),g.context.handleScrollArrowVisibility(ke),p&&g.state.selectedIndex===null&&g.state.activeIndex===null&&g.context.listRef.current[0]!=null&&g.set("activeIndex",0)}finally{N()}},[g,L,q,Y,E,C,B,$,p,O,R]),y.useEffect(()=>{if(!E||!q||!L)return;const oe=Kt(q);function N(z){g.context.setOpen(!1,dt(X6,z))}return Et(oe,"resize",N)},[g,E,q,L]);const J={...$?{role:"presentation"}:{role:"listbox","aria-multiselectable":v||void 0,"aria-readonly":b||void 0,id:`${P}-list`},onKeyDown(oe){j&&gc.has(oe.key)&&oe.stopPropagation()},onScroll(oe){$||A(oe.currentTarget)},...E&&{style:$?{height:"100%"}:bO},className:!$&&E?Qb.className:void 0},F=vt("div",t,{ref:[s,g.context.popupRef],state:U,stateAttributesMapping:QH,props:[I,J,Uh(X),m]});return d.jsxs(y.Fragment,{children:[!D&&Qb.getElement(k),d.jsx(Wy,{context:x,modal:!1,disabled:!V,openInteractionType:_,returnFocus:u,restoreFocus:!0,children:F})]})});function ER(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function vm(e){return Sx(e.scrollHeight,e.clientHeight)}function TR(e){return Sj.getScale(e)}function Nu(e,t,s){return e/s[t]}function bm(e,t){return Fu({x:Nu(e.x,"x",t),y:Nu(e.y,"y",t),width:Nu(e.width,"x",t),height:Nu(e.height,"y",t)})}const RR=[["transform","none"],["scale","1"],["translate","0 0"]];function JH(e){const{style:t}=e,s={};for(const[o,a]of RR)s[o]=t.getPropertyValue(o),t.setProperty(o,a,"important");return()=>{for(const[o]of RR){const a=s[o];a?t.setProperty(o,a):t.removeProperty(o)}}}const WH=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,m=Vs(),g=m.useState("multiple"),v=m.useState("readOnly"),{alignItemWithTriggerActive:b}=Ex(),p=m.useState("hasScrollArrows"),x=m.useState("openMethod"),w={id:`${m.useState("id")}-list`,role:"listbox","aria-multiselectable":g||void 0,"aria-readonly":v||void 0,onScroll(R){var C,j;(j=(C=m.context.scrollHandlerRef).current)==null||j.call(C,R.currentTarget)},...b&&{style:bO},className:p&&x!=="touch"?Qb.className:void 0},E=m.useStateSetter("listElement");return vt("div",t,{ref:[s,E],props:[w,u]})});function qh(e={}){const{guess:t,label:s,metadata:o,textRef:a,index:c}=e,{register:u,unregister:m,subscribeMapChange:g,nextIndexRef:v}=OH(),b=y.useRef(-1),[p,x]=y.useState(c==null&&t?()=>{if(b.current===-1){const R=v.current;v.current+=1,b.current=R}return b.current}:-1),S=c??p,w=y.useRef(null),E=y.useCallback(R=>{const C=w.current;C&&m(C),w.current=R,R&&u(R,{metadata:o??null,index:c??null,label:s,textRef:a})},[c,u,m,o,s,a]);return Me(()=>{if(c==null)return g(R=>{var j;const C=w.current?(j=R.get(w.current))==null?void 0:j.index:null;C!=null&&x(C)})},[c,g]),{ref:E,index:S}}const TO=y.createContext(void 0);function RO(){const e=y.useContext(TO);if(!e)throw new Error(mn(57));return e}const e9=y.memo(y.forwardRef(function(t,s){const{render:o,className:a,style:c,value:u=null,label:m,disabled:g=!1,nativeButton:v=!1,...b}=t,p=y.useRef(null),x=qh({guess:!0,label:m,textRef:p}),S=Vs(),{props:w,multiple:E,disabled:R,readOnly:C,isItemEqualToValue:j}=S.useState("itemRoot"),O=R||g,k=S.useState("isActive",x.index),D=S.useState("open"),P=S.useState("isSelected",u),L=S.useState("isSelectedByFocus",x.index),_=x.index,V=y.useRef(null);Me(()=>{const U=S.context.valuesRef.current;return U[_]=u,()=>{delete U[_]}},[_,u,S]),Me(()=>{const U=S.state.value,J=S.state.selectedIndex;let F=J,oe;E&&Array.isArray(U)?(F=uH(_,u,S.context.valuesRef.current,U,j,J),oe=F===_,_===J&&!oe&&(S.context.selectedItemTextRef.current=null)):(oe=U!==void 0&&Ea(u,U,j),oe&&(F=_)),S.set("selectedIndex",F),oe&&p.current&&(S.context.selectedItemTextRef.current=p.current)},[_,E,j,S,u]);const I=y.useRef("mouse"),X=y.useRef(!1),{getButtonProps:Y,buttonRef:q}=ss({disabled:O,focusableWhenDisabled:!0,native:v,composite:!0}),$={disabled:O,selected:P,highlighted:k};function G(U){if(R||C)return;const J=S.state.value;if(E){const F=Array.isArray(J)?J:[],oe=P?dH(F,u,j):[...F,u];S.context.setValue(oe,dt(kl,U))}else S.context.setValue(u,dt(kl,U)),S.context.setOpen(!1,dt(kl,U))}function H(){S.context.selectionRef.current.dragY=0}const K={role:"option","aria-selected":P,tabIndex:D&&k?0:-1,onKeyDown(U){S.set("activeIndex",_),U.key===" "&&S.context.typingRef.current&&U.preventDefault()},onClick(U){const J=I.current!=="touch",F=U.nativeEvent.pointerType,oe=J&&sc(U.nativeEvent)&&(F!==void 0||k),N=J&&!oe&&!X.current;X.current=!1,!(O||N)&&G(U.nativeEvent)},onPointerEnter(U){I.current=U.pointerType},onPointerMove(U){if(U.pointerType==="mouse"&&U.buttons===1){const J=S.context.selectionRef.current;J.dragY+=U.movementY,J.dragY**2>=64&&(J.allowUnselectedMouseUp=!0)}},onPointerDown(U){I.current=U.pointerType,X.current=!0,H()},onMouseUp(){var F;if(H(),O||I.current==="touch"||X.current)return;const U=!S.context.selectionRef.current.allowSelectedMouseUp&&P,J=!S.context.selectionRef.current.allowUnselectedMouseUp&&!P;U||J||(X.current=!0,(F=V.current)==null||F.click(),X.current=!1)}},B=vt("div",t,{ref:[q,s,x.ref,V],state:$,props:[w,K,b,Y]}),A=y.useMemo(()=>({selected:P,index:_,textRef:p,selectedByFocus:L}),[P,_,p,L]);return d.jsx(TO.Provider,{value:A,children:B})})),t9=y.memo(y.forwardRef(function(t,s){const{render:o,className:a,style:c,keepMounted:u,selected:m,...g}=t,v=y.useRef(null),{transitionStatus:b,setMounted:p}=od(m),S=vt("span",t,{ref:[s,v],state:{selected:m,transitionStatus:b},props:[{"aria-hidden":!0,children:"✔️"},g],stateAttributesMapping:Ti});return Ro({batch:!0,enabled:!m,open:m,ref:v,onComplete(){m||p(!1)}}),S})),n9=y.forwardRef(function(t,s){const{selected:o}=RO();return t.keepMounted||o?d.jsx(t9,{...t,selected:o,ref:s}):null}),r9=y.memo(y.forwardRef(function(t,s){const{index:o,textRef:a,selectedByFocus:c}=RO(),u=Vs(),{render:m,className:g,style:v,...b}=t,p=y.useCallback(S=>{S&&(o===0&&(u.context.firstItemTextRef.current=S),c&&(u.context.selectedItemTextRef.current=S))},[u,o,c]);return vt("div",t,{ref:[p,s,a],props:b})})),CO=y.forwardRef(function(t,s){const{render:o,className:a,style:c,direction:u,keepMounted:m,...g}=t,v=u==="up",b=Vs(),{side:p,scrollDownArrowRef:x,scrollUpArrowRef:S}=Ex(),w=v?"scrollUpArrowVisible":"scrollDownArrowVisible",E=b.useState(w),R=b.useState("openMethod"),C=E&&R!=="touch",j=Rn(),O=v?S:x,{mounted:k,transitionStatus:D,setMounted:P}=od(C);Me(()=>(b.context.scrollArrowsMountedCountRef.current+=1,b.set("hasScrollArrows",!0),()=>{b.context.scrollArrowsMountedCountRef.current=Math.max(0,b.context.scrollArrowsMountedCountRef.current-1),b.context.scrollArrowsMountedCountRef.current===0&&b.set("hasScrollArrows",!1)}),[b]),Ro({open:C,ref:O,onComplete(){C||P(!1)}});const V=vt("div",t,{ref:[s,O],state:{direction:u,visible:C,side:p,transitionStatus:D},props:[{"aria-hidden":!0,children:v?"▲":"▼",style:{position:"absolute"},onMouseMove(X){if(X.movementX===0&&X.movementY===0||j.isStarted())return;b.set("activeIndex",null);function Y(){var B;const q=b.state.listElement??b.context.popupRef.current;if(!q)return;b.set("activeIndex",null),b.context.handleScrollArrowVisibility(q);const $=Sx(q.scrollHeight,q.clientHeight),G=eh(q.scrollTop,$),H=G===(v?0:$),K=b.context.listRef.current;if(G!==q.scrollTop&&(q.scrollTop=G),H){j.clear();return}if(K.length>0){const A=((B=O.current)==null?void 0:B.offsetHeight)||0;q.scrollTop=s9(K,v,G,q.clientHeight,A,$)}j.start(40,Y)}j.start(40,Y)},onMouseLeave(){j.clear()}},g],stateAttributesMapping:Ti});return k||m?V:null});function s9(e,t,s,o,a,c){if(t){let b=0;const p=s+a-ms;for(let w=0;w<e.length;w+=1){const E=e[w];if(E&&E.offsetTop>=p){b=w;break}}const x=Math.max(0,b-1),S=e[x];return x<b&&S?eh(S.offsetTop-a,c):0}let u=e.length-1;const m=s+o-a+ms;for(let b=0;b<e.length;b+=1){const p=e[b];if(p&&p.offsetTop+p.offsetHeight>m){u=Math.max(0,b-1);break}}const g=Math.min(e.length-1,u+1),v=e[g];return g>u&&v?eh(v.offsetTop+v.offsetHeight-o+a,c):c}const o9=y.forwardRef(function(t,s){return d.jsx(CO,{...t,ref:s,direction:"down"})}),i9=y.forwardRef(function(t,s){return d.jsx(CO,{...t,ref:s,direction:"up"})}),$h=bH;function Zh({className:e,...t}){return d.jsx(CH,{"data-slot":"select-value",className:De("flex flex-1 text-left",e),...t})}function Kh({className:e,size:t="default",children:s,...o}){return d.jsxs(TH,{"data-slot":"select-trigger","data-size":t,className:De("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[s,d.jsx(NH,{render:d.jsx(gh,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Yh({className:e,children:t,side:s="bottom",sideOffset:o=4,align:a="center",alignOffset:c=0,alignItemWithTrigger:u=!0,...m}){return d.jsx(jH,{children:d.jsx(VH,{side:s,sideOffset:o,align:a,alignOffset:c,alignItemWithTrigger:u,className:"isolate z-50",children:d.jsxs(XH,{"data-slot":"select-content","data-align-trigger":u,className:De("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...m,children:[d.jsx(a9,{}),d.jsx(WH,{children:t}),d.jsx(l9,{})]})})})}function Vu({className:e,children:t,...s}){return d.jsxs(e9,{"data-slot":"select-item",className:De("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground 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),...s,children:[d.jsx(r9,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),d.jsx(n9,{render:d.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:d.jsx(kN,{className:"pointer-events-none"})})]})}function a9({className:e,...t}){return d.jsx(i9,{"data-slot":"select-scroll-up-button",className:De("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:d.jsx(p5,{})})}function l9({className:e,...t}){return d.jsx(o9,{"data-slot":"select-scroll-down-button",className:De("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:d.jsx(gh,{})})}const NO=y.createContext(void 0);function c9(){const e=y.useContext(NO);if(e===void 0)throw new Error(mn(63));return e}const u9="data-checked",d9="data-unchecked",jO={...ud,checked(e){return e?{[u9]:""}:{[d9]:""}}},f9=y.forwardRef(function(t,s){const{checked:o,className:a,defaultChecked:c,"aria-labelledby":u,form:m,id:g,inputRef:v,name:b,nativeButton:p=!1,onCheckedChange:x,readOnly:S=!1,required:w=!1,disabled:E=!1,render:R,uncheckedValue:C,value:j,style:O,...k}=t,{clearErrors:D}=md(),{state:P,setTouched:L,setDirty:_,validityData:V,setFilled:I,validationMode:X,disabled:Y,name:q,validation:$}=No(),{labelId:G}=mc(),H=Y||E,K=q??b,B=y.useRef(null),A=Vr(B,v,$.inputRef),U=y.useRef(null),J=dd(H,U),F=Qn(),oe=hc({id:g}),N=p?void 0:oe,[z,Z]=So({controlled:o,default:!!c,name:"Switch",state:"checked"});fd(U,F,z,void 0,!H,b),Me(()=>{I(z)},[z,I]),pc(z,()=>{D(K),_(z!==V.initialValue),$.change(z)});const{getButtonProps:te,buttonRef:ue}=ss({disabled:H,native:p}),W=Wj(u,G,B,!p,N,k["aria-label"]),be={id:p?oe:F,role:"switch","aria-checked":z,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":W,onFocus(){J(!0)},onBlur(){const pe=B.current;!pe||H||(L(!0),J(!1),X==="onBlur"&&$.commit(pe.checked))},onClick(pe){if(S||H)return;pe.preventDefault();const we=B.current;we&&Pl(we,pe)}},de={...$.getValidationProps(H),checked:z,disabled:H,form:m,id:N,name:K,required:w,style:K?Vy:wa,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:A,onChange(pe){if(pe.nativeEvent.defaultPrevented)return;if(S){pe.preventDefault();return}const we=pe.currentTarget.checked,Oe=dt(lr,pe.nativeEvent);x==null||x(we,Oe),!Oe.isCanceled&&Z(we)},onClick(pe){pe.stopPropagation()},onFocus(){var pe;(pe=U.current)==null||pe.focus()},...j!==void 0?{value:j}:Ut},fe=y.useMemo(()=>({...P,checked:z,disabled:H,readOnly:S,required:w}),[P,z,H,S,w]),xe=vt("span",t,{state:fe,ref:[s,U,ue],props:[be,k,te,pe=>$.getValidationProps(H,pe)],stateAttributesMapping:jO});return d.jsxs(NO.Provider,{value:fe,children:[xe,!z&&K&&C!==void 0&&d.jsx("input",{type:"hidden",form:m,name:K,value:C,disabled:H}),d.jsx("input",{...de,suppressHydrationWarning:!0})]})}),m9=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,m=c9();return vt("span",t,{state:m,ref:s,stateAttributesMapping:jO,props:u})});function CR({className:e,size:t="default",...s}){return d.jsx(f9,{"data-slot":"switch","data-size":t,className:De("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...s,children:d.jsx(m9,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}class qu extends Error{constructor(t,s,o){super(t),this.code=s,this.params=o}}function OO(){return Wt({queryKey:["server"],queryFn:Qe.server,staleTime:Number.POSITIVE_INFINITY}).data}function p$(){var t;const e=(t=OO())==null?void 0:t.mode;return e==="server"||e==="demo"}function ji(){const e=OO();return(e==null?void 0:e.mode)==="demo"?e.demo??null:null}let Ll=null,Ul=null;function h9(e){return Ul=e,()=>{Ul===e&&(Ul=null)}}function p9(e){return Ll=e,()=>{Ll===e&&(Ll=null)}}const kO="hatchlight.visitor";let Is=null,tb=null,Bl=null;function g9(){try{return sessionStorage.getItem(kO)}catch{return null}}async function _O(e=!1){const t=e?null:(Is==null?void 0:Is.token)??g9(),s=await fetch("/api/visitor",{method:"POST",headers:t?{authorization:`Bearer ${t}`}:{}}),o=await s.json().catch(()=>null);if(!s.ok||typeof(o==null?void 0:o.token)!="string")throw new qu((o==null?void 0:o.error)??`Request failed (HTTP ${s.status})`,typeof(o==null?void 0:o.code)=="string"?o.code:void 0,(o==null?void 0:o.params)??void 0);Is={token:o.token,mediaKey:o.mediaKey};try{sessionStorage.setItem(kO,o.token)}catch{}return Is}function v9(){return tb??(tb=_O(!0).then(e=>(Bl==null||Bl(),e)).finally(()=>{tb=null})),tb}function b9(e){return Bl=e,()=>{Bl===e&&(Bl=null)}}function AO(){return Is?{authorization:`Bearer ${Is.token}`}:{}}async function MO(e,t){const s=c=>{const u=new Headers(c);for(const[m,g]of Object.entries(AO()))u.set(m,g);return{...t,headers:u}},o=await fetch(e,s(t==null?void 0:t.headers));if(o.status!==401||!Is)return o;const a=await o.clone().json().catch(()=>null);return(a==null?void 0:a.code)!=="visitorRequired"?o:(await v9(),fetch(e,s(t==null?void 0:t.headers)))}async function Ve(e,t){const s=await MO(e,t);if(!s.ok){const o=await s.json().catch(()=>null);throw((o==null?void 0:o.code)==="signInRequired"||(o==null?void 0:o.code)==="passwordChangeRequired")&&(Ll==null||Ll()),(o==null?void 0:o.code)==="storageFull"&&(Ul==null||Ul()),new qu((o==null?void 0:o.error)??`Request failed (HTTP ${s.status})`,typeof(o==null?void 0:o.code)=="string"?o.code:void 0,(o==null?void 0:o.params)??void 0)}return s.status===200||s.status===201?s.json():void 0}const dn=(e,t)=>({method:e,headers:{"content-type":"application/json"},body:JSON.stringify(t)}),Qe={models:()=>Ve("/api/models"),providers:()=>Ve("/api/providers"),setKey:(e,t)=>Ve(`/api/providers/${e}/key`,dn("PUT",{key:t})),setOwnKey:(e,t)=>Ve(`/api/account/keys/${e}`,dn("PUT",{key:t})),deleteOwnKey:e=>Ve(`/api/account/keys/${e}`,{method:"DELETE"}),deleteKey:e=>Ve(`/api/providers/${e}/key`,{method:"DELETE"}),sessions:()=>Ve("/api/sessions"),session:e=>Ve(`/api/sessions/${e}`),deleteSession:e=>Ve(`/api/sessions/${e}`,{method:"DELETE"}),createTurn:e=>Ve("/api/turns",dn("POST",e)),improvePrompt:(e,t)=>Ve("/api/prompts/improve",{...dn("POST",e),signal:t}),assistant:()=>Ve("/api/assistant"),assistantView:e=>Ve(`/api/sessions/${e}/assistant`),sendToAssistant:e=>Ve("/api/assistant/messages",dn("POST",e)),stopAssistant:e=>Ve(`/api/sessions/${e}/assistant/stop`,dn("POST",{})),answerAssistant:(e,t)=>Ve(`/api/sessions/${e}/assistant/answers`,dn("POST",t)),cancelJob:e=>Ve(`/api/jobs/${e}/cancel`,{method:"POST"}),server:()=>Ve("/api/server"),setupNeeded:()=>Ve("/api/setup"),setup:e=>Ve("/api/setup",dn("POST",e)),login:e=>Ve("/api/login",dn("POST",e)),logout:()=>Ve("/api/logout",{method:"POST"}),account:()=>Ve("/api/account"),dismissResetNotice:()=>Ve("/api/account/reset-notice",{method:"DELETE"}),changePassword:e=>Ve("/api/account/password",dn("PUT",e)),accountSessions:()=>Ve("/api/account/sessions"),revokeSession:e=>Ve(`/api/account/sessions/${e}`,{method:"DELETE"}),revokeOtherSessions:e=>Ve(`/api/account/sessions${e?"?tokens=true":""}`,{method:"DELETE"}),tokens:()=>Ve("/api/account/tokens"),createToken:e=>Ve("/api/account/tokens",dn("POST",e)),revokeToken:e=>Ve(`/api/account/tokens/${e}`,{method:"DELETE"}),userTokens:e=>Ve(`/api/users/${e}/tokens`),revokeUserToken:(e,t)=>Ve(`/api/users/${e}/tokens/${t}`,{method:"DELETE"}),startTotp:()=>Ve("/api/account/totp",{method:"POST"}),enableTotp:e=>Ve("/api/account/totp",dn("PUT",e)),disableTotp:e=>Ve("/api/account/totp",dn("DELETE",e)),invite:e=>Ve(`/api/invites/${e}`),acceptInvite:(e,t)=>Ve(`/api/invites/${e}/accept`,dn("POST",t)),invites:()=>Ve("/api/invites"),createInvite:e=>Ve("/api/invites",dn("POST",e)),deleteInvite:e=>Ve(`/api/invites/${e}`,{method:"DELETE"}),users:()=>Ve("/api/users"),updateUser:(e,t)=>Ve(`/api/users/${e}`,dn("PATCH",t)),resetPassword:e=>Ve(`/api/users/${e}/password`,{method:"POST"}),passwordReset:e=>Ve(`/api/password-resets/${e}`),setPasswordFromLink:(e,t)=>Ve(`/api/password-resets/${e}`,dn("POST",{password:t})),agents:()=>Ve("/api/agents"),connectClaudeDesktop:e=>Ve("/api/agents/claude-desktop",dn("PUT",e)),disconnectClaudeDesktop:()=>Ve("/api/agents/claude-desktop",{method:"DELETE"}),retryJob:e=>Ve(`/api/jobs/${e}/retry`,{method:"POST"}),upload:e=>Ve("/api/assets",{method:"POST",headers:{"content-type":e.type},body:e}),keysLost:()=>Ve("/api/keys/lost"),dismissKeysLost:()=>Ve("/api/keys/lost",{method:"DELETE"}),deleteAsset:e=>Ve(`/api/assets/${e}`,{method:"DELETE"}),localModels:()=>Ve("/api/local-models"),installModel:(e,t)=>Ve(`/api/local-models/${e}/install`,dn("POST",t?{variant:t}:{})),cancelModel:e=>Ve(`/api/local-models/${e}/cancel`,{method:"POST"}),deleteModel:e=>Ve(`/api/local-models/${e}`,{method:"DELETE"}),checkpoints:()=>Ve("/api/checkpoints"),addCheckpoint:e=>Ve(`/api/checkpoints?${new URLSearchParams({name:e.name})}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:e}),updateCheckpoint:(e,t)=>Ve(`/api/checkpoints/${e}`,dn("PATCH",t)),deleteCheckpoint:e=>Ve(`/api/checkpoints/${e}`,{method:"DELETE"}),trainer:()=>Ve("/api/trainer"),installTrainer:()=>Ve("/api/trainer/install",{method:"POST"}),removeTrainer:()=>Ve("/api/trainer",{method:"DELETE"}),cancelTrainerInstall:()=>Ve("/api/trainer/install/cancel",{method:"POST"}),train:e=>Ve("/api/trainings",dn("POST",e)),cancelTraining:()=>Ve("/api/trainings/cancel",{method:"POST"}),finishTraining:()=>Ve("/api/trainings/finish",{method:"POST"}),captioner:()=>Ve("/api/captioner"),caption:(e,t)=>Ve("/api/captions",{...dn("POST",{assetId:e}),signal:t}),loras:()=>Ve("/api/loras"),addLora:e=>Ve(`/api/loras?${new URLSearchParams({name:e.name})}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:e}),deleteLora:e=>Ve(`/api/loras/${e}`,{method:"DELETE"}),modelFolders:()=>Ve("/api/model-folders"),modelFolderSuggestions:()=>Ve("/api/model-folders/suggestions"),addModelFolder:e=>Ve("/api/model-folders",dn("POST",{path:e})),rescanModelFolders:()=>Ve("/api/model-folders/rescan",{method:"POST"}),removeModelFolder:e=>Ve(`/api/model-folders/${e}`,{method:"DELETE"}),settings:()=>Ve("/api/settings"),saveSettings:e=>Ve("/api/settings",dn("PUT",e)),moveModels:e=>Ve("/api/local-models/location",dn("POST",{path:e})),gallery:(e,t)=>{const s=new URLSearchParams({limit:String(zO)});return e&&s.set("query",e),t&&(s.set("before",String(t.createdAt)),s.set("beforeId",t.id)),Ve(`/api/gallery?${s}`)}},zO=60,Cx=e=>Is?`${e}m=${encodeURIComponent(Is.mediaKey)}`:"",ir=e=>`/api/assets/${e}${Cx("?")}`,NR=(e,t)=>`/api/trainings/${e}/samples/${t}`,y9=(e,t)=>`/api/jobs/${e}/preview?v=${t}${Cx("&")}`,x9=(e,t,s="card")=>`/api/local-models/${e}/demos/${t}?size=${s}${Cx("&")}`,w9="https://hatchlight.app",S9="https://github.com/hatchlight/hatchlight";function E9(){try{return window.self!==window.top}catch{return!0}}function T9({demo:e,children:t}){const{t:s,explain:o}=Xe(),a=On(),c=Wt({queryKey:["visitor"],queryFn:()=>_O(),staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,retry:!1});return y.useEffect(()=>b9(()=>{a.invalidateQueries({predicate:u=>!["visitor","server"].includes(String(u.queryKey[0]))})}),[a]),c.isPending?null:c.isError?d.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[d.jsxs("p",{className:"text-sm text-soft",children:[s("demo.startFailed")," ",o(c.error)]}),d.jsx(Ue,{variant:"outline",onClick:()=>void c.refetch(),children:s("demo.retry")})]}):d.jsxs("div",{className:"flex h-full flex-col",children:[e&&d.jsx(R9,{demo:e}),d.jsx("div",{className:"min-h-0 flex-1",children:t})]})}function R9({demo:e}){const{t}=Xe(),s="font-medium text-ink underline underline-offset-2";return d.jsxs("p",{role:"note",className:"shrink-0 border-b border-line bg-panel px-4 py-1.5 text-center text-xs leading-relaxed text-soft",children:[t("demo.notice",{count:e.ttlHours})," ",d.jsx("a",{href:w9,target:"_blank",rel:"noreferrer",className:s,children:t("demo.install")})," · ",d.jsx("a",{href:S9,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-ink",children:t("demo.source")}),E9()&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("a",{href:window.location.origin,target:"_blank",rel:"noreferrer",className:s,children:t("demo.newTab")})]})]})}function DO(e){return Array.isArray(e)?e.map(t=>DO(t)).join(","):e==null?"":String(e)}const jR=new Map;function C9(e,t){const s=JSON.stringify({locale:DO(e),options:t}),o=jR.get(s);if(o)return o;const a=new Intl.NumberFormat(e,t);return jR.set(s,a),a}function $u(e,t,s){return e==null?"":C9(t,s).format(e)}function lh(e,t,s){return(e-t)*100/(s-t)}const IO=y.createContext(void 0);function PO(){const e=y.useContext(IO);if(e===void 0)throw new Error(mn(51));return e}const N9="data-complete",j9="data-indeterminate",O9="data-progressing",Nx={status(e){return e==="progressing"?{[O9]:""}:e==="complete"?{[N9]:""}:e==="indeterminate"?{[j9]:""}:null}},LO=y.forwardRef(function(t,s){const{format:o,getAriaValueText:a,locale:c,max:u=100,min:m=0,value:g,render:v,className:b,children:p,style:x,...S}=t,[w,E]=y.useState();let R="indeterminate",C=null,j=null,O="",k="indeterminate progress";if(g!=null&&Number.isFinite(g)){const V=lh(g,m,u);C=Fn(Number.isNaN(V)?0:V,0,100),j=Fn(g,m,u),R=j===u?"complete":"progressing",O=o?$u(j,c,o):$u(C/100,c,{style:"percent"}),k=O}const D=y.useMemo(()=>({status:R}),[R]),P={"aria-labelledby":w,"aria-valuemax":u,"aria-valuemin":m,"aria-valuenow":j??void 0,"aria-valuetext":a?a(O,g):k,role:"progressbar",children:d.jsxs(y.Fragment,{children:[p,d.jsx("span",{role:"presentation",style:wa,children:"x"})]})},L=y.useMemo(()=>({formattedValue:O,percentageValue:C,setLabelId:E,state:D,value:g}),[O,C,E,D,g]),_=vt("div",t,{state:D,ref:s,props:[P,S],stateAttributesMapping:Nx});return d.jsx(IO.Provider,{value:L,children:_})}),k9=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,{state:m}=PO();return vt("div",t,{state:m,ref:s,props:u,stateAttributesMapping:Nx})}),_9=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,{percentageValue:m,state:g}=PO(),v=m==null?{}:{insetInlineStart:0,height:"inherit",width:`${m}%`};return vt("div",t,{state:g,ref:s,props:[{style:v},u],stateAttributesMapping:Nx})});function A9({store:e,parentContext:t,isDrawer:s}){const o=e.useState("open"),a=e.useState("mounted"),c=e.useState("disablePointerDismissal"),u=e.useState("modal"),m=e.useState("popupElement"),g=e.useState("floatingRootContext"),[v,b]=y.useState(0),[p,x]=y.useState(0),S=v===0,w=Ah(g,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(E){if(!e.context.outsidePressEnabledRef.current||"button"in E&&E.button!==0)return!1;if("touches"in E){if(E.type==="touchend"){if(E.changedTouches.length!==1||E.touches.length!==0)return!1}else if(E.touches.length!==1)return!1}const R=Pn(E);if(S&&!c){if(u){const C=e.context.internalBackdropRef.current,j=e.context.backdropRef.current;return C||j?C===R||j===R||ot(R,m)&&!(R!=null&&R.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:S});return yO(o&&u===!0,m),e.useContextCallback("onNestedDialogOpen",(E,R)=>{!e.select("open")&&!e.select("mounted")||(b(E),x(R))}),Me(()=>{!o&&!a&&(b(0),x(0))},[o,a]),Me(()=>(t!=null&&t.onNestedDialogOpen&&o&&t.onNestedDialogOpen(v+1,p+(s?1:0)),()=>{t!=null&&t.onNestedDialogOpen&&o&&t.onNestedDialogOpen(0,0)}),[s,o,v,p,t]),ax(e,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:v,nestedOpenDrawerCount:p}),null}const UO=y.createContext(void 0);function Oi(e){const t=y.useContext(UO);if(!e&&t===void 0)throw new Error(mn(27));return t}const M9={...zu,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class z9 extends id{constructor(s,o,a){const c=new Dh,u=D9(s,c,o,a);super(u,I9(c),M9);yt(this,"setOpen",(s,o)=>{var a,c;o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!s&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),(c=(a=this.context).onOpenChange)==null||c.call(a,s,o),!o.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(s,o),this.update(nx(this.state,s,o.trigger)))})}}function D9(e,t,s,o=!1){return{...lx(t,s,o),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function I9(e){return{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function BO(e,t){const{children:s,open:o,defaultOpen:a=!1,onOpenChange:c,onOpenChangeComplete:u,disablePointerDismissal:m=!1,modal:g=!0,actionsRef:v,handle:b,triggerId:p,defaultTriggerId:x=null}=t,S=e==="drawer",w=e==="alert-dialog",E=w?!0:g,R=w||m,C=w?"alertdialog":"dialog",j=Oi(!0),O=j!=null,k={modal:E,disablePointerDismissal:R,nested:O,role:C},D=oj((X,Y)=>new z9({open:a,openProp:o,activeTriggerId:x,triggerIdProp:p,...k},X,Y),!0);D.useControlledProp("openProp",o),D.useControlledProp("triggerIdProp",p),D.useSyncedValues(k),D.useContextCallback("onOpenChange",c),D.useContextCallback("onOpenChangeComplete",u);const P=D.useState("open"),L=D.useState("mounted"),_=D.useState("payload");nU(D,P),ox(D);const{forceUnmount:V}=ix(P,D);y.useImperativeHandle(v,()=>({unmount:V,close:()=>D.setOpen(!1,dt(Nh))}),[V,D]);const I=P||L||b!=null;return d.jsxs(UO.Provider,{value:D,children:[b&&d.jsx(tx,{handle:b,store:D}),I&&d.jsx(A9,{store:D,parentContext:j==null?void 0:j.context,isDrawer:S}),typeof s=="function"?s({payload:_}):s]})}function P9(e){return BO("alert-dialog",e)}const jx=y.forwardRef(function(t,s){const{render:o,className:a,style:c,forceRender:u=!1,...m}=t,g=Oi(),v=g.useState("open"),b=g.useState("nested"),p=g.useState("mounted"),x=g.useState("transitionStatus");return vt("div",t,{state:{open:v,transitionStatus:x},ref:[g.context.backdropRef,s],stateAttributesMapping:Uy,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},m],enabled:u||!b})}),Gh=y.forwardRef(function(t,s){const{render:o,className:a,style:c,disabled:u=!1,nativeButton:m=!0,...g}=t,v=Oi(),b=v.useState("open"),{getButtonProps:p,buttonRef:x}=ss({disabled:u,native:m}),S={disabled:u};function w(E){b&&v.setOpen(!1,dt(K6,E.nativeEvent))}return vt("button",t,{state:S,ref:[s,x],props:[{onClick:w},g,p]})}),Ox=y.forwardRef(function(t,s){const{render:o,className:a,style:c,id:u,...m}=t,g=Oi(),v=Qn(u);return g.useSyncedValueWithCleanup("descriptionElementId",v),vt("p",t,{ref:s,props:[{id:v},m]})}),HO=y.createContext(void 0);function L9(){const e=y.useContext(HO);if(e===void 0)throw new Error(mn(26));return e}const U9="--nested-dialogs",B9="data-nested-dialog-open",H9={...nd,...Ti,nestedDialogOpen(e){return e?{[B9]:""}:null}},kx=y.forwardRef(function(t,s){const{render:o,className:a,style:c,finalFocus:u,initialFocus:m,...g}=t,v=Oi(),b=v.useState("descriptionElementId"),p=v.useState("disablePointerDismissal"),x=v.useState("floatingRootContext"),S=v.useState("popupProps"),w=v.useState("modal"),E=v.useState("mounted"),R=v.useState("nested"),C=v.useState("nestedOpenDialogCount"),j=v.useState("open"),O=v.useState("openMethod"),k=v.useState("titleElementId"),D=v.useState("transitionStatus"),P=v.useState("role"),L=x.useState("floatingId");L9(),Ro({open:j,ref:v.context.popupRef,onComplete(){var q,$;j&&(($=(q=v.context).onOpenChangeComplete)==null||$.call(q,!0))}});const _=m===void 0?WL(v.context.popupRef):m,V=C>0,I=v.useStateSetter("popupElement"),Y=vt("div",t,{state:{open:j,nested:R,transitionStatus:D,nestedDialogOpen:V},props:[S,{id:L,"aria-labelledby":k,"aria-describedby":b,role:P,...zh,hidden:!E,onKeyDown(q){gc.has(q.key)&&q.stopPropagation()},style:{[U9]:C}},g],ref:[s,v.context.popupRef,I],stateAttributesMapping:H9});return d.jsx(Wy,{context:x,openInteractionType:O,disabled:!E,closeOnFocusOut:!p,initialFocus:_,returnFocus:u,modal:w!==!1,restoreFocus:"popup",children:Y})}),_x=y.forwardRef(function(t,s){const{keepMounted:o=!1,...a}=t,c=Oi(),u=c.useState("mounted"),m=c.useState("modal"),g=c.useState("open");return u||o?d.jsx(HO.Provider,{value:o,children:d.jsxs(Qy,{ref:s,...a,children:[u&&m===!0&&d.jsx(Tx,{ref:c.context.internalBackdropRef,inert:px(!g)}),t.children]})}):null}),Ax=y.forwardRef(function(t,s){const{render:o,className:a,style:c,id:u,...m}=t,g=Oi(),v=Qn(u);return g.useSyncedValueWithCleanup("titleElementId",v),vt("h2",t,{ref:s,props:[{id:v},m]})}),F9=jy(function(t,s){const{render:o,className:a,style:c,disabled:u=!1,nativeButton:m=!0,id:g,payload:v,handle:b,...p}=t,x=Oi(!0),w=cx(b)??x;if(!w)throw new Error(mn(79));const E=Qn(g),R=w.useState("floatingRootContext"),C=w.useState("isOpenedByTrigger",E),j=w.useState("triggerPopupId",E),O=y.useRef(null),{registerTrigger:k,isMountedByThisTrigger:D}=sx(E,O,w,{payload:v}),{getButtonProps:P,buttonRef:L}=ss({disabled:u,native:m}),_=ex(R),V=dO(()=>w.select("open"),Y=>{w.set("openMethod",Y)}),I={disabled:u,open:C},X=w.useState("triggerProps",D);return vt("button",t,{state:I,ref:[L,s,k,O],props:[_.reference,X,V,{[K2]:"",id:E,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":j},p,P],stateAttributesMapping:Ly})}),V9=F9;function Mx({...e}){return d.jsx(P9,{"data-slot":"alert-dialog",...e})}function q9({...e}){return d.jsx(V9,{"data-slot":"alert-dialog-trigger",...e})}function $9({...e}){return d.jsx(_x,{"data-slot":"alert-dialog-portal",...e})}function Z9({className:e,...t}){return d.jsx(jx,{"data-slot":"alert-dialog-overlay",className:De("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function zx({className:e,size:t="default",...s}){return d.jsxs($9,{children:[d.jsx(Z9,{}),d.jsx(kx,{"data-slot":"alert-dialog-content","data-size":t,className:De("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})]})}function Dx({className:e,...t}){return d.jsx("div",{"data-slot":"alert-dialog-header",className:De("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Ix({className:e,...t}){return d.jsx("div",{"data-slot":"alert-dialog-footer",className:De("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Px({className:e,...t}){return d.jsx(Ax,{"data-slot":"alert-dialog-title",className:De("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function FO({className:e,...t}){return d.jsx(Ox,{"data-slot":"alert-dialog-description",className:De("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Lx({className:e,...t}){return d.jsx(Ue,{"data-slot":"alert-dialog-action",className:De(e),...t})}function Ux({className:e,variant:t="outline",size:s="default",...o}){return d.jsx(Gh,{"data-slot":"alert-dialog-cancel",className:De(e),render:d.jsx(Ue,{variant:t,size:s}),...o})}function K9({className:e,children:t,value:s,...o}){return d.jsxs(LO,{value:s,"data-slot":"progress",className:De("flex flex-wrap gap-3",e),...o,children:[t,d.jsx(VO,{children:d.jsx(qO,{})})]})}function VO({className:e,...t}){return d.jsx(k9,{className:De("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),"data-slot":"progress-track",...t})}function qO({className:e,...t}){return d.jsx(_9,{"data-slot":"progress-indicator",className:De("h-full bg-primary transition-all",e),...t})}function $O({className:e,...t}){return d.jsx("textarea",{"data-slot":"textarea",className:De("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}function ZO(e,t){const s=Math.max(0,t)/1e3;return s<60?e.t("format.seconds",{seconds:e.number(s,{minimumFractionDigits:1,maximumFractionDigits:1})}):e.t("format.minutesSeconds",{minutes:Math.floor(s/60),seconds:Math.round(s%60)})}function Du(e,t){const s=t<.1?3:2;return e.number(t,{style:"currency",currency:"USD",minimumFractionDigits:s,maximumFractionDigits:s})}function KO(e,t){return t<60?e.t("format.remaining.underMinute"):t<3600?e.t("format.remaining.minutes",{minutes:Math.round(t/60)}):e.t("format.remaining.hours",{hours:Math.floor(t/3600),minutes:Math.round(t%3600/60)})}const OR=3,kR=200,Y9=800;function _R(e,t){switch(t){case"uv":return e("training.install.uv");case"scripts":return e("training.install.scripts");case"python":return e("training.install.python");case"packages":return e("training.install.packages");case"checking":return e("training.install.checking")}}function AR(e,t){switch(t){case"waitingGpu":return e("training.stage.waitingGpu");case"loading":return e("training.stage.loading");case"caching":return e("training.stage.caching");case"training":return e("training.stage.training");case"saving":return e("training.stage.saving")}}const Qh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-dim",pd="gap-5 rounded-2xl ring-line [--card-spacing:--spacing(5)] sm:[--card-spacing:--spacing(6)]";function Bx({value:e,label:t,className:s}){return d.jsx(LO,{value:e,"aria-label":t,className:De("w-full",s),children:d.jsx(VO,{className:"h-1.5 bg-line",children:d.jsx(qO,{className:"flow rounded-full duration-500"})})})}function Eo({label:e,ariaLabel:t,question:s,confirm:o,disabled:a,onConfirm:c,children:u}){const{t:m}=Xe(),[g,v]=y.useState(!1);return d.jsxs(Mx,{open:g,onOpenChange:v,children:[d.jsx(q9,{render:d.jsx(Ue,{variant:"outline",disabled:a,"aria-label":t,className:"text-dim hover:text-danger"}),children:e}),d.jsxs(zx,{children:[d.jsx(Dx,{children:d.jsx(Px,{children:s})}),u,d.jsxs(Ix,{children:[d.jsx(Ux,{children:m("common.cancel")}),d.jsx(Lx,{variant:"destructive",onClick:()=>{v(!1),c()},children:o})]})]})]})}function G9({status:e}){const t=Xe(),{t:s,bytes:o,explain:a}=t,c=kt({mutationFn:Qe.installTrainer}),u=kt({mutationFn:Qe.cancelTrainerInstall}),m=e.install;if(m){const g=m.totalBytes&&m.receivedBytes!=null?m.receivedBytes/m.totalBytes:null;return d.jsxs("div",{className:"flex flex-col gap-3",role:"status",children:[d.jsx("p",{className:"text-sm",children:_R(s,m.step)}),g!=null&&d.jsxs(d.Fragment,{children:[d.jsx(Bx,{value:g*100,label:_R(s,m.step)}),d.jsx("p",{className:"font-mono text-xs text-dim",children:s("training.install.received",{received:o(m.receivedBytes??0),total:o(m.totalBytes??0)})})]}),m.step==="packages"&&d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:s("training.install.packagesHint")}),d.jsx("div",{children:d.jsx(Ue,{variant:"outline",onClick:()=>u.mutate(),children:s("common.cancel")})})]})}return d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:s("training.install.intro",{size:o(e.downloadBytes)})}),e.error&&d.jsx("p",{className:"text-sm text-danger",children:a(e.error)}),e.error&&d.jsx(YO,{}),c.error&&d.jsx("p",{className:"text-sm text-danger",children:a(c.error)}),d.jsx("div",{children:d.jsx(Ue,{variant:"aurora",onClick:()=>c.mutate(),disabled:c.isPending,children:s("training.install.start")})})]})}function MR({training:e}){const{t}=Xe();if(e.samples.length===0)return null;const s=e.samples.at(-1);return d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("p",{className:Qh,children:t("training.samples")}),d.jsx("div",{className:"flex flex-wrap items-end gap-3",children:e.samples.map(o=>d.jsxs("figure",{className:"flex flex-col gap-1.5",children:[d.jsx("a",{href:NR(e.id,o),target:"_blank",rel:"noreferrer",className:"rounded-lg focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none",children:d.jsx("img",{src:NR(e.id,o),alt:t("training.sampleAt",{step:o}),className:`rounded-lg object-cover ${o===s?"h-40 w-40":"h-20 w-20"}`})}),d.jsx("figcaption",{className:"font-mono text-xs text-dim",children:t("training.sampleAt",{step:o})})]},o))})]})}function Q9({training:e}){const t=Xe(),s=gd(),{t:o,bytes:a,explain:c}=t,u=kt({mutationFn:Qe.cancelTraining}),m=kt({mutationFn:Qe.finishTraining});if(e.state!=="running")return d.jsxs("div",{className:"flex flex-col gap-4",children:[e.state==="done"&&d.jsx("p",{className:"text-sm text-good",role:"status",children:e.keptStep!=null?o("training.doneKept",{name:e.name,trigger:e.trigger,step:e.keptStep}):o("training.done",{name:e.name,trigger:e.trigger})}),e.state==="canceled"&&d.jsx("p",{className:"text-sm text-dim",role:"status",children:o("training.canceled",{name:e.name})}),e.state==="failed"&&d.jsx("p",{className:"text-sm text-danger",role:"alert",children:e.error?c(e.error):o("training.failed",{name:e.name})}),d.jsx(MR,{training:e})]});const g=e.steps>0?e.step/e.steps:0;return d.jsxs("div",{className:"flex flex-col gap-4",children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[d.jsxs("p",{className:"font-medium",children:[e.name,e.startedBy&&e.startedBy.userId!==(s==null?void 0:s.id)&&d.jsx("span",{className:"ml-2 text-sm font-normal text-dim",children:o("training.startedBy",{name:e.startedBy.name})})]}),d.jsx("p",{className:"text-sm text-dim",role:"status",children:AR(o,e.stage)})]}),d.jsx(Bx,{value:g*100,label:AR(o,e.stage)}),d.jsxs("p",{className:"font-mono text-xs text-dim",children:[o("training.steps",{step:e.step,steps:e.steps}),e.secondsLeft!=null&&` · ${KO(t,e.secondsLeft)}`,e.freeMemoryBytes!=null&&` · ${o("training.freeMemory",{free:a(e.freeMemoryBytes)})}`]}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:o("training.runningHint")})]}),d.jsx(MR,{training:e}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:o("training.samplesHint")}),m.error&&d.jsx("p",{className:"text-sm text-danger",children:c(m.error)}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.savedStep!=null&&e.step<e.steps&&d.jsx(Ue,{variant:"secondary",onClick:()=>m.mutate(),disabled:m.isPending,children:o("training.keep",{step:e.savedStep})}),d.jsx(Ue,{variant:"outline",onClick:()=>u.mutate(),children:o("training.cancel")})]})]})}const X9=new Set(["image/png","image/jpeg","image/webp"]),J9=768;function W9({chosen:e,toggle:t,close:s}){var m;const{t:o,explain:a}=Xe(),c=Q3({queryKey:["gallery",""],queryFn:({pageParam:g})=>Qe.gallery("",g),initialPageParam:void 0,getNextPageParam:g=>g.length<zO?void 0:g.at(-1)}),u=(((m=c.data)==null?void 0:m.pages.flat())??[]).filter(g=>X9.has(g.mime));return d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-line bg-bg p-3",children:[c.error&&d.jsx("p",{className:"text-sm text-danger",children:a(c.error)}),c.isSuccess&&u.length===0&&d.jsx("p",{className:"text-sm text-dim",children:o("training.galleryEmpty")}),d.jsx("ul",{className:"grid max-h-72 grid-cols-4 gap-2 overflow-y-auto p-0.5 sm:grid-cols-6",children:u.map(g=>{const v=e.has(g.id);return d.jsx("li",{children:d.jsx("button",{type:"button",onClick:()=>t(g),"aria-pressed":v,"aria-label":o("training.pickPicture"),title:g.prompt??void 0,className:`block aspect-square w-full overflow-hidden rounded-lg outline-none ring-offset-2 ring-offset-bg focus-visible:ring-3 focus-visible:ring-ring/50 ${v?"ring-2 ring-pink":"opacity-80 hover:opacity-100"}`,children:d.jsx("img",{src:ir(g.id),alt:"",loading:"lazy",className:"h-full w-full object-cover"})})},g.id)})}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.hasNextPage&&d.jsx(Ue,{variant:"ghost",onClick:()=>void c.fetchNextPage(),disabled:c.isFetchingNextPage,children:o("training.galleryMore")}),d.jsx(Ue,{variant:"secondary",onClick:s,children:o("training.galleryClose")})]})]})}function eF({hidden:e}){var K;const t=On(),{t:s,explain:o}=Xe(),a=y.useId(),c=y.useRef(null),[u,m]=y.useState([]),g=y.useRef(u);g.current=u;const[v,b]=y.useState(""),[p,x]=y.useState(""),[S,w]=y.useState(String(Y9)),[E,R]=y.useState(!1),[C,j]=y.useState(!1),O=Wt({queryKey:["captioner"],queryFn:Qe.captioner}),k=B=>m(A=>A.length>=kR||A.some(U=>U.asset.id===B.id)?A:[...A,{asset:B,caption:""}]),D=(B,A)=>m(U=>U.map(J=>J.asset.id===B?{...J,...A}:J)),P=kt({mutationFn:async B=>{for(const A of B)k(await Qe.upload(A))}}),L=y.useRef(null),[_,V]=y.useState(null),[I,X]=y.useState(null);y.useEffect(()=>()=>{var B;return(B=L.current)==null?void 0:B.abort()},[]);const Y=async(B,A)=>{var J,F;(J=L.current)==null||J.abort();const U=new AbortController;L.current=U,X(null);try{for(const[oe,N]of B.entries()){const z=g.current.find(ue=>ue.asset.id===N.asset.id);if(!z||A&&z.caption.trim())continue;V({id:N.asset.id,n:oe+1,total:B.length});const{caption:Z}=await Qe.caption(N.asset.id,U.signal),te=(F=g.current.find(ue=>ue.asset.id===N.asset.id))==null?void 0:F.caption;(!A||!(te!=null&&te.trim()))&&D(N.asset.id,{caption:Z})}}catch(oe){U.signal.aborted||X(oe)}finally{L.current===U&&(L.current=null,V(null))}},q=()=>{var B;(B=L.current)==null||B.abort(),L.current=null,V(null)},$=kt({mutationFn:()=>Qe.train({name:v.trim(),trigger:p.trim(),steps:Number(S),pictures:u.map(B=>({assetId:B.asset.id,caption:B.caption})),consent:E}),onSuccess:B=>t.setQueryData(["trainer"],A=>A&&{...A,training:B})}),G=u.length>=OR&&v.trim()!==""&&/^[\p{L}\p{N}_-]{2,40}$/u.test(p.trim())&&Number(S)>=100&&Number(S)<=4e3&&E&&!_,H=u.filter(B=>!B.caption.trim());return d.jsxs("form",{hidden:e,className:"flex flex-col gap-6",onSubmit:B=>{B.preventDefault(),G&&$.mutate()},children:[d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[d.jsx("p",{className:"text-sm font-medium",children:s("training.pictures",{count:u.length,min:OR})}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(Ue,{variant:"outline",onClick:()=>{var B;return(B=c.current)==null?void 0:B.click()},disabled:P.isPending,children:P.isPending?s("training.adding"):s("training.addPictures")}),d.jsx(Ue,{variant:"outline",onClick:()=>j(B=>!B),"aria-expanded":C,children:s("training.fromGallery")})]}),d.jsx("input",{ref:c,type:"file",accept:"image/png,image/jpeg,image/webp",multiple:!0,hidden:!0,onChange:B=>{const A=[...B.target.files??[]];B.target.value="",A.length&&P.mutate(A)}})]}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:s("training.picturesHint")}),P.error&&d.jsx("p",{className:"text-sm text-danger",children:o(P.error)}),C&&d.jsx(W9,{chosen:new Set(u.map(B=>B.asset.id)),toggle:B=>m(A=>A.some(U=>U.asset.id===B.id)?A.filter(U=>U.asset.id!==B.id):A.length>=kR?A:[...A,{asset:B,caption:""}]),close:()=>j(!1)}),u.length>0&&d.jsx("ul",{className:"grid gap-3 sm:grid-cols-2",children:u.map((B,A)=>{var oe;const U=B.size,J=U!=null&&Math.min(U.width,U.height)<J9,F=(_==null?void 0:_.id)===B.asset.id;return d.jsxs("li",{className:"flex items-start gap-3 rounded-xl border border-line bg-bg p-2",children:[d.jsxs("div",{className:"flex w-20 shrink-0 flex-col gap-1",children:[d.jsx("img",{src:ir(B.asset.id),alt:"",onLoad:N=>{const{naturalWidth:z,naturalHeight:Z}=N.currentTarget;D(B.asset.id,{size:{width:z,height:Z}})},className:`h-20 w-20 rounded-lg object-cover ${F?"animate-pulse motion-reduce:animate-none":""}`}),J&&d.jsx("span",{title:s("training.smallHint",{width:U.width,height:U.height}),className:"font-mono text-[11px] text-danger",children:s("training.small")})]}),d.jsx($O,{value:B.caption,onChange:N=>D(B.asset.id,{caption:N.target.value}),placeholder:s("training.captionPlaceholder"),"aria-label":s("training.captionOf",{n:A+1}),maxLength:500,rows:3,disabled:F,className:"min-h-20 min-w-0 flex-1 resize-none [field-sizing:fixed]"}),d.jsxs("div",{className:"flex flex-col items-center",children:[d.jsx(Ue,{variant:"ghost",size:"icon",onClick:()=>m(N=>N.filter(z=>z.asset.id!==B.asset.id)),"aria-label":s("training.removePicture",{n:A+1}),children:d.jsx(Oa,{"aria-hidden":"true"})}),((oe=O.data)==null?void 0:oe.ready)&&d.jsx(Ue,{variant:"ghost",size:"icon",onClick:()=>void Y([B],!1),disabled:_!=null,"aria-label":s("training.describe",{n:A+1}),title:s("training.describe",{n:A+1}),children:d.jsx(C5,{"aria-hidden":"true"})})]})]},B.asset.id)})}),u.length>0&&d.jsxs("div",{className:"flex flex-col gap-2",children:[(K=O.data)!=null&&K.ready?d.jsx("div",{className:"flex flex-wrap items-center gap-2",children:_?d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-sm",role:"status",children:s("training.describing",{n:_.n,total:_.total})}),d.jsx(Ue,{variant:"outline",onClick:q,children:s("training.describeStop")})]}):H.length>0&&d.jsx(Ue,{variant:"outline",onClick:()=>void Y(H,!0),children:s("training.describeAll")})}):O.isSuccess&&d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:s("training.describeNeedsModel")}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:s("training.describeHint")}),I!=null&&d.jsx("p",{className:"text-sm text-danger",children:o(I)})]})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_1fr_8rem]",children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Or,{htmlFor:`${a}-name`,className:"text-dim",children:s("training.name")}),d.jsx(Cn,{id:`${a}-name`,value:v,onChange:B=>b(B.target.value),maxLength:80,placeholder:s("training.namePlaceholder"),className:"h-10"})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Or,{htmlFor:`${a}-trigger`,className:"text-dim",children:s("training.trigger")}),d.jsx(Cn,{id:`${a}-trigger`,value:p,onChange:B=>x(B.target.value),maxLength:40,placeholder:s("training.triggerPlaceholder"),spellCheck:!1,className:"h-10 font-mono"})]}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Or,{htmlFor:`${a}-steps`,className:"text-dim",children:s("training.stepsLabel")}),d.jsx(Cn,{id:`${a}-steps`,type:"number",min:100,max:4e3,step:50,value:S,onChange:B=>w(B.target.value),className:"h-10 font-mono"})]})]}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:s("training.triggerHint")})]}),d.jsxs(Or,{className:"items-start gap-3 leading-relaxed font-normal",children:[d.jsx(tO,{checked:E,onCheckedChange:R,className:"mt-0.5"}),s("training.consent")]}),$.error&&d.jsx("p",{className:"text-sm text-danger",children:o($.error)}),d.jsx("div",{children:d.jsx(Ue,{type:"submit",variant:"aurora",size:"lg",disabled:!G||$.isPending,children:s("training.start")})})]})}function YO(){const{t:e,explain:t}=Xe(),s=kt({mutationFn:Qe.removeTrainer});return d.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-line pt-4 text-sm",children:[d.jsx(Eo,{label:e("training.remove"),question:e("training.removeAsk"),confirm:e("training.removeConfirm"),disabled:s.isPending,onConfirm:()=>s.mutate()}),s.error&&d.jsx("p",{className:"text-danger",children:t(s.error)})]})}function tF(){var c,u;const{t:e,explain:t}=Xe(),s=qs(),o=Wt({queryKey:["trainer"],queryFn:Qe.trainer}),a=o.data;return d.jsxs("section",{"aria-label":e("training.title"),className:"flex flex-col gap-5 rounded-xl border border-line bg-panel-2/60 p-4 sm:p-5",children:[d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:e("training.intro")}),o.error&&d.jsx("p",{className:"text-sm text-danger",children:t(o.error)}),a&&a.state!=="ready"&&s.owner&&d.jsx(G9,{status:a}),a&&a.state!=="ready"&&!s.owner&&d.jsx("p",{className:"text-sm text-dim",children:e("training.askOwner")}),(a==null?void 0:a.state)==="ready"&&d.jsxs(d.Fragment,{children:[a.training&&d.jsx(Q9,{training:a.training}),d.jsx(eF,{hidden:((c=a.training)==null?void 0:c.state)==="running"}),((u=a.training)==null?void 0:u.state)!=="running"&&s.owner&&d.jsx(YO,{})]})]})}function nF(e,t){switch(t){case"read":return e("tokens.scopeRead");case"generate":return e("tokens.scopeGenerate");case"paid":return e("tokens.scopePaid");case"train":return e("tokens.scopeTrain")}}function rF({token:e}){const{t,date:s,number:o}=Xe(),a=c=>o(c,{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4});return d.jsx("span",{className:"text-xs text-dim",children:[e.scopes.map(c=>nF(t,c)).join(", "),e.spendLimitUsd==null?t("tokens.spent",{spent:a(e.spentUsd)}):t("tokens.spentOf",{spent:a(e.spentUsd),limit:a(e.spendLimitUsd)}),e.lastUsedAt==null?t("tokens.neverUsed"):t("tokens.lastUsed",{date:s(e.lastUsedAt)}),e.expiresAt==null?t("tokens.noExpiry"):e.expiresAt<Date.now()?t("tokens.expired"):t("tokens.expires",{date:s(e.expiresAt)})].join(" · ")})}const bo=10;function ha(e,t){switch(t){case"owner":return e("role.owner");case"admin":return e("role.admin");case"member":return e("role.member")}}const GO=y.createContext(null),gd=()=>y.useContext(GO);function qs(){const e=gd();return ji()?{server:!0,owner:!1,admin:!1,train:!1,paid:!1}:e?{server:!0,owner:e.role==="owner",admin:e.role!=="member",train:e.canTrain,paid:e.canUsePaid}:{server:!1,owner:!0,admin:!0,train:!0,paid:!0}}const vc=()=>{window.location.hash="#/",window.location.reload()},wr="h-10",Ta="rounded-xl border border-line bg-bg/60 p-4",Ra="font-medium",sF=e=>{var t;return((t=/^#\/invite\/([\w-]+)$/.exec(e))==null?void 0:t[1])??null},oF=e=>{var t;return((t=/^#\/reset\/([\w-]+)$/.exec(e))==null?void 0:t[1])??null},iF=e=>(window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e));function aF({children:e}){var s,o;const t=Wt({queryKey:["server"],queryFn:Qe.server,staleTime:Number.POSITIVE_INFINITY});return t.isPending?null:((s=t.data)==null?void 0:s.mode)==="demo"?d.jsx(T9,{demo:t.data.demo,children:e}):((o=t.data)==null?void 0:o.mode)!=="server"?e:d.jsx(lF,{secure:t.data.secure,children:e})}function lF({secure:e,children:t}){var v;const s=On(),o=y.useSyncExternalStore(iF,()=>window.location.hash),a=Wt({queryKey:["account"],queryFn:()=>Qe.account().catch(b=>{if(b instanceof qu&&b.code==="signInRequired")return null;throw b}),retry:!1}),c=Wt({queryKey:["setup"],queryFn:Qe.setupNeeded,enabled:a.data===null});y.useEffect(()=>p9(()=>{s.invalidateQueries({queryKey:["account"]})}),[s]),y.useEffect(()=>h9(()=>{s.invalidateQueries({queryKey:["account"]})}),[s]);const u=sF(o),m=oF(o);let g=null;if(a.isPending||a.data===null&&c.isPending)g=null;else if(m)g=d.jsx(mF,{token:m,signedIn:a.data!=null});else{if(a.data&&!a.data.mustChangePassword)return d.jsx(GO.Provider,{value:a.data,children:e&&!a.data.resetNotice?t:d.jsxs("div",{className:"flex h-full flex-col",children:[!e&&d.jsx(zR,{banner:!0}),a.data.resetNotice&&d.jsx(cF,{notice:a.data.resetNotice}),d.jsx("div",{className:"min-h-0 flex-1",children:t})]})});a.data?g=d.jsx(hF,{}):(v=c.data)!=null&&v.needed?g=d.jsx(uF,{}):u?g=d.jsx(fF,{token:u}):g=d.jsx(dF,{})}return d.jsxs("div",{className:"relative isolate flex h-full overflow-x-hidden overflow-y-auto",children:[d.jsx("div",{className:"sky -z-10","aria-hidden":"true"}),d.jsxs("main",{className:"m-auto flex w-full max-w-md flex-col gap-6 px-4 py-10 sm:py-16",children:[d.jsx(bx,{className:"self-center"}),!e&&d.jsx(zR,{}),g&&d.jsx(ld,{className:De(pd,"scene-in bg-panel/85 backdrop-blur-sm"),children:d.jsx(cd,{className:"flex flex-col gap-6",children:g})})]})]})}function Ca({title:e,intro:t}){return d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("h1",{className:"font-display text-[34px] leading-none font-extrabold tracking-[-0.02em] text-balance sm:text-4xl",children:e}),t&&d.jsx("p",{className:"text-sm leading-relaxed text-soft",children:t})]})}function cF({notice:e}){const{t,date:s}=Xe(),o=On(),a=kt({mutationFn:Qe.dismissResetNotice,onSuccess:()=>o.invalidateQueries({queryKey:["account"]})});return d.jsxs("div",{role:"status",className:"flex shrink-0 flex-wrap items-center justify-center gap-x-4 gap-y-2 border-b border-line bg-panel px-4 py-2 text-sm",children:[d.jsx("span",{children:t("account.resetNotice",{name:e.by,date:s(e.at)})}),d.jsx(Ue,{variant:"outline",onClick:()=>a.mutate(),disabled:a.isPending,children:t("account.resetNoticeOk")})]})}function zR({banner:e=!1}){const{t}=Xe();return e?d.jsx("p",{role:"note",className:"shrink-0 bg-warn px-4 py-1 text-center text-xs font-medium text-black",children:t("account.unencrypted")}):d.jsxs("p",{role:"note",className:"flex gap-3 rounded-xl border border-warn/40 bg-warn/10 px-4 py-3 text-sm leading-relaxed text-warn",children:[d.jsx(c2,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0"}),t("account.unencrypted")]})}function Hr({label:e,children:t}){return d.jsxs(Or,{className:"flex-col items-stretch gap-2 font-normal text-soft",children:[e,t]})}function qr({error:e,id:t}){const{explain:s}=Xe();return e?d.jsx("p",{id:t,role:"alert",className:"text-sm text-danger",children:s(e)}):null}function QO({submit:e,pending:t,error:s,children:o,action:a}){const{t:c}=Xe(),u=y.useId(),[m,g]=y.useState(""),[v,b]=y.useState(""),[p,x]=y.useState(""),S=p!==""&&p!==v;return d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:w=>{w.preventDefault(),S||e(m,v)},children:[o,d.jsx(Hr,{label:c("account.username"),children:d.jsx(Cn,{value:m,onChange:w=>g(w.target.value),autoComplete:"username",required:!0,"aria-describedby":s?`${u}-error`:void 0,className:wr})}),d.jsx(Hr,{label:c("account.newPassword"),children:d.jsx(Cn,{type:"password",value:v,onChange:w=>b(w.target.value),autoComplete:"new-password",minLength:bo,required:!0,"aria-describedby":`${u}-hint`,className:wr})}),d.jsx(Hr,{label:c("account.passwordAgain"),children:d.jsx(Cn,{type:"password",value:p,onChange:w=>x(w.target.value),autoComplete:"new-password",required:!0,"aria-invalid":S||void 0,"aria-describedby":`${u}-hint`,className:wr})}),d.jsx("p",{id:`${u}-hint`,className:De("text-xs",S?"text-danger":"text-dim"),children:S?c("account.passwordsDiffer"):c("account.passwordHint",{min:bo})}),d.jsx(qr,{error:s,id:`${u}-error`}),d.jsx(Ue,{type:"submit",variant:"aurora",size:"lg",disabled:t||S||v.length<bo,children:a})]})}function uF(){const{t:e}=Xe(),[t,s]=y.useState(""),o=kt({mutationFn:a=>Qe.setup({code:t,...a}),onSuccess:vc});return d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:e("setup.title"),intro:e("setup.intro")}),d.jsx(QO,{submit:(a,c)=>o.mutate({username:a,password:c}),pending:o.isPending,error:o.error,action:e("setup.create"),children:d.jsx(Hr,{label:e("setup.code"),children:d.jsx(Cn,{value:t,onChange:a=>s(a.target.value),autoComplete:"off",spellCheck:!1,required:!0,placeholder:"XXXX-XXXX-XXXX",className:De(wr,"font-mono tracking-wider uppercase")})})})]})}function dF(){const{t:e}=Xe(),t=y.useId(),[s,o]=y.useState(""),[a,c]=y.useState(""),[u,m]=y.useState(""),[g,v]=y.useState(!1),b=kt({mutationFn:()=>Qe.login({username:s,password:a,totp:g?u:void 0}),onSuccess:vc,onError:E=>{E instanceof qu&&E.code==="totpRequired"&&v(!0)}}),p=E=>{E.preventDefault(),b.mutate()},x=b.error instanceof qu&&b.error.code==="totpRequired",S=b.error!=null&&!x,w=S?`${t}-error`:void 0;return d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:e("signin.title")}),d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:p,children:[g?d.jsx(Hr,{label:e("signin.code"),children:d.jsx(Cn,{value:u,onChange:E=>m(E.target.value),inputMode:"numeric",autoComplete:"one-time-code",autoFocus:!0,required:!0,"aria-invalid":S||void 0,"aria-describedby":w,className:De(wr,"font-mono text-lg tracking-[0.3em]")})}):d.jsxs(d.Fragment,{children:[d.jsx(Hr,{label:e("account.username"),children:d.jsx(Cn,{value:s,onChange:E=>o(E.target.value),autoComplete:"username",required:!0,"aria-invalid":S||void 0,"aria-describedby":w,className:wr})}),d.jsx(Hr,{label:e("account.password"),children:d.jsx(Cn,{type:"password",value:a,onChange:E=>c(E.target.value),autoComplete:"current-password",required:!0,"aria-invalid":S||void 0,"aria-describedby":w,className:wr})})]}),S&&d.jsx(qr,{error:b.error,id:`${t}-error`}),d.jsx(Ue,{type:"submit",variant:"aurora",size:"lg",disabled:b.isPending,children:e("signin.submit")}),g&&d.jsx(Ue,{variant:"ghost",onClick:()=>{v(!1),m(""),b.reset()},className:"text-dim",children:e("common.back")})]}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:e("signin.forgot")})]})}function fF({token:e}){const{t}=Xe(),s=Wt({queryKey:["invite",e],queryFn:()=>Qe.invite(e),retry:!1}),o=kt({mutationFn:a=>Qe.acceptInvite(e,a),onSuccess:vc});return s.isPending?null:s.error?d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:t("invite.title")}),d.jsx(qr,{error:s.error}),d.jsx("a",{href:"#/",className:yx({variant:"outline"}),children:t("signin.title")})]}):d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:t("invite.title"),intro:t("invite.intro",{role:ha(t,s.data.role)})}),d.jsx(QO,{submit:(a,c)=>o.mutate({username:a,password:c}),pending:o.isPending,error:o.error,action:t("invite.accept")})]})}function mF({token:e,signedIn:t}){const{t:s}=Xe(),o=y.useId(),[a,c]=y.useState(""),[u,m]=y.useState(""),g=Wt({queryKey:["reset",e],queryFn:()=>Qe.passwordReset(e),retry:!1}),v=kt({mutationFn:()=>Qe.setPasswordFromLink(e,a)}),b=u!==""&&u!==a;return g.isPending?null:v.isSuccess||g.error?d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:s("account.choosePassword")}),v.isSuccess?d.jsx("p",{role:"status",className:"text-sm text-good",children:s("reset.done")}):d.jsx(qr,{error:g.error}),d.jsx(Ue,{variant:"aurora",size:"lg",onClick:vc,children:t&&!v.isSuccess?s("reset.open"):s("signin.title")})]}):d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:s("account.choosePassword"),intro:s("reset.intro",{name:g.data.username})}),d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:p=>{p.preventDefault(),b||v.mutate()},children:[d.jsx("input",{type:"text",value:g.data.username,autoComplete:"username",readOnly:!0,hidden:!0}),d.jsx(Hr,{label:s("account.newPassword"),children:d.jsx(Cn,{type:"password",value:a,onChange:p=>c(p.target.value),autoComplete:"new-password",minLength:bo,required:!0,"aria-describedby":`${o}-hint`,className:wr})}),d.jsx(Hr,{label:s("account.passwordAgain"),children:d.jsx(Cn,{type:"password",value:u,onChange:p=>m(p.target.value),autoComplete:"new-password",required:!0,"aria-invalid":b||void 0,"aria-describedby":`${o}-hint`,className:wr})}),d.jsx("p",{id:`${o}-hint`,className:De("text-xs",b?"text-danger":"text-dim"),children:b?s("account.passwordsDiffer"):s("account.passwordHint",{min:bo})}),d.jsx(qr,{error:v.error}),d.jsx(Ue,{type:"submit",variant:"aurora",size:"lg",disabled:v.isPending||b||a.length<bo,children:s("reset.submit")})]})]})}function hF(){const{t:e}=Xe();return d.jsxs(d.Fragment,{children:[d.jsx(Ca,{title:e("account.choosePassword"),intro:e("account.choosePasswordIntro")}),d.jsx(XO,{onDone:vc,wide:!0}),d.jsx(JO,{className:"self-center text-dim"})]})}function XO({onDone:e,wide:t=!1}){const{t:s}=Xe(),o=y.useId(),[a,c]=y.useState(""),[u,m]=y.useState(""),[g,v]=y.useState(!1),b=kt({mutationFn:()=>Qe.changePassword({current:a,next:u}),onSuccess:()=>{c(""),m(""),v(!0),e==null||e()}});return d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:p=>{p.preventDefault(),v(!1),b.mutate()},children:[d.jsx(Hr,{label:s("account.currentPassword"),children:d.jsx(Cn,{type:"password",value:a,onChange:p=>c(p.target.value),autoComplete:"current-password",required:!0,"aria-describedby":b.error?`${o}-error`:void 0,className:wr})}),d.jsx(Hr,{label:s("account.newPassword"),children:d.jsx(Cn,{type:"password",value:u,onChange:p=>m(p.target.value),autoComplete:"new-password",minLength:bo,required:!0,"aria-describedby":`${o}-hint`,className:wr})}),d.jsx("p",{id:`${o}-hint`,className:"text-xs text-dim",children:s("account.passwordHint",{min:bo})}),d.jsx(qr,{error:b.error,id:`${o}-error`}),g&&d.jsx("p",{role:"status",className:"text-sm text-good",children:s("account.passwordChanged")}),d.jsx(Ue,{type:"submit",variant:t?"aurora":"outline",size:t?"lg":"default",disabled:b.isPending||u.length<bo,className:t?void 0:"self-start",children:s("account.changePassword")})]})}function JO({className:e}){const{t}=Xe(),s=kt({mutationFn:Qe.logout,onSettled:vc});return d.jsxs(Ue,{variant:"ghost",onClick:()=>s.mutate(),disabled:s.isPending,className:De("h-10",e),children:[d.jsx(w5,{"aria-hidden":"true"}),t("account.signOut")]})}function pF({className:e}){const t=gd(),{t:s}=Xe();return t?d.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 border-t border-line pt-3",children:[d.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 px-2",children:[d.jsx("span",{className:"max-w-full truncate text-sm font-medium",title:t.username,children:t.displayName}),d.jsx(ac,{variant:"outline",className:"font-mono text-[10px] tracking-[0.12em] text-dim uppercase",children:ha(s,t.role)})]}),d.jsx(JO,{className:e})]}):null}function WO({title:e,intro:t}){return d.jsxs(xx,{className:"flex flex-col gap-2",children:[d.jsx("h2",{className:Qh,children:e}),d.jsx("p",{className:"max-w-2xl text-sm leading-relaxed text-dim",children:t})]})}function g$(){const e=gd(),{t,bytes:s}=Xe();if(!e)return null;const{usedBytes:o,quotaBytes:a}=e.storage;return d.jsxs(ld,{className:pd,children:[d.jsx(WO,{title:t("account.title"),intro:t("account.signedInAs",{name:e.username})}),d.jsxs(cd,{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:De(Ta,"flex flex-col gap-3"),children:[d.jsx("h3",{className:Ra,children:t("account.storageTitle")}),d.jsx("p",{className:"text-sm text-dim",children:a==null?t("account.storage",{used:s(o)}):t("account.storageOf",{used:s(o),quota:s(a)})}),a!=null&&a>0&&d.jsx(Bx,{value:Math.min(o/a*100,100),label:t("account.storageTitle")})]}),d.jsxs("div",{className:"grid items-start gap-3 md:grid-cols-2",children:[d.jsxs("div",{className:Ta,children:[d.jsx("h3",{className:De(Ra,"mb-4"),children:t("account.changePassword")}),d.jsx(XO,{})]}),d.jsx(gF,{enabled:e.totp})]}),d.jsx(vF,{})]})]})}function gF({enabled:e}){const{t}=Xe(),s=On(),[o,a]=y.useState(""),[c,u]=y.useState(""),[m,g]=y.useState(""),v=()=>s.invalidateQueries({queryKey:["account"]}),b=()=>(a(""),u(""),g(""),v()),p=kt({mutationFn:Qe.startTotp}),x=kt({mutationFn:()=>{var C;return Qe.enableTotp({secret:((C=p.data)==null?void 0:C.secret)??"",code:o,password:m,current:e?c:void 0})},onSuccess:()=>(p.reset(),b())}),S=kt({mutationFn:()=>Qe.disableTotp({password:m,code:c}),onSuccess:b}),w=d.jsx(Hr,{label:t("account.currentPassword"),children:d.jsx(Cn,{type:"password",value:m,onChange:C=>g(C.target.value),autoComplete:"current-password",className:wr})}),E=(C,j,O)=>d.jsx(Hr,{label:O,children:d.jsx(Cn,{value:C,onChange:k=>j(k.target.value),placeholder:"123456",inputMode:"numeric",autoComplete:"one-time-code",className:De(wr,"font-mono tracking-[0.3em]")})}),R=p.data&&d.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-line bg-panel p-3",children:[d.jsx("p",{className:"text-sm leading-relaxed",children:t("account.twoStepAdd")}),d.jsx("a",{href:p.data.uri,className:"rounded-sm font-mono text-xs break-all text-pink underline underline-offset-2 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none",children:p.data.uri}),d.jsxs("p",{className:"flex flex-col gap-1.5 text-sm text-dim",children:[t("account.twoStepSecret"),d.jsx("code",{className:"rounded-lg border border-line bg-bg px-3 py-2.5 font-mono text-base tracking-[0.18em] break-all text-ink select-all",children:p.data.secret.replace(/(.{4})/g,"$1 ").trim()})]})]});return d.jsxs("div",{className:De(Ta,"flex flex-col gap-4"),children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsx("h3",{className:Ra,children:t("account.twoStep")}),d.jsx(ac,{variant:"outline",className:De("font-mono text-[10px] tracking-[0.12em] uppercase",e?"border-good/40 text-good":"text-dim"),children:t(e?"account.twoStepOn":"account.twoStepOff")})]}),d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:t("account.twoStepIntro")}),e&&p.data?d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:C=>{C.preventDefault(),x.mutate()},children:[R,d.jsx("p",{className:"text-sm text-dim",children:t("account.twoStepMoveHint")}),w,d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E(c,u,t("account.twoStepOldCode")),E(o,a,t("account.twoStepNewCode"))]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(Ue,{type:"submit",variant:"aurora",disabled:!m||!c||!o||x.isPending,children:t("account.twoStepMoveConfirm")}),d.jsx(Ue,{variant:"ghost",onClick:()=>{p.reset(),x.reset(),a(""),u("")},children:t("common.cancel")})]})]}):e?d.jsxs(d.Fragment,{children:[d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:C=>{C.preventDefault(),S.mutate()},children:[d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[w,E(c,u,t("signin.code"))]}),d.jsx(Ue,{type:"submit",variant:"outline",disabled:!m||!c||S.isPending,className:"self-start text-dim hover:text-danger",children:t("account.twoStepDisable")})]}),d.jsx(Ue,{variant:"ghost",onClick:()=>{S.reset(),p.mutate()},disabled:p.isPending,className:"self-start",children:t("account.twoStepMove")})]}):p.data?d.jsxs("form",{className:"flex flex-col gap-4",onSubmit:C=>{C.preventDefault(),x.mutate()},children:[R,d.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[w,E(o,a,t("signin.code"))]}),d.jsx(Ue,{type:"submit",variant:"aurora",disabled:!o||!m||x.isPending,className:"self-start",children:t("account.twoStepConfirm")})]}):d.jsx(Ue,{variant:"outline",onClick:()=>p.mutate(),disabled:p.isPending,className:"self-start",children:t("account.twoStepEnable")}),d.jsx(qr,{error:p.error??x.error??S.error})]})}function vF(){var v,b;const{t:e,date:t}=Xe(),s=On(),o=Wt({queryKey:["account-sessions"],queryFn:Qe.accountSessions}),a=()=>s.invalidateQueries({queryKey:["account-sessions"]}),c=kt({mutationFn:Qe.revokeSession,onSuccess:a}),[u,m]=y.useState(!0),g=kt({mutationFn:()=>Qe.revokeOtherSessions(u),onSuccess:()=>(s.invalidateQueries({queryKey:["tokens"]}),a())});return d.jsxs("div",{className:De(Ta,"flex flex-col gap-4"),children:[d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[d.jsx("h3",{className:Ra,children:e("account.sessions")}),(((v=o.data)==null?void 0:v.length)??0)>1&&d.jsx(Eo,{label:e("account.signOutOthers"),question:e("account.signOutOthersQuestion"),confirm:e("account.signOutOthers"),disabled:g.isPending,onConfirm:()=>g.mutate(),children:d.jsxs(Or,{className:"min-h-9 gap-3 font-normal",children:[d.jsx(tO,{checked:u,onCheckedChange:p=>m(p)}),e("account.signOutOthersTokens")]})})]}),d.jsx("ul",{className:"flex flex-col divide-y divide-line",children:(b=o.data)==null?void 0:b.map(p=>{const x=p.userAgent??e("account.unknownBrowser");return d.jsxs("li",{className:"flex flex-col gap-3 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between",children:[d.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[d.jsx("span",{className:"text-sm break-words",children:x}),d.jsxs("span",{className:"flex flex-wrap items-center gap-2 font-mono text-xs text-dim",children:[p.current?d.jsx(ac,{variant:"outline",className:"border-good/40 font-mono text-[10px] tracking-[0.12em] text-good uppercase",children:e("account.thisBrowser")}):e("account.lastSeen",{when:t(p.lastSeenAt)}),p.ip&&d.jsx("span",{children:p.ip})]})]}),!p.current&&d.jsx(Eo,{label:e("account.signOutThere"),ariaLabel:`${e("account.signOutThere")}: ${x}`,question:e("account.signOutThereQuestion",{browser:x}),confirm:e("account.signOutThere"),onConfirm:()=>c.mutate(p.id)})]},p.id)})}),d.jsx(qr,{error:o.error??c.error??g.error})]})}function v$(){const e=gd(),{t}=Xe();return!e||e.role==="member"?null:d.jsxs(ld,{className:pd,children:[d.jsx(WO,{title:t("users.title"),intro:t("users.intro")}),d.jsxs(cd,{className:"flex flex-col gap-3",children:[d.jsx(yF,{owner:e.role==="owner"}),d.jsx(xF,{}),d.jsx(wF,{me:e})]})]})}function ek({terms:e,setTerms:t,owner:s}){const{t:o}=Xe(),a=y.useId(),c=s?["member","admin","owner"]:["member"];return d.jsxs("div",{className:"flex flex-col gap-x-6 gap-y-3 sm:flex-row sm:flex-wrap sm:items-center",children:[s?d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Or,{htmlFor:`${a}-role`,className:"font-normal text-dim",children:o("users.role")}),d.jsxs($h,{items:c.map(u=>({value:u,label:ha(o,u)})),value:e.role,onValueChange:u=>{u&&t({...e,role:u})},children:[d.jsx(Kh,{id:`${a}-role`,className:"min-w-32 data-[size=default]:h-10",children:d.jsx(Zh,{})}),d.jsx(Yh,{children:c.map(u=>d.jsx(Vu,{value:u,children:ha(o,u)},u))})]})]}):d.jsx("span",{className:"text-sm text-dim",children:ha(o,e.role)}),e.role==="member"&&d.jsxs(d.Fragment,{children:[d.jsxs(Or,{className:"min-h-10 gap-3 font-normal",children:[d.jsx(CR,{checked:e.canUsePaid,onCheckedChange:u=>t({...e,canUsePaid:u})}),o("users.canUsePaid")]}),d.jsxs(Or,{className:"min-h-10 gap-3 font-normal",children:[d.jsx(CR,{checked:e.canTrain,onCheckedChange:u=>t({...e,canTrain:u})}),o("users.canTrain")]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Or,{htmlFor:`${a}-limit`,className:"font-normal text-dim",children:o("users.limit")}),d.jsx(bF,{id:`${a}-limit`,value:e.monthlyLimitUsd,placeholder:o("users.noLimit"),onCommit:u=>t({...e,monthlyLimitUsd:u})})]})]})}function bF({id:e,value:t,placeholder:s,onCommit:o}){const[a,c]=y.useState(t==null?"":String(t));y.useEffect(()=>c(t==null?"":String(t)),[t]);const u=()=>{const m=a.trim()===""?null:Number(a);if(m!==null&&!(Number.isFinite(m)&&m>=0)){c(t==null?"":String(t));return}m!==t&&o(m)};return d.jsx(Cn,{id:e,type:"number",min:0,step:"any",value:a,placeholder:s,onChange:m=>c(m.target.value),onBlur:u,onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),u())},className:De(wr,"w-28 font-mono")})}function tk({link:e,label:t,copied:s,onCopy:o}){const{t:a}=Xe(),c=y.useId();return d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Or,{htmlFor:c,className:"leading-relaxed font-normal text-dim",children:t}),d.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[d.jsx(Cn,{id:c,readOnly:!0,value:e,onFocus:u=>u.target.select(),className:De(wr,"flex-1 font-mono text-xs md:text-xs")}),d.jsx(Ue,{variant:"outline",onClick:o,children:a(s?"settings.agentsCopied":"settings.agentsCopy")})]})]})}function yF({owner:e}){const{t}=Xe(),s=On(),[o,a]=y.useState({role:"member",canUsePaid:!1,canTrain:!1,monthlyLimitUsd:null}),[c,u]=y.useState(!1),m=kt({mutationFn:()=>Qe.createInvite(o),onSuccess:()=>(u(!1),s.invalidateQueries({queryKey:["invites"]}))}),g=m.data?`${window.location.origin}/#/invite/${m.data.token}`:null;return d.jsxs("div",{className:De(Ta,"flex flex-col gap-4"),children:[d.jsx("h3",{className:Ra,children:t("users.invite")}),d.jsx(ek,{terms:o,setTerms:a,owner:e}),d.jsx(Ue,{variant:"aurora",onClick:()=>m.mutate(),disabled:m.isPending,className:"self-start",children:t("users.createInvite")}),g&&d.jsx(tk,{link:g,label:t("users.inviteLink"),copied:c,onCopy:()=>{var v;return void((v=navigator.clipboard)==null?void 0:v.writeText(g).then(()=>u(!0)))}}),d.jsx(qr,{error:m.error})]})}function xF(){const{t:e,date:t}=Xe(),s=On(),o=Wt({queryKey:["invites"],queryFn:Qe.invites}),a=kt({mutationFn:Qe.deleteInvite,onSuccess:()=>s.invalidateQueries({queryKey:["invites"]})}),c=Date.now(),u=(o.data??[]).filter(m=>m.usedAt==null&&m.expiresAt>c);return u.length===0?null:d.jsxs("div",{className:De(Ta,"flex flex-col gap-4"),children:[d.jsx("h3",{className:Ra,children:e("users.openInvites")}),d.jsx("ul",{className:"flex flex-col divide-y divide-line",children:u.map(m=>d.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 py-3 first:pt-0 last:pb-0",children:[d.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm",children:[d.jsx(ac,{variant:"outline",className:"font-mono text-[10px] tracking-[0.12em] uppercase",children:ha(e,m.role)}),d.jsx("span",{className:"font-mono text-xs text-dim",children:e("users.expires",{when:t(m.expiresAt)})})]}),d.jsx(Eo,{label:e("users.revokeInvite"),question:e("users.revokeInviteQuestion"),confirm:e("users.revokeInvite"),onConfirm:()=>a.mutate(m.id)})]},m.id))}),d.jsx(qr,{error:a.error})]})}function wF({me:e}){var o;const{t}=Xe(),s=Wt({queryKey:["users"],queryFn:Qe.users});return d.jsxs("div",{className:De(Ta,"flex flex-col gap-2"),children:[d.jsx("h3",{className:Ra,children:t("users.people")}),d.jsx("ul",{className:"flex flex-col divide-y divide-line",children:(o=s.data)==null?void 0:o.map(a=>d.jsx(EF,{user:a,me:e},a.id))}),d.jsx(qr,{error:s.error})]})}function SF({userId:e}){var c,u;const{t}=Xe(),s=On(),o=Wt({queryKey:["user-tokens",e],queryFn:()=>Qe.userTokens(e)}),a=kt({mutationFn:m=>Qe.revokeUserToken(e,m),onSuccess:()=>s.invalidateQueries({queryKey:["user-tokens",e]})});return d.jsxs("div",{className:"flex flex-col gap-2",children:[((c=o.data)==null?void 0:c.length)===0&&d.jsx("p",{className:"text-sm text-dim",children:t("users.noTokens")}),d.jsx("ul",{className:"flex flex-col gap-2",children:(u=o.data)==null?void 0:u.map(m=>d.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3",children:[d.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[d.jsx("span",{className:"text-sm break-all",children:m.name}),d.jsx(rF,{token:m})]}),d.jsx(Eo,{label:t("tokens.revoke"),question:t("tokens.revokeQuestion",{name:m.name}),confirm:t("tokens.revoke"),disabled:a.isPending,onConfirm:()=>a.mutate(m.id)})]},m.id))}),d.jsx(qr,{error:o.error??a.error})]})}function EF({user:e,me:t}){const{t:s,date:o,bytes:a}=Xe(),c=On(),[u,m]=y.useState(!1),[g,v]=y.useState(!1),b=t.role==="owner"||e.role==="member"&&e.id!==t.id,p=kt({mutationFn:E=>Qe.updateUser(e.id,E),onSuccess:()=>c.invalidateQueries({queryKey:["users"]})}),x=kt({mutationFn:()=>Qe.resetPassword(e.id),onSuccess:()=>m(!1)}),S=x.data?`${window.location.origin}/#/reset/${x.data.token}`:null,w="font-mono text-[10px] tracking-[0.12em] uppercase";return d.jsxs("li",{className:"flex flex-col gap-3 py-4 last:pb-0",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{className:De("font-medium break-all",e.disabled&&"text-dim line-through"),children:e.username}),e.id===t.id&&d.jsx("span",{className:"text-xs text-dim",children:s("users.you")}),!b&&d.jsx(ac,{variant:"outline",className:De(w,"text-dim"),children:ha(s,e.role)}),e.totp&&d.jsx(ac,{variant:"outline",className:De(w,"border-good/40 text-good"),children:s("account.twoStep")})]}),d.jsx("p",{className:"text-xs text-dim",children:e.storage.quotaBytes==null?s("users.storage",{used:a(e.storage.usedBytes)}):s("users.storageOf",{used:a(e.storage.usedBytes),quota:a(e.storage.quotaBytes)})}),e.lastReset&&d.jsx("p",{className:"text-xs text-dim",children:s("users.lastReset",{name:e.lastReset.by,date:o(e.lastReset.at)})}),b&&d.jsxs(d.Fragment,{children:[d.jsx(ek,{terms:{role:e.role,canUsePaid:e.canUsePaid,canTrain:e.canTrain,monthlyLimitUsd:e.monthlyLimitUsd},setTerms:E=>p.mutate(E),owner:t.role==="owner"}),e.id!==t.id&&d.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.disabled?d.jsx(Ue,{variant:"outline",onClick:()=>p.mutate({disabled:!1}),children:s("users.enable")}):d.jsx(Eo,{label:s("users.disable"),question:s("users.disableQuestion",{name:e.username}),confirm:s("users.disable"),onConfirm:()=>p.mutate({disabled:!0})}),d.jsx(Eo,{label:s("users.resetPassword"),question:s("users.resetQuestion",{name:e.username}),confirm:s("users.resetPassword"),disabled:x.isPending,onConfirm:()=>x.mutate()}),d.jsx(Ue,{variant:"outline","aria-expanded":g,onClick:()=>v(E=>!E),children:s("users.tokens")})]}),g&&d.jsx(SF,{userId:e.id})]}),S&&d.jsx(tk,{link:S,label:s("users.resetLink",{name:e.username}),copied:u,onCopy:()=>{var E;return void((E=navigator.clipboard)==null?void 0:E.writeText(S).then(()=>m(!0)))}}),d.jsx(qr,{error:p.error??x.error})]})}const TF="modulepreload",RF=function(e){return"/"+e},DR={},Xh=function(t,s,o){let a=Promise.resolve();if(s&&s.length>0){let u=function(v){return Promise.all(v.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),g=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));a=u(s.map(v=>{if(v=RF(v),v in DR)return;DR[v]=!0;const b=v.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${p}`))return;const x=document.createElement("link");if(x.rel=b?"stylesheet":TF,b||(x.as="script"),x.crossOrigin="",x.href=v,g&&x.setAttribute("nonce",g),document.head.appendChild(x),b)return new Promise((S,w)=>{x.addEventListener("load",S),x.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(u){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=u,window.dispatchEvent(m),!m.defaultPrevented)throw u}return a.then(u=>{for(const m of u||[])m.status==="rejected"&&c(m.reason);return t().catch(c)})},nk=y.createContext(void 0);function CF(e){const t=y.useContext(nk);if(t===void 0)throw new Error(mn(33));return t}const Hx=y.createContext(void 0);function _a(e){const t=y.useContext(Hx);if(t===void 0&&!e)throw new Error(mn(36));return t}const NF=y.createContext(void 0);function Fx(e=!0){const t=y.useContext(NF);if(t===void 0&&!e)throw new Error(mn(25));return t}const rk=y.createContext(null);function sk(e="root"){const t=y.useContext(rk),s=y.useContext(Hx);return t===null||s===void 0?null:(e==="submenu-trigger"?s.virtualFocus||s.parentVirtualFocus:s.virtualFocus)?t:null}const jF={visible:!0,ref:null};function OF(){return jF}function kF(e,t,s="root"){const o=sk(s),c=((s==="submenu-trigger"?o==null?void 0:o.useSubmenuTrigger:o==null?void 0:o.useItem)??OF)({label:e.label,children:e.children,render:e.render}),u=Vr(t,c.ref);return{visible:c.visible,ref:u,props:c.props}}function _F(e){e.preventDefault()}function AF(e){const{closeOnClick:t,highlighted:s,id:o,nodeId:a,store:c,typingRef:u,itemRef:m,itemMetadata:g}=e,v=_a(),b=Fx(!0),p=g.type==="submenu-trigger",x=p?v.parentVirtualFocus:v.virtualFocus,w=(p&&v.parent.type==="menu"?v.parent.store:v.store).useState("webkitAriaSelected",s),{events:E}=c.useState("floatingTreeRoot"),R=c.useState("open"),C=b!==void 0,j=!x&&R&&s?0:-1;return y.useMemo(()=>({id:o,role:"menuitem",tabIndex:j,"aria-selected":w,onMouseDown:x?_F:void 0,onKeyDown(O){O.key===" "&&(u!=null&&u.current)&&O.preventDefault()},onMouseMove(O){a&&E.emit("itemhover",{nodeId:a,target:O.currentTarget})},onClick(O){t&&E.emit("close",{domEvent:O.nativeEvent,reason:kl})},onMouseUp(O){if(b){const k=b.initialCursorPointRef.current;if(b.initialCursorPointRef.current=null,C&&k&&Math.abs(O.clientX-k.x)<=1&&Math.abs(O.clientY-k.y)<=1||C&&!ky&&O.button===2)return}m.current&&c.context.allowMouseUpTriggerRef.current&&(!C||O.button===2)&&g.type==="regular-item"&&Pl(m.current,O,{detail:1,pointerType:"mouse"})}}),[t,j,o,E,a,c.context.allowMouseUpTriggerRef,u,m,b,C,g.type,w,x])}const MF={type:"regular-item"};function zF(e){const{closeOnClick:t,disabled:s,highlighted:o,id:a,store:c,typingRef:u=c.context.typingRef,nativeButton:m,itemMetadata:g,nodeId:v}=e,b=y.useRef(null),{getButtonProps:p,buttonRef:x}=ss({disabled:s,focusableWhenDisabled:!0,native:m,composite:!0}),S=AF({closeOnClick:t,highlighted:o,id:a,nodeId:v,store:c,typingRef:u,itemRef:b,itemMetadata:g}),w=y.useCallback(R=>Gn(S,{onMouseEnter(C){g.type==="submenu-trigger"&&g.setActive(C.nativeEvent)}},R,p),[S,p,g]),E=Vr(b,x);return y.useMemo(()=>({getItemProps:w,itemRef:E}),[w,E])}const DF=y.forwardRef(function(t,s){const{render:o,className:a,id:c,label:u,nativeButton:m=!1,disabled:g=!1,closeOnClick:v=!0,style:b,...p}=t,{store:x}=_a(),S=qh({guess:!0,label:u}),w=Qn(c),E=x.useState("disabled"),R=x.useState("isActive",S.index),C=x.useState("floatingNodeId"),j=x.useState("itemProps"),O=g||E,{getItemProps:k,itemRef:D}=zF({closeOnClick:v,disabled:O,highlighted:R,id:w,store:x,nativeButton:m,nodeId:C,itemMetadata:MF});return vt("div",t,{state:{disabled:O,highlighted:R},props:[j,p,k],ref:[D,s,S.ref]})}),IF=y.forwardRef(function(t,s){const o=kF(t,s);return o.visible?d.jsx(DF,{...t,ref:o.ref}):null}),PF=y.createContext(void 0);function LF(){return y.useContext(PF)}function UF(e,t){const s=Gy(e.render);if(y.isValidElement(s)){const o=s.props;if(Object.hasOwn(o,"id"))return o.id??""}return e.id??t}function BF(e,t,s){const o=UF(e,t),a=o===t?void 0:o,c=y.useCallback(u=>s==null?void 0:s(u?a:void 0),[a,s]);return[o,c]}function HF(e,t,s){const o=Gy(e.render),a=y.isValidElement(o)?o.props:void 0,c=e["aria-label"]??(a==null?void 0:a["aria-label"]);let u=e["aria-labelledby"]??(a==null?void 0:a["aria-labelledby"]);return u==null&&!c&&(u=t?t.id||void 0:s||void 0),u}const FF=y.forwardRef(function(t,s){var pe;const{render:o,className:a,style:c,finalFocus:u,id:m,initialFocus:g,...v}=t,{store:b,defaultFloatingId:p,setRenderedFloatingId:x,virtualFocus:S,orientation:w}=_a(),E=LF(),{side:R,align:C}=CF(),j=Rx()!=null,O=b.useState("open"),k=b.useState("transitionStatus"),D=b.useState("popupProps"),P=b.useState("mounted"),L=b.useState("instantType"),_=b.useState("activeTriggerElement"),V=b.useState("parent"),I=b.useState("lastOpenChangeReason"),X=b.useState("rootId"),Y=b.useState("floatingRootContext"),q=b.useState("floatingTreeRoot"),$=b.useState("closeDelay"),G=b.useState("hoverEnabled"),H=b.useState("disabled"),K=b.useState("openMethod"),B=b.useState("activeTriggerId"),A=b.useState("listElement"),[U,J]=BF(t,p,x),F=HF(t,_,B),oe=V.type==="menu"?E:void 0,N=V.type==="context-menu";let z=g??V.type!=="menu";g===void 0&&A&&V.type!=="menu"&&(z=()=>b.state.activeIndex!==null?!1:A),Ro({open:O,ref:b.context.popupRef,onComplete(){var we,Oe;O&&((Oe=(we=b.context).onOpenChangeComplete)==null||Oe.call(we,!0))}}),y.useEffect(()=>{function we(Oe){b.setOpen(!1,dt(Oe.reason,Oe.domEvent))}return q.events.on("close",we),()=>{q.events.off("close",we)}},[q.events,b]),fj(Y,{enabled:G&&!H&&!N&&V.type!=="menubar",closeDelay:$});const Z=b.useStateSetter("popupElement"),te=((pe=y.useContext(rk))==null?void 0:pe.useParentHandoff)??qF,{parentVirtualFocusRef:ue,handleFocus:W}=te(b,V,O,S),be={transitionStatus:k,side:R,align:C,open:O,nested:V.type==="menu",instant:L},de=vt("div",t,{state:be,ref:[s,b.context.popupRef,Z,J],stateAttributesMapping:Uy,props:[D,{id:U,...A?{role:"presentation"}:{role:"menu","aria-orientation":w==="horizontal"?"horizontal":void 0,"aria-labelledby":F},onKeyDown(we){var Oe;(Oe=oe==null?void 0:oe.onPopupKeyDown)==null||Oe.call(oe,we),j&&gc.has(we.key)&&we.stopPropagation()},onFocus:W},Uh(k),v,{"data-rootownerid":X}]});let fe=V.type===void 0||N;(_||V.type==="menubar"&&I!==Rh)&&(fe=!0);const xe=(oe==null?void 0:oe.getReturnElement)??ue;return d.jsx(Wy,{context:Y,openInteractionType:K,modal:N,disabled:!P,returnFocus:u??xe??fe,explicitReturnFocus:u===void 0&&xe?!1:void 0,initialFocus:z,restoreFocus:!0,getInsideElements:V.type===void 0?()=>[b.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:V.type!=="menubar"?q:void 0,previousFocusableElement:_,nextFocusableElement:V.type===void 0?b.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.context.beforeContentFocusGuardRef,children:de})}),VF={parentVirtualFocusRef:void 0,handleFocus:void 0};function qF(){return VF}const $F=y.forwardRef(function(t,s){var a;const o=((a=sk())==null?void 0:a.Popup)??FF;return d.jsx(o,{...t,ref:s})}),ok=y.createContext(void 0);function ZF(){const e=y.useContext(ok);if(e===void 0)throw new Error(mn(32));return e}const KF=y.forwardRef(function(t,s){const{keepMounted:o=!1,...a}=t,{store:c,parent:u}=_a();if(!(c.useState("mounted")||o))return null;const v=u.type==="menu"||u.type==="menubar"?"group":void 0;return d.jsx(ok.Provider,{value:o,children:d.jsx(Qy,{ref:s,...a,portalOwnerRole:v})})});function YF(e){const{store:t,domReference:s,positionerElement:o,open:a}=e,c=y.useRef(null),u=y.useRef(null),m=Mh(o);Me(()=>{var g;a||((g=u.current)==null||g.abort(),u.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[a,t]),Me(()=>{const g=s,v=c.current;if(g&&(c.current=g),!v||!g||g===v||!t.select("open"))return;t.set("instantType",void 0);const b=new AbortController;return u.current=b,m(()=>{t.select("open")&&t.set("instantType","trigger-change")},b.signal),()=>{b.abort()}},[s,m,t])}const GF=y.forwardRef(function(t,s){var He;const{anchor:o,positionMethod:a="absolute",className:c,render:u,side:m,align:g,sideOffset:v=0,alignOffset:b=0,collisionBoundary:p="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=Y2,style:C,...j}=t,{store:O,virtualFocus:k,syncHighlightedItem:D}=_a(),P=ZF(),L=Fx(!0),_=O.useState("parent"),V=O.useState("floatingRootContext"),I=O.useState("floatingTreeRoot"),X=O.useState("mounted"),Y=O.useState("open"),q=O.useState("modal"),$=O.useState("openMethod"),G=O.useState("activeTriggerElement"),H=O.useState("transitionStatus"),K=O.useState("positionerElement"),B=O.useState("instantType"),A=O.useState("adaptiveOrigin"),U=O.useState("lastOpenChangeReason"),J=O.useState("floatingNodeId"),F=O.useState("floatingParentNodeId"),oe=V.useState("domReferenceElement");let N=o,z=v,Z=b,te=g,ue=R;_.type==="context-menu"&&(N=o??((He=_.context)==null?void 0:He.anchor),te=te??"start",!m&&te!=="center"&&(Z=t.alignOffset??2,z=t.sideOffset??-5));let W=m,be=te;_.type==="menu"?(W=W??"inline-end",be=be??"start",ue=t.collisionAvoidance??G2):_.type==="menubar"&&(W=W??(_.context.orientation==="vertical"?"inline-end":"bottom"),be=be??"start");const de=_.type==="context-menu",fe=mx({anchor:N,floatingRootContext:V,positionMethod:L?"fixed":a,mounted:X,side:W,sideOffset:z,align:be,alignOffset:Z,arrowPadding:de?0:S,collisionBoundary:p,collisionPadding:x,sticky:w,nodeId:J,keepMounted:P,disableAnchorTracking:E,collisionAvoidance:ue,shift:de?{crossAxis:!("side"in ue&&ue.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:I,adaptiveOrigin:A,lazyFlip:k?"placement":!1});y.useEffect(()=>{function se(ye){ye.open&&(ye.parentNodeId===J&&O.set("hoverEnabled",!1),ye.nodeId!==J&&ye.parentNodeId===O.select("floatingParentNodeId")&&O.setOpen(!1,dt(Tu)))}return I.events.on("menuopenchange",se),()=>{I.events.off("menuopenchange",se)}},[O,I.events,J]),y.useEffect(()=>{if(O.select("floatingParentNodeId")==null)return;function se(ye){if(ye.open||ye.nodeId!==O.select("floatingParentNodeId"))return;const Ae=ye.reason??Tu;O.setOpen(!1,dt(Ae))}return I.events.on("menuopenchange",se),()=>{I.events.off("menuopenchange",se)}},[I.events,O]);const xe=Rn();y.useEffect(()=>{Y||xe.clear()},[Y,xe]),y.useEffect(()=>{function se(ye){if(!(!Y||ye.nodeId!==O.select("floatingParentNodeId")))if(ye.target&&G&&G!==ye.target){const Ae=O.select("closeDelay");Ae>0?xe.isStarted()||xe.start(Ae,()=>{O.setOpen(!1,dt(Tu))}):O.setOpen(!1,dt(Tu))}else xe.clear()}return I.events.on("itemhover",se),()=>{I.events.off("itemhover",se)}},[I.events,Y,G,O,xe]),y.useEffect(()=>{const se={open:Y,nodeId:J,parentNodeId:F,reason:O.select("lastOpenChangeReason")};I.events.emit("menuopenchange",se)},[I.events,Y,O,J,F]),YF({store:O,domReference:oe,positionerElement:K,open:Y});const pe={open:Y,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:_.type==="menu",instant:B},we=_.type==="menubar"&&_.context.modal;xO(Y&&(we||q&&U!==Bn),$==="touch",K,G);const ke=hx(t,pe,{styles:fe.positionerStyles,transitionStatus:H,props:j,refs:[s,O.useStateSetter("positionerElement")],hidden:!X,inert:!Y}),Pe=X&&_.type!=="menu"&&(_.type!=="menubar"&&q&&U!==Bn||_.type==="menubar"&&_.context.modal);let Te=null;return _.type==="menubar"?Te=_.context.contentElement:_.type===void 0&&(Te=G),d.jsxs(nk.Provider,{value:fe,children:[Pe&&d.jsx(Tx,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:px(!Y),cutout:Te}),d.jsx(qL,{id:J,children:d.jsx(hd,{elementsRef:O.context.itemDomElements,labelsRef:O.context.itemLabels,onMapChange:D,children:ke})})]})}),QF=y.createContext(null);function ik(e){return y.useContext(QF)}function XF(e){return e==null?lr:e.type.startsWith("key")?Hy:e.type.startsWith("mouse")||e.type.startsWith("pointer")?G6:lr}const JF={...zu,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{var o;const s=zu.triggerPopupId(e,t);return s?((o=e.listElement)==null?void 0:o.id)||s:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Fs&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>{var t;return((t=e.highlightedItem)==null?void 0:t.id)||void 0},isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType==="trigger-change"&&!zu.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class WF extends id{constructor(t,s,o=!1){const a=new Dh,c=tV(a,s,o,t);super(c,eV(a),JF),this.observe("parent",u=>{u.type==="menu"?this.context.allowMouseUpTriggerRef=u.store.context.allowMouseUpTriggerRef:u.type!==void 0&&(this.context.allowMouseUpTriggerRef=u.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const t=this.state.parent;if(t.type!=="menu")return;let s=t.store.select("rootId"),o=t.store.select("floatingTreeRoot"),a=t.store.select("keyboardEventRelay");return t.store.subscribe(()=>{const c=t.store.select("rootId"),u=t.store.select("floatingTreeRoot"),m=t.store.select("keyboardEventRelay");s===c&&o===u&&a===m||(s=c,o=u,a=m,this.notifyAll())})}setOpen(t,s){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:s})}setActiveIndex(t,s,o){if(this.state.activeIndex!==t){const c=(t===null?void 0:this.context.itemDomElements.current[t])===this.context.reportedItem;this.context.highlightReason=c?"none":s,this.context.highlightEvent=c?void 0:o}this.set("activeIndex",t)}highlightItem(t,s,o){const a=this.context.itemDomElements.current.indexOf(t);a>-1&&this.setActiveIndex(a,s,o)}}function eV(e){return{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:y.createRef(),beforeTriggerFocusGuardRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function tV(e,t,s=!1,o){return{...lx(e,t,s),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Ut,inputProps:Ut,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Xy,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ut,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...o}}const IR=y.createContext(null);function ak(e,t){return(e===ka||e===kl)&&(t==null?void 0:t.detail)===0}function nV(e,t){return e===qm||ak(e,t)}const rV=vh(function(t){const{children:s,open:o,onOpenChange:a,onOpenChangeComplete:c,onItemHighlighted:u,defaultOpen:m=!1,disabled:g=!1,modal:v,loopFocus:b=!0,orientation:p="vertical",actionsRef:x,closeParentOnEsc:S=!1,handle:w,triggerId:E,defaultTriggerId:R=null,highlightItemOnHover:C=!0,isSubmenu:j=!1,virtualFocus:O=!1,virtualFocusRef:k,allowEscape:D=!0,resetOnPointerLeave:P=!0}=t,L=Fx(!0),_=_a(!0),V=ik(!0),I=_==null?void 0:_.store,X=(_==null?void 0:_.virtualFocus)??!1,Y=y.useMemo(()=>j&&I?{type:"menu",store:I}:V?{type:"menubar",context:V}:L&&!I?{type:"context-menu",context:L}:{type:void 0},[L,I,V,j]),q=Qn(),$=Qn(),[G,H]=y.useState(void 0),K=(G??$)||void 0,B=Ri(),A=Y.type==="menu"?Y.store:void 0,U=(o??m)&&(A==null?void 0:A.state.transitionStatus)==="starting",J=In(()=>U?A==null?void 0:A.state.instantType:void 0).current,F=In(()=>{const je=new WF({open:m,openProp:o,activeTriggerId:R,triggerIdProp:E,parent:Y,disabled:g,highlightItemOnHover:C,modal:Y.type===void 0?v:void 0,rootId:q,instantType:J},K,B!=null);return je.context.virtualFocusRef=k,je}).current;F.useControlledProp("openProp",o),F.useControlledProp("triggerIdProp",E),F.useContextCallback("onOpenChangeComplete",c);const oe=F.useState("floatingTreeRoot"),N=nj(oe),z=F.useState("open"),Z=F.useState("activeTriggerElement"),te=F.useState("positionerElement"),ue=F.useState("hoverEnabled"),W=F.useState("disabled"),be=F.useState("lastOpenChangeReason"),de=F.useState("parent"),fe=F.useState("activeIndex"),xe=F.useState("keyboardOpen"),pe=F.useState("payload"),we=F.useState("floatingParentNodeId"),Oe=y.useRef(null),ke=y.useRef(de.type!=="context-menu"),Pe=Rn(),Te=y.useRef(!0),He=Rn(),se=we!=null,{openMethod:ye,triggerProps:Ae}=fO(z);F.useSyncedValues({disabled:g,highlightItemOnHover:C,modal:de.type===void 0?v:void 0,openMethod:ye,rootId:q}),ox(F);const{forceUnmount:Be,transitionStatus:ae}=ix(z,F,()=>{F.set("allowMouseEnter",!1)},U),ve=Mh(F.context.popupRef);y.useEffect(()=>{if(J===void 0)return;const je=()=>{F.state.instantType===J&&F.set("instantType",void 0)};if(!z){je();return}if(ae!==void 0)return;if(F.context.popupRef.current==null){je();return}const ee=new AbortController;return ve(je,ee.signal),()=>{ee.abort()}},[J,z,ae,ve,F]),Me(()=>{L&&!_?F.update({parent:{type:"context-menu",context:L},floatingNodeId:N,floatingParentNodeId:B}):(_||!F.select("activeTriggerElement"))&&F.update({floatingNodeId:N,floatingParentNodeId:B})},[L,_,N,B,Z,F]),y.useEffect(()=>{if(z||(Oe.current=null),de.type==="context-menu"){if(!z){Pe.clear(),ke.current=!1;return}Pe.start(500,()=>{ke.current=!0})}},[Pe,z,de.type]),Me(()=>{!z&&!ue&&F.set("hoverEnabled",!0)},[z,ue,F]);const ze=Ie((je,ee)=>{const Le=ee.reason;if(!je&&!F.select("open")||z===je&&ee.trigger===Z&&be===Le)return;const Ce=rx(ee);if(!je&&ee.trigger==null&&(ee.trigger=Z??void 0),a==null||a(je,ee),ee.isCanceled)return;F.state.floatingRootContext.dispatchOpenChange(je,ee);const et=ee.event;if(je===!1&&Le!==kl&&(et==null?void 0:et.type)==="click"&&et.pointerType==="touch"&&!Te.current)return;je&&Le===Ol?(Te.current=!1,He.start(300,()=>{Te.current=!0})):(Te.current=!0,He.clear());const Ze=!je&&(Le===Ch||Le==null);Oe.current=ee.event;const pt=nx(F.state,je,ee.trigger,Ce());pt.openChangeReason=Le,pt.keyboardOpen=je&&nV(Le,et),de.type==="menubar"&&(Le===Ol||Le===ya||Le===Bn||Le===qm||Le===Tu)?pt.instantType="group":ak(Le,et)?pt.instantType="click":Ze?pt.instantType="dismiss":pt.instantType=void 0,F.update(pt)}),_e=rj({popupStore:F,floatingRootContext:F.state.floatingRootContext,floatingId:K,nested:B!=null,onOpenChange:ze}),Re=_e.context.events;Me(()=>{const je=({open:ee,eventDetails:Le})=>ze(ee,Le);return Re.on("setOpen",je),()=>{Re==null||Re.off("setOpen",je)}},[Re,ze]),Me(()=>F.subscribeToParentMenu(),[F]);const Ge=y.useCallback(()=>{F.setOpen(!1,dt(Nh))},[F]);y.useImperativeHandle(x,()=>({unmount:Be,close:Ge}),[Be,Ge]);let Ye;de.type==="context-menu"&&(Ye=de.context),y.useImperativeHandle(Ye==null?void 0:Ye.positionerRef,()=>te,[te]),y.useImperativeHandle(Ye==null?void 0:Ye.actionsRef,()=>({setOpen:ze}),[ze]);const mt=Ah(_e,{enabled:!W,bubbles:{escapeKey:S&&de.type==="menu"},outsidePress(){var je;return de.type!=="context-menu"||((je=Oe.current)==null?void 0:je.type)==="contextmenu"?!0:ke.current},externalTree:se?oe:void 0}),nt=fc(),ut=hj(_e,{enabled:!W,listRef:F.context.itemDomElements,activeIndex:fe,virtual:O,nested:de.type==="menubar"||!O&&de.type!==void 0,parentOrientation:de.type==="menubar"?de.context.orientation:void 0,loopFocus:b,focusItemOnOpen:O?xe:void 0,allowEscape:O&&b&&D,orientation:p,triggerOrientation:O?"vertical":p,rtl:nt==="rtl",disabledIndices:ns,onNavigate(je,ee){F.setActiveIndex(je,XF(ee),ee==null?void 0:ee.nativeEvent)},openOnArrowKeyDown:de.type!=="context-menu"&&!(O&&j),externalTree:!O&&se?oe:void 0,nestedReturnFocusRef:A==null?void 0:A.context.virtualFocusRef,focusItemOnHover:C,resetOnPointerLeave:P}),Rt=y.useCallback(je=>{F.context.typingRef.current=je},[F]),At=pj(_e,{enabled:!W&&!O,listRef:F.context.itemLabels,elementsRef:F.context.itemDomElements,activeIndex:fe,resetMs:UL,onMatch:(je,ee)=>{z&&je!==fe&&F.setActiveIndex(je,Hy,ee.nativeEvent)},onTyping:Rt}),it=Ie(u),qe=y.useRef(-1),at=Ie(()=>{const je=F.state.activeIndex,ee=je===null?void 0:F.context.itemDomElements.current[je]??void 0;if((ee==null?void 0:ee.isConnected)===!1)return;const Le=ee===void 0?-1:je;if(qe.current===Le&&F.context.reportedItem===ee)return;qe.current=Le,F.context.reportedItem=ee,O&&F.set("highlightedItem",ee);const{highlightReason:Ce,highlightEvent:et}=F.context;F.context.highlightReason=lr,F.context.highlightEvent=void 0,u&&it(ee,By(Ce,et,{label:ee===void 0?void 0:F.context.itemLabels.current[Le]??void 0}))});Me(()=>{at()},[fe,at]);const Nt=y.useMemo(()=>{if(!O)return ut.reference;if(!ut.trigger)return Ut;const{onFocus:je,...ee}=ut.trigger;return ee},[O,ut.reference,ut.trigger]);F.useSyncedValue("inputProps",O?ut.reference??Ut:Ut);const ht=y.useMemo(()=>{const je=Gn(At.reference,Nt,mt.reference,{onMouseMove(){F.set("allowMouseEnter",!0)}},Ae);return je["aria-haspopup"]="menu",je["aria-expanded"]=z,je},[F,At.reference,Nt,mt.reference,Ae,z]),Gt=y.useMemo(()=>{const je=Gn(ut.trigger,mt.trigger,Ae);return je["aria-haspopup"]="menu",je["aria-expanded"]=!1,je},[ut.trigger,mt.trigger,Ae]);In(()=>(F.update({inactiveTriggerProps:Gt}),null));const Bt=y.useMemo(()=>Gn(zh,{onMouseMove(){F.set("allowMouseEnter",!0),de.type==="menu"&&F.set("hoverEnabled",!1)},onClick(){F.select("hoverEnabled")&&F.set("hoverEnabled",!1)},onKeyDown(je){const ee=F.select("keyboardEventRelay");ee&&!je.isPropagationStopped()&&ee(je)}},At.floating,ut.floating,mt.floating),[de.type,F,At.floating,ut.floating,mt.floating]),Ft=ut.item??Ut;ax(F,{floatingRootContext:_e,activeTriggerProps:ht,inactiveTriggerProps:Gt,popupProps:Bt,itemProps:Ft});const sn=y.useMemo(()=>({store:F,parent:Y,orientation:p,loopFocus:b,allowEscape:D,defaultFloatingId:$,setRenderedFloatingId:H,virtualFocus:O,parentVirtualFocus:X,syncHighlightedItem:at}),[F,Y,p,b,D,$,O,X,at]),rt=typeof s=="function"?s({payload:pe}):s;let Dt=d.jsxs(Hx.Provider,{value:sn,children:[w&&d.jsx(tx,{handle:w,store:F}),rt]});return(de.type===void 0||de.type==="context-menu")&&(Dt=d.jsx($L,{externalTree:oe,children:Dt})),Dt});function sV(e){const t=y.useContext(IR);if(t===null)return d.jsx(rV,{...e});const s=t.Root;return d.jsx(IR.Provider,{value:null,children:d.jsx(s,{...t.options,...e})})}function lk(e={}){const{highlightItemOnHover:t,highlightedIndex:s,onHighlightedIndexChange:o}=Fh(),{ref:a,index:c}=qh(e),u=s===c,m=y.useRef(null),g=Vr(a,m);return{compositeProps:{tabIndex:u?0:-1,onFocus(){o(c)},onMouseMove(){const b=m.current;if(!t||!b)return;const p=b.hasAttribute("disabled")||b.ariaDisabled==="true";!u&&!p&&b.focus()}},compositeRef:g,index:c}}function ck(e){const{render:t,className:s,style:o,state:a=Ut,props:c=ns,refs:u=ns,metadata:m,stateAttributesMapping:g,tag:v="div",...b}=e,{compositeProps:p,compositeRef:x}=lk({metadata:m});return vt(v,e,{state:a,ref:[x,...u],props:[p,...c,b],stateAttributesMapping:g})}function uk(e){if(rn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!po(e))return uk(wo(e))}function oV(e,t){function s(c,u,m){var v;const g=c.currentTarget;Hs.flushSync(()=>{e.setOpen(!1,dt(ya,c.nativeEvent,g))}),(v=EL(g.isConnected?g:t.current,u,m))==null||v.focus()}function o(c){s(c,-1,e.select("positionerElement"))}function a(c){var m;const u=e.select("positionerElement");u&&zl(c,u)?(m=e.context.beforeContentFocusGuardRef.current)==null||m.focus():s(c,1,u)}return{handlePreFocusGuardFocus:o,handleFocusTargetFocus:a}}function iV(e){const{enabled:t=!0,mouseDownAction:s,open:o}=e,a=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:c=>{(s==="open"&&!o||s==="close"&&o)&&(a.current=!0,Tt(c.currentTarget).addEventListener("click",()=>{a.current=!1},{once:!0}))},onClick:c=>{a.current&&(a.current=!1,c.preventBaseUIHandler())}}:Ut,[t,s,o])}const aV=jy(function(t,s){const{render:o,className:a,style:c,disabled:u=!1,nativeButton:m=!0,id:g,openOnHover:v,delay:b=100,closeDelay:p=0,handle:x,payload:S,...w}=t,E=_a(!0),C=cx(x)??(E==null?void 0:E.store);if(!C)throw new Error(mn(85));const j=Qn(g),O=C.useState("isTriggerActive",j),k=C.useState("floatingRootContext"),D=C.useState("isOpenedByTrigger",j),P=C.useState("triggerControlsId",j),L=y.useRef(null),_=cV(),V=Fh(!0),I=Ci(),X=y.useMemo(()=>I??new Xy,[I]),Y=nj(X),q=Ri(),{registerTrigger:$,isMountedByThisTrigger:G}=sx(j,L,C,{payload:S,closeDelay:p,parent:_,floatingTreeRoot:X,floatingNodeId:Y,floatingParentNodeId:q,keyboardEventRelay:V==null?void 0:V.relayKeyboardEvent}),H=_.type==="menubar",K=C.useState("disabled"),B=u||K||H&&_.context.disabled,{getButtonProps:A,buttonRef:U}=ss({disabled:B,native:m});y.useEffect(()=>{!D&&_.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,D,_.type]);const J=y.useRef(null),F=Rn(),oe=Ie(He=>{if(!J.current)return;F.clear(),C.context.allowMouseUpTriggerRef.current=!1;const se=He.target;ot(J.current,se)||ot(C.select("positionerElement"),se)||se===J.current||se!=null&&uk(se)===C.select("rootId")||hO(He,J.current)||X.events.emit("close",{domEvent:He,reason:w2})});y.useEffect(()=>{const He=Tt(J.current);if(D&&C.select("lastOpenChangeReason")===Bn)return He.addEventListener("mouseup",oe,{once:!0}),()=>{He.removeEventListener("mouseup",oe)}},[D,oe,C]);const N=H&&_.context.hasSubmenuOpen,Z=mj(k,{enabled:(v??N)&&!B&&(!H||N&&!G),handleClose:gj({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:_.type===void 0?b:void 0,delay:{close:p},triggerElementRef:L,externalTree:X,isActiveTrigger:O,isClosing:()=>C.select("transitionStatus")==="ending"}),te=lV(D,C.select("lastOpenChangeReason")),ue=ex(k,{enabled:!B,event:D&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:_.type===void 0?te:!1}),W=uj(k,{enabled:!B&&N}),be=iV({open:D,enabled:H,mouseDownAction:"open"}),de=y.useMemo(()=>Gn(W.reference,ue.reference),[W.reference,ue.reference]),fe=C.useState("triggerProps",G),xe=C.useState("filterTriggerProps"),{handlePreFocusGuardFocus:pe,handleFocusTargetFocus:we}=oV(C,L),Oe={disabled:B,open:D},ke=[J,s,U,$,L],Pe=[de,Z??Ut,fe,{"aria-haspopup":"menu","aria-controls":P,id:j,onMouseDown:He=>{if(C.select("open"))return;F.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Tt(He.currentTarget).addEventListener("mouseup",oe,{once:!0})}},xe,H?{role:"menuitem"}:{},be,w,A],Te=vt("button",t,{enabled:!H,stateAttributesMapping:Hb,state:Oe,ref:ke,props:Pe});return H?d.jsx(ck,{tag:"button",render:o,className:a,style:c,state:Oe,refs:ke,props:Pe,stateAttributesMapping:Hb}):D?d.jsxs(y.Fragment,{children:[d.jsx(oc,{ref:C.context.beforeTriggerFocusGuardRef,onFocus:pe},`${j}-pre-focus-guard`),d.jsx(y.Fragment,{children:Te},j),d.jsx(oc,{ref:C.context.triggerFocusTargetRef,onFocus:we},`${j}-post-focus-guard`)]}):d.jsx(y.Fragment,{children:Te},j)});function lV(e,t){const s=Rn(),[o,a]=y.useState(!1);return Me(()=>{e&&t===Bn?(a(!0),s.start(BL,()=>{a(!1)})):e||(s.clear(),a(!1))},[e,t,s]),o}function cV(){const e=ik();return y.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function uV({...e}){return d.jsx(sV,{"data-slot":"dropdown-menu",...e})}function dV({...e}){return d.jsx(aV,{"data-slot":"dropdown-menu-trigger",...e})}function fV({align:e="start",alignOffset:t=0,side:s="bottom",sideOffset:o=4,className:a,...c}){return d.jsx(KF,{children:d.jsx(GF,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:s,sideOffset:o,children:d.jsx($F,{"data-slot":"dropdown-menu-content",className:De("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",a),...c})})})}function mV({className:e,inset:t,variant:s="default",...o}){return d.jsx(IF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:De("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...o})}const dk=vh(function(t){return BO("dialog",t)});function Xb({...e}){return d.jsx(dk,{"data-slot":"sheet",...e})}function hV({...e}){return d.jsx(_x,{"data-slot":"sheet-portal",...e})}function pV({className:e,...t}){return d.jsx(jx,{"data-slot":"sheet-overlay",className:De("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function Jb({className:e,children:t,side:s="right",showCloseButton:o=!0,...a}){const{t:c}=Xe();return d.jsxs(hV,{children:[d.jsx(pV,{}),d.jsxs(kx,{"data-slot":"sheet-content","data-side":s,className:De("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...a,children:[t,o&&d.jsxs(Gh,{"data-slot":"sheet-close",render:d.jsx(Ue,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[d.jsx(Oa,{}),d.jsx("span",{className:"sr-only",children:c("ui.close")})]})]})]})}function Wb({className:e,...t}){return d.jsx("div",{"data-slot":"sheet-header",className:De("flex flex-col gap-0.5 p-4",e),...t})}function ey({className:e,...t}){return d.jsx(Ax,{"data-slot":"sheet-title",className:De("font-heading text-base font-medium text-foreground",e),...t})}function gV({className:e,...t}){return d.jsx(Ox,{"data-slot":"sheet-description",className:De("text-sm text-muted-foreground",e),...t})}const nb=768;function vV(){const[e,t]=y.useState(void 0);return y.useEffect(()=>{const s=window.matchMedia(`(max-width: ${nb-1}px)`),o=()=>{t(window.innerWidth<nb)};return s.addEventListener("change",o),t(window.innerWidth<nb),()=>s.removeEventListener("change",o)},[]),!!e}const bV="hatchlight.sidebar",yV="16rem",xV="18rem",wV="3rem",SV="b",fk=y.createContext(null);function vd(){const e=y.useContext(fk);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function EV({defaultOpen:e=!0,open:t,onOpenChange:s,className:o,style:a,children:c,...u}){const m=vV(),[g,v]=y.useState(!1),[b,p]=y.useState(e),x=t??b,S=y.useCallback(C=>{const j=typeof C=="function"?C(x):C;s?s(j):p(j);try{localStorage.setItem(bV,String(j))}catch{}},[s,x]),w=y.useCallback(()=>m?v(C=>!C):S(C=>!C),[m,S]);y.useEffect(()=>{const C=j=>{const O=j.target;!((O==null?void 0:O.isContentEditable)||(O==null?void 0:O.tagName)==="INPUT"||(O==null?void 0:O.tagName)==="TEXTAREA")&&j.key===SV&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),w())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[w]);const E=x?"expanded":"collapsed",R=y.useMemo(()=>({state:E,open:x,setOpen:S,isMobile:m,openMobile:g,setOpenMobile:v,toggleSidebar:w}),[E,x,S,m,g,w]);return d.jsx(fk.Provider,{value:R,children:d.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":yV,"--sidebar-width-icon":wV,...a},className:De("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",o),...u,children:c})})}function TV({side:e="left",variant:t="sidebar",collapsible:s="offcanvas",className:o,children:a,dir:c,...u}){const{t:m}=Xe(),{isMobile:g,state:v,openMobile:b,setOpenMobile:p}=vd();return s==="none"?d.jsx("div",{"data-slot":"sidebar",className:De("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",o),...u,children:a}):g?d.jsx(Xb,{open:b,onOpenChange:p,...u,children:d.jsxs(Jb,{dir:c,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":xV},side:e,children:[d.jsxs(Wb,{className:"sr-only",children:[d.jsx(ey,{children:m("ui.menu")}),d.jsx(gV,{children:m("ui.menuDescription")})]}),d.jsx("nav",{"aria-label":m("ui.menu"),className:"flex h-full w-full flex-col",children:a})]})}):d.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":v,"data-collapsible":v==="collapsed"?s:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[d.jsx("div",{"data-slot":"sidebar-gap",className:De("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),d.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:De("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...u,children:d.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:a})})]})}function mk({className:e,onClick:t,...s}){const{t:o}=Xe(),{toggleSidebar:a}=vd();return d.jsxs(Ue,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:De(e),onClick:c=>{t==null||t(c),a()},...s,children:[d.jsx(R5,{}),d.jsx("span",{className:"sr-only",children:o("ui.toggleSidebar")})]})}function RV({className:e,...t}){const{t:s}=Xe(),{toggleSidebar:o}=vd();return d.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":s("ui.toggleSidebar"),tabIndex:-1,onClick:o,title:s("ui.toggleSidebar"),className:De("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function CV({className:e,...t}){return d.jsx("main",{"data-slot":"sidebar-inset",className:De("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function NV({className:e,...t}){return d.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:De("flex flex-col gap-2 p-2",e),...t})}function jV({className:e,...t}){return d.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:De("flex flex-col gap-2 p-2",e),...t})}function OV({className:e,...t}){return d.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:De("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function kV({className:e,...t}){return d.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:De("relative flex w-full min-w-0 flex-col p-2",e),...t})}function _V({className:e,render:t,...s}){return Hh({defaultTagName:"div",props:Gn({className:De("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e)},s),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function AV({className:e,...t}){return d.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:De("w-full text-sm",e),...t})}function rb({className:e,...t}){return d.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:De("flex w-full min-w-0 flex-col gap-0",e),...t})}function ym({className:e,...t}){return d.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:De("group/menu-item relative",e),...t})}const MV=ad("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function xm({render:e,isActive:t=!1,variant:s="default",size:o="default",tooltip:a,className:c,...u}){const{isMobile:m,state:g}=vd(),v=Hh({defaultTagName:"button",props:Gn({className:De(MV({variant:s,size:o}),c)},u),render:a?d.jsx(Gj,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:o,active:t}});return a?(typeof a=="string"&&(a={children:a}),d.jsxs(Yj,{children:[v,d.jsx(Qj,{side:"right",align:"center",hidden:g!=="collapsed"||m,...a})]})):v}function zV({className:e,render:t,showOnHover:s=!1,...o}){return Hh({defaultTagName:"button",props:Gn({className:De("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",s&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",e)},o),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}const hk=y.createContext(void 0);function pk(){const e=y.useContext(hk);if(e===void 0)throw new Error(mn(64));return e}const DV="data-activation-direction",Vx={tabActivationDirection:e=>({[DV]:e})},IV=y.forwardRef(function(t,s){const{className:o,defaultValue:a=0,onValueChange:c,orientation:u="horizontal",render:m,value:g,style:v,...b}=t,p=t.defaultValue!==void 0,x=y.useRef([]),[S,w]=y.useState(()=>new Map),[E,R]=So({controlled:g,default:a,name:"Tabs",state:"value"}),C=g!==void 0,[j,O]=y.useState(()=>new Map),k=y.useRef(void 0),D=y.useCallback(ue=>ty(j,ue),[j]),[P,L]=y.useState(()=>({previousValue:E,tabActivationDirection:"none"})),{previousValue:_,tabActivationDirection:V}=P;let I=V,X=!1;_!==E&&(I=PR(_,E,u,j),X=_!=null&&E!=null&&D(E)==null);const Y=X?_:E,q=_!==Y||V!==I;Me(()=>{q&&L({previousValue:Y,tabActivationDirection:I})},[Y,q,I]);const $=Ie((ue,W)=>{const be=PR(E,ue,u,j);W.activationDirection=be,c==null||c(ue,W),!W.isCanceled&&R(()=>ue)}),G=Ie((ue,W)=>{c==null||c(ue,dt(W,void 0,void 0,{activationDirection:"none"}))}),H=Ie((ue,W)=>(w(be=>{const de=new Map(be);return de.set(ue,W),de}),()=>{w(be=>{if(be.get(ue)!==W)return be;const de=new Map(be);return de.delete(ue),de})})),K=y.useCallback(ue=>S.get(ue),[S]),B=y.useCallback(ue=>{for(const W of j.values())if(ue===W.value)return W.id},[j]),A=y.useMemo(()=>({getTabElementBySelectedValue:D,getTabIdByPanelValue:B,getTabPanelIdByValue:K,onValueChange:$,orientation:u,registerMountedTabPanel:H,setTabMap:O,tabActivationDirection:I,value:E}),[D,B,K,$,u,H,O,I,E]),U=y.useMemo(()=>{for(const ue of j.values())if(ue.value===E)return ue},[j,E]),J=y.useMemo(()=>{for(const ue of j.values())if(!ue.disabled)return ue.value},[j]),F=y.useRef(!p),oe=y.useRef(a),N=y.useRef(p),z=y.useRef(!1);Me(()=>{var fe;if(C)return;function ue(xe,pe){R(()=>xe),L({previousValue:xe,tabActivationDirection:"none"}),G(xe,pe),F.current=!1}if(j.size===0){z.current&&E!==null&&!((fe=k.current)!=null&&fe.isConnected)&&ue(null,TT);return}z.current=!0,k.current=j.keys().next().value;const W=U==null?void 0:U.disabled,be=U==null&&E!==null;if(!W&&E===oe.current&&(N.current=!1),N.current&&W&&E===oe.current)return;const de=F.current;if(W||be){const xe=J??null;if(E===xe){F.current=!1;return}let pe=TT;de?pe=RT:W&&(pe=S2),ue(xe,pe);return}de&&U!=null&&(G(E,RT),F.current=!1)},[J,C,G,U,R,j,E]);const te=vt("div",t,{state:{orientation:u,tabActivationDirection:I},ref:s,props:b,stateAttributesMapping:Vx});return d.jsx(hk.Provider,{value:A,children:d.jsx(hd,{elementsRef:x,children:te})})});function ty(e,t){for(const[s,o]of e.entries())if(t===o.value)return s;return null}function PR(e,t,s,o){if(e==null||t==null)return"none";const[a,c,u]=s==="horizontal"?["left","left","right"]:["top","up","down"],m=ty(o,e),g=ty(o,t);if(m==null||g==null)return m!==g&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?u:c:"none";const v=m.getBoundingClientRect()[a],b=g.getBoundingClientRect()[a];return b<v?c:b>v?u:"none"}const qx="data-composite-item-active",gk=y.createContext(void 0);function PV(){const e=y.useContext(gk);if(e===void 0)throw new Error(mn(65));return e}const LV=y.forwardRef(function(t,s){const{className:o,disabled:a=!1,render:c,value:u,id:m,nativeButton:g=!0,style:v,...b}=t,{value:p,getTabPanelIdByValue:x,onValueChange:S,orientation:w,tabActivationDirection:E}=pk(),{activateOnFocus:R,registerTabResizeObserverElement:C,tabsListElement:j}=PV(),{highlightedIndex:O,onHighlightedIndexChange:k}=Fh(),D=Qn(m),P=y.useMemo(()=>({disabled:a,id:D,value:u}),[a,D,u]),{compositeProps:L,compositeRef:_,index:V}=lk({metadata:P}),I=u===p,X=y.useRef(!1),Y=y.useRef(null),q=Ie(z=>{var Z;(Z=Y.current)==null||Z.call(Y),Y.current=z?C(z):null});Me(()=>{if(X.current){X.current=!1;return}if(!(I&&V>-1&&O!==V))return;const z=j;if(z!=null){const Z=or(Tt(z));if(Z&&ot(z,Z))return}a||k(V)},[I,V,O,k,a,j]);const{getButtonProps:$,buttonRef:G}=ss({disabled:a,native:g,focusableWhenDisabled:!0}),H=x(u),K=y.useRef(!1),B=y.useRef(!1);function A(z){S(u,dt(lr,z.nativeEvent,void 0,{activationDirection:"none"}))}function U(z){I||a||A(z)}function J(z){I||a||R&&(!K.current||B.current)&&A(z)}function F(z){if(I||a)return;K.current=!0,B.current=z.button===0;const Z=Tt(z.currentTarget);function te(){K.current=!1,B.current=!1,Z.removeEventListener("pointerup",te),Z.removeEventListener("pointercancel",te)}Z.addEventListener("pointerup",te),Z.addEventListener("pointercancel",te)}return vt("button",t,{state:{disabled:a,active:I,orientation:w,tabActivationDirection:E},ref:[s,G,_,q],props:[L,{role:"tab","aria-controls":H,"aria-selected":I,id:D,onClick:U,onFocus:J,onPointerDown:F,[qx]:I?"":void 0,onKeyDownCapture(){X.current=!0}},b,$],stateAttributesMapping:Vx})}),UV="",BV=()=>()=>{},HV=()=>!0,FV=()=>!1;function VV(){return Ih.useSyncExternalStore(BV,HV,FV)}function qV(){const[e,t]=y.useState(!1);return y.useEffect(()=>{t(!0)},[]),e}const $V=_h(18)?VV:qV;function $x(){return!$V()}function ZV(e){const{script:t}=e,{nonce:s}=EO();return $x()?d.jsx("script",{nonce:s,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}function KV(e){const{loopFocus:t=!0,orientation:s="both",grid:o,onLoop:a,direction:c,highlightedIndex:u,onHighlightedIndexChange:m,rootRef:g,enableHomeAndEndKeys:v=!1,stopEventPropagation:b,disabledIndices:p,modifierKeys:x=ns}=e,[S,w]=y.useState(0),E=o!=null,R=y.useRef(null),C=Vr(R,g),j=y.useRef([]),O=y.useRef(!1),k=y.useRef(null),D=u??S,P=Ie((X,Y=!1)=>{if(k.current=j.current[X]??null,(m??w)(X),Y){const q=j.current[X];xR(R.current,q,c,s)}}),L=Ie(X=>{var G;if(X.size===0)return;if(O.current){const H=j.current,K=H.indexOf(k.current);if(K===-1){const B=H[D];!B||Ml(H,D,p)?P(YV(H,p)):k.current=B}else K!==D&&P(K);return}O.current=!0;const Y=Array.from(X.keys()),q=Y.find(H=>H==null?void 0:H.hasAttribute(qx))??null,$=q?((G=X.get(q))==null?void 0:G.index)??-1:-1;if($!==-1)P($);else if(Ml(Y,D,p)){const H=Al(Y,{disabledIndices:p});_l(Y,H)||P(H)}xR(R.current,q,c,s)});Me(()=>{if(p==null||u!=null||!O.current)return;const X=j.current;if(Ml(X,D,p)){const Y=Al(X,{disabledIndices:p});_l(X,Y)||P(Y)}},[p,u,D,j,P]);const _=Ie((X,Y,q)=>a?a(X,Y,q,j):q),V=Ie(X=>{const Y=X.key===ih||X.key===ah;if(!gc.has(X.key)||!v&&Y||GV(X,x)||!R.current)return;const $=c==="rtl",G=$?sh:oh,H=$?oh:sh,K=s==="vertical"?rh:G,B=s==="vertical"?nh:H,A=Pn(X.nativeEvent);if(A!=null&&yR(A)&&!nO(A)){const z=A.selectionStart,Z=A.selectionEnd,te=A.value;if(z==null||X.shiftKey||z!==Z||X.key!==B&&z<te.length||X.key!==K&&z>0)return}let U=D;const J=km(j,p),F=$b(j,p);o!=null&&(U=o({disabledIndices:p,elementsRef:j,event:X,highlightedIndex:D,loopFocus:t,maxIndex:F,minIndex:J,onLoop:_,orientation:s,rtl:$}));const oe=s!=="vertical"&&X.key===G||s!=="horizontal"&&X.key===rh,N=s!=="vertical"&&X.key===H||s!=="horizontal"&&X.key===nh;v&&(X.key===ih?U=J:X.key===ah&&(U=F)),U===D&&(oe||N)&&(t&&U===F&&oe?(U=J,a&&(U=a(X,D,U,j))):t&&U===J&&N?(U=F,a&&(U=a(X,D,U,j))):U=Al(j.current,{startingIndex:U,decrement:N,disabledIndices:p})),U!==D&&!_l(j.current,U)&&(b&&X.stopPropagation(),(E||Y||oe||N)&&X.preventDefault(),P(U,!0),queueMicrotask(()=>{var z;(z=j.current[U])==null||z.focus()}))});return{props:{ref:C,onFocus(X){const Y=R.current,q=Pn(X.nativeEvent);!Y||q==null||!yR(q)||q.setSelectionRange(0,q.value.length)},onKeyDown:V},highlightedIndex:D,onHighlightedIndexChange:P,elementsRef:j,onMapChange:L,relayKeyboardEvent:V}}function YV(e,t){let s=-1;for(let o=0;o<e.length;o+=1){const a=e[o];if(!(!a||Ml(e,o,t))){if(a.hasAttribute(qx))return o;s===-1&&(s=o)}}return Math.max(s,0)}function GV(e,t){for(const s of ZH)if(!t.includes(s)&&e.getModifierState(s))return!0;return!1}function vk(e){const{render:t,className:s,style:o,refs:a=ns,props:c=ns,state:u=Ut,stateAttributesMapping:m,highlightedIndex:g,onHighlightedIndexChange:v,orientation:b,grid:p,loopFocus:x,onLoop:S,enableHomeAndEndKeys:w,onMapChange:E,stopEventPropagation:R=!0,rootRef:C,disabledIndices:j,modifierKeys:O,highlightItemOnHover:k=!1,tag:D="div",...P}=e,L=fc(),{props:_,highlightedIndex:V,onHighlightedIndexChange:I,elementsRef:X,onMapChange:Y,relayKeyboardEvent:q}=KV({grid:p,loopFocus:x,onLoop:S,orientation:b,highlightedIndex:g,onHighlightedIndexChange:v,rootRef:C,stopEventPropagation:R,enableHomeAndEndKeys:w,direction:L,disabledIndices:j,modifierKeys:O}),$=vt(D,e,{state:u,ref:a,props:[_,...c,P],stateAttributesMapping:m}),G=y.useMemo(()=>({highlightedIndex:V,onHighlightedIndexChange:I,highlightItemOnHover:k,relayKeyboardEvent:q}),[V,I,k,q]);return d.jsx(Xj.Provider,{value:G,children:d.jsx(hd,{elementsRef:X,onMapChange:H=>{E==null||E(H),Y(H)},children:$})})}const QV=y.forwardRef(function(t,s){const{activateOnFocus:o=!1,className:a,loopFocus:c=!0,render:u,style:m,...g}=t,{orientation:v,setTabMap:b,tabActivationDirection:p}=pk(),[x,S]=y.useState(0),[w,E]=y.useState(null),R=y.useRef(new Set),C=y.useRef(new Set),j=y.useRef(null);Me(()=>{if(typeof ResizeObserver>"u")return;const _=new ResizeObserver(()=>{R.current.forEach(V=>{V()})});return j.current=_,w&&_.observe(w),C.current.forEach(V=>{_.observe(V)}),()=>{_.disconnect(),j.current=null}},[w]);const O=Ie(_=>(R.current.add(_),()=>{R.current.delete(_)})),k=Ie(_=>{var V;return C.current.add(_),(V=j.current)==null||V.observe(_),()=>{var I;C.current.delete(_),(I=j.current)==null||I.unobserve(_)}}),D={orientation:v,tabActivationDirection:p},P={"aria-orientation":v==="vertical"?"vertical":void 0,role:"tablist"},L=y.useMemo(()=>({activateOnFocus:o,registerIndicatorUpdateListener:O,registerTabResizeObserverElement:k,tabsListElement:w}),[o,O,k,w]);return d.jsx(gk.Provider,{value:L,children:d.jsx(vk,{render:u,className:a,style:m,state:D,refs:[s,E],props:[P,g],stateAttributesMapping:Vx,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:c,orientation:v,onHighlightedIndexChange:S,onMapChange:b,disabledIndices:ns})})});function bk({className:e,orientation:t="horizontal",...s}){return d.jsx(IV,{"data-slot":"tabs","data-orientation":t,className:De("group/tabs flex gap-2 data-horizontal:flex-col",e),...s})}const XV=ad("group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-xl p-1 text-muted-foreground group-data-horizontal/tabs:h-11 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"border border-sidebar-border bg-panel",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function yk({className:e,variant:t="default",...s}){return d.jsx(QV,{"data-slot":"tabs-list","data-variant":t,className:De(XV({variant:t}),e),...s})}function ch({className:e,...t}){return d.jsx(LV,{"data-slot":"tabs-trigger",className:De("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[10px] border border-transparent px-4 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","group-data-[variant=default]/tabs-list:data-active:bg-ink group-data-[variant=default]/tabs-list:data-active:font-semibold group-data-[variant=default]/tabs-list:data-active:text-bg group-data-[variant=line]/tabs-list:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function JV(e){const{open:t,defaultOpen:s=!1,onOpenChange:o,disabled:a}=e,[c,u]=So({controlled:t,default:s,name:"Collapsible",state:"open"}),{mounted:m,setMounted:g,transitionStatus:v}=od(c,!0,!0),b=Qn(),[p,x]=y.useState(),S=p===null?void 0:p??b,w=Ie(E=>{const R=!c,C=dt(ka,E.nativeEvent);o(R,C),!C.isCanceled&&u(R)});return y.useMemo(()=>({defaultPanelId:b,disabled:a,handleTrigger:w,mounted:m,open:c,panelId:S,setMounted:g,setOpen:u,setPanelIdState:x,transitionStatus:v}),[b,a,w,m,c,S,g,u,x,v])}const xk=y.createContext(void 0);function wk(){const e=y.useContext(xk);if(e===void 0)throw new Error(mn(15));return e}const WV="data-open",e7="data-closed",wm=Py,t7="data-panel-open",n7={[WV]:""},r7={[e7]:""},s7={open(e){return e?{[t7]:""}:null}},o7={open(e){return e?n7:r7}},Sk={...o7,...Ti},i7=y.forwardRef(function(t,s){const{render:o,className:a,defaultOpen:c=!1,disabled:u=!1,onOpenChange:m,open:g,style:v,...b}=t,p=Ie(m),x=JV({open:g,defaultOpen:c,onOpenChange:p,disabled:u}),S=y.useMemo(()=>({open:x.open,disabled:x.disabled,transitionStatus:x.transitionStatus}),[x.open,x.disabled,x.transitionStatus]),w=y.useMemo(()=>({...x,onOpenChange:p,state:S}),[x,p,S]),E=vt("div",t,{state:S,ref:s,props:b,stateAttributesMapping:Sk});return d.jsx(xk.Provider,{value:w,children:E})}),a7={...s7,...Ti},l7=y.forwardRef(function(t,s){const{panelId:o,open:a,handleTrigger:c,state:u,disabled:m}=wk(),{className:g,disabled:v=m,render:b,nativeButton:p=!0,style:x,...S}=t,{getButtonProps:w,buttonRef:E}=ss({disabled:v,native:p});return vt("button",t,{state:u,ref:[s,E],props:[{"aria-controls":a?o:void 0,"aria-expanded":a,onClick:c},S,w],stateAttributesMapping:a7})}),Tl={height:void 0,width:void 0};function c7(e){const{externalRef:t,hiddenUntilFound:s,id:o,keepMounted:a,mounted:c,onOpenChange:u,open:m,setMounted:g,setOpen:v,transitionStatus:b}=e,p=y.useRef(null),x=y.useRef(null),[S,w]=y.useState(Tl),E=y.useRef(Tl),R=y.useRef(!1),C=y.useRef(m),j=y.useRef(!1),[O,k]=y.useState(!1),D=y.useRef(null),P=Vr(t,p),L=fn(m),_=Mh(p),V=!m&&!c,I=O?"idle":b,X=m&&(C.current||j.current),Y=!m&&c&&x.current==="css-animation"&&S.height===void 0&&S.width===void 0?E.current:S,q=s&&V&&x.current!=="css-animation",$=Ie((A,U=!0)=>{U&&(E.current=A),w(A)}),G=Ie(()=>{var A;(A=D.current)==null||A.call(D),D.current=null}),H=Ie(A=>{G(),D.current=()=>{D.current=null,A()}}),K=Ie(()=>{m&&c&&x.current==="css-animation"&&(j.current=!0)});Me(()=>{!O||b==="starting"||k(!1)},[O,b]),y.useEffect(()=>()=>{K(),G()},[K,G]),Me(()=>{m||(C.current=!1,j.current=!1);const A=p.current;if(!A)return;!m&&D.current&&G();const U=u7(A,X);if(x.current=U,m&&b==="idle"&&C.current&&U==="css-animation"){E.current=Rl(A);return}if(m&&b==="starting"){const oe=R.current;if(R.current=!1,U==="none"){$(Rl(A)),k(!0);return}if(U==="css-transition"){const Z=d7(A);if($(Rl(A)),!oe)return Z;const te=Sm(A,"transition-duration","0s");return H(te),k(!0),Z}$(Rl(A));const N=Sm(A,"animation-name","none");if(!oe){N();return}const z=Sm(A,"animation-duration","0s");N(),H(z),k(!0);return}if(!m&&c&&(b==="idle"||b==="starting")){if(U==="none"){$(Tl,!1),g(!1);return}$(Rl(A));return}if(b!=="ending")return;if(U==="none"){g(!1);return}const J=Rl(A);if(!(J.height>0||J.width>0)){g(!1);return}$(J),U==="css-animation"&&Sm(A,"animation-name","none")()},[c,m,G,$,g,H,X,b]),Ro({enabled:m&&c&&I==="idle",open:!0,ref:p,onComplete(){m&&$(Tl,!1)}}),y.useEffect(()=>{if(m||!c||I!=="ending")return;if(!p.current){g(!1),$(Tl,!1);return}const U=new AbortController;let J=-1;function F(){L.current||(g(!1),$(Tl,!1))}return J=fr.request(()=>{_(F,U.signal)}),()=>{fr.cancel(J),U.abort()}},[L,c,m,I,_,$,g]),Me(()=>{const A=p.current;!A||!s||!V||A.setAttribute("hidden","until-found")},[V,s]),y.useEffect(function(){const U=p.current;if(!U)return;const J=bs.create();let F=-1;const oe=(Z,te)=>{J.start(0,()=>{L.current||(F=fr.request(()=>{L.current||(Z&&(R.current=!1),te&&U.setAttribute(wm,""),U.setAttribute("hidden","until-found"))}))})},z=Et(U,"beforematch",Z=>{const te=dt(lr,Z);if(u(!0,te),te.isCanceled){oe(!1,!1);return}R.current=!0;const ue=U.hasAttribute(wm);U.removeAttribute(wm),v(!0),oe(!0,ue)});return()=>{J.clear(),fr.cancel(F),z()}},[L,u,v]);const B=a||s||c||m;return{height:Y.height,props:{...q?{[wm]:""}:void 0,hidden:V,id:o},ref:P,shouldPreventOpenAnimation:X,shouldRender:B,transitionStatus:I,width:Y.width}}function Rl(e){return{height:e.scrollHeight,width:e.scrollWidth}}function u7(e,t){const s=Kt(e).getComputedStyle(e),o=(s.animationName.split(",").map(c=>c.trim()).some(c=>c!==""&&c!=="none")||t)&&LR(s.animationDuration),a=LR(s.transitionDuration);return o&&a||a?"css-transition":o?"css-animation":"none"}function LR(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function Sm(e,t,s){const o=e.style.getPropertyValue(t),a=e.style.getPropertyPriority(t);return e.style.setProperty(t,s),()=>{if(o===""){e.style.removeProperty(t);return}e.style.setProperty(t,o,a)}}function d7(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(a=>{e.style.setProperty(a,"initial","important")});function s(){Object.entries(t).forEach(([a,c])=>{if(c===""){e.style.removeProperty(a);return}e.style.setProperty(a,c)})}const o=fr.request(s);return()=>{fr.cancel(o),s()}}const f7="--collapsible-panel-height",m7="--collapsible-panel-width",h7=y.forwardRef(function(t,s){const{className:o,hiddenUntilFound:a,keepMounted:c,render:u,id:m,style:g,...v}=t,{defaultPanelId:b,mounted:p,onOpenChange:x,open:S,setMounted:w,setPanelIdState:E,setOpen:R,state:C,transitionStatus:j}=wk(),O=a??!1,k=c??!1,D=m||void 0,P=D??b;Me(()=>(E(K=>D??(K===null?void 0:K)),()=>{E(K=>K===D?null:K)}),[D,E]);const{height:L,props:_,ref:V,shouldPreventOpenAnimation:I,shouldRender:X,transitionStatus:Y,width:q}=c7({externalRef:s,hiddenUntilFound:O,id:P,keepMounted:k,mounted:p,onOpenChange:x,open:S,setMounted:w,setOpen:R,transitionStatus:j}),$={...C,transitionStatus:Y},G=B2(g,$),H=vt("div",{...t,style:void 0},{state:$,ref:V,props:[_,{style:{[f7]:L===void 0?"auto":`${L}px`,[m7]:q===void 0?"auto":`${q}px`}},v,G?{style:G}:void 0,I?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Sk});return X?H:null});function Zx({...e}){return d.jsx(i7,{"data-slot":"collapsible",...e})}function Kx({...e}){return d.jsx(l7,{"data-slot":"collapsible-trigger",...e})}function Yx({...e}){return d.jsx(h7,{"data-slot":"collapsible-content",...e})}const b$=[30,90,365,null],p7=/^[a-z0-9][a-z0-9-]{0,63}$/,Gx=4,g7=["sd1","sdxl","flux","wan","z-image"];GE({prompt:ta().trim().min(1),aspectRatio:ta().regex(/^\d+:\d+$/).optional(),seed:fu().int().nonnegative().optional(),count:fu().int().min(1).max(8).default(1),durationSeconds:fu().int().min(1).max(120).optional(),referenceAssetIds:vb(ta()).default([]),strength:fu().min(.05).max(1).optional(),maskAssetId:ta().optional(),loras:vb(GE({id:ta().regex(p7),weight:fu().min(-2).max(2).default(1)})).max(Gx*g7.length).optional(),extras:ZP(ta(),gb()).default({})});const Ek=y.createContext({isLoading:!1,value:"",setValue:()=>{},maxHeight:240,onSubmit:void 0,disabled:!1,textareaRef:Fe.createRef()});function v7(){return y.useContext(Ek)}function b7({className:e,isLoading:t=!1,maxHeight:s=240,value:o,onValueChange:a,onSubmit:c,children:u,disabled:m=!1,onClick:g,...v}){const[b,p]=y.useState(o||""),x=y.useRef(null),S=E=>{p(E),a==null||a(E)},w=E=>{var R;m||(R=x.current)==null||R.focus(),g==null||g(E)};return d.jsx(Ek.Provider,{value:{isLoading:t,value:o??b,setValue:a??S,maxHeight:s,onSubmit:c,disabled:m,textareaRef:x},children:d.jsx("div",{onClick:w,className:De("cursor-text rounded-[22px] border border-[#2c2c32] bg-panel/85 p-3 transition-colors focus-within:border-orange/50",m&&"cursor-not-allowed opacity-60",e),...v,children:u})})}function y7({className:e,onKeyDown:t,disableAutosize:s=!1,...o}){const{value:a,setValue:c,maxHeight:u,onSubmit:m,disabled:g,textareaRef:v}=v7(),b=w=>{!w||s||(w.style.height="auto",typeof u=="number"?w.style.height=`${Math.min(w.scrollHeight,u)}px`:w.style.height=`min(${w.scrollHeight}px, ${u})`)},p=w=>{v.current=w,b(w)};y.useLayoutEffect(()=>{if(!v.current||s)return;const w=v.current;w.style.height="auto",typeof u=="number"?w.style.height=`${Math.min(w.scrollHeight,u)}px`:w.style.height=`min(${w.scrollHeight}px, ${u})`},[u,s,v.current]);const x=w=>{b(w.target),c(w.target.value)},S=w=>{w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing&&(w.preventDefault(),m==null||m()),t==null||t(w)};return d.jsx($O,{ref:p,value:a,onChange:x,onKeyDown:S,className:De("min-h-[44px] w-full resize-none rounded-none border-none bg-transparent px-0 py-1.5 text-base leading-relaxed text-ink shadow-none outline-none placeholder:text-dim focus-visible:ring-0 md:text-base dark:bg-transparent",e),rows:1,disabled:g,...o})}function x7({children:e,className:t,...s}){return d.jsx("div",{className:De("flex items-center gap-2",t),...s,children:e})}function Tk(e,t){return e-t}function Rk(e,t,s,o,a,c){const u=Fn(e,s,o);if(!a)return u;const m=c.slice();return m[t]=Fn(u,c[t-1]??-1/0,c[t+1]??1/0),m.sort(Tk)}function Ck(e,t,s){if(!Array.isArray(e))return!0;const o=t*s;for(let a=0;a<e.length-1;a+=1)if(!(Math.abs(e[a]-e[a+1])>=o))return!1;return!0}const Cl=()=>null,bd={activeThumbIndex:Cl,max:Cl,min:Cl,minStepsBetweenValues:Cl,step:Cl,values:Cl,...ud},Nk=y.createContext(void 0);function Jh(){const e=y.useContext(Nk);if(e===void 0)throw new Error(mn(62));return e}function w7(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&wx(e,t)}const S7=y.forwardRef(function(t,s){const{"aria-labelledby":o,className:a,defaultValue:c,disabled:u=!1,id:m,format:g,largeStep:v=10,locale:b,render:p,max:x=100,min:S=0,minStepsBetweenValues:w=0,form:E,name:R,onValueChange:C,onValueCommitted:j,orientation:O="horizontal",step:k=1,thumbCollisionBehavior:D="push",thumbAlignment:P="center",value:L,style:_,...V}=t,I=Qn(m),X=yH(I),Y=Ie(C),q=Ie(j),{clearErrors:$}=md(),{state:G,disabled:H,name:K,setTouched:B,setDirty:A,validityData:U,validation:J}=No(),{labelId:F}=mc(),[oe,N]=y.useState(),z=o??mO(F,oe),Z=H||u,te=K??R,[ue,W]=So({controlled:L,default:c??S,name:"Slider"}),be=y.useRef(null),de=y.useRef(null),fe=y.useRef([]),xe=y.useRef(null),pe=y.useRef(-1),we=y.useRef(null),Oe=y.useRef(lr),[ke,Pe]=y.useState(-1),[Te,He]=y.useState(-1),[se,ye]=y.useState(!1),[Ae,Be]=y.useState(()=>new Map),[ae,ve]=y.useState([void 0,void 0]),ze=Ie(it=>{Pe(it),it!==-1&&He(it)}),_e=Ie(it=>{it&&(de.current=it)}),Re=Array.isArray(ue),Ge=y.useMemo(()=>Re?ue.map(it=>Fn(it,S,x)).sort(Tk):[Fn(ue,S,x)],[x,S,Re,ue]),Ye=Re?Ge:Ge[0];fd(J.inputRef,I,Ye,void 0,!Z,R),pc(Ye,()=>{$(te),J.change(Ye);const it=U.initialValue;let qe;Array.isArray(Ye)&&Array.isArray(it)?qe=!wx(Ye,it):qe=Ye!==it,A(qe)});const mt=Ie((it,qe)=>{if(Number.isNaN(it)||w7(it,ue))return!1;const at=qe.event,Nt=at.constructor,ht=new Nt(at.type,at);return Object.defineProperty(ht,"target",{writable:!0,value:{value:it,name:te}}),qe.event=ht,Y(it,qe),qe.isCanceled?!1:(Oe.current=qe.reason,W(it),!0)}),nt=Ie((it,qe,at)=>{const Nt=Rk(it,qe,S,x,Re,Ge);if(Ck(Nt,k,w)){const ht="key"in at?Hy:Y6,Gt=mt(Nt,dt(ht,at.nativeEvent,void 0,{activeThumbIndex:qe}));B(!0),Gt&&q(Nt,By(ht,at.nativeEvent))}});Me(()=>{if(!Z)return;const it=or(Tt(be.current));ot(be.current,it)&&it.blur(),ke!==-1&&ze(-1)},[ke,Z,ze]);const ut=y.useMemo(()=>({...G,activeThumbIndex:ke,disabled:Z,dragging:se,orientation:O,max:x,min:S,minStepsBetweenValues:w,step:k,values:Ge}),[G,ke,Z,se,x,S,w,O,k,Ge]),Rt=y.useMemo(()=>({active:ke,controlRef:de,disabled:Z,dragging:se,validation:J,format:g,handleInputChange:nt,indicatorPosition:ae,inset:P!=="center",isArrayValue:Re,labelId:z,rootLabelId:X,largeStep:v,lastUsedThumbIndex:Te,lastChangeReasonRef:Oe,form:E,locale:b,max:x,min:S,minStepsBetweenValues:w,name:te,onValueCommitted:q,orientation:O,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:pe,pressedValuesRef:we,registerFieldControlRef:_e,renderBeforeHydration:P==="edge",setActive:ze,setDragging:ye,setIndicatorPosition:ve,setLabelId:N,setValue:mt,state:ut,step:k,thumbCollisionBehavior:D,thumbMap:Ae,thumbRefs:fe,values:Ge}),[ke,z,X,Z,se,J,g,nt,ae,v,Te,E,b,x,S,w,te,q,O,Re,_e,ze,mt,ut,k,D,P,Ae,Ge]),At=vt("div",t,{state:ut,ref:[s,be],props:[{"aria-labelledby":z,id:I,role:"group"},V,it=>J.getValidationProps(Z,it)],stateAttributesMapping:bd});return d.jsx(Nk.Provider,{value:Rt,children:d.jsx(hd,{elementsRef:fe,onMapChange:Be,children:At})})});function E7(e){return e==="touch"||e==="pen"}function jk(e,t){const s=e.getBoundingClientRect();return t?(s.top+s.bottom)/2:(s.left+s.right)/2}function Iu(e){if(e===0)return 0;if(Math.abs(e)<1){const s=e.toExponential().split("e-"),o=s[0].split(".")[1];return(o?o.length:0)+parseInt(s[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function Ok(e,t,s){const o=Math.round((e-s)/t)*t+s;return Number(o.toFixed(Math.max(Iu(t),Iu(s))))}function UR(e,t,s,o,a,c,u,m){const g=e.slice(),v=c*u,b=g.length-1,p=m??e,x=o+t*v,S=a-(b-t)*v;g[t]=Fn(s,x,S);for(let w=t+1;w<=b;w+=1){const E=g[w-1]+v,R=a-(b-w)*v,C=p[w];let j=Math.max(g[w],E);C<j&&(j=Math.max(C,E)),g[w]=Fn(j,E,R)}for(let w=t-1;w>=0;w-=1){const E=g[w+1]-v,R=o+w*v,C=p[w];let j=Math.min(g[w],E);C>j&&(j=Math.min(C,E)),g[w]=Fn(j,R,E)}for(let w=0;w<=b;w+=1)g[w]=Number(g[w].toFixed(12));return g}function T7(e,t,s,o,a,c,u,m,g,v){const b=s??t,p=o??t;if(!(b.length>1))return{value:c,thumbIndex:0,didSwap:!1};const S=g*v;if(e==="push")return{value:UR(b,a,c,u,m,g,v),thumbIndex:a,didSwap:!1};const w=b.slice(),E=w[a-1],R=w[a+1],C=E!=null?E+S:u,j=R!=null?R-S:m,O=Number(Fn(c,C,j).toFixed(12));switch(w[a]=O,e){case"swap":{const k=b[a],D=1e-7,P=c>k,L=c<k,_=P&&R!=null&&c>=R-D,V=L&&E!=null&&c<=E+D;if(!_&&!V)return{value:w,thumbIndex:a,didSwap:!1};const I=_?a+1:a-1,X=w.map((U,J)=>{if(J===a)return O;const F=p[J];return F??b[J]});let Y=c;_?Y=Math.max(c,w[I]):Y=Math.min(c,w[I]);const q=UR(w,I,Y,u,m,g,v,X),$=_?I-1:I+1,G=q[$-1],H=q[$+1];let K=G!=null?G+S:u;K=Math.max(K,u+$*S);let B=H!=null?H-S:m;B=Math.min(B,m-(q.length-1-$)*S);const A=Fn(O,K,B);return q[$]=Number(A.toFixed(12)),{value:q,thumbIndex:I,didSwap:!0}}case"none":default:return{value:w,thumbIndex:a,didSwap:!1}}}const R7=2;function C7(e,t){if(!e)return{start:0,end:0};function s(c){const u=c!=null?parseFloat(c):0;return Number.isNaN(u)?0:u}const o=t?"Top":"InlineStart",a=t?"Bottom":"InlineEnd";return{start:s(e[`border${o}Width`])+s(e[`padding${o}`]),end:s(e[`border${a}Width`])+s(e[`padding${a}`])}}function BR(e,t){if(t.current!=null&&e.changedTouches){const s=e;for(let o=0;o<s.changedTouches.length;o+=1){const a=s.changedTouches[o];if(a.identifier===t.current)return{x:a.clientX,y:a.clientY}}return null}return{x:e.clientX,y:e.clientY}}const N7=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,{disabled:m,dragging:g,inset:v,isArrayValue:b,lastChangeReasonRef:p,max:x,min:S,minStepsBetweenValues:w,onValueCommitted:E,orientation:R,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:j,pressedValuesRef:O,registerFieldControlRef:k,renderBeforeHydration:D,setActive:P,setDragging:L,setValue:_,state:V,step:I,thumbCollisionBehavior:X,thumbRefs:Y,values:q}=Jh(),$=fc(),G=q.length>1,H=R==="vertical",K=y.useRef(null),B=y.useRef(null),A=Ie(se=>{se&&B.current==null&&(B.current=Kt(se).getComputedStyle(se))}),U=y.useRef(null),J=y.useRef(0),F=y.useRef(0),oe=y.useRef(null),N=y.useRef(!1),z=fn(q);function Z(se){return se==null?void 0:se.querySelector('input[type="range"]')}function te(se){j.current=se,Y.current[se]||(C.current=null)}function ue(){j.current=-1,C.current=null}function W(se){return _t(se)?Y.current.some(ye=>{var Ae;return!_t(ye)||!ot(ye,se)?!1:((Ae=Z(ye))==null?void 0:Ae.disabled)===!0}):!1}function be(se){const ye=K.current,Ae=j.current;if(!ye||Ae<0||Ae>=q.length)return Ae>=q.length&&(oe.current=null),null;const{width:Be,height:ae,bottom:ve,left:ze,right:_e}=ye.getBoundingClientRect(),Re=C7(B.current,H),Ge=F.current,Ye=(H?ae:Be)-Re.start-Re.end-Ge*2,mt=C.current??0,nt=se.x-mt,ut=se.y-mt,Rt=H?ve-ut-Re.end:($==="rtl"?_e-nt:nt-ze)-Re.start,At=Fn((Rt-Ge)/Ye,0,1);let it=(x-S)*At+S;return it=Ok(it,I,S),it=Fn(it,S,x),G?T7(X,q,z.current,O.current,Ae,it,S,x,I,w):{value:b?[it]:it,thumbIndex:Ae,didSwap:!1}}function de(se){var Be;O.current=G?q.slice():null,oe.current=null,z.current=q;const ye=j.current;let Ae=ye;if(ye>-1&&ye<q.length){if(q[ye]===x){let ae=ye;for(;ae>0&&q[ae-1]===x;)ae-=1;Ae=ae}}else{const ae=H?"y":"x";let ve;Ae=-1;for(let ze=0;ze<Y.current.length;ze+=1){const _e=Y.current[ze];if(_t(_e)&&!((Be=Z(_e))!=null&&Be.disabled)){const Re=jk(_e,H),Ge=Math.abs(se[ae]-Re);(ve===void 0||Ge<=ve)&&(Ae=ze,ve=Ge)}}}if(Ae>-1&&Ae!==ye&&te(Ae),v){const ae=Y.current[Ae];if(_t(ae)){const ve=ae.getBoundingClientRect(),ze=H?"height":"width";F.current=ve[ze]/2}}}function fe(se){var Ae;const ye=Z((Ae=Y.current)==null?void 0:Ae[se]);ye&&ye.focus({preventScroll:!0,focusVisible:!1})}function xe(se,ye,Ae){const Be=_(se.value,dt(ye,Ae,void 0,{activeThumbIndex:se.thumbIndex}));return Be&&(oe.current=se.value,z.current=Array.isArray(se.value)?se.value:[se.value],se.didSwap&&(te(se.thumbIndex),fe(se.thumbIndex))),Be}const pe=Ie(se=>{const ye=BR(se,U);if(ye==null)return;if(J.current+=1,se.type==="pointermove"&&se.buttons===0){we(se);return}const Ae=be(ye);Ae!=null&&Ck(Ae.value,I,w)&&(!g&&J.current>R7&&L(!0),xe(Ae,Q6,se))}),we=Ie(se=>{var Ae,Be;if(BR(se,U)==null)return;P(-1),L(!1),C.current=null;const ye=oe.current;if(Array.isArray(ye)&&ye.length!==q.length&&(oe.current=null),oe.current!=null){const ae=p.current;E(oe.current,By(ae,se))}"pointerType"in se&&((Ae=K.current)!=null&&Ae.hasPointerCapture(se.pointerId))&&((Be=K.current)==null||Be.releasePointerCapture(se.pointerId)),j.current=-1,Pe()}),Oe=Ie(se=>{U.current==null&&we(se)}),ke=Ie(se=>{const ye=N.current;if(N.current=!1,m)return;if(W(Pn(se))){ue();return}const Ae=se.changedTouches[0];if(Ae==null)return;if(U.current=Ae.identifier,!ye){const ae={x:Ae.clientX,y:Ae.clientY};de(ae);const ve=be(ae);if(ve==null)return;fe(ve.thumbIndex),xe(ve,ET,se),J.current=0}const Be=Tt(K.current);Be.addEventListener("touchmove",pe,{passive:!0}),Be.addEventListener("touchend",we,{passive:!0}),Be.addEventListener("touchcancel",we,{passive:!0})}),Pe=Ie(()=>{const se=Tt(K.current);se.removeEventListener("pointermove",pe),se.removeEventListener("pointerup",we),se.removeEventListener("pointercancel",Oe),se.removeEventListener("touchmove",pe),se.removeEventListener("touchend",we),se.removeEventListener("touchcancel",we),U.current=null,O.current=null,oe.current=null,N.current=!1}),Te=xa();return y.useEffect(()=>{const se=K.current;if(!se)return()=>Pe();const ye=Et(se,"touchstart",ke,{passive:!0});return()=>{ye(),Te.cancel(),Pe()}},[Pe,ke,K,Te]),y.useEffect(()=>{m&&Pe()},[m,Pe]),vt("div",t,{state:V,ref:[s,k,K,A],props:[{"data-base-ui-slider-control":D?"":void 0,onPointerDown(se){N.current=!1;const ye=K.current,Ae=Pn(se.nativeEvent);if(!ye||m||se.defaultPrevented||!_t(Ae)||se.button!==0)return;if(W(Ae)){ue();return}const Be={x:se.clientX,y:se.clientY};de(Be);const ae=be(Be);if(ae==null)return;ot(Y.current[ae.thumbIndex],or(Tt(ye)))?se.preventDefault():Te.request(()=>{fe(ae.thumbIndex)}),L(!0),C.current!=null||xe(ae,ET,se.nativeEvent),se.nativeEvent.pointerId&&ye.setPointerCapture(se.nativeEvent.pointerId),J.current=0,N.current=E7(se.pointerType);const _e=Tt(ye);_e.addEventListener("pointermove",pe,{passive:!0}),_e.addEventListener("pointerup",we,{once:!0}),_e.addEventListener("pointercancel",Oe,{once:!0})}},u],stateAttributesMapping:bd})}),j7=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,{state:m}=Jh();return vt("div",t,{state:m,ref:s,props:[{style:{position:"relative"}},u],stateAttributesMapping:bd})}),O7="data-index";var HR;const k7=new Set([...gc,wO,SO]);function _7(e,t,s,o){if(!(t<0))return e.length===2?`${$u(e[t],o,s)} ${t===0?"start":"end"} range`:s?$u(e[t],o,s):void 0}function A7(e,t,s,o,a){const c=e+t*s,u=Number(c.toFixed(Math.max(Iu(e),Iu(t),Iu(o))));return Fn(u,o,a)}const M7=y.forwardRef(function(t,s){const{render:o,children:a,className:c,"aria-describedby":u,"aria-label":m,"aria-labelledby":g,"aria-valuetext":v,disabled:b=!1,getAriaLabel:p,getAriaValueText:x,id:S,index:w,inputRef:E,onBlur:R,onFocus:C,onKeyDown:j,tabIndex:O,style:k,...D}=t,P=Qn(S),{active:L,lastUsedThumbIndex:_,controlRef:V,disabled:I,validation:X,format:Y,handleInputChange:q,inset:$,isArrayValue:G,labelId:H,largeStep:K,locale:B,max:A,min:U,minStepsBetweenValues:J,form:F,name:oe,orientation:N,pressedThumbCenterOffsetRef:z,pressedThumbIndexRef:Z,renderBeforeHydration:te,setActive:ue,setIndicatorPosition:W,state:be,step:de,thumbRefs:fe,values:xe}=Jh(),pe=fc(),we=b||I,Oe=xe.length>1,ke=N==="vertical",Pe=pe==="rtl",{setTouched:Te,validationMode:He}=No(),se=y.useRef(null),ye=y.useRef(null),Ae=dd(we,ye),Be=y.useRef(!1),ae=Ie(Ce=>{Be.current||C==null||C(Ce)}),ve=Ie(Ce=>{Be.current||R==null||R(Ce)}),ze=Qn(),_e=hc(),Re=Oe?ze:_e,Ge=y.useMemo(()=>({inputId:Re}),[Re]),{ref:Ye,index:mt}=qh({metadata:Ge}),nt=Oe?w??mt:0,ut=nt===xe.length-1,Rt=xe[nt],At=lh(Rt,U,A),[it,qe]=y.useState(),at=$x(),Nt=_>=0&&_<xe.length?_:-1,ht=Ie(()=>{const Ce=V.current,et=se.current;if(!Ce||!et)return;const Ze=et.getBoundingClientRect(),pt=Ce.getBoundingClientRect(),Ct=ke?"height":"width",un=pt[Ct]-Ze[Ct],hn=(Ze[Ct]/2+un*At/100)/pt[Ct]*100,Xn=Number.isFinite(hn)?hn:void 0;qe(Xn),nt===0?W(Vn=>[Xn,Vn[1]]):ut&&W(Vn=>[Vn[0],Xn])});Me(()=>{$&&queueMicrotask(ht)},[ht,$]),Me(()=>{$&&ht()},[ht,$,At]),Me(()=>{if(!$)return;const Ce=V.current,et=se.current;if(!Ce||!et)return;const Ze=Kt(Ce).ResizeObserver;if(typeof Ze!="function")return;const pt=new Ze(ht);return pt.observe(Ce),pt.observe(et),()=>{pt.disconnect()}},[V,ht,$]);const Gt=ke?"bottom":"insetInlineStart",Bt=ke?"left":"top";let Ft;Oe?L===nt?Ft=2:Nt===nt&&(Ft=1):L===nt&&(Ft=1);let sn;!$&&!Number.isFinite(At)?sn=wa:sn={position:"absolute",[Gt]:$?"var(--position)":`${At}%`,[Bt]:"50%",translate:`${(ke||!Pe?-1:1)*50}% ${(ke?1:-1)*50}%`,zIndex:Ft,...$&&{"--position":`${it??0}%`,visibility:te&&at||it===void 0?"hidden":void 0}};let rt;ke&&(rt=Pe?"vertical-rl":"vertical-lr");const Dt=typeof p=="function"?p(nt):m,je=Gn({"aria-label":Dt,"aria-labelledby":g??(Dt==null?H:void 0),"aria-describedby":u,"aria-orientation":N,"aria-valuenow":Rt,"aria-valuetext":typeof x=="function"?x($u(Rt,B,Y),Rt,nt):v??_7(xe,nt,Y,B),disabled:we,form:F,id:Re,max:A,min:U,name:oe,onChange(Ce){q(Ce.currentTarget.valueAsNumber,nt,Ce)},onFocus(Ce){const et=Be.current;Be.current=!1,ue(nt),Ae(!0),et&&Ce.stopPropagation()},onBlur(Ce){if(Be.current){Ce.stopPropagation();return}ue(-1),!fe.current.some(et=>ot(et,Ce.relatedTarget))&&(Te(!0),Ae(!1),He==="onBlur"&&X.commit(Rk(Rt,nt,U,A,G,xe)))},onKeyDown(Ce){if(Ce.defaultPrevented||!k7.has(Ce.key))return;gc.has(Ce.key)&&Ce.stopPropagation();let et=null,Ze=0,pt=Ce.shiftKey?K:de;const Ct=Ok(Rt,de,U);switch(Ce.key){case nh:Ze=1;break;case oh:Ze=Pe?-1:1;break;case rh:Ze=-1;break;case sh:Ze=Pe?1:-1;break;case wO:pt=K,Ze=1;break;case SO:pt=K,Ze=-1;break;case ah:et=Oe&&Number.isFinite(xe[nt+1])?xe[nt+1]-de*J:A;break;case ih:et=Oe&&Number.isFinite(xe[nt-1])?xe[nt-1]+de*J:U;break}if(Ze!==0&&(et=A7(Ct,pt,Ze,U,A)),et!==null){const un=Ce.currentTarget;y2(un)||(Be.current=!0,un.blur(),un.focus({preventScroll:!0,focusVisible:!0})),q(et,nt,Ce),Ce.preventDefault()}},step:de,style:{...wa,width:"100%",height:"100%",writingMode:rt},tabIndex:O,type:"range",value:Rt??""},Ce=>X.getValidationProps(we,Ce),{onFocus:ae,onBlur:ve,onKeyDown:j}),ee=Vr(ye,X.inputRef,E);return vt("div",t,{state:be,ref:[s,Ye,se],props:[{[O7]:nt,children:d.jsxs(y.Fragment,{children:[a,d.jsx("input",{ref:ee,...je,suppressHydrationWarning:!0}),$&&ut&&te&&(HR||(HR=d.jsx(ZV,{script:UV})))]}),id:P,onPointerDown(Ce){if(we)return;Z.current=nt;const et=jk(Ce.currentTarget,ke);z.current=(ke?Ce.clientY:Ce.clientX)-et},style:sn,suppressHydrationWarning:te||void 0},D],stateAttributesMapping:bd})});function z7(e,t,s,o,a,c){const u={visibility:c||s&&(o===void 0||t&&a===void 0)?"hidden":void 0,position:e?"absolute":"relative",[e?"width":"height"]:"inherit"};let m=`${o??0}%`,g=`${(a??0)-(o??0)}%`;return s&&(u["--start-position"]=m,m="var(--start-position)",t&&(u["--relative-size"]=g,g="var(--relative-size)")),u[e?"bottom":"insetInlineStart"]=t?m:0,u[e?"height":"width"]=t?g:m,u}const D7=y.forwardRef(function(t,s){const{render:o,className:a,style:c,...u}=t,{indicatorPosition:m,inset:g,max:v,min:b,orientation:p,renderBeforeHydration:x,state:S,values:w}=Jh(),E=$x(),R=p==="vertical",C=w.length>1,j=z7(R,C,g,g?m[0]:lh(w[0],b,v),g?m[1]:lh(w[w.length-1],b,v),g&&x&&E);return vt("div",t,{state:S,ref:s,props:[{"data-base-ui-slider-indicator":x?"":void 0,style:j,suppressHydrationWarning:x||void 0},u],stateAttributesMapping:bd})});function uh({className:e,defaultValue:t,value:s,min:o=0,max:a=100,getAriaValueText:c,...u}){const m=s??t,g=Array.isArray(m)?m:m==null?[o,a]:[m];return d.jsx(S7,{className:De("data-horizontal:w-full data-vertical:h-full",e),"data-slot":"slider",defaultValue:t,value:s,min:o,max:a,thumbAlignment:"edge",...u,children:d.jsxs(N7,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[d.jsx(j7,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:d.jsx(D7,{"data-slot":"slider-range",className:"bg-primary select-none data-horizontal:h-full data-vertical:w-full"})}),Array.from({length:g.length},(v,b)=>d.jsx(M7,{"data-slot":"slider-thumb",getAriaValueText:c,className:"relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"},b))]})})}const kk=y.createContext(void 0);function I7(){return y.useContext(kk)}const _k=y.forwardRef(function(t,s){const{className:o,defaultPressed:a=!1,disabled:c=!1,form:u,onPressedChange:m,pressed:g,render:v,type:b,value:p,nativeButton:x=!0,style:S,...w}=t,E=Qn(p||void 0),R=I7(),C=(R==null?void 0:R.value)??[],j=(c||(R==null?void 0:R.disabled))??!1,[O,k]=So({controlled:R?E!==void 0&&C.indexOf(E)>-1:g,default:a,name:"Toggle",state:"pressed"}),{getButtonProps:D,buttonRef:P}=ss({disabled:j,native:x}),L={disabled:j,pressed:O},_=[P,s],V=[{"aria-pressed":O,onClick(Y){var G;const q=!O,$=dt(lr,Y.nativeEvent);m==null||m(q,$),!$.isCanceled&&(E&&((G=R==null?void 0:R.setGroupValue)==null||G.call(R,E,q,$)),!$.isCanceled&&k(q))}},w,D],I=vt("button",t,{enabled:!R,state:L,ref:_,props:V}),X=y.useMemo(()=>({disabled:j,focusableWhenDisabled:!1}),[j]);return R?d.jsx(ck,{tag:"button",render:v,className:o,style:S,metadata:X,state:L,refs:_,props:V}):I}),Ak=ad("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}});function Mk({className:e,variant:t="default",size:s="default",...o}){return d.jsx(_k,{"data-slot":"toggle",className:De(Ak({variant:t,size:s,className:e})),...o})}const P7=y.createContext(void 0);function L7(){return y.useContext(P7)}const U7=y.forwardRef(function(t,s){const{defaultValue:o,disabled:a=!1,loopFocus:c=!0,onValueChange:u,orientation:m="horizontal",multiple:g=!1,value:v,className:b,render:p,style:x,...S}=t,w=Rx(),E=L7(),R=o??ns,C=v!==void 0||o!==void 0,j=((w==null?void 0:w.disabled)??!1)||((E==null?void 0:E.disabled)??!1)||a,[O,k]=So({controlled:v,default:R,name:"ToggleGroup",state:"value"}),D=Ie((I,X,Y)=>{let q;g?(q=O.slice(),X?q.push(I):q.splice(O.indexOf(I),1)):q=X?[I]:[],u==null||u(q,Y),!Y.isCanceled&&k(q)}),P={disabled:j,multiple:g,orientation:m},L=y.useMemo(()=>({disabled:j,setGroupValue:D,value:O,isValueInitialized:C}),[j,D,O,C]),_={role:"group"},V=vt("div",t,{enabled:!!w,state:P,ref:s,props:[_,S]});return d.jsx(kk.Provider,{value:L,children:w?V:d.jsx(vk,{render:p,className:b,style:x,state:P,refs:[s],props:[_,S],loopFocus:c,enableHomeAndEndKeys:!0,orientation:m})})}),zk=y.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function Na({className:e,variant:t,size:s,spacing:o=2,orientation:a="horizontal",children:c,...u}){return d.jsx(U7,{"data-slot":"toggle-group","data-variant":t,"data-size":s,"data-spacing":o,"data-orientation":a,style:{"--gap":o},className:De("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...u,children:d.jsx(zk.Provider,{value:{variant:t,size:s,spacing:o,orientation:a},children:c})})}function wi({className:e,children:t,variant:s="default",size:o="default",...a}){const c=y.useContext(zk);return d.jsx(_k,{"data-slot":"toggle-group-item","data-variant":c.variant||s,"data-size":c.size||o,"data-spacing":c.spacing,className:De("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",Ak({variant:c.variant||s,size:c.size||o}),e),...a,children:t})}function yd({...e}){return d.jsx(dk,{"data-slot":"dialog",...e})}function B7({...e}){return d.jsx(_x,{"data-slot":"dialog-portal",...e})}function Dk({...e}){return d.jsx(Gh,{"data-slot":"dialog-close",...e})}function H7({className:e,...t}){return d.jsx(jx,{"data-slot":"dialog-overlay",className:De("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function xd({className:e,children:t,showCloseButton:s=!0,...o}){const{t:a}=Xe();return d.jsxs(B7,{children:[d.jsx(H7,{}),d.jsxs(kx,{"data-slot":"dialog-content",className:De("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[t,s&&d.jsxs(Gh,{"data-slot":"dialog-close",render:d.jsx(Ue,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[d.jsx(Oa,{}),d.jsx("span",{className:"sr-only",children:a("ui.close")})]})]})]})}function wd({className:e,...t}){return d.jsx(Ax,{"data-slot":"dialog-title",className:De("font-heading text-base leading-none font-medium",e),...t})}function Ik({className:e,...t}){return d.jsx(Ox,{"data-slot":"dialog-description",className:De("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const FR=["free","original","1:1","4:3","3:4","16:9","9:16"],VR=[0,2048,1536,1024,768,512],F7=4096,vu=.05,qR="h-10 rounded-xl px-3.5 aria-pressed:border-transparent aria-pressed:bg-ink aria-pressed:text-bg",Em={x:0,y:0,w:1,h:1};function $R(e,t,s){const o=Math.min(t,s*e),a=o/e;return{x:(t-o)/2/t,y:(s-a)/2/s,w:o/t,h:a/s}}const ao=(e,t,s)=>Math.min(s,Math.max(t,e));function V7({src:e,onDone:t,onClose:s}){const{t:o,explain:a,number:c}=Xe(),u=y.useId(),m=y.useId(),g=y.useRef(null),[v,b]=y.useState(null),[p,x]=y.useState(0),[S,w]=y.useState(!1),[E,R]=y.useState("free"),[C,j]=y.useState(Em),[O,k]=y.useState(0),[D,P]=y.useState(!1),[L,_]=y.useState(null),V=y.useRef(null);y.useEffect(()=>{const N=new Image;N.onload=()=>b(N),N.src=e},[e]);const I=y.useMemo(()=>{if(!v)return null;const N=Math.min(1,F7/Math.max(v.naturalWidth,v.naturalHeight)),z=Math.round(v.naturalWidth*N),Z=Math.round(v.naturalHeight*N),te=p%2===1,ue=document.createElement("canvas");ue.width=te?Z:z,ue.height=te?z:Z;const W=ue.getContext("2d");return W?(W.translate(ue.width/2,ue.height/2),S&&W.scale(-1,1),W.rotate(p*Math.PI/2),W.drawImage(v,-z/2,-Z/2,z,Z),ue):null},[v,p,S]),X=y.useRef(null);y.useLayoutEffect(()=>{var Z;const N=X.current;if(!N||!I)return;const z=Math.min(1,1600/Math.max(I.width,I.height));N.width=Math.round(I.width*z),N.height=Math.round(I.height*z),(Z=N.getContext("2d"))==null||Z.drawImage(I,0,0,N.width,N.height)},[I]);const Y=N=>{if(N==="free"||!v)return null;if(N==="original")return p%2===1?v.naturalHeight/v.naturalWidth:v.naturalWidth/v.naturalHeight;const[z=1,Z=1]=N.split(":").map(Number);return z/Z},q=(N,z,Z)=>{R(N);const te=Y(N),ue=(I==null?void 0:I.width)??1,W=(I==null?void 0:I.height)??1;j(te==null?Em:$R(te,ue,W))},$=N=>{const z=(p+N+4)%4;if(x(z),!I)return;const Z=(z-p)%2!==0,te=Z?I.height:I.width,ue=Z?I.width:I.height,W=E==="original"?te/ue:E==="free"?null:Y(E);j(W==null?Em:$R(W,te,ue))},G=()=>{x(0),w(!1),R("free"),j(Em),k(0)},H=(N,z)=>{N.stopPropagation(),N.target.setPointerCapture(N.pointerId),V.current={mode:z,start:{x:N.clientX,y:N.clientY},box:C}},K=N=>{var ke;const z=V.current,Z=(ke=g.current)==null?void 0:ke.getBoundingClientRect();if(!z||!Z||!I)return;const te=(N.clientX-z.start.x)/Z.width,ue=(N.clientY-z.start.y)/Z.height,W=z.box;if(z.mode==="move"){j({...W,x:ao(W.x+te,0,1-W.w),y:ao(W.y+ue,0,1-W.h)});return}const be=z.mode==="nw"||z.mode==="sw",de=z.mode==="nw"||z.mode==="ne",fe=be?W.x+W.w:W.x,xe=de?W.y+W.h:W.y;let pe=ao(be?W.w-te:W.w+te,vu,be?fe:1-fe),we=ao(de?W.h-ue:W.h+ue,vu,de?xe:1-xe);const Oe=Y(E);if(Oe!=null){const Pe=I.width/I.height/Oe;we>pe*Pe?we=pe*Pe:pe=we/Pe}j({x:be?fe-pe:fe,y:de?xe-we:xe,w:pe,h:we})},B=N=>{const te={ArrowLeft:[-.02,0],ArrowRight:[.02,0],ArrowUp:[0,-.02],ArrowDown:[0,.02]}[N.key];if(!te||!I)return;N.preventDefault();const[ue,W]=te,be=Y(E),de=be==null?null:I.width/I.height/be;j(fe=>{if(!N.shiftKey)return{...fe,x:ao(fe.x+ue,0,1-fe.w),y:ao(fe.y+W,0,1-fe.h)};if(de==null)return{...fe,w:ao(fe.w+ue,vu,1-fe.x),h:ao(fe.h+W,vu,1-fe.y)};let xe=ao(fe.w+ue+W,vu,1-fe.x),pe=xe*de;return fe.y+pe>1&&(pe=1-fe.y,xe=pe/de),{...fe,w:xe,h:pe}})},A=(()=>{if(!I)return null;const N=I.width*C.w,z=I.height*C.h,Z=O>0?Math.min(1,O/Math.max(N,z)):1;return{width:Math.max(1,Math.round(N*Z)),height:Math.max(1,Math.round(z*Z))}})(),U=async()=>{if(!(!I||!A)){P(!0),_(null);try{const N=document.createElement("canvas");N.width=A.width,N.height=A.height;const z=N.getContext("2d");if(!z)throw new Error(o("adjust.cannotDraw"));z.imageSmoothingQuality="high",z.drawImage(I,C.x*I.width,C.y*I.height,C.w*I.width,C.h*I.height,0,0,N.width,N.height);const Z=await new Promise(te=>N.toBlob(te,"image/webp",.95));if(!Z)throw new Error(o("adjust.cannotSave"));await t(Z)}catch(N){_(a(N))}finally{P(!1)}}},J="absolute size-4 rounded-sm border-2 border-white bg-black/40",F=N=>N==="free"?o("adjust.free"):N==="original"?o("adjust.original"):N,oe=N=>N===0?o("adjust.sizeAsIs"):o("adjust.sizeLongest",{size:c(N)});return d.jsx(yd,{open:!0,onOpenChange:N=>!N&&!D&&s(),disablePointerDismissal:!0,children:d.jsxs(xd,{showCloseButton:!1,className:"flex max-h-[96dvh] w-full max-w-[calc(100%-2rem)] sm:w-fit flex-col gap-4 overflow-y-auto rounded-2xl bg-panel p-5 ring-line sm:max-w-[calc(100%-2rem)] sm:p-6",children:[d.jsx(wd,{className:"font-display text-2xl font-bold tracking-tight",children:o("adjust.title")}),d.jsxs("div",{ref:g,onPointerMove:K,onPointerUp:()=>{V.current=null},onPointerCancel:()=>{V.current=null},className:"relative mx-auto w-fit touch-none select-none overflow-hidden rounded-xl",children:[d.jsx("canvas",{ref:X,className:"block max-h-[60vh] max-w-full",role:"img","aria-label":o("adjust.preview")}),I&&d.jsx("button",{type:"button","aria-label":o("adjust.cropArea"),onKeyDown:B,onPointerDown:N=>H(N,"move"),className:"absolute cursor-move border border-white/90 shadow-[0_0_0_9999px_rgb(0_0_0/0.55)] focus-visible:outline-2 focus-visible:outline-pink",style:{left:`${C.x*100}%`,top:`${C.y*100}%`,width:`${C.w*100}%`,height:`${C.h*100}%`},children:["nw","ne","sw","se"].map(N=>d.jsx("span",{"aria-hidden":"true",onPointerDown:z=>H(z,N),className:`${J} ${N[0]==="n"?"-top-2":"-bottom-2"} ${N[1]==="w"?"-left-2":"-right-2"} ${N==="nw"||N==="se"?"cursor-nwse-resize":"cursor-nesw-resize"}`},N))})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsxs(Ue,{variant:"outline",onClick:()=>$(-1),children:[d.jsx(N5,{"aria-hidden":"true"}),o("adjust.rotateLeft")]}),d.jsxs(Ue,{variant:"outline",onClick:()=>$(1),children:[d.jsx(j5,{"aria-hidden":"true"}),o("adjust.rotateRight")]}),d.jsxs(Mk,{variant:"outline",pressed:S,onPressedChange:w,className:qR,children:[d.jsx(h5,{"aria-hidden":"true"}),o("adjust.flip")]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{id:m,className:"mr-1 text-sm text-dim",children:o("adjust.crop")}),d.jsx(Na,{"aria-labelledby":m,value:[E],onValueChange:([N])=>{const z=FR.find(Z=>Z===N);z&&q(z)},className:"flex-wrap",children:FR.map(N=>d.jsx(wi,{value:N,variant:"outline",className:qR,children:F(N)},N))})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Or,{id:u,className:"font-normal text-dim",children:o("adjust.size")}),d.jsxs($h,{value:O,onValueChange:N=>N!=null&&k(N),items:VR.map(N=>({value:N,label:oe(N)})),children:[d.jsx(Kh,{"aria-labelledby":u,className:"data-[size=default]:h-10 rounded-xl",children:d.jsx(Zh,{})}),d.jsx(Yh,{children:VR.map(N=>d.jsx(Vu,{value:N,children:oe(N)},N))})]})]}),A&&d.jsx("span",{className:"font-mono text-xs text-dim",children:o("adjust.result",{width:c(A.width),height:c(A.height)})}),d.jsx(Ue,{variant:"ghost",onClick:G,className:"text-dim",children:o("adjust.reset")})]}),d.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line pt-4",children:[d.jsx("span",{className:"mr-auto text-sm text-danger",role:"alert",children:L}),d.jsx(Ue,{variant:"ghost",onClick:s,disabled:D,children:o("common.cancel")}),d.jsx(Ue,{variant:"aurora",size:"lg",onClick:U,disabled:!I||D,children:o(D?"mask.saving":"adjust.done")})]})]})})}const ZR=["same","1:1","4:3","3:4","16:9","9:16"],KR=[0,.25,.5,1],q7=2048,$7=.04,YR="h-10 rounded-xl px-3.5 aria-pressed:border-transparent aria-pressed:bg-ink aria-pressed:text-bg",Tm=(e,t,s)=>Math.min(s,Math.max(t,e));function Z7(e,t,s,o){let a=e*(1+o),c=t*(1+o);if(s!=="same"){const[u=1,m=1]=s.split(":").map(Number),g=u/m;a/c<g?a=c*g:c=a/g}return{width:Math.round(a),height:Math.round(c)}}const GR=(e,t)=>new Promise(s=>e.toBlob(s,t,.95));function K7({src:e,onDone:t,onClose:s}){const{t:o,explain:a,number:c}=Xe(),u=y.useId(),m=y.useId(),g=y.useRef(null),[v,b]=y.useState(null),[p,x]=y.useState("16:9"),[S,w]=y.useState(0),[E,R]=y.useState({x:.5,y:.5}),[C,j]=y.useState(!1),[O,k]=y.useState(null),D=y.useRef(null);y.useEffect(()=>{const K=new Image;K.onload=()=>b(K),K.onerror=()=>k(o("extend.cannotLoad")),K.src=e},[e]);const P=v?Z7(v.naturalWidth,v.naturalHeight,p,S):null,L=P?Math.min(1,q7/Math.max(P.width,P.height)):1,_=P&&{width:Math.round(P.width*L),height:Math.round(P.height*L)},V=!!(v&&P&&(P.width>v.naturalWidth||P.height>v.naturalHeight)),I=v&&P?{w:v.naturalWidth/P.width,h:v.naturalHeight/P.height,x:(1-v.naturalWidth/P.width)*E.x,y:(1-v.naturalHeight/P.height)*E.y}:null,X=y.useMemo(()=>{var B;if(!v)return null;const K=document.createElement("canvas");return K.width=12,K.height=12,(B=K.getContext("2d"))==null||B.drawImage(v,0,0,12,12),K},[v]),Y=(K,B,A)=>{const U=K.getContext("2d");return!U||!v||!I||!X?!1:(K.width=B,K.height=A,U.imageSmoothingEnabled=!0,U.imageSmoothingQuality="high",U.drawImage(X,0,0,B,A),U.drawImage(v,I.x*B,I.y*A,I.w*B,I.h*A),!0)},q=y.useRef(null);y.useLayoutEffect(()=>{if(!q.current||!P)return;const K=Math.min(1,1200/Math.max(P.width,P.height));Y(q.current,Math.round(P.width*K),Math.round(P.height*K))});const $=K=>{var N;const B=D.current,A=(N=g.current)==null?void 0:N.getBoundingClientRect();if(!B||!A||!I)return;const U=1-I.w,J=1-I.h,F=(K.clientX-B.start.x)/A.width,oe=(K.clientY-B.start.y)/A.height;R({x:U>0?Tm(B.place.x+F/U,0,1):.5,y:J>0?Tm(B.place.y+oe/J,0,1):.5})},G=K=>{const A={ArrowLeft:[-.05,0],ArrowRight:[.05,0],ArrowUp:[0,-.05],ArrowDown:[0,.05]}[K.key];if(!A)return;K.preventDefault();const[U,J]=A;R(F=>({x:Tm(F.x+U,0,1),y:Tm(F.y+J,0,1)}))},H=async()=>{if(!(!_||!I||!v)){j(!0),k(null);try{const K=document.createElement("canvas");if(!Y(K,_.width,_.height))throw new Error(o("adjust.cannotDraw"));const B=document.createElement("canvas");B.width=_.width,B.height=_.height;const A=B.getContext("2d");if(!A)throw new Error(o("adjust.cannotDraw"));A.fillStyle="#fff",A.fillRect(0,0,B.width,B.height);const U=Math.round($7*Math.min(I.w*B.width,I.h*B.height)),J=I.x*B.width,F=I.y*B.height,oe=J+I.w*B.width,N=F+I.h*B.height,z={left:J>.5?J+U:0,top:F>.5?F+U:0,right:oe<B.width-.5?oe-U:B.width,bottom:N<B.height-.5?N-U:B.height};A.fillStyle="#000",A.fillRect(z.left,z.top,z.right-z.left,z.bottom-z.top);const Z=document.createElement("canvas");Z.width=B.width,Z.height=B.height;const te=Z.getContext("2d");te&&(te.fillStyle="rgb(255 61 139)",te.fillRect(0,0,Z.width,Z.height),te.clearRect(z.left,z.top,z.right-z.left,z.bottom-z.top));const[ue,W]=await Promise.all([GR(K,"image/webp"),GR(B,"image/png")]);if(!ue||!W)throw new Error(o("adjust.cannotSave"));await t(ue,W,Z.toDataURL("image/png"))}catch(K){k(a(K))}finally{j(!1)}}};return d.jsx(yd,{open:!0,onOpenChange:K=>!K&&!C&&s(),disablePointerDismissal:!0,children:d.jsxs(xd,{showCloseButton:!1,className:"flex max-h-[96dvh] w-full max-w-[calc(100%-2rem)] sm:w-fit flex-col gap-4 overflow-y-auto rounded-2xl bg-panel p-5 ring-line sm:max-w-[calc(100%-2rem)] sm:p-6",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(wd,{className:"font-display text-2xl font-bold tracking-tight",children:o("extend.title")}),d.jsx(Ik,{className:"text-dim",children:o("extend.hint")})]}),d.jsxs("div",{ref:g,onPointerMove:$,onPointerUp:()=>{D.current=null},onPointerCancel:()=>{D.current=null},className:"relative mx-auto w-fit touch-none select-none overflow-hidden rounded-xl",children:[d.jsx("canvas",{ref:q,role:"img","aria-label":o("extend.preview"),className:"block max-h-[56vh] max-w-full"}),I&&d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[repeating-linear-gradient(45deg,rgb(0_0_0/0.35)_0_8px,rgb(0_0_0/0.15)_8px_16px)]",style:{clipPath:`polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${I.x*100}% ${I.y*100}%, ${(I.x+I.w)*100}% ${I.y*100}%, ${(I.x+I.w)*100}% ${(I.y+I.h)*100}%, ${I.x*100}% ${(I.y+I.h)*100}%, ${I.x*100}% ${I.y*100}%)`}}),d.jsx("button",{type:"button","aria-label":o("extend.place"),onKeyDown:G,onPointerDown:K=>{K.currentTarget.setPointerCapture(K.pointerId),D.current={start:{x:K.clientX,y:K.clientY},place:E}},className:"absolute cursor-move border border-white/90 focus-visible:outline-2 focus-visible:outline-pink",style:{left:`${I.x*100}%`,top:`${I.y*100}%`,width:`${I.w*100}%`,height:`${I.h*100}%`}})]})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{id:u,className:"mr-1 text-sm text-dim",children:o("extend.shape")}),d.jsx(Na,{"aria-labelledby":u,value:[p],onValueChange:([K])=>{const B=ZR.find(A=>A===K);B&&x(B)},className:"flex-wrap",children:ZR.map(K=>d.jsx(wi,{value:K,variant:"outline",className:YR,children:K==="same"?o("extend.same"):K},K))})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx("span",{id:m,className:"mr-1 text-sm text-dim",children:o("extend.room")}),d.jsx(Na,{"aria-labelledby":m,value:[String(S)],onValueChange:([K])=>{const B=KR.find(A=>String(A)===K);B!=null&&w(B)},className:"flex-wrap",children:KR.map(K=>d.jsx(wi,{value:String(K),variant:"outline",className:YR,children:K===0?o("extend.none"):`+${c(K,{style:"percent"})}`},K))})]}),d.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line pt-4",children:[d.jsxs("span",{className:"mr-auto flex flex-wrap items-center gap-3",children:[_&&d.jsx("span",{className:"font-mono text-xs text-dim",children:o("adjust.result",{width:c(_.width),height:c(_.height)})}),v&&!V&&d.jsx("span",{className:"text-sm text-dim",children:o("extend.noRoom")}),d.jsx("span",{className:"text-sm text-danger",role:"alert",children:O})]}),d.jsx(Ue,{variant:"ghost",onClick:s,disabled:C,children:o("common.cancel")}),d.jsx(Ue,{variant:"aurora",size:"lg",onClick:H,disabled:!V||C,children:o(C?"mask.saving":"extend.done")})]})]})})}function Zu(e,t){switch(t){case"comfyui":return e("folders.app.comfyui");case"a1111":return e("folders.app.a1111");case"stabilityMatrix":return e("folders.app.stabilityMatrix");case null:return e("folders.app.none")}}function Y7({linked:e}){const{t}=Xe();return d.jsx("span",{className:"rounded-md bg-panel-2 px-1.5 py-0.5 font-mono text-xs text-dim",children:e.app?t("folders.from",{app:Zu(t,e.app)}):t("folders.fromFolder")})}function G7(e,t){return t.app?Zu(e,t.app):e("folders.tag")}function Pk(){const e=On();return()=>{for(const t of["model-folders","loras","checkpoints","models"])e.invalidateQueries({queryKey:[t]})}}function Q7({folder:e}){const{t,explain:s,language:o}=Xe(),a=qs(),c=Pk(),u=kt({mutationFn:()=>Qe.removeModelFolder(e.id),onSuccess:c}),{unknown:m,unreadable:g,tooLarge:v}=e.skipped,b=[m>0&&t("folders.skipped.unknown",{count:m}),g>0&&t("folders.skipped.unreadable",{count:g}),v>0&&t("folders.skipped.tooLarge",{count:v})].filter(p=>typeof p=="string");return d.jsxs("li",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 rounded-xl border border-line bg-bg/60 px-4 py-3",children:[d.jsxs("div",{className:"min-w-0 flex-1 basis-60",children:[d.jsx("p",{className:"truncate font-mono text-sm",title:e.path,children:e.path??Zu(t,e.app)}),d.jsx("p",{className:"mt-0.5 text-sm text-dim",children:e.available?t("folders.holds",{app:Zu(t,e.app),checkpoints:t("folders.checkpoints",{count:e.checkpoints}),loras:t("folders.loras",{count:e.loras})}):t("folders.unavailable")}),e.available&&b.length>0&&d.jsx("p",{className:"mt-1 text-xs text-dim",children:t("folders.skipped",{reasons:new Intl.ListFormat(o).format(b)})}),e.truncated&&d.jsx("p",{className:"mt-1 text-xs text-dim",children:t("folders.truncated")}),u.error&&d.jsx("p",{className:"mt-1 text-sm text-danger",children:s(u.error)})]}),a.admin&&d.jsx(Eo,{label:t("folders.remove"),ariaLabel:t("folders.removeNamed",{path:e.path??""}),question:t("folders.removeAsk",{path:e.path??""}),confirm:t("folders.removeConfirm"),disabled:u.isPending,onConfirm:()=>u.mutate()})]})}function y$(){var w;const{t:e,explain:t}=Xe(),s=qs(),o=y.useId(),a=Pk(),c=Wt({queryKey:["model-folders"],queryFn:Qe.modelFolders}),u=Wt({queryKey:["model-folders","suggestions"],queryFn:Qe.modelFolderSuggestions,enabled:s.admin}),[m,g]=y.useState(!1),[v,b]=y.useState(""),p=kt({mutationFn:E=>Qe.addModelFolder(E),onSuccess:()=>{g(!1),b(""),a()}}),x=kt({mutationFn:Qe.rescanModelFolders,onSuccess:a}),S=c.data??[];return d.jsxs(ld,{className:pd,children:[d.jsxs(xx,{className:"flex flex-wrap items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[d.jsx("h2",{className:Qh,children:e("folders.title")}),d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:e("folders.intro")})]}),s.admin&&d.jsxs("div",{className:"flex flex-wrap gap-2",children:[S.length>0&&d.jsx(Ue,{variant:"outline",onClick:()=>x.mutate(),disabled:x.isPending,children:e("folders.rescan")}),!m&&d.jsx(Ue,{variant:"secondary",onClick:()=>g(!0),children:e("folders.add")})]})]}),d.jsxs(cd,{className:"flex flex-col gap-3 empty:hidden",children:[s.admin&&((w=u.data)==null?void 0:w.map(E=>d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 rounded-xl border border-dashed border-line px-4 py-3",children:[d.jsx("p",{className:"min-w-0 flex-1 basis-60 text-sm",children:e("folders.found",{app:Zu(e,E.app),path:E.path})}),d.jsx(Ue,{variant:"secondary",onClick:()=>p.mutate(E.path),disabled:p.isPending,"aria-label":e("folders.useNamed",{path:E.path}),children:e("folders.use")})]},E.path))),m&&d.jsxs("form",{className:"flex flex-col gap-3",onSubmit:E=>{E.preventDefault(),p.mutate(v)},children:[d.jsx(Or,{htmlFor:`${o}-path`,className:"text-dim",children:e("folders.pathLabel")}),d.jsx(Cn,{id:`${o}-path`,value:v,onChange:E=>b(E.target.value),spellCheck:!1,autoFocus:!0,className:"h-10 font-mono"}),d.jsx("p",{className:"text-xs leading-relaxed text-dim",children:e("folders.pathHint")}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(Ue,{type:"submit",disabled:p.isPending||!v.trim(),children:e("folders.use")}),d.jsx(Ue,{variant:"outline",onClick:()=>{g(!1),p.reset()},children:e("common.cancel")})]})]}),(p.isPending||x.isPending)&&d.jsx("p",{className:"text-sm text-dim",role:"status",children:e("folders.reading")}),(p.error||x.error||c.error)&&d.jsx("p",{className:"text-sm text-danger",children:t(p.error??x.error??c.error)}),c.data&&S.length===0&&!m&&d.jsx("p",{className:"text-sm text-dim",children:e("folders.empty")}),S.length>0&&d.jsx("ul",{className:"flex flex-col gap-2",children:S.map(E=>d.jsx(Q7,{folder:E},E.id))})]})]})}function QR(e,t){switch(t){case"sd1":return e("loras.base.sd1");case"sdxl":return e("loras.base.sdxl");case"flux":return e("loras.base.flux");case"wan":return e("loras.base.wan");case"z-image":return e("loras.base.zImage")}}function Qx(){const e=ji()!==null;return Wt({queryKey:["loras"],queryFn:Qe.loras,enabled:!e})}function X7({lora:e,models:t}){const{t:s,bytes:o,explain:a}=Xe(),c=qs(),u=On(),m=kt({mutationFn:()=>Qe.deleteLora(e.id),onSuccess:()=>u.invalidateQueries({queryKey:["loras"]})}),g=t.filter(v=>v.capabilities.loraBase===e.base);return d.jsxs("li",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 rounded-xl border border-line bg-bg/60 px-4 py-3",children:[d.jsxs("div",{className:"min-w-0 flex-1 basis-60",children:[d.jsx("p",{className:"truncate font-medium",title:e.name,children:e.name}),d.jsx("p",{className:"mt-0.5 text-sm text-dim",children:g.length>0?s("loras.worksWith",{base:QR(s,e.base),models:g.map(v=>v.name).join(", ")}):s("loras.noModel",{base:QR(s,e.base)})}),e.linked&&d.jsx("p",{className:"mt-1.5",children:d.jsx(Y7,{linked:e.linked})}),e.trigger&&d.jsxs("p",{className:"mt-1.5 text-xs text-dim",children:[s("loras.trigger")," ",d.jsx("code",{className:"rounded-md bg-panel-2 px-1.5 py-0.5 font-mono text-ink",children:e.trigger})]}),m.error&&d.jsx("p",{className:"mt-1 text-sm text-danger",children:a(m.error)})]}),d.jsx("span",{className:"font-mono text-xs text-dim",children:o(e.size)}),c.admin&&!e.linked&&d.jsx(Eo,{label:s("loras.delete"),ariaLabel:s("loras.deleteNamed",{name:e.name}),question:s("loras.deleteAsk",{name:e.name,size:o(e.size)}),confirm:s("loras.deleteConfirm"),disabled:m.isPending,onConfirm:()=>m.mutate()})]})}function x$(){const{t:e,bytes:t,explain:s}=Xe(),o=Qx(),a=Wt({queryKey:["models"],queryFn:Qe.models}),c=y.useRef(null),u=On(),m=kt({mutationFn:b=>Qe.addLora(b),onSuccess:()=>u.invalidateQueries({queryKey:["loras"]})}),g=m.isPending?m.variables:null,v=qs();return d.jsx(ld,{className:pd,children:d.jsxs(Zx,{className:"flex flex-col gap-5",children:[d.jsxs(xx,{className:"flex flex-wrap items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[d.jsx("h2",{className:Qh,children:e("loras.title")}),d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:e("loras.intro")})]}),d.jsxs("div",{className:De("flex flex-wrap gap-2",!v.train&&"hidden"),children:[d.jsxs(Kx,{render:d.jsx(Ue,{variant:"outline",className:"group"}),children:[e("training.open"),d.jsx(gh,{"aria-hidden":"true",className:"transition-transform group-data-panel-open:rotate-180 motion-reduce:transition-none"})]}),d.jsx(Ue,{variant:"secondary",onClick:()=>{var b;return(b=c.current)==null?void 0:b.click()},disabled:g!=null,children:e("loras.add")})]}),d.jsx("input",{ref:c,type:"file",accept:".safetensors",hidden:!0,onChange:b=>{var x;const p=(x=b.target.files)==null?void 0:x[0];b.target.value="",p&&m.mutate(p)}})]}),d.jsxs(cd,{className:"flex flex-col gap-3 empty:hidden",children:[v.train&&d.jsx(Yx,{children:d.jsx(tF,{})}),g&&d.jsx("p",{className:"text-sm text-dim",role:"status",children:e("loras.adding",{name:g.name,size:t(g.size)})}),m.error&&d.jsx("p",{className:"text-sm text-danger",children:s(m.error)}),o.error&&d.jsx("p",{className:"text-sm text-danger",children:s(o.error)}),o.data&&o.data.length===0&&!g&&d.jsx("p",{className:"text-sm text-dim",children:e("loras.empty")}),o.data&&o.data.length>0&&d.jsx("ul",{className:"flex flex-col gap-2",children:o.data.map(b=>d.jsx(X7,{lora:b,models:a.data??[]},b.id))})]})]})})}function J7({bases:e,value:t,onChange:s}){const{t:o,number:a,language:c}=Xe(),u=y.useId(),g=(Qx().data??[]).filter(p=>e.includes(p.base));if(g.length===0)return null;const v=t.flatMap(p=>{const x=g.find(S=>S.id===p.id);return x?[{...p,lora:x}]:[]}),b=g.filter(p=>!t.some(x=>x.id===p.id));return d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.map(({id:p,weight:x,lora:S})=>d.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-line bg-panel py-1 pr-1 pl-3 text-sm",children:[d.jsx("span",{className:"max-w-40 truncate",title:S.name,children:S.name}),d.jsx("span",{id:`${u}-${p}`,className:"sr-only",children:o("loras.weightOf",{name:S.name})}),d.jsx(uh,{min:0,max:1.5,step:.05,value:x,onValueChange:w=>s(t.map(E=>E.id===p?{...E,weight:Array.isArray(w)?w[0]??0:w}:E)),"aria-labelledby":`${u}-${p}`,format:{style:"percent"},locale:c,getAriaValueText:(w,E)=>o("loras.weightValue",{amount:a(E,{style:"percent"})}),className:"w-24"}),d.jsx("span",{className:"w-10 font-mono text-xs text-dim",children:a(x,{style:"percent"})}),d.jsx(Ue,{variant:"ghost",size:"icon",onClick:()=>s(t.filter(w=>w.id!==p)),"aria-label":o("loras.removeNamed",{name:S.name}),children:d.jsx(Oa,{"aria-hidden":"true"})})]},p)),b.length>0&&v.length<Gx*e.length&&d.jsxs($h,{value:null,onValueChange:p=>{p&&s([...t,{id:p,weight:1}])},children:[d.jsx(Kh,{"aria-label":o("loras.choose"),className:"data-[size=default]:h-10 rounded-xl",children:d.jsx(Zh,{placeholder:o("loras.choose")})}),d.jsx(Yh,{alignItemWithTrigger:!1,children:b.map(p=>d.jsx(Vu,{value:p.id,children:p.name},p.id))})]})]})}const W7="rgb(255 61 139)",eq=2048,XR="h-10 rounded-xl px-3.5 aria-pressed:border-transparent aria-pressed:bg-ink aria-pressed:text-bg";function tq(e){var s;const t=(s=e.getContext("2d"))==null?void 0:s.getImageData(0,0,e.width,e.height).data;if(!t)return!1;for(let o=3;o<t.length;o+=4)if(t[o])return!0;return!1}function nq(e){var c;const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=(c=e.getContext("2d"))==null?void 0:c.getImageData(0,0,t.width,t.height),o=t.getContext("2d");if(!s||!o)return Promise.resolve(null);const a=s.data;for(let u=0;u<a.length;u+=4){const m=(a[u+3]??0)>0?255:0;a[u]=m,a[u+1]=m,a[u+2]=m,a[u+3]=255}return o.putImageData(s,0,0),new Promise(u=>t.toBlob(u,"image/png"))}function rq({src:e,mask:t,onDone:s,onClose:o}){const{t:a,explain:c}=Xe(),[u,m]=y.useState(null),g=y.useId(),v=y.useRef(null),[b,p]=y.useState(48),[x,S]=y.useState(!1),[w,E]=y.useState(!1),[R,C]=y.useState(!1),[j,O]=y.useState(!1),[k,D]=y.useState(null),P=y.useRef(null),L=Y=>{const q=v.current,$=q==null?void 0:q.getContext("2d");if(!q||!$)return;const G=Math.min(1,eq/Math.max(Y.naturalWidth,Y.naturalHeight));if(q.width=Math.round(Y.naturalWidth*G),q.height=Math.round(Y.naturalHeight*G),!t){C(!0);return}const H=new Image;H.onload=()=>{$.drawImage(H,0,0,q.width,q.height);const K=$.getImageData(0,0,q.width,q.height),B=K.data;for(let A=0;A<B.length;A+=4){const U=(B[A]??0)>127;B[A]=255,B[A+1]=61,B[A+2]=139,B[A+3]=U?255:0}$.putImageData(K,0,0),E(!0),C(!0)},H.onerror=()=>C(!0),H.src=t},_=Y=>{const q=Y.currentTarget,$=q.getBoundingClientRect();return{x:(Y.clientX-$.left)/$.width*q.width,y:(Y.clientY-$.top)/$.height*q.height,scale:q.width/$.width,screen:{x:Y.clientX-$.left,y:Y.clientY-$.top}}},V=Y=>{const q=Y.currentTarget.getContext("2d"),$=_(Y);if(!q||!R)return;const G=P.current??$;q.globalCompositeOperation=x?"destination-out":"source-over",q.strokeStyle=W7,q.lineCap="round",q.lineJoin="round",q.lineWidth=b*$.scale,q.beginPath(),q.moveTo(G.x,G.y),q.lineTo($.x,$.y),q.stroke(),P.current=$,x||E(!0)},I=()=>{var q;const Y=v.current;(q=Y==null?void 0:Y.getContext("2d"))==null||q.clearRect(0,0,Y.width,Y.height),E(!1)},X=async()=>{if(v.current){O(!0),m(null);try{const Y=await nq(v.current);Y&&await s(Y,v.current.toDataURL("image/png"))}catch(Y){m(c(Y))}finally{O(!1)}}};return d.jsx(yd,{open:!0,onOpenChange:Y=>!Y&&!j&&o(),disablePointerDismissal:!0,children:d.jsxs(xd,{showCloseButton:!1,className:"flex max-h-[96dvh] w-full max-w-[calc(100%-2rem)] sm:w-fit flex-col gap-4 overflow-y-auto rounded-2xl bg-panel p-5 ring-line sm:max-w-[calc(100%-2rem)] sm:p-6",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx(wd,{className:"font-display text-2xl font-bold tracking-tight",children:a("mask.title")}),d.jsx(Ik,{className:"text-dim",children:a("mask.hint")})]}),d.jsxs("div",{className:"relative mx-auto w-fit overflow-hidden rounded-xl",children:[d.jsx("img",{src:e,alt:"",onLoad:Y=>L(Y.currentTarget),className:"block max-h-[62vh] max-w-full select-none",draggable:!1}),d.jsx("canvas",{ref:v,onPointerDown:Y=>{Y.currentTarget.setPointerCapture(Y.pointerId),P.current=null,V(Y)},onPointerMove:Y=>{D(_(Y).screen),Y.buttons===1&&V(Y)},onPointerUp:Y=>{P.current=null,x&&E(tq(Y.currentTarget))},onPointerLeave:()=>D(null),className:"absolute inset-0 h-full w-full cursor-none touch-none opacity-55"}),k&&d.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute rounded-full border-2 border-white mix-blend-difference",style:{width:b,height:b,left:k.x-b/2,top:k.y-b/2}})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-3",children:[d.jsxs(Na,{"aria-label":a("mask.tool"),value:[x?"erase":"brush"],onValueChange:([Y])=>Y&&S(Y==="erase"),children:[d.jsxs(wi,{value:"brush",variant:"outline",className:XR,children:[d.jsx(m5,{"aria-hidden":"true"}),a("mask.brush")]}),d.jsxs(wi,{value:"erase",variant:"outline",className:XR,children:[d.jsx(y5,{"aria-hidden":"true"}),a("mask.erase")]})]}),d.jsxs("div",{className:"flex h-10 items-center gap-3",children:[d.jsx("span",{id:g,className:"text-sm text-dim",children:a("mask.size")}),d.jsx("div",{className:"w-32",children:d.jsx(uh,{"aria-labelledby":g,min:8,max:160,value:[b],onValueChange:Y=>{const q=Array.isArray(Y)?Y[0]:Y;q!=null&&p(q)}})})]}),d.jsx(Ue,{variant:"ghost",onClick:I,disabled:!w,className:"text-dim",children:a("mask.clear")})]}),d.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line pt-4",children:[d.jsx("span",{className:"mr-auto text-sm text-danger",role:"alert",children:u}),d.jsx(Ue,{variant:"ghost",onClick:o,disabled:j,children:a("common.cancel")}),d.jsx(Ue,{variant:"aurora",size:"lg",onClick:X,disabled:!R||!w||j,children:a(j?"mask.saving":"mask.done")})]})]})})}const Xx=1e3/24,sq=1600,Rm=480,Bs=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Lk(e){return e>=1?[Rm,Math.round(Rm/e)]:[Math.round(Rm*e),Rm]}function oq(e){const t=y.useRef(null),s=y.useRef(e.fraction);s.current=e.fraction;const o=y.useRef(null),[a,c]=Lk(e.ratio);return y.useEffect(()=>{if(!e.preview)return;let u=!0;return iy(e.preview).then(m=>{if(!u)return;o.current=m;const g=t.current;g&&Bs()&&Pu(g,m,.9)}).catch(()=>{}),()=>{u=!1}},[e.preview]),y.useEffect(()=>{const u=t.current;if(!u)return;if(Bs()){Ou(u,.3,0);return}Ou(u,s.current,performance.now());let m=0,g=0;const v=b=>{m=requestAnimationFrame(v),!(b-g<Xx)&&(g=b,o.current?Pu(u,o.current,.35+.55*(s.current??.5)):Ou(u,s.current,b))};return m=requestAnimationFrame(v),()=>cancelAnimationFrame(m)},[a,c]),d.jsx("div",{className:"relative overflow-hidden rounded-2xl bg-panel",style:{aspectRatio:String(e.ratio)},children:d.jsx("canvas",{ref:t,width:a,height:c,className:"absolute inset-0 h-full w-full"})})}function iq(e){const t=y.useRef(null),[s]=y.useState(()=>e.from??0),[o,a]=y.useState(()=>e.fresh&&!Bs());return y.useEffect(()=>{if(!o)return;let c=0,u=!1;return iy(e.src).then(m=>{const g=t.current;if(u||!g)return;[g.width,g.height]=Lk(m.width/m.height);const v=performance.now();let b=0;const p=x=>{const S=Math.min(1,(x-v)/sq);S<1?c=requestAnimationFrame(p):a(!1),!(S<1&&x-b<Xx)&&(b=x,Pu(g,m,s+(1-s)*(1-(1-S)**3)))};c=requestAnimationFrame(p)}).catch(()=>a(!1)),()=>{u=!0,cancelAnimationFrame(c)}},[o,e.src,s]),d.jsxs("span",{className:"relative block",style:o?{aspectRatio:String(e.ratio)}:void 0,children:[d.jsx("img",{src:e.src,alt:e.alt,loading:"lazy",className:`${e.className??""} ${o?"opacity-0":e.fresh?"":"print-in"}`}),o&&d.jsx("canvas",{ref:t,className:`absolute inset-0 h-full w-full ${e.className??""}`})]})}const ju=new Map,ja=new Set,bu=()=>{for(const e of ja)e()};function aq(e){return y.useSyncExternalStore(t=>(ja.add(t),()=>ja.delete(t)),()=>ju.get(e))}const ny=new Map;function lq(e){return y.useSyncExternalStore(t=>(ja.add(t),()=>ja.delete(t)),()=>ny.get(e))}let ry=null;function w$(){return y.useSyncExternalStore(e=>(ja.add(e),()=>ja.delete(e)),()=>ry)}async function cq(e,t){await e.cancelQueries({queryKey:["session"]});let s=!1;e.setQueriesData({queryKey:["session"]},o=>o!=null&&o.turns.some(a=>a.jobs.some(c=>c.id===t.id))?(s=!0,{...o,turns:o.turns.map(a=>({...a,jobs:a.jobs.map(c=>c.id===t.id?t:c)}))}):o),s||e.invalidateQueries({queryKey:["session"]}),t.status==="succeeded"&&e.invalidateQueries({queryKey:["gallery"]})}function uq(e){if(Object.keys(AO()).length>0)return new fq(e);const t=new EventSource(e);return{addEventListener:(s,o)=>t.addEventListener(s,a=>o(a)),close:()=>t.close()}}const dq=3e3;class fq{constructor(t){yt(this,"listeners",new Map);yt(this,"controller",new AbortController);this.path=t,this.run()}addEventListener(t,s){const o=this.listeners.get(t)??new Set;o.add(s),this.listeners.set(t,o)}close(){this.controller.abort()}async run(){const{signal:t}=this.controller;for(;!t.aborted;){try{const s=await MO(this.path,{signal:t,headers:{accept:"text/event-stream"}});s.ok&&s.body&&await this.read(s.body)}catch{}if(t.aborted)return;await new Promise(s=>setTimeout(s,dq))}}async read(t){const s=t.getReader(),o=new TextDecoder;let a="";for(;;){const{value:c,done:u}=await s.read();if(u)return;const{events:m,rest:g}=mq(a+o.decode(c,{stream:!0}));a=g;for(const v of m)for(const b of this.listeners.get(v.type)??[])b({data:v.data})}}}function mq(e){const t=e.replace(/\r\n?/g,`
|
|
323
|
+
`).split(`
|
|
324
|
+
|
|
325
|
+
`),s=t.pop()??"",o=[];for(const a of t){let c="message";const u=[];for(const m of a.split(`
|
|
326
|
+
`))m.startsWith("event:")?c=m.slice(6).trim():m.startsWith("data:")&&u.push(m.slice(5).replace(/^ /,""));u.length>0&&o.push({type:c,data:u.join(`
|
|
327
|
+
`)})}return{events:o,rest:s}}function hq(){const e=On();y.useEffect(()=>{const t=uq("/api/events");let s=Promise.resolve(),o=!1;return t.addEventListener("ready",()=>{o&&(e.invalidateQueries({queryKey:["session"]}),e.invalidateQueries({queryKey:["assistant"]}),e.invalidateQueries({queryKey:["local-models"]}),e.invalidateQueries({queryKey:["loras"]}),e.invalidateQueries({queryKey:["trainer"]})),o=!0}),t.addEventListener("models.moving",a=>{const c=JSON.parse(a.data);if(c.type!=="models.moving")return;const{type:u,...m}=c;ry=m,bu()}),t.addEventListener("models.changed",()=>{ny.clear(),ry=null,bu(),e.invalidateQueries({queryKey:["local-models"]}),e.invalidateQueries({queryKey:["models"]}),e.invalidateQueries({queryKey:["checkpoints"]}),e.invalidateQueries({queryKey:["captioner"]})}),t.addEventListener("trainer.changed",a=>{var u;const c=JSON.parse(a.data);e.setQueryData(["trainer"],c.trainer),((u=c.trainer.training)==null?void 0:u.state)==="done"&&e.invalidateQueries({queryKey:["loras"]})}),t.addEventListener("loras.changed",()=>{e.invalidateQueries({queryKey:["loras"]})}),t.addEventListener("model.progress",a=>{const c=JSON.parse(a.data);c.type==="model.progress"&&(ny.set(c.id,c),bu())}),t.addEventListener("job.updated",a=>{var u;const c=JSON.parse(a.data);c.type==="job.updated"&&((c.job.status!=="running"||((u=ju.get(c.job.id))==null?void 0:u.stage)==="queued")&&ju.delete(c.job.id),s=s.then(()=>cq(e,c.job)),c.job.status==="succeeded"&&e.invalidateQueries({queryKey:["account"]}),bu())}),t.addEventListener("assistant.changed",a=>{const{sessionId:c}=JSON.parse(a.data);e.invalidateQueries({queryKey:["assistant",c]}),e.invalidateQueries({queryKey:["session",c]})}),t.addEventListener("job.progress",a=>{const c=JSON.parse(a.data);if(c.type!=="job.progress")return;const{type:u,jobId:m,...g}=c;ju.set(m,{...ju.get(m),...g}),bu()}),()=>t.close()},[e])}function Jx(e){return e==="gpu"?"great":e==="none"?"none":"slow"}function yo(e){var t;return((t=e.variants.find(s=>s.id===e.variant))==null?void 0:t.fit)??"none"}function Uk(e){var t;return((t=e.variants.find(s=>s.id===e.variant))==null?void 0:t.memoryBytes)??null}function Bk(e){const t=e.gpus.map(s=>s.memoryBytes);return t.length>0?Math.max(...t):null}const Hk=["gpu","offload","cpu","none"],JR=["sdxl-turbo","z-image-turbo","flux-schnell"];function pq(e,t="image"){const s=a=>Hk.indexOf(yo(a)),o=a=>{const c=JR.indexOf(a.id);return c===-1?JR.length:c};return e.filter(a=>a.media===t&&!a.tasks.includes("upscale")&&a.variant!=null&&(yo(a)==="gpu"||yo(a)==="offload")).sort((a,c)=>Number(c.ready)-Number(a.ready)||+(c.state!=="available")-+(a.state!=="available")||s(a)-s(c)||o(a)-o(c)||a.size-c.size)[0]}function gq(e){const t=e.tasks[0];return t==="image-edit"||t==="upscale"?"edit":t==="text-to-video"||t==="image-to-video"?"video":"image"}function vq(e,t){return e.tasks.some(s=>t==="edit"?s==="image-edit"||s==="image-to-image"||s==="upscale":t==="video"?s==="text-to-video"||s==="image-to-video":s==="text-to-image")}function S$(e,t){return e.filter(s=>(t.category==="all"||vq(s,t.category))&&(!t.runsWell||yo(s)==="gpu")&&(!t.commercial||s.commercial.kind==="allowed")&&(!t.installed||s.state!=="available"))}function bq(e){const t=s=>Hk.indexOf(yo(s));return e.toSorted((s,o)=>{var a,c,u,m;return+(o.state!=="available")-+(s.state!=="available")||t(s)-t(o)||(((a=o.profile)==null?void 0:a.quality)??0)-(((c=s.profile)==null?void 0:c.quality)??0)||(((u=o.profile)==null?void 0:u.speed)??0)-(((m=s.profile)==null?void 0:m.speed)??0)||s.size-o.size})}function E$(e){const t=new Set;for(const s of["image","edit","video"]){const o=e.filter(a=>gq(a)===s&&yo(a)==="gpu").toSorted((a,c)=>{var u,m,g,v;return(((u=c.profile)==null?void 0:u.quality)??0)-(((m=a.profile)==null?void 0:m.quality)??0)||(((g=c.profile)==null?void 0:g.speed)??0)-(((v=a.profile)==null?void 0:v.speed)??0)||a.size-c.size})[0];o&&t.add(o.id)}return t}const yq=e=>new Set(e.filter(t=>t.hasKey||!t.requiresKey).map(t=>t.id));function xq(e,t,s){const o=yq(t),a=new Map;for(const c of e){const u=c.profile;if(!u||c.providerId==="local"||c.media!==s)continue;const m=a.get(u.family)??{profile:u,media:c.media,routes:[]};m.routes.push(c),!m.ready&&o.has(c.providerId)&&(m.ready=c),a.set(u.family,m)}return[...a.values()].sort((c,u)=>u.profile.quality-c.profile.quality||u.profile.speed-c.profile.speed||c.profile.name.localeCompare(u.profile.name))}function wq(e){return e.toSorted((t,s)=>+!!s.ready-+!!t.ready||s.profile.speed-t.profile.speed||s.profile.quality-t.profile.quality)[0]}const WR={fal:"https://fal.ai/dashboard/keys",openai:"https://platform.openai.com/api-keys",google:"https://aistudio.google.com/apikey",replicate:"https://replicate.com/account/api-tokens",openrouter:"https://openrouter.ai/settings/keys"},ra={great:{text:"text-good",bg:"bg-good/12",bar:"bg-good"},slow:{text:"text-warn",bg:"bg-warn/12",bar:"bg-warn"},none:{text:"text-danger",bg:"bg-danger/12",bar:"bg-danger"}},Sq="h-10 rounded-[10px] px-4 text-dim hover:bg-transparent aria-pressed:bg-ink aria-pressed:font-semibold aria-pressed:text-bg",Eq="h-10 rounded-full border border-line-strong px-3.5 text-[13px] text-dim aria-pressed:border-transparent aria-pressed:bg-ink aria-pressed:text-bg",Fk=e=>e!=null&&e.sample?`/samples/${e.sample}`:null;function Wx(e){const t=Fk(e.profile);if(t)return t;if(e.kind==="local"){const s=e.model.demos.findIndex(o=>o.media==="image");if(s>=0)return x9(e.model.id,s)}return null}const ps=e=>e.kind==="cloud"?e.profile.name:e.model.name;function sy(e,t){return e(t==="great"?"fit.great":t==="slow"?"fit.slow":"fit.none")}function Tq(e,t){switch(t){case"speed":return e("bestFor.speed");case"drafts":return e("bestFor.drafts");case"photo":return e("bestFor.photo");case"text":return e("bestFor.text");case"illustration":return e("bestFor.illustration");case"editing":return e("bestFor.editing");case"instructions":return e("bestFor.instructions");case"detail":return e("bestFor.detail");case"motion":return e("bestFor.motion");case"cinema":return e("bestFor.cinema");case"sound":return e("bestFor.sound")}}function Rq(e,t){const s=c=>c.filter(u=>u!=null).sort((u,m)=>u-m)[0],o=s(t.routes.map(c=>{var u;return(u=c.pricing)==null?void 0:u.usdPerOutput}));if(o!=null)return t.media==="video"?e.t("picker.perVideo",{price:Du(e,o)}):e.t("picker.perPicture",{price:Du(e,o)});const a=s(t.routes.map(c=>{var u;return(u=c.pricing)==null?void 0:u.usdPerSecond}));return a!=null?e.t("picker.perSecond",{price:Du(e,a)}):t.media==="video"?e.t("picker.paidVideo"):e.t("picker.paid")}function eC(e){return d.jsx("span",{className:"inline-flex gap-[3px]",role:"img","aria-label":e.label,children:[1,2,3].map(t=>d.jsx("i",{className:`h-1.5 w-3.5 rounded-sm ${t>e.value?"bg-line-strong":e.tone==="speed"?"bg-gold":"aurora"}`},t))})}function Vk(e){const t=y.useRef(null),[s,o]=y.useState(()=>Bs());return y.useEffect(()=>{if(e.src){const b=setTimeout(()=>o(!0),e.delay??0);return()=>clearTimeout(b)}const a=t.current;if(!a)return;let c=0;for(const b of e.seed??"")c=(c*31+b.charCodeAt(0))%1e5;if(Ou(a,.4,performance.now()+c*97),Bs())return;let u=0,m=0;const g=b=>{u=requestAnimationFrame(g),!(b-m<Xx)&&(m=b,Ou(a,.4,b+c*97))},v=new IntersectionObserver(([b])=>{cancelAnimationFrame(u),b!=null&&b.isIntersecting&&(u=requestAnimationFrame(g))});return v.observe(a),()=>{v.disconnect(),cancelAnimationFrame(u)}},[e.src,e.delay,e.seed]),e.src?d.jsx("img",{src:e.src,alt:e.alt,loading:"lazy",decoding:"async",className:`focus-in h-full w-full object-cover ${s?"focused":""} ${e.className??""}`}):d.jsx("canvas",{ref:t,width:240,height:180,className:`h-full w-full ${e.className??""}`})}function Cq(e){var S,w;const t=Xe(),{t:s}=t,o=(S=e.hardware)==null?void 0:S.gpus.toSorted((E,R)=>R.memoryBytes-E.memoryBytes)[0],a=e.hardware?Bk(e.hardware):null,c=((w=e.pick)==null?void 0:w.kind)==="local"?e.pick.model:void 0,u=qs(),m=ji()!==null,g=c?Uk(c):null,v=c?Jx(yo(c)):null,b=g&&a?Math.min(1,g/a):0,[p,x]=y.useState(0);return y.useEffect(()=>{if(Bs()){x(b);return}const E=performance.now();let R=0;const C=j=>{const O=Math.min(1,(j-E)/1400);x(b*(1-(1-O)**3)),O<1&&(R=requestAnimationFrame(C))};return R=requestAnimationFrame(C),()=>cancelAnimationFrame(R)},[b]),d.jsxs("section",{"aria-label":s("picker.bestHere"),className:"rise-in grid overflow-hidden rounded-2xl border border-line bg-panel md:grid-cols-[1.1fr_1fr]",style:{"--i":1},children:[d.jsxs("div",{className:"flex flex-col gap-4 border-line p-6 max-md:border-b md:border-r",children:[d.jsxs("p",{className:"flex items-center gap-2 font-mono text-[11px] uppercase tracking-[0.12em] text-dim",children:[d.jsx("i",{"aria-hidden":"true",className:"breathe size-1.5 rounded-full bg-good shadow-[0_0_10px_var(--good)]"}),s("picker.machine")]}),d.jsxs("p",{className:"font-display text-xl leading-tight font-bold tracking-tight",children:[(o==null?void 0:o.name)??s("picker.noGpu"),d.jsx("span",{className:"mt-1 block font-sans text-sm font-normal tracking-normal text-dim",children:[a!=null&&s("picker.gpuMemory",{size:t.bytes(a)}),e.hardware&&s("picker.ram",{size:t.bytes(e.hardware.memoryBytes)})].filter(Boolean).join(" · ")})]}),a!=null&&g!=null&&v&&d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex justify-between font-mono text-xs text-dim tabular-nums",children:[d.jsx("span",{children:s("picker.vram")}),d.jsx("span",{children:s("picker.vramUse",{used:t.bytes(Math.round(a*p)),total:t.bytes(a)})})]}),d.jsx("div",{className:"relative h-3.5 overflow-hidden rounded-full border border-line bg-panel-2",role:"img","aria-label":s("picker.vramUse",{used:t.bytes(g),total:t.bytes(a)}),children:d.jsx("i",{className:`sweep absolute inset-y-0 left-0 rounded-full ${ra[v].bar}`,style:{width:`${p*100}%`}})}),d.jsx("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-dim",children:["great","slow","none"].map(E=>d.jsxs("li",{className:"inline-flex items-center gap-1.5",children:[d.jsx("i",{className:`size-2 rounded-sm ${ra[E].bar}`}),sy(s,E)]},E))})]})]}),e.pick&&d.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[d.jsx("p",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-dim",children:s("picker.best")}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"size-24 shrink-0 overflow-hidden rounded-xl bg-panel-2",children:d.jsx(Vk,{src:Wx(e.pick),alt:ps(e.pick),delay:300})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h2",{className:"font-display text-2xl leading-tight font-bold tracking-tight",children:ps(e.pick)}),d.jsx("p",{className:"mt-1 text-sm text-dim",children:e.pick.kind!=="local"?s("picker.whyCloud"):s(v==="great"?"picker.whyLocal":"picker.whySlow")})]})]}),d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[d.jsx("span",{className:"aurora rounded-full px-2.5 py-0.5 text-xs font-semibold",children:s("picker.recommended")}),v&&d.jsxs("span",{className:`rounded-full px-2.5 py-0.5 text-xs ${ra[v].bg} ${ra[v].text}`,children:[d.jsx("span",{"aria-hidden":"true",children:"● "}),sy(s,v)]}),g!=null&&d.jsx("span",{className:"rounded-full bg-white/6 px-2.5 py-0.5 text-xs",children:s("picker.uses",{size:t.bytes(g)})})]}),d.jsxs("div",{className:"mt-auto flex flex-wrap items-center gap-2",children:[c&&!c.ready&&!u.admin?d.jsx("p",{className:"text-sm text-dim",children:s(m?"demo.onlyInstalled":"models.askAdmin")}):d.jsx(Ue,{variant:"aurora",size:"lg",onClick:()=>e.pick&&e.onChoose(e.pick),children:c&&!c.ready?s("picker.downloadUse",{size:t.bytes(c.size)}):s("picker.useThis")}),d.jsx(Ue,{variant:"outline",size:"lg",onClick:e.onSeeAll,children:s("picker.seeAll")})]})]})]})}function Nq({entries:e}){const{t}=Xe(),s=y.useRef(null),[o,a]=y.useState(0),[c,u]=y.useState(!1),m=y.useRef(!1),g=e[o%e.length],v=g&&Wx(g);return y.useEffect(()=>{const b=s.current;if(!b||!v)return;let p=0,x,S=!1;const w=()=>{Bs()||(x=setTimeout(()=>{m.current?w():a(E=>(E+1)%e.length)},2800))};return iy(v).then(E=>{if(S)return;if(Bs())return Pu(b,E,1),w();u(!0);const R=performance.now(),C=j=>{const O=Math.min(1,(j-R)/1100);Pu(b,E,1-(1-O)**3),O<1?p=requestAnimationFrame(C):(u(!1),w())};p=requestAnimationFrame(C)}).catch(()=>{u(!1),w()}),()=>{S=!0,cancelAnimationFrame(p),clearTimeout(x)}},[v,e.length]),g?d.jsxs("section",{"aria-label":t("picker.compareTitle"),onPointerEnter:()=>{m.current=!0},onPointerLeave:()=>{m.current=!1},onFocus:()=>{m.current=!0},onBlur:()=>{m.current=!1},className:"rise-in grid items-center gap-6 md:grid-cols-[17rem_1fr]",style:{"--i":2},children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx("p",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-dim",children:t("picker.compareEyebrow")}),d.jsx("h3",{className:"font-display text-2xl leading-tight font-bold tracking-tight text-balance",children:t("picker.compareTitle")}),d.jsxs("p",{className:"rounded-lg border border-line bg-panel px-3 py-2 font-mono text-[13px] leading-relaxed",children:[d.jsx("span",{className:"text-pink",children:"› "}),t("picker.comparePrompt")]})]}),d.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1.4fr_1fr]",children:[d.jsxs("figure",{className:"flex flex-col gap-2",children:[d.jsx("div",{className:"relative aspect-square overflow-hidden rounded-2xl border border-line bg-panel",children:d.jsx("canvas",{ref:s,width:640,height:640,className:"absolute inset-0 h-full w-full"})}),d.jsxs("figcaption",{className:"flex justify-between gap-2 px-0.5 font-mono text-xs text-dim",children:[d.jsx("span",{className:"font-sans font-medium text-ink",children:ps(g)}),d.jsx("span",{children:g.kind==="local"?t("picker.free"):t("picker.cloud")})]})]}),d.jsx("div",{className:"flex flex-col gap-1.5",children:e.map((b,p)=>d.jsxs("button",{type:"button","aria-current":p===o%e.length,onClick:()=>a(p),className:"relative overflow-hidden rounded-xl border border-line bg-panel px-3 py-2.5 text-left transition-colors aria-[current=true]:border-line-strong aria-[current=true]:bg-panel-2",children:[d.jsx("span",{className:"block text-sm font-semibold",children:ps(b)}),d.jsx("span",{className:"font-mono text-xs text-dim",children:b.kind==="local"?t("picker.free"):t("picker.cloud")}),p===o%e.length&&!c&&d.jsx("i",{"aria-hidden":"true",className:"aurora absolute inset-x-0 bottom-0 h-0.5 origin-left motion-safe:animate-[grow_2.8s_linear_both]"},o)]},b.key))})]})]}):null}function jq(e){const t=Xe(),{t:s}=t,{entry:o}=e,a=o.profile,c=o.kind==="local"?o.model:void 0,u=c?Jx(yo(c)):null,m=c?Uk(c):null,g=o.kind==="local"?o.model.author:o.kind==="cloud"?o.profile.author:o.model.providerId,v=o.kind==="cloud"?[...new Set(o.family.routes.map(w=>w.providerId))].join(" · "):null,b=o.kind==="cloud"?o.family.media:o.model.media,p=qs(),x=o.kind==="cloud"&&!o.family.ready||o.kind==="other"&&!o.ready,S=x&&!p.paid;return d.jsxs("article",{"data-chosen":e.chosen,className:"glow-card rise-in relative flex flex-col overflow-hidden rounded-2xl border border-line bg-panel",style:{"--i":e.index+3},children:[d.jsx("button",{type:"button","aria-pressed":e.chosen,"aria-label":ps(o),onClick:e.onChoose,className:"absolute inset-0 z-10 rounded-2xl"}),d.jsx("div",{className:"relative aspect-[4/3] overflow-hidden bg-panel-2",children:d.jsx(Vk,{src:Wx(o),alt:s("picker.sampleOf",{model:ps(o)}),delay:500+e.index*160,seed:o.key})}),d.jsxs("div",{className:"flex flex-1 flex-col gap-2.5 p-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.best&&d.jsx("span",{className:"aurora rounded-full px-2.5 py-0.5 text-xs font-semibold",children:s("picker.best")}),d.jsxs("span",{className:`rounded-full px-2 py-0.5 text-[11px] ${u?`${ra[u].bg} ${ra[u].text}`:x?"bg-white/6 text-ink":"bg-good/12 text-good"}`,children:[(u||!x)&&d.jsx("span",{"aria-hidden":"true",children:"● "}),u?sy(s,u):s(S?"picker.noPaid":x?"picker.needsKey":"picker.ready")]})]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h4",{className:"font-display text-lg leading-tight font-bold tracking-tight",children:ps(o)}),d.jsx("p",{className:"truncate text-xs text-dim",title:v??g,children:v?s("picker.via",{author:g,services:v}):g})]}),a&&d.jsxs("dl",{className:"grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-1 text-xs text-dim",children:[d.jsx("dt",{children:s("picker.speed")}),d.jsx("dd",{children:d.jsx(eC,{value:a.speed,tone:"speed",label:s("picker.outOf",{value:a.speed})})}),d.jsx("dt",{children:s("picker.quality")}),d.jsx("dd",{children:d.jsx(eC,{value:a.quality,tone:"quality",label:s("picker.outOf",{value:a.quality})})}),b!=="video"&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:s("picker.text")}),d.jsx("dd",{children:a.text?s("picker.textGood"):s("picker.textPoor")})]})]}),c&&m!=null&&u&&e.gpuTotal!=null&&d.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-panel-2",role:"img","aria-label":s("picker.vramUse",{used:t.bytes(m),total:t.bytes(e.gpuTotal)}),children:d.jsx("i",{className:`block h-full rounded-full ${ra[u].bar}`,style:{width:`${Math.min(100,m/e.gpuTotal*100)}%`}})}),a&&a.bestFor.length>0&&d.jsx("ul",{className:"flex flex-wrap gap-1",children:a.bestFor.map(w=>d.jsx("li",{className:"rounded-full border border-line-strong px-2 py-0.5 text-[11px] text-dim",children:Tq(s,w)},w))}),d.jsxs("p",{className:"mt-auto flex items-center justify-between gap-2 pt-1 font-mono text-xs text-dim tabular-nums",children:[d.jsx("span",{children:c?c.ready?s("picker.installed"):t.bytes(c.size):o.kind==="cloud"?Rq(t,o.family):""}),d.jsx("span",{className:"text-ink",children:c?s("picker.free"):""})]})]})]})}function Oq(e){const{model:t}=e,s=Xe(),{t:o}=s,a=lq(t.id),c=kt({mutationFn:()=>Qe.installModel(t.id)}),u=(a==null?void 0:a.state)??t.state,m=(a==null?void 0:a.receivedBytes)??t.receivedBytes,g=(a==null?void 0:a.size)??t.size,v=(a==null?void 0:a.bytesPerSecond)??0,b=u!=="available"||c.isPending||c.isSuccess,{mutate:p}=c,x=qs(),S=ji()!==null;y.useEffect(()=>{x.admin&&e.autoStart&&t.state==="available"&&p()},[]);const w=[["downloading",o("picker.stepDownload")],["verifying",o("picker.stepCheck")],["installed",o("picker.stepReady")]],E=u==="verifying"?1:u==="installed"?2:0,R=c.error?s.explain(c.error):t.error?s.explain({message:t.error,code:t.errorCode,params:t.errorParams}):null;return d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsx("ol",{className:"flex flex-wrap gap-1.5 text-xs",children:w.map(([C,j],O)=>d.jsx("li",{className:`rounded-full border px-2.5 py-0.5 transition-colors ${!b||O>E?"border-line text-dim":O<E?"border-good/40 text-good":"border-pink text-ink shadow-[0_0_0_3px_rgb(255_61_139/0.15)]"}`,children:j},C))}),b?d.jsxs(d.Fragment,{children:[d.jsx(K9,{value:g?Math.round(m/g*100):0,"aria-label":o("picker.stepDownload"),className:"*:data-[slot=progress-track]:h-2.5 *:data-[slot=progress-track]:bg-panel-2 **:data-[slot=progress-indicator]:rounded-full **:data-[slot=progress-indicator]:bg-linear-to-r **:data-[slot=progress-indicator]:from-pink **:data-[slot=progress-indicator]:via-orange **:data-[slot=progress-indicator]:to-gold"}),d.jsxs("p",{className:"flex flex-wrap justify-between gap-2 font-mono text-xs text-dim tabular-nums","aria-live":"polite",children:[d.jsx("span",{children:u==="queued"?o("models.progress.queued"):u==="verifying"?o("models.progress.verifying"):o("models.progress.received",{received:s.bytes(m),total:s.bytes(g)})}),u==="downloading"&&v>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:o("models.progress.speed",{speed:s.bytes(v)})}),d.jsx("span",{children:KO(s,(g-m)/v)})]})]})]}):x.admin?d.jsx(Ue,{variant:"aurora",size:"lg",onClick:()=>c.mutate(),className:"self-start",children:o("picker.download",{size:s.bytes(t.size)})}):d.jsx("p",{className:"text-sm text-dim",children:o(S?"demo.onlyInstalled":"models.askAdmin")}),R&&d.jsx("p",{className:"text-sm text-danger",children:R})]})}function kq(e){var S;const{t,explain:s}=Xe(),o=qs(),a=On(),c=e.providers.filter(w=>w.requiresKey&&e.routes.some(E=>E.providerId===w.id)),[u,m]=y.useState(((S=c[0])==null?void 0:S.id)??""),[g,v]=y.useState(""),b=y.useId(),p=c.find(w=>w.id===u)??c[0],x=kt({mutationFn:()=>o.server?Qe.setOwnKey((p==null?void 0:p.id)??u,g.trim()):Qe.setKey((p==null?void 0:p.id)??u,g.trim()),onSuccess:()=>(v(""),a.invalidateQueries({queryKey:["providers"]}))});return p?o.paid?d.jsxs("form",{className:"flex flex-col gap-3",onSubmit:w=>{w.preventDefault(),g.trim()&&x.mutate()},children:[c.length>1&&d.jsx(Na,{"aria-label":t("picker.service"),value:[p.id],onValueChange:([w])=>w&&m(w),className:"flex-wrap",children:c.map(w=>d.jsx(wi,{value:w.id,className:Eq,children:w.name},w.id))}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Or,{htmlFor:b,className:"text-dim",children:t("settings.keyLabel",{provider:p.name})}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(Cn,{id:b,type:"password",value:g,onChange:w=>v(w.target.value),placeholder:t("settings.pasteKey"),autoComplete:"off",className:"h-11 min-w-0 flex-[1_1_14rem] rounded-xl bg-bg font-mono"}),d.jsx(Ue,{type:"submit",variant:"aurora",size:"lg",disabled:!g.trim()||x.isPending,className:"h-11",children:t("picker.saveKey")})]})]}),d.jsxs("p",{className:"flex flex-wrap justify-between gap-2 text-xs text-dim",children:[d.jsx("span",{children:o.server?t("picker.keyNoteServer",{provider:p.name}):t("picker.keyNote",{provider:p.name})}),WR[p.id]&&d.jsx("a",{href:WR[p.id],target:"_blank",rel:"noreferrer",className:"underline decoration-line-strong underline-offset-4 hover:text-pink",children:t("picker.whereKey",{provider:p.name})})]}),x.error&&d.jsx("p",{className:"text-sm text-danger",children:s(x.error)})]}):d.jsx("p",{className:"text-sm text-dim",children:t("picker.noPaid")}):null}function qk(e){var G,H,K,B;const{t}=Xe(),{server:s,paid:o}=qs(),a=Wt({queryKey:["models"],queryFn:Qe.models}),c=Wt({queryKey:["providers"],queryFn:Qe.providers}),u=Wt({queryKey:["local-models"],queryFn:Qe.localModels}),[m,g]=y.useState(null),v=y.useRef(null),b=y.useRef(null),p=xq(a.data??[],c.data??[],e.media),[x,S]=y.useState(!1),w=bq((((G=u.data)==null?void 0:G.models)??[]).filter(A=>A.media===e.media&&!A.tasks.includes("upscale"))),E=A=>A.state!=="available"||Jx(yo(A))!=="none",R=x?0:w.filter(A=>!E(A)).length,C=w.filter(A=>x||E(A)).map(A=>({kind:"local",key:`local:${A.id}`,profile:A.profile,model:A})),j=p.map(A=>({kind:"cloud",key:`cloud:${A.profile.family}`,profile:A.profile,family:A})),O=new Set((c.data??[]).filter(A=>A.hasKey||!A.requiresKey).map(A=>A.id)),k=(a.data??[]).filter(A=>!A.profile&&A.providerId!=="local"&&A.media===e.media).map(A=>({kind:"other",key:`other:${A.id}`,model:A,ready:O.has(A.providerId)})),D=[...C,...j,...k],P=u.data?Bk(u.data.hardware):null,L=pq(((H=u.data)==null?void 0:H.models)??[],e.media),_=L?C.find(A=>A.kind==="local"&&A.model.id===L.id):(()=>{const A=wq(p);return j.find(U=>U.kind==="cloud"&&U.family===A)})(),V=D.filter((A,U)=>Fk(A.profile)&&D.findIndex(J=>{var F,oe;return((F=J.profile)==null?void 0:F.family)===((oe=A.profile)==null?void 0:oe.family)})===U),I=D.find(A=>A.key===m),[X,Y]=y.useState(null),q=(A,U=!1)=>{g(A.key),Y(U?A.key:null),requestAnimationFrame(()=>{var J;return(J=b.current)==null?void 0:J.scrollIntoView({block:"nearest",behavior:Bs()?"auto":"smooth"})})},$=(I==null?void 0:I.kind)==="local"?I.model.ready?`local/${I.model.id}`:null:(I==null?void 0:I.kind)==="cloud"?((K=I.family.ready)==null?void 0:K.id)??null:(I==null?void 0:I.kind)==="other"&&I.ready?I.model.id:null;return d.jsxs("div",{className:"flex flex-col gap-8",children:[d.jsx(Na,{"aria-label":t("picker.media"),value:[e.media],onValueChange:([A])=>{A!=="image"&&A!=="video"||(e.setMedia(A),g(null))},spacing:1,className:"self-start rounded-xl border border-line bg-panel p-1",children:["image","video"].map(A=>d.jsx(wi,{value:A,className:Sq,children:t(A==="image"?"picker.image":"picker.video")},A))}),u.isPending?d.jsx("div",{className:"developing h-64 rounded-2xl border border-line","aria-hidden":"true"}):d.jsx(Cq,{hardware:(B=u.data)==null?void 0:B.hardware,pick:_,onChoose:A=>q(A,!0),onSeeAll:()=>{var A;return(A=v.current)==null?void 0:A.scrollIntoView({behavior:Bs()?"auto":"smooth"})}}),V.length>=2&&d.jsx(Nq,{entries:V},e.media),d.jsx("div",{ref:v,className:"flex flex-col gap-8",children:[{entries:C,title:t("picker.localTitle"),body:t("picker.localBody")},{entries:j,title:t(s?"picker.cloudTitleServer":"picker.cloudTitle"),body:t(s?"picker.cloudBodyServer":"picker.cloudBody")},{entries:k,title:t("picker.otherTitle"),body:t("picker.otherBody")}].map(A=>A.entries.length>0&&d.jsxs("section",{"aria-label":A.title,children:[d.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[d.jsx("h3",{className:"font-display text-xl font-bold tracking-tight",children:A.title}),d.jsx("p",{className:"text-sm text-dim",children:A.body})]}),d.jsx("div",{className:"mt-3 grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-3.5",children:A.entries.map((U,J)=>d.jsx(jq,{entry:U,index:J,chosen:U.key===m,best:U.key===(_==null?void 0:_.key),gpuTotal:P,onChoose:()=>q(U)},U.key))}),A.entries===C&&R>0&&d.jsx(Ue,{variant:"ghost",onClick:()=>S(!0),className:"mt-3 text-dim",children:t("picker.showTooBig",{count:R})})]},A.title))}),I&&d.jsxs("div",{ref:b,className:"rise-in sticky bottom-3 z-10 flex flex-col gap-3 rounded-2xl border border-line-strong bg-panel/90 p-4 shadow-[0_20px_50px_-20px_#000] backdrop-blur-xl",children:[d.jsx("p",{className:"font-display text-lg font-bold tracking-tight",children:$?t("picker.readyWith",{model:ps(I)}):I.kind==="local"||!o?ps(I):t("picker.keyFor",{model:ps(I)})}),$?e.ready($,ps(I)):I.kind==="local"?d.jsx(Oq,{model:I.model,autoStart:X===I.key}):d.jsx(kq,{routes:I.kind==="cloud"?I.family.routes:[I.model],providers:c.data??[]})]},I.key)]})}function _q(e){const{t}=Xe(),[s,o]=y.useState(e.media);return d.jsx(yd,{open:!0,onOpenChange:a=>!a&&e.onClose(),children:d.jsx(xd,{showCloseButton:!1,className:"block max-h-[92dvh] w-[min(68rem,calc(100%-2rem))] max-w-none overflow-y-auto rounded-2xl bg-bg p-0 ring-line-strong sm:max-w-none",children:d.jsxs("div",{className:"flex flex-col gap-6 p-5 sm:p-8",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsx(wd,{className:"font-display text-3xl leading-tight font-extrabold tracking-tight",children:t("composer.chooseModel")}),d.jsxs(Dk,{render:d.jsx(Ue,{variant:"ghost",size:"icon"}),children:[d.jsx(Oa,{}),d.jsx("span",{className:"sr-only",children:t("common.close")})]})]}),d.jsx(qk,{media:s,setMedia:o,ready:a=>d.jsx(Ue,{variant:"aurora",size:"lg",onClick:()=>e.onUse(a,s),className:"self-start",children:t("picker.useThis")})})]})})})}const $k="hatchlight.models",tC="(min-width: 1024px)",yu="default",Cm="shortest";function Zk(e){try{localStorage.setItem($k,JSON.stringify(e))}catch{}}function Aq(){try{const e=JSON.parse(Ny(localStorage,$k)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function Mq(){return y.useSyncExternalStore(e=>{const t=window.matchMedia(tC);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>window.matchMedia(tC).matches)}const ri="font-mono text-[11px] tracking-[0.14em] text-dim uppercase";function zq(e){var je;const{models:t,providers:s,references:o,setReferences:a,inspector:c}=e,{t:u,explain:m,number:g,language:v}=Xe(),b={prompt:y.useId(),ratio:y.useId(),count:y.useId(),strength:y.useId(),length:y.useId()},p=Mq(),[x,S]=y.useState(!1),[w,E]=y.useState(""),[R,C]=y.useState(Aq),j=ji()!==null;y.useEffect(()=>{!j||t.length===0||t.some(ee=>R.includes(ee.id))||C(t.map(ee=>ee.id))},[j,t,R]);const[O,k]=y.useState(""),[D,P]=y.useState(1),[L,_]=y.useState("image"),[V,I]=y.useState(!1),[X,Y]=y.useState(null),[q,$]=y.useState(null),[G,H]=y.useState([]),K=Qx(),B=y.useRef(null),[A,U]=y.useState(null),[J,F]=y.useState(!1),[oe,N]=y.useState(!1),[z,Z]=y.useState(null),[te,ue]=y.useState(null),[W,be]=y.useState(null),[de,fe]=y.useState(null),[xe]=o.length===1?o:[],pe=xe!=null&&(A==null?void 0:A.reference)===xe?A:null,we=(pe==null?void 0:pe.id)??null,Oe=t.some(ee=>ee.media==="image"&&ee.capabilities.mask!=null),ke=new Set(s.filter(ee=>ee.hasKey||!ee.requiresKey).map(ee=>ee.id)),Pe=ee=>ke.has(ee.providerId)?o.length>ee.capabilities.maxReferenceImages?ee.capabilities.maxReferenceImages===0?u("composer.blocked.noReferences",{model:ee.name}):u("composer.blocked.tooManyReferences",{model:ee.name,count:ee.capabilities.maxReferenceImages}):we&&ee.capabilities.mask==null?u("composer.blocked.noMask",{model:ee.name}):null:u("composer.blocked.needsKey",{model:ee.name}),Te=t.filter(ee=>ee.media===L&&ee.capabilities.upscale==null),He=Te.filter(ee=>R.includes(ee.id)&&!Pe(ee)),se=[...new Set(He.flatMap(ee=>ee.capabilities.aspectRatios))],ye=Math.max(1,...He.map(ee=>ee.capabilities.maxCount)),Ae=[...new Set(He.flatMap(ee=>ee.capabilities.durations??[]))].sort((ee,Le)=>ee-Le),Be=He.find(ee=>ee.capabilities.strength!=null),ae=o.length>0&&Be!=null,ve=q??(we?(Be==null?void 0:Be.capabilities.mask)??(Be==null?void 0:Be.capabilities.strength):Be==null?void 0:Be.capabilities.strength),ze=[...new Set(He.flatMap(ee=>ee.capabilities.loraBase??[]))],_e=ze.flatMap(ee=>G.filter(Le=>{var Ce;return(Ce=K.data)==null?void 0:Ce.some(et=>et.id===Le.id&&et.base===ee)}).slice(0,Gx)),Re=ae&&He.every(ee=>ee.capabilities.strength!=null)?[]:se,Ge=Re.includes(O)?O:"",Ye=Math.min(D,ye),mt=X!=null&&Ae.includes(X)?X:null;y.useEffect(()=>Zk(R),[R]);const nt=y.useRef(!1);y.useEffect(()=>{if(nt.current||t.length===0)return;nt.current=!0;const ee=t.filter(Le=>R.includes(Le.id)).map(Le=>Le.media);ee.length>0&&!ee.includes("image")&&_("video")},[t,R]);const ut=kt({mutationFn:Qe.upload,onSuccess:ee=>a([...o,ee.id])}),Rt=y.useRef(null);y.useEffect(()=>()=>{var ee;return(ee=Rt.current)==null?void 0:ee.abort()},[]);const At=y.useRef(w);At.current=w;const it=()=>{var ee;(ee=Rt.current)==null||ee.abort(),Rt.current=null,be(null)},qe=async()=>{const ee=w.trim();if(ee===""||Rt.current)return;const Le=new AbortController;Rt.current=Le,be(Le),fe(null);try{const{prompt:Ce}=await Qe.improvePrompt({prompt:ee,modelIds:He.map(et=>et.id),editing:o.length>0,language:v},Le.signal);!Le.signal.aborted&&At.current.trim()===ee&&ue(Ce)}catch(Ce){Le.signal.aborted||fe(Ce)}finally{Rt.current===Le&&(Rt.current=null,be(null))}},at=w.trim()!==""&&He.length>0&&!e.busy,Nt=()=>{if(!at)return;const ee=w.trim();e.onSubmit({prompt:ee,modelIds:He.map(Ce=>Ce.id),aspectRatio:Ge||void 0,count:Ye,durationSeconds:mt??void 0,strength:ae&&q!=null?q:void 0,maskAssetId:we??void 0,loras:_e.length>0?_e:void 0}).then(()=>E(Ce=>Ce.trim()===ee?"":Ce),()=>{}),it(),ue(null),fe(null)},ht=()=>S(!1),Gt=He.length===0&&Te.some(ee=>R.includes(ee.id)&&ke.has(ee.providerId)),Bt=e.error??(ut.error?m(ut.error):null)??(de?m(de):null)??(Gt?u("composer.tooManyReferences"):null),Ft=He.length*Ye,sn=[He.length===0?u("composer.summaryNone"):u("composer.summaryModels",{count:He.length}),Ge,ye>1&&u("composer.summaryEach",{count:Ye})].filter(Boolean).join(" · "),rt=((je=K.data)==null?void 0:je.some(ee=>ze.includes(ee.base)))??!1,Dt=d.jsxs("div",{className:"flex flex-col gap-[22px]",children:[t.some(ee=>ee.media==="video")&&d.jsx(bk,{value:L,onValueChange:ee=>_(ee),children:d.jsxs(yk,{"aria-label":u("composer.output"),className:"w-full",children:[d.jsx(ch,{value:"image",children:u("composer.images")}),d.jsx(ch,{value:"video",children:u("composer.video")})]})}),d.jsxs("fieldset",{className:"flex min-w-0 flex-col gap-1.5",children:[d.jsx("legend",{className:De(ri,"mb-2.5"),children:u("composer.models")}),Te.filter(ee=>ke.has(ee.providerId)||R.includes(ee.id)).map(ee=>{const Le=Pe(ee),Ce=R.includes(ee.id)&&!Le;return d.jsxs(Mk,{variant:"outline",pressed:Ce,disabled:Le!==null,title:Le??ee.id,onPressedChange:et=>C(et?[...R,ee.id]:R.filter(Ze=>Ze!==ee.id)),className:"h-auto min-h-11 w-full justify-start gap-2.5 rounded-xl border-line bg-panel px-3 py-2 text-left font-normal hover:bg-panel-2 aria-pressed:border-orange aria-pressed:bg-panel",children:[d.jsx("i",{"aria-hidden":"true",className:De("size-2 shrink-0 rounded-full",ke.has(ee.providerId)?"bg-good":"bg-dim")}),d.jsx("span",{className:"min-w-0 flex-1 truncate",children:ee.name}),d.jsx("span",{className:"shrink-0 font-mono text-[11px] text-dim",children:ee.linked?G7(u,ee.linked):ee.providerId})]},ee.id)}),d.jsxs(Ue,{variant:"outline",hidden:j,onClick:()=>{ht(),I(!0)},className:"h-11 justify-start gap-2 rounded-xl border-dashed text-dim hover:text-ink dark:bg-transparent",children:[d.jsx(zb,{}),u("composer.chooseModel")]})]}),Re.length>0&&d.jsxs("div",{className:"flex flex-col gap-2.5",children:[d.jsx("span",{id:b.ratio,className:ri,children:u("composer.ratio")}),d.jsx(Na,{"aria-labelledby":b.ratio,value:[Ge||yu],onValueChange:ee=>{const[Le=yu]=ee;k(Le===yu?"":Le)},className:"grid w-full grid-cols-4 gap-1.5",children:[yu,...Re].map(ee=>d.jsx(wi,{value:ee,variant:"outline",className:"h-[52px] min-w-0 rounded-[10px] border-line bg-panel px-1 font-mono text-xs text-soft aria-pressed:border-ink aria-pressed:bg-panel-2 aria-pressed:text-ink",children:ee===yu?u("composer.ratioDefault"):ee},ee))})]}),ye>1&&d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-baseline justify-between",children:[d.jsx("span",{id:b.count,className:ri,children:u(L==="video"?"composer.videoCount":"composer.imageCount")}),d.jsx("span",{className:"font-mono text-[13px]",children:g(Ye)})]}),d.jsx(uh,{"aria-labelledby":b.count,min:1,max:ye,step:1,value:[Ye],onValueChange:ee=>P(typeof ee=="number"?ee:ee[0]??1),locale:v,className:"py-2"})]}),Ae.length>0&&d.jsxs("div",{className:"flex flex-col gap-2.5",children:[d.jsx("span",{id:b.length,className:ri,children:u("composer.length")}),d.jsxs($h,{value:mt==null?Cm:String(mt),onValueChange:ee=>Y(ee&&ee!==Cm?Number(ee):null),items:[{value:Cm,label:u("composer.lengthShortest")},...Ae.map(ee=>({value:String(ee),label:u("format.seconds",{seconds:ee})}))],children:[d.jsx(Kh,{"aria-labelledby":b.length,className:"h-10 w-full rounded-xl bg-panel data-[size=default]:h-10",children:d.jsx(Zh,{})}),d.jsxs(Yh,{children:[d.jsx(Vu,{value:Cm,children:u("composer.lengthShortest")}),Ae.map(ee=>d.jsx(Vu,{value:String(ee),children:u("format.seconds",{seconds:ee})},ee))]})]})]}),ae&&ve!=null&&d.jsxs("div",{className:"flex flex-col gap-3",children:[d.jsxs("div",{className:"flex items-baseline justify-between",children:[d.jsx("span",{id:b.strength,className:ri,children:u("composer.strength")}),d.jsx("span",{className:"font-mono text-[13px]",children:g(ve,{style:"percent"})})]}),d.jsx(uh,{"aria-labelledby":b.strength,min:.1,max:1,step:.05,value:[ve],onValueChange:ee=>$(typeof ee=="number"?ee:ee[0]??ve),format:{style:"percent"},locale:v,getAriaValueText:(ee,Le)=>u("composer.strengthValue",{amount:g(Le,{style:"percent"})}),className:"py-2"})]}),d.jsxs("div",{className:"flex flex-col gap-2.5",hidden:j&&o.length===0,children:[d.jsx("span",{className:ri,children:u("composer.referenceImages")}),d.jsxs("ul",{className:"flex flex-wrap gap-2","aria-label":u("composer.referenceImages"),children:[o.map(ee=>d.jsxs("li",{className:"relative",children:[j?d.jsx("img",{src:ir(ee),alt:u("common.reference"),className:"block size-14 rounded-[10px] object-cover"}):d.jsx("button",{type:"button",onClick:()=>{ht(),Z(ee)},"aria-label":u("composer.adjust"),title:u("composer.adjust"),className:"block rounded-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/60",children:d.jsx("img",{src:ir(ee),alt:u("common.reference"),className:"size-14 rounded-[10px] object-cover transition-opacity hover:opacity-80"})}),ee===xe&&pe&&d.jsx("img",{src:pe.marks,alt:"",className:"pointer-events-none absolute inset-0 size-14 rounded-[10px] object-cover opacity-55"}),d.jsx("button",{type:"button","aria-label":u("composer.removeReference"),onClick:()=>a(o.filter(Le=>Le!==ee)),className:"absolute -top-1.5 -right-1.5 grid size-6 place-items-center rounded-full border border-line-strong bg-panel-2 text-soft outline-none after:absolute after:-inset-2 hover:text-ink focus-visible:ring-3 focus-visible:ring-ring/60",children:d.jsx(Oa,{className:"size-3.5"})})]},ee)),d.jsx("li",{hidden:j,children:d.jsx("button",{type:"button",onClick:()=>{var ee;return(ee=B.current)==null?void 0:ee.click()},disabled:ut.isPending,"aria-label":ut.isPending?u("composer.uploading"):u("composer.addReference"),title:u("composer.addReference"),className:"grid size-14 place-items-center rounded-[10px] border border-dashed border-line-strong text-dim outline-none transition-colors hover:border-dim hover:text-ink focus-visible:ring-3 focus-visible:ring-ring/60 disabled:opacity-60",children:ut.isPending?d.jsx($N,{className:"size-[18px] animate-spin"}):d.jsx(zb,{className:"size-[18px]"})})})]}),xe!=null&&Oe&&!j&&d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[d.jsx(Ue,{variant:"outline",onClick:()=>{ht(),F(!0)},children:u(we?"composer.editArea":"composer.markArea")}),d.jsx(Ue,{variant:"outline",onClick:()=>{ht(),N(!0)},children:u("composer.extend")}),we&&d.jsx(Ue,{variant:"ghost",onClick:()=>U(null),className:"text-dim",children:u("composer.removeMask")})]}),d.jsx("input",{ref:B,type:"file",accept:"image/png,image/jpeg,image/webp",hidden:!0,onChange:ee=>{var Ce;const Le=(Ce=ee.target.files)==null?void 0:Ce[0];Le&&ut.mutate(Le),ee.target.value=""}})]}),rt&&d.jsxs("div",{className:"flex flex-col gap-2.5",children:[d.jsx("span",{className:ri,children:u("composer.styles")}),d.jsx(J7,{bases:ze,value:G,onChange:H})]})]});return d.jsxs(d.Fragment,{children:[p&&d.jsx("aside",{"aria-label":u("composer.parameters"),className:"min-h-0 overflow-y-auto border-r border-[#1a1a1e] px-5 py-6",children:Dt}),d.jsxs("section",{"aria-label":u("composer.promptAndResults"),className:"flex min-h-0 min-w-0 flex-col",children:[d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.children}),d.jsxs("div",{className:"flex shrink-0 flex-col gap-2.5 px-3 pt-2.5 pb-3 max-lg:border-t max-lg:border-[#1a1a1e] max-lg:bg-[#0c0c0f] lg:px-7 lg:pt-2 lg:pb-6",children:[!p&&d.jsxs("div",{className:"flex gap-2 overflow-x-auto",children:[d.jsxs(Ue,{variant:"outline",onClick:()=>S(!0),className:"h-10 shrink-0 gap-2 rounded-full border-[#2c2c32] bg-panel px-3.5 dark:bg-panel",children:[d.jsx(O5,{}),sn]}),d.jsxs(Ue,{variant:"outline",onClick:()=>c.onOpenChange(!0),className:"h-10 shrink-0 gap-2 rounded-full border-[#2c2c32] bg-panel px-3.5 dark:bg-panel",children:[c.thumb&&d.jsx("img",{src:c.thumb,alt:"",className:"size-5 rounded-md object-cover"}),u("inspector.chip")]})]}),te!=null&&d.jsxs("section",{"aria-label":u("composer.suggestion"),className:"rise-in rounded-2xl border border-line bg-panel p-4",children:[d.jsx("h3",{className:ri,children:u("composer.suggestion")}),d.jsx("p",{className:"mt-1.5 leading-relaxed",children:te}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[d.jsx(Ue,{onClick:()=>{E(te),ue(null)},children:u("composer.suggestionUse")}),d.jsx(Ue,{variant:"outline",onClick:qe,disabled:W!=null,children:u("composer.suggestionAnother")}),d.jsx(Ue,{variant:"ghost",onClick:()=>ue(null),className:"text-dim",children:u("composer.suggestionDiscard")})]})]}),d.jsx("p",{role:"alert",className:"text-sm text-danger empty:hidden",children:Bt}),d.jsxs(b7,{value:w,onValueChange:ee=>{E(ee),fe(null)},onSubmit:Nt,className:"flex flex-col gap-1.5 rounded-[20px] bg-panel pl-4 lg:pl-[18px]",children:[d.jsx("label",{htmlFor:b.prompt,className:"sr-only",children:u("composer.prompt")}),d.jsx(y7,{id:b.prompt,placeholder:o.length>0?u(L==="video"?"composer.placeholder.motion":"composer.placeholder.change"):u(L==="video"?"composer.placeholder.video":"composer.placeholder.image")}),d.jsxs(x7,{className:"justify-between gap-2",children:[j?d.jsx("span",{}):W?d.jsxs(Ue,{variant:"ghost",onClick:ee=>{ee.stopPropagation(),it()},className:"-ml-2 gap-2 text-dim",children:[d.jsx(_5,{className:"size-3 fill-current"}),d.jsx("span",{className:"animate-pulse",children:u("composer.improving")}),d.jsx("span",{className:"sr-only",children:u("composer.improveStop")})]}):d.jsxs(Ue,{variant:"ghost",onClick:ee=>{ee.stopPropagation(),qe()},disabled:w.trim()==="",className:"-ml-2 gap-2 text-dim",children:[d.jsx(k5,{}),u("composer.improve")]}),d.jsx(Ue,{variant:"aurora",onClick:ee=>{ee.stopPropagation(),Nt()},disabled:!at,className:"h-11 px-5 text-[15px]",children:Ft>0?u("composer.make",{count:Ft}):u("composer.generate")})]})]})]})]}),p&&d.jsx("aside",{"aria-label":u("inspector.label"),className:"min-h-0 overflow-y-auto border-l border-[#1a1a1e] bg-[#0c0c0f] px-5 py-6",children:c.content}),!p&&d.jsxs(d.Fragment,{children:[d.jsx(Xb,{open:x,onOpenChange:S,children:d.jsxs(Jb,{side:"bottom",className:"max-h-[85dvh] gap-0 rounded-t-3xl border-line bg-rail",children:[d.jsx(Wb,{className:"px-5 pt-5 pb-3",children:d.jsx(ey,{className:"font-display text-xl font-bold",children:u("composer.parameters")})}),d.jsx("div",{className:"min-h-0 overflow-y-auto px-5 pb-8",children:Dt})]})}),d.jsx(Xb,{open:c.open,onOpenChange:c.onOpenChange,children:d.jsxs(Jb,{side:"bottom",className:"max-h-[85dvh] gap-0 rounded-t-3xl border-line bg-rail",children:[d.jsx(Wb,{className:"px-5 pt-5 pb-3",children:d.jsx(ey,{className:"font-display text-xl font-bold",children:u("inspector.label")})}),d.jsx("div",{className:"min-h-0 overflow-y-auto px-5 pb-8",children:c.content})]})})]}),z!=null&&d.jsx(V7,{src:ir(z),onDone:async ee=>{const Le=await Qe.upload(new File([ee],"adjusted",{type:ee.type}));a(Ce=>Ce.map(et=>et===z?Le.id:et)),Z(null)},onClose:()=>Z(null)}),oe&&xe!=null&&d.jsx(K7,{src:ir(xe),onDone:async(ee,Le,Ce)=>{const[et,Ze]=await Promise.all([Qe.upload(new File([ee],"extended",{type:ee.type})),Qe.upload(new File([Le],"mask.png",{type:Le.type}))]);a(pt=>pt.map(Ct=>Ct===xe?et.id:Ct)),U({reference:et.id,id:Ze.id,marks:Ce}),N(!1)},onClose:()=>N(!1)}),J&&xe!=null&&d.jsx(rq,{src:ir(xe),mask:we?ir(we):null,onDone:async(ee,Le)=>{const Ce=await Qe.upload(new File([ee],"mask.png",{type:"image/png"}));U({reference:xe,id:Ce.id,marks:Le}),F(!1)},onClose:()=>F(!1)}),V&&d.jsx(_q,{media:L,onClose:()=>I(!1),onUse:(ee,Le)=>{_(Le),C(Ce=>Ce.includes(ee)?Ce:[...Ce,ee]),I(!1)}})]})}function Kk(e,t){var o,a,c;const{t:s}=e;return[[s("lightbox.model"),t.modelName],[s("lightbox.ratio"),(o=t.params)==null?void 0:o.aspectRatio],[s("lightbox.length"),((a=t.params)==null?void 0:a.durationSeconds)&&s("format.seconds",{seconds:t.params.durationSeconds})],[s("lightbox.seed"),(c=t.params)==null?void 0:c.seed],[s("lightbox.cost"),t.costUsd==null?null:t.costUsd===0?s("picker.free"):Du(e,t.costUsd)]].filter(([,u])=>u!=null)}function Yk({assetId:e,onDeleted:t,className:s}){const{t:o,explain:a}=Xe(),c=On(),[u,m]=y.useState(!1),g=kt({mutationFn:()=>Qe.deleteAsset(e),onSuccess:()=>{c.invalidateQueries({queryKey:["gallery"]}),c.invalidateQueries({queryKey:["session"]}),c.invalidateQueries({queryKey:["account"]}),t()}});return d.jsxs(d.Fragment,{children:[d.jsxs(Ue,{variant:"outline",disabled:g.isPending,onClick:()=>m(!0),className:De("text-dim hover:text-danger",s),children:[d.jsx(a2,{"aria-hidden":"true"}),o("asset.delete")]}),g.error&&d.jsx("p",{className:"text-sm text-danger",children:a(g.error)}),d.jsx(Mx,{open:u,onOpenChange:m,children:d.jsxs(zx,{children:[d.jsxs(Dx,{children:[d.jsx(Px,{children:o("asset.deleteTitle")}),d.jsx(FO,{children:o("asset.deleteBody")})]}),d.jsxs(Ix,{children:[d.jsx(Ux,{children:o("nav.cancel")}),d.jsx(Lx,{variant:"destructive",onClick:()=>{m(!1),g.mutate()},children:o("asset.delete")})]})]})})]})}function Dq({item:e,onClose:t,onUseAsReference:s}){const o=Xe(),{t:a}=o,c=e.mime.startsWith("video/"),u=Kk(o,e);return d.jsx(yd,{open:!0,onOpenChange:m=>!m&&t(),children:d.jsxs(xd,{showCloseButton:!1,className:"flex h-[92dvh] w-[min(1200px,calc(100%-2rem))] max-w-none flex-col gap-0 overflow-hidden rounded-2xl bg-panel p-0 ring-line sm:max-w-none md:flex-row",children:[d.jsx(wd,{className:"sr-only",children:a(c?"gallery.generatedVideo":"common.generatedImage")}),d.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 items-center justify-center bg-bg",children:c?d.jsx("video",{src:ir(e.assetId),controls:!0,autoPlay:!0,loop:!0,playsInline:!0,className:"max-h-full max-w-full object-contain"}):d.jsx("img",{src:ir(e.assetId),alt:e.prompt??a("common.generatedImage"),className:"max-h-full max-w-full object-contain"})}),d.jsxs("div",{className:"flex max-h-[45%] w-full shrink-0 flex-col gap-5 overflow-y-auto border-line p-5 max-md:border-t md:max-h-none md:w-80 md:border-l md:p-6",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.prompt?d.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:e.prompt}):d.jsx("span",{}),d.jsxs(Dk,{render:d.jsx(Ue,{variant:"ghost",size:"icon",className:"-mt-2 -mr-2"}),children:[d.jsx(Oa,{}),d.jsx("span",{className:"sr-only",children:a("common.close")})]})]}),u.length>0&&d.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-[13px]",children:u.map(([m,g])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-dim",children:m}),d.jsx("dd",{className:"font-mono",children:String(g)})]},m))}),d.jsxs("div",{className:"mt-auto flex flex-col gap-2",children:[!c&&d.jsx(Ue,{variant:"aurora",onClick:()=>s(e.assetId),children:a("common.useAsReference")}),d.jsxs("a",{href:ir(e.assetId),download:`hatchlight-${e.assetId}`,className:yx({variant:"outline"}),children:[d.jsx(v5,{"aria-hidden":"true"}),a("lightbox.download")]}),d.jsx(Yk,{assetId:e.assetId,onDeleted:t})]})]})]})})}function Iq({item:e,onOpen:t,onUseAsReference:s,upscale:o,talkHref:a,onDeleted:c}){var v;const u=Xe(),{t:m}=u;if(!e)return d.jsx("p",{className:"text-sm leading-relaxed text-dim",children:m("inspector.empty")});const g=e.mime.startsWith("video/");return d.jsxs("div",{className:"flex flex-col gap-[18px]",children:[d.jsx("button",{type:"button",onClick:()=>t(e),"aria-label":m("inspector.openLarge"),className:"block overflow-hidden rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/60",children:g?d.jsx("video",{src:ir(e.assetId),muted:!0,loop:!0,autoPlay:!0,playsInline:!0,className:"w-full bg-black"}):d.jsx("img",{src:ir(e.assetId),alt:e.prompt??m("common.generatedImage"),className:"w-full bg-black object-contain"})}),d.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-[13px]",children:Kk(u,e).map(([b,p])=>d.jsxs("div",{className:"contents",children:[d.jsx("dt",{className:"text-dim",children:b}),d.jsx("dd",{className:"min-w-0 truncate font-mono",children:String(p)})]},b))}),d.jsxs("div",{className:"flex flex-col gap-2",children:[!g&&d.jsx(Ue,{onClick:()=>s(e.assetId),className:"h-[42px] font-semibold",children:m("common.useAsReference")}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o&&!g&&d.jsx(Ue,{variant:"outline",disabled:o.busy,onClick:()=>o.run(e.assetId),className:"h-[42px]",children:m("job.upscale",{factor:u.number(o.factor)})}),d.jsx(Ue,{variant:"outline",onClick:()=>t(e),className:"h-[42px] [&:only-child]:col-span-2",children:m("inspector.openLarge")})]}),a&&d.jsx(Ue,{variant:"ghost",nativeButton:!1,render:d.jsx("a",{href:a}),className:"h-[42px] border border-line text-soft",children:m("inspector.talk")}),d.jsx(Yk,{assetId:e.assetId,onDeleted:c,className:"h-[42px]"})]}),e.prompt&&d.jsxs(Zx,{className:"text-xs leading-relaxed text-dim",children:[d.jsxs(Kx,{className:"group flex min-h-8 items-center gap-1 rounded-sm outline-none hover:text-ink focus-visible:ring-3 focus-visible:ring-ring/50",children:[m("job.details"),d.jsx(gh,{className:"size-3.5 transition-transform group-data-[panel-open]:rotate-180"})]}),d.jsxs(Yx,{children:[d.jsx("p",{className:"mt-1 whitespace-pre-wrap text-ink",children:e.prompt}),((v=e.params)==null?void 0:v.translatedPrompt)&&d.jsxs("p",{className:"mt-2",children:[m("job.translated")," ",d.jsx("span",{className:"text-ink",children:e.params.translatedPrompt})]})]})]})]})}function Pq(e){const[,t,s,o]=e.replace(/^#/,"").split("/");return t==="gallery"?{view:"gallery"}:t==="models"?{view:"models"}:t==="settings"?{view:"settings"}:t==="talk"?{view:"chat",talk:!0}:t==="s"&&s?{view:"chat",sessionId:s,talk:o==="talk"}:{view:"chat",talk:!1}}const Lq=e=>(window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e));function Uq(){const e=y.useSyncExternalStore(Lq,()=>window.location.hash);return Pq(e)}const cn={newChat:"#/",session:e=>`#/s/${e}`,newTalk:"#/talk",talk:e=>`#/s/${e}/talk`,gallery:"#/gallery",models:"#/models",settings:"#/settings"};function lc(e){window.location.hash=e}function Gk(e){const{t}=Xe(),s=[{prompt:t("welcome.suggestion.fox"),label:t("welcome.suggestion.fox.short")},{prompt:t("welcome.suggestion.lighthouse"),label:t("welcome.suggestion.lighthouse.short")},{prompt:t("welcome.suggestion.ramen"),label:t("welcome.suggestion.ramen.short")},{prompt:t("welcome.suggestion.city"),label:t("welcome.suggestion.city.short")}],[o,a]=y.useState(()=>{var m;return((m=s[0])==null?void 0:m.prompt)??""}),c=o.trim()!==""&&!e.busy,u=()=>{c&&(Zk([e.modelId]),e.onSubmit({prompt:o.trim(),modelIds:[e.modelId],count:1}))};return d.jsxs("form",{className:"flex flex-col gap-3",onSubmit:m=>{m.preventDefault(),u()},children:[d.jsxs("div",{className:"flex flex-wrap gap-2 rounded-[22px] border border-[#2c2c32] bg-panel p-2 pl-4 focus-within:border-orange/50",children:[d.jsx(Cn,{value:o,onChange:m=>a(m.target.value),"aria-label":t("welcome.prompt"),placeholder:t("welcome.prompt"),className:"h-12 min-w-0 flex-[1_1_16rem] border-0 bg-transparent px-0 text-base focus-visible:ring-0 md:text-base dark:bg-transparent"}),d.jsx(Ue,{type:"submit",variant:"aurora",disabled:!c,className:"h-12 px-6 text-[15px] max-sm:w-full",children:e.busy?t("welcome.generating"):t("welcome.generate")})]}),d.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(m=>d.jsx(Ue,{type:"button",variant:"outline","aria-pressed":o===m.prompt,onClick:()=>a(m.prompt),className:"h-10 rounded-full px-4 text-soft aria-pressed:border-ink aria-pressed:text-ink dark:bg-panel",children:m.label},m.prompt))}),e.error&&d.jsx("p",{className:"text-sm text-danger",children:e.error})]})}function Bq(e){const{t}=Xe(),[s,o]=y.useState("image");return ji()?d.jsx(Hq,{...e}):d.jsxs("div",{className:"relative flex flex-col gap-10 py-6 md:py-12",children:[d.jsx("div",{className:"sky","aria-hidden":"true"}),d.jsxs("header",{className:"rise-in relative flex flex-col items-start gap-5",children:[d.jsx(Bh,{className:"h-14 md:h-16"}),d.jsxs("h1",{className:"max-w-[16ch] font-display text-[44px] leading-[0.95] font-extrabold tracking-[-0.03em] text-balance sm:text-7xl",children:[t("welcome.title")," ",d.jsx("span",{className:"text-soft",children:t("welcome.titleAccent")})]}),d.jsx("p",{className:"max-w-[58ch] text-[17px] leading-relaxed text-soft",children:t("welcome.lede")})]}),d.jsx("div",{className:"relative",children:d.jsx(qk,{media:s,setMedia:o,ready:a=>d.jsx(Gk,{modelId:a,busy:e.busy,error:e.error,onSubmit:e.onSubmit})})}),d.jsx(Ue,{variant:"link",onClick:e.onSkip,className:"rise-in relative h-10 self-start px-0 text-dim decoration-line-strong underline-offset-4 hover:text-ink",style:{"--i":8},children:t("welcome.skip")})]})}function Hq(e){var a;const{t}=Xe(),s=Wt({queryKey:["models"],queryFn:Qe.models}),o=(a=s.data)==null?void 0:a[0];return d.jsxs("div",{className:"relative flex flex-col gap-10 py-6 md:py-12",children:[d.jsx("div",{className:"sky","aria-hidden":"true"}),d.jsxs("header",{className:"rise-in relative flex flex-col items-start gap-5",children:[d.jsx(Bh,{className:"h-14 md:h-16"}),d.jsxs("h1",{className:"max-w-[16ch] font-display text-[44px] leading-[0.95] font-extrabold tracking-[-0.03em] text-balance sm:text-7xl",children:[t("demo.welcomeTitle")," ",d.jsx("span",{className:"text-soft",children:t("demo.welcomeTitleAccent")})]}),!s.isPending&&d.jsx("p",{className:"max-w-[58ch] text-[17px] leading-relaxed text-soft",children:o?t("demo.welcomeLede",{model:o.name}):t("demo.modelNotReady")})]}),o&&d.jsxs("div",{className:"rise-in relative flex flex-col gap-3 rounded-2xl border border-line-strong bg-panel/90 p-4",children:[d.jsx("p",{className:"font-display text-lg font-bold tracking-tight",children:t("picker.readyWith",{model:o.name})}),d.jsx(Gk,{modelId:o.id,busy:e.busy,error:e.error,onSubmit:e.onSubmit})]}),o&&d.jsx(Ue,{variant:"link",onClick:e.onSkip,className:"rise-in relative h-10 self-start px-0 text-dim decoration-line-strong underline-offset-4 hover:text-ink",children:t("welcome.skip")})]})}const Qk="hatchlight.welcomed";function Fq(){try{return Ny(localStorage,Qk)==="1"}catch{return!1}}function nC(){try{localStorage.setItem(Qk,"1")}catch{}}function Vq({since:e}){const t=Xe(),[s,o]=y.useState(Date.now);return y.useEffect(()=>{const a=setInterval(()=>o(Date.now()),100);return()=>clearInterval(a)},[]),d.jsx(d.Fragment,{children:ZO(t,s-e)})}function sb(e){return d.jsxs(Yj,{children:[d.jsx(Gj,{render:d.jsx(Ue,{variant:"ghost",size:"icon-sm","aria-label":e.label,disabled:e.disabled,onClick:e.onClick,className:"text-dim hover:text-ink max-md:size-10"}),children:e.icon}),d.jsx(Qj,{children:e.label})]})}function qq(e){const{job:t,model:s}=e,o=Xe(),{t:a}=o,c=aq(t.id),u=kt({mutationFn:()=>Qe.cancelJob(t.id)}),m=kt({mutationFn:()=>Qe.retryJob(t.id)}),g=(s==null?void 0:s.name)??t.modelId,v=t.status==="queued"||t.status==="running",b=y.useRef(v),p=y.useRef(!1);c!=null&&c.preview&&(p.current=!0);const[x,S]=(t.params.aspectRatio??((s==null?void 0:s.media)==="video"?"16:9":"1:1")).split(":").map(Number),w=(x||1)/(S||1),E=t.status==="running"?c==null?void 0:c.fraction:void 0,R=t.assets.length>1,C=t.status==="succeeded"&&t.startedAt&&t.finishedAt?[ZO(o,t.finishedAt-t.startedAt),t.costUsd!=null&&(t.costUsd===0?a("picker.free"):Du(o,t.costUsd))].filter(Boolean).join(" · "):null;return d.jsxs("article",{"aria-label":g,className:"rise-in flex min-w-0 flex-col gap-2",style:{"--i":e.index},children:[v&&d.jsxs(d.Fragment,{children:[d.jsx(oq,{ratio:w,fraction:E,preview:c!=null&&c.preview?y9(t.id,c.preview):void 0}),d.jsxs("div",{className:"flex flex-col gap-1.5 font-mono text-xs text-[#a1a1aa]",children:[d.jsxs("div",{className:"flex min-h-8 items-center gap-2.5",children:[d.jsx("i",{"aria-hidden":"true",className:De("breathe size-2 shrink-0 rounded-full",t.status==="queued"?"bg-dim":"bg-orange shadow-[0_0_12px_var(--orange)]")}),d.jsx("span",{className:"min-w-0 flex-1 truncate",children:g}),d.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>u.mutate(),disabled:u.isPending,className:"font-sans max-md:h-10",children:a("common.cancel")})]}),d.jsxs("div",{className:"flex items-center gap-2.5 text-dim",children:[d.jsx("span",{className:"min-w-0 flex-1 truncate","aria-live":"polite",children:t.status==="running"||(c==null?void 0:c.stage)==="queued"?Zq(o,c):a("job.waiting")}),t.status==="running"&&t.startedAt&&d.jsx("span",{className:"shrink-0 tabular-nums",children:d.jsx(Vq,{since:t.startedAt})})]}),d.jsx("div",{"aria-hidden":"true",className:"h-1 overflow-hidden rounded-full bg-line",children:t.status==="running"&&d.jsx("div",{className:De("flow h-full transition-[width] duration-500",E==null&&"w-full opacity-60"),style:E==null?void 0:{width:`${Math.round(E*100)}%`}})}),t.status==="running"&&(c==null?void 0:c.busyBytes)!=null&&d.jsx("p",{className:"text-dim",children:a("progress.lowMemory",{size:o.bytes(c.busyBytes)})})]})]}),(t.status==="failed"||t.status==="canceled")&&d.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-line bg-panel p-4",children:[t.status==="failed"?d.jsx("p",{className:"text-sm leading-relaxed text-danger",children:o.explain({message:t.error??"",code:t.errorCode,params:t.errorParams})}):d.jsx("p",{className:"text-sm text-dim",children:a("job.canceledEarly")}),m.error&&d.jsx("p",{className:"text-sm text-danger",children:o.explain(m.error)}),d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-dim",children:g}),d.jsx(Ue,{variant:"outline",size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,className:"max-md:h-10",children:a("job.retry")})]})]}),t.status==="succeeded"&&t.assets.length===0&&d.jsx("p",{className:"flex w-full items-center justify-center rounded-2xl border border-dashed border-line text-sm text-dim",style:{aspectRatio:w},children:a("job.deleted")}),t.assets.length>0&&d.jsx("div",{className:R?"grid grid-cols-2 gap-2.5":"contents",children:t.assets.map((j,O)=>{const k=()=>e.onOpen({assetId:j.id,mime:j.mime,prompt:e.prompt,modelName:g,params:t.params,costUsd:t.costUsd==null?null:t.costUsd/t.assets.length}),D=j.mime.startsWith("video/");return d.jsxs("figure",{className:"flex min-w-0 flex-col gap-1.5",children:[D?d.jsx("video",{src:ir(j.id),"aria-label":`${g}: ${e.prompt}`,controls:!0,loop:!0,playsInline:!0,preload:"metadata",className:"print-in w-full rounded-2xl bg-black"}):d.jsx("button",{type:"button","aria-label":a("job.openImage",{model:g}),onClick:k,className:"block w-full rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/60",children:d.jsx(iq,{src:ir(j.id),alt:`${g}: ${e.prompt}`,fresh:b.current,from:p.current?.85:0,ratio:w,className:"w-full rounded-2xl"})}),d.jsxs("figcaption",{className:"flex min-h-8 items-center gap-1 font-mono text-xs text-dim",children:[d.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d.jsx("span",{className:"truncate text-[#a1a1aa]",children:R?`${g} · ${o.number(O+1)}`:g}),C&&d.jsx("span",{className:"tabular-nums",children:C})]}),d.jsx("span",{className:"flex shrink-0",children:D?d.jsx(sb,{label:a("job.details"),icon:d.jsx(VN,{}),onClick:k}):d.jsxs(d.Fragment,{children:[d.jsx(sb,{label:a("common.useAsReference"),icon:d.jsx(x5,{}),onClick:()=>e.onUseAsReference(j.id)}),e.upscale&&(s==null?void 0:s.capabilities.upscale)==null&&d.jsx(sb,{label:a("job.upscale",{factor:o.number(e.upscale.factor)}),icon:d.jsx(S5,{}),disabled:e.upscale.busy,onClick:()=>{var P;return(P=e.upscale)==null?void 0:P.run(j.id)}})]})})]})]},j.id)})}),t.params.translatedPrompt&&d.jsxs(Zx,{className:"text-xs leading-relaxed text-dim",children:[d.jsx(Kx,{className:"min-h-8 rounded-sm outline-none hover:text-ink focus-visible:ring-3 focus-visible:ring-ring/50",children:a("job.details")}),d.jsx(Yx,{children:d.jsxs("p",{children:[a("job.translated")," ",d.jsx("span",{className:"text-ink",children:t.params.translatedPrompt})]})})]})]})}function $q(e){const{turn:t}=e,{t:s}=Xe();return d.jsxs("article",{className:"flex flex-col gap-3.5",children:[d.jsxs("header",{className:"rise-in flex flex-col gap-1 md:flex-row md:items-baseline md:gap-3",children:[d.jsx("span",{className:"shrink-0 font-mono text-[11px] tracking-[0.14em] text-dim uppercase",children:e.label}),d.jsx("p",{className:"whitespace-pre-wrap leading-snug text-[#e4e4e7]",children:t.prompt})]}),t.referenceAssetIds.length>0&&d.jsx("div",{className:"flex gap-2",children:t.referenceAssetIds.map(o=>d.jsx("img",{src:ir(o),alt:s("common.reference"),onError:a=>{a.currentTarget.style.visibility="hidden"},className:"size-12 shrink-0 rounded-[10px] border border-line object-cover"},o))}),d.jsx("div",{className:De("grid gap-3.5",t.jobs.length>1?"sm:grid-cols-2":"max-w-xl"),children:t.jobs.map((o,a)=>d.jsx(qq,{index:a,job:o,prompt:t.prompt,model:e.models.get(o.modelId),onOpen:e.onOpen,onUseAsReference:e.onUseAsReference,upscale:e.upscale},o.id))})]})}function Zq(e,t){if(!t)return e.t("job.starting");const s=t.fraction==null?null:e.number(t.fraction,{style:"percent"});return t.stage==="generating"&&t.step&&t.steps?e.t("progress.step",{step:t.step,steps:t.steps}):[t.stage==="queued"?t.position!=null?e.t("progress.queuedAt",{position:t.position}):e.t("progress.queued"):t.stage==="retrying"?e.t("progress.retrying"):t.stage==="translating"?e.t("progress.translating"):t.stage==="waitingGpu"?e.t("progress.waitingGpu"):t.stage==="starting"?e.t("progress.starting"):t.stage==="loading"||t.stage==="lowMemory"?e.t("progress.loading"):t.stage==="generating"?e.t("progress.generating"):t.message,s].filter(Boolean).join(" · ")||e.t("job.starting")}function Kq({sessionId:e,references:t,setReferences:s,addReference:o}){var K,B,A,U,J;const a=Xe(),{t:c}=a,u=On(),m=Wt({queryKey:["models"],queryFn:Qe.models}),g=Wt({queryKey:["providers"],queryFn:Qe.providers}),v=Wt({queryKey:["session",e],queryFn:()=>Qe.session(e),enabled:e!=null}),b=Wt({queryKey:["sessions"],queryFn:Qe.sessions}),[p,x]=y.useState(Fq),S=!e&&!p&&((K=b.data)==null?void 0:K.length)===0,w=!e&&!p&&b.isPending,[E,R]=y.useState(null),[C,j]=y.useState(null),[O,k]=y.useState(!1),D=kt({mutationFn:F=>Qe.createTurn({...F,sessionId:e,referenceAssetIds:F.referenceAssetIds??t}),onSuccess:({session:F,turn:oe},N)=>{nC(),N.referenceAssetIds||s(z=>z.filter(Z=>!oe.referenceAssetIds.includes(Z))),u.setQueryData(["session",F.id],z=>z!=null&&z.turns.some(Z=>Z.id===oe.id)?z:{...z??F,turns:[...(z==null?void 0:z.turns)??[],oe]}),u.invalidateQueries({queryKey:["session",F.id]}),u.invalidateQueries({queryKey:["sessions"]}),!e&&["","#",cn.newChat].includes(window.location.hash)&&lc(cn.session(F.id))}}),P=new Map((B=m.data)==null?void 0:B.map(F=>[F.id,F])),L=(A=m.data)==null?void 0:A.find(F=>F.capabilities.upscale!=null),_=L==null?void 0:L.capabilities.upscale,V=L&&_!=null?{factor:_,busy:D.isPending,run:F=>D.mutate({prompt:c("job.upscale",{factor:a.number(_)}),modelIds:[L.id],count:1,referenceAssetIds:[F]})}:void 0,I=v.error??m.error??g.error,X=ji()!==null,Y=Wt({queryKey:["assistant",e],queryFn:()=>Qe.assistantView(e),enabled:e!=null&&!X}),q=new Set((U=Y.data)==null?void 0:U.entries.flatMap(F=>F.turnId?[F.turnId]:[])),$=((J=v.data)==null?void 0:J.turns)??[],G=$.toReversed().flatMap(F=>F.jobs.flatMap(oe=>oe.assets.map(N=>Yq(F,oe,N,P.get(oe.modelId)))))[0],H=C??G??null;return d.jsxs(d.Fragment,{children:[S?d.jsx("div",{className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto",children:d.jsx("div",{className:"mx-auto max-w-5xl px-4 py-6 md:px-8",children:d.jsx(Bq,{busy:D.isPending,error:D.error?a.explain(D.error):null,onSubmit:F=>D.mutate(F),onSkip:()=>{nC(),x(!0)}})})}):!w&&d.jsx("div",{className:"grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)] lg:grid-cols-[300px_minmax(0,1fr)_320px]",children:d.jsx(zq,{models:m.data??[],providers:g.data??[],references:t,setReferences:s,busy:D.isPending,error:D.error?a.explain(D.error):null,onSubmit:F=>D.mutateAsync(F),inspector:{content:d.jsx(Iq,{item:H,onOpen:F=>{k(!1),R(F)},onUseAsReference:F=>{k(!1),o(F)},upscale:V,talkHref:e&&!X?cn.talk(e):void 0,onDeleted:()=>{k(!1),j(null)}}),thumb:(H==null?void 0:H.mime.startsWith("image/"))===!0?ir(H.assetId):void 0,open:O,onOpenChange:k},children:d.jsxs("div",{className:"flex flex-col gap-8 px-4 py-5 md:px-7 md:py-6",children:[I&&d.jsx("p",{className:"text-sm text-danger",children:a.explain(I)}),!e&&b.data&&d.jsxs("div",{className:"rise-in py-6 md:py-10",children:[d.jsx("p",{className:"font-mono text-[11px] tracking-[0.18em] text-dim uppercase",children:c("chat.eyebrow")}),d.jsx("h1",{className:"mt-3 font-display text-[40px] leading-[0.95] font-extrabold tracking-[-0.03em] text-balance md:text-5xl",children:c("chat.heading")}),d.jsx("p",{className:"mt-4 max-w-xl leading-relaxed text-soft",children:c("chat.intro")})]}),$.map((F,oe)=>{var N;return d.jsx($q,{turn:F,label:[c("chat.turn",{number:oe+1}),q.has(F.id)&&c("chat.askedInChat"),(N=F.jobs[0])==null?void 0:N.params.aspectRatio].filter(Boolean).join(" · "),models:P,onOpen:z=>{j(z),k(!window.matchMedia("(min-width: 1024px)").matches)},onUseAsReference:o,upscale:V},F.id)}).toReversed()]})})}),E&&d.jsx(Dq,{item:E,onClose:()=>R(null),onUseAsReference:F=>{o(F),R(null)}})]})}function Yq(e,t,s,o){return{assetId:s.id,mime:s.mime,prompt:e.prompt,modelName:(o==null?void 0:o.name)??t.modelId,params:t.params,costUsd:t.costUsd==null?null:t.costUsd/t.assets.length}}const rC="keys-lost";function Gq(){var a;const{t:e}=Xe(),t=On(),s=Wt({queryKey:["keys-lost"],queryFn:Qe.keysLost}),{mutate:o}=kt({mutationFn:Qe.dismissKeysLost,onSuccess:()=>t.invalidateQueries({queryKey:["keys-lost"]})});return y.useEffect(()=>{var c;if(!((c=s.data)!=null&&c.lost)){Au.dismiss(rC);return}Au.warning(e("keys.lost"),{id:rC,duration:Number.POSITIVE_INFINITY,action:{label:e("keys.lostOpen"),onClick:()=>{o(),lc(cn.settings)}},cancel:{label:e("update.later"),onClick:()=>o()}})},[(a=s.data)==null?void 0:a.lost,e,o]),null}const e0=()=>window.__TAURI__;async function Qq(){var e;return await((e=e0())==null?void 0:e.core.invoke("update_status"))??null}function Xq(e){var s;const t=(s=e0())==null?void 0:s.event.listen("update-ready",o=>e(o.payload));return()=>void(t==null?void 0:t.then(o=>o()))}async function Jq(){var e;await((e=e0())==null?void 0:e.core.invoke("install_update"))}const ob="update";function Wq(){const{t:e}=Xe(),[t,s]=y.useState(null),o=y.useRef(!1),{mutate:a}=kt({mutationFn:Jq,onError:()=>Au.error(e("update.failed"),{id:ob,duration:1e4})});return y.useEffect(()=>{const c=Xq(s);return Qq().then(u=>u&&s(u)).catch(()=>{}),c},[]),y.useEffect(()=>{!t||o.current||Au(e("update.ready",{version:t}),{id:ob,description:e("update.body"),duration:Number.POSITIVE_INFINITY,action:{label:e("update.restart"),onClick:c=>{c.preventDefault(),o.current=!0,Au.loading(e("update.installing"),{id:ob}),a()}},cancel:{label:e("update.later"),onClick:()=>{o.current=!0}},onDismiss:()=>{o.current=!0}})},[t,e,a]),null}const e$=y.lazy(()=>Xh(()=>import("./Assistant-pvqlzfRM.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Assistant}))),t$=y.lazy(()=>Xh(()=>import("./Gallery-BmgPWzZ8.js"),__vite__mapDeps([3,1,2])).then(e=>({default:e.Gallery}))),n$=y.lazy(()=>Xh(()=>import("./Models-DwIqpODX.js"),__vite__mapDeps([4,1,2])).then(e=>({default:e.Models}))),r$=y.lazy(()=>Xh(()=>import("./Settings-BV8oksGm.js"),__vite__mapDeps([5,4,1,2])).then(e=>({default:e.Settings})));function s$(){try{return localStorage.getItem("hatchlight.sidebar")!=="false"}catch{return!0}}function o$(){hq();const e=Uq(),t=ji()!==null,s=t?e.view==="chat"?{...e,talk:!1}:e.view==="gallery"?e:{view:"chat",talk:!1}:e,[o,a]=y.useState([]),c=m=>{a(g=>g.includes(m)?g:[...g,m].slice(-4)),s.view!=="chat"?lc(cn.newChat):s.talk&&lc(s.sessionId?cn.session(s.sessionId):cn.newChat)},u=s.view==="chat"?`chat/${s.sessionId??""}/${s.talk?"talk":""}`:s.view;return d.jsxs(EV,{defaultOpen:s$(),className:"relative h-full min-h-0",children:[d.jsx(Wq,{}),!t&&d.jsx(Gq,{}),d.jsx(i$,{route:s,demo:t}),d.jsxs(CV,{className:"min-h-0 overflow-hidden bg-bg",children:[s.view==="chat"?d.jsx(a$,{route:s,demo:t}):d.jsx(l$,{}),d.jsx("div",{className:"scene-in flex min-h-0 flex-1 flex-col max-md:pb-[4.25rem]",children:d.jsxs(y.Suspense,{fallback:null,children:[s.view==="chat"&&s.talk&&d.jsx(e$,{sessionId:s.sessionId,addReference:c},s.sessionId??"new"),s.view==="chat"&&!s.talk&&d.jsx(Kq,{sessionId:s.sessionId,references:o,setReferences:a,addReference:c},s.sessionId??"new"),s.view==="gallery"&&d.jsx(t$,{addReference:c}),s.view==="models"&&d.jsx(n$,{}),s.view==="settings"&&d.jsx(r$,{})]})},u),d.jsx(c$,{route:s,demo:t})]})]})}function i$({route:e,demo:t}){var S,w;const{t:s}=Xe(),o=On(),{isMobile:a,setOpenMobile:c}=vd(),u=Wt({queryKey:["sessions"],queryFn:Qe.sessions}),[m,g]=y.useState(),v=e.view==="chat"?e.sessionId:void 0,b=()=>{a&&c(!1)},p=kt({mutationFn:Qe.deleteSession,onSuccess:(E,R)=>(e.view==="chat"&&e.sessionId===R&&lc(cn.newChat),o.invalidateQueries({queryKey:["sessions"]}))}),x=[{to:cn.gallery,label:s("nav.gallery"),icon:HN,current:e.view==="gallery"},{to:cn.models,label:s("nav.localModels"),icon:DN,current:e.view==="models"}].filter(E=>!t||E.to!==cn.models);return d.jsxs(d.Fragment,{children:[d.jsxs(TV,{collapsible:"icon",role:"navigation","aria-label":s("ui.menu"),className:"absolute h-full border-sidebar-border",children:[d.jsxs(NV,{className:"gap-4 p-4 group-data-[collapsible=icon]:px-2",children:[d.jsxs("a",{href:cn.newChat,onClick:b,className:"flex items-center rounded-lg px-1 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",children:[d.jsx(bx,{crack:"var(--rail)",className:"group-data-[collapsible=icon]:hidden"}),d.jsx(Bh,{crack:"var(--rail)",label:"Hatchlight",className:"hidden group-data-[collapsible=icon]:block"})]}),d.jsxs(rb,{children:[d.jsx(ym,{className:"mb-2",children:d.jsxs(xm,{tooltip:s("nav.newSession"),onClick:b,render:d.jsx("a",{href:cn.newChat}),className:"cta h-11 justify-center rounded-xl font-semibold text-on-aurora hover:text-on-aurora active:text-on-aurora data-active:text-on-aurora group-data-[collapsible=icon]:size-10!",children:[d.jsx(zb,{className:"size-[18px]!",strokeWidth:2.4}),d.jsx("span",{children:s("nav.newSession")})]})}),x.map(E=>d.jsx(ym,{children:d.jsxs(xm,{tooltip:E.label,isActive:E.current,onClick:b,render:d.jsx("a",{href:E.to}),className:"h-10 rounded-lg",children:[d.jsx(E.icon,{}),d.jsx("span",{children:E.label})]})},E.to))]})]}),d.jsx(OV,{children:d.jsxs(kV,{className:"px-4 group-data-[collapsible=icon]:px-2",children:[d.jsx(_V,{className:"font-mono text-[11px] tracking-[0.14em] text-dim uppercase",children:s("nav.sessions")}),d.jsx(AV,{children:d.jsxs(rb,{children:[(S=u.data)==null?void 0:S.map(E=>d.jsxs(ym,{children:[d.jsx(xm,{isActive:E.id===v,onClick:b,render:d.jsx("a",{href:e.view==="chat"&&e.talk?cn.talk(E.id):cn.session(E.id),title:E.title,"aria-current":E.id===v?"page":void 0}),className:"h-10 rounded-lg data-active:shadow-[inset_0_0_0_1px_#2c2c32]",children:d.jsx("span",{className:"truncate",children:E.title})}),d.jsxs(uV,{children:[d.jsx(dV,{render:d.jsx(zV,{showOnHover:!0,className:"top-2","aria-label":s("nav.sessionActions",{title:E.title})}),children:d.jsx(b5,{})}),d.jsx(fV,{side:"right",align:"start",children:d.jsxs(mV,{variant:"destructive",onClick:()=>g({id:E.id,title:E.title}),children:[d.jsx(a2,{}),s("nav.delete")]})})]})]},E.id)),((w=u.data)==null?void 0:w.length)===0&&d.jsx("li",{className:"px-2 py-2 text-sm text-dim group-data-[collapsible=icon]:hidden",children:s("nav.noSessions")})]})})]})}),d.jsxs(jV,{className:"p-4 group-data-[collapsible=icon]:px-2",children:[!t&&d.jsx(rb,{children:d.jsx(ym,{children:d.jsxs(xm,{tooltip:s("nav.settings"),isActive:e.view==="settings",onClick:b,render:d.jsx("a",{href:cn.settings}),className:"h-10 rounded-lg",children:[d.jsx(n2,{}),d.jsx("span",{children:s("nav.settings")})]})})}),d.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:d.jsx(pF,{className:"shrink-0 rounded-md px-2 py-1 text-xs text-dim hover:text-ink"})})]}),d.jsx(RV,{})]}),d.jsx(Mx,{open:m!==void 0,onOpenChange:E=>{E||g(void 0)},children:d.jsxs(zx,{children:[d.jsxs(Dx,{children:[d.jsx(Px,{children:s("nav.deleteSession",{title:(m==null?void 0:m.title)??""})}),d.jsx(FO,{children:s("nav.deleteSessionConfirm")})]}),d.jsxs(Ix,{children:[d.jsx(Ux,{children:s("nav.cancel")}),d.jsx(Lx,{variant:"destructive",onClick:()=>{m&&p.mutate(m.id),g(void 0)},children:s("nav.delete")})]})]})})]})}function a$({route:e,demo:t}){var u,m;const{t:s}=Xe(),a=(m=(u=Wt({queryKey:["sessions"],queryFn:Qe.sessions}).data)==null?void 0:u.find(g=>g.id===e.sessionId))==null?void 0:m.title,c=g=>lc(e.sessionId?g?cn.talk(e.sessionId):cn.session(e.sessionId):g?cn.newTalk:cn.newChat);return d.jsxs("header",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-3 border-b border-[#1a1a1e] px-4 py-3 md:h-[4.75rem] md:flex-nowrap md:px-8 md:py-0",children:[d.jsx(mk,{className:"size-11 rounded-xl border border-line bg-panel md:size-9 md:border-0 md:bg-transparent"}),d.jsx("h1",{className:"min-w-0 flex-1 truncate font-display text-[22px] font-bold tracking-[-0.02em] md:text-[26px]",children:a??s("nav.newSession")}),!t&&d.jsx(bk,{value:e.talk?"talk":"advanced",onValueChange:g=>c(g==="talk"),className:"max-md:w-full",children:d.jsxs(yk,{"aria-label":s("session.mode"),className:"max-md:w-full",children:[d.jsx(ch,{value:"talk",children:s("session.chat")}),d.jsx(ch,{value:"advanced",children:s("session.advanced")})]})})]})}function l$(){return d.jsxs("div",{className:"flex items-center gap-3 border-b border-[#1a1a1e] px-4 py-3 md:hidden",children:[d.jsx(mk,{className:"size-11 rounded-xl border border-line bg-panel"}),d.jsx(bx,{})]})}function c$({route:e,demo:t}){const{t:s}=Xe(),o=[{to:cn.newChat,label:s("nav.session"),icon:E5,current:e.view==="chat"},{to:cn.gallery,label:s("nav.gallery"),icon:HN,current:e.view==="gallery"},{to:cn.models,label:s("nav.models"),icon:DN,current:e.view==="models"},{to:cn.settings,label:s("nav.settings"),icon:n2,current:e.view==="settings"}].filter(a=>!t||a.to!==cn.models&&a.to!==cn.settings);return d.jsx("nav",{"aria-label":s("nav.main"),className:De("fixed inset-x-0 bottom-0 z-30 grid h-[4.25rem] border-t border-sidebar-border bg-rail/95 pb-[env(safe-area-inset-bottom)] backdrop-blur md:hidden",t?"grid-cols-2":"grid-cols-4"),children:o.map(a=>d.jsxs("a",{href:a.to,"aria-current":a.current?"page":void 0,className:De("flex flex-col items-center justify-center gap-1 text-[11px]",a.current?"text-ink":"text-dim"),children:[d.jsx(a.icon,{className:"size-[22px]",strokeWidth:1.8}),a.label,d.jsx("span",{"aria-hidden":"true",className:De("h-[3px] w-[18px] rounded-full",a.current&&"aurora")})]},a.to))})}const u$=new U3({defaultOptions:{queries:{staleTime:3e4,retry:1}}});n5.createRoot(document.getElementById("root")).render(d.jsx(y.StrictMode,{children:d.jsx(f6,{children:d.jsx(m3,{client:u$,children:d.jsxs(kB,{children:[d.jsx(aF,{children:d.jsx(o$,{})}),d.jsx(m6,{position:"bottom-right",mobileOffset:{bottom:"5rem"}})]})})})}));export{So as $,Qn as A,Ue as B,gh as C,hc as D,Wj as E,ss as F,zO as G,Ut as H,Cn as I,qq as J,Gb as K,Dq as L,Bh as M,vn as N,vt as O,b7 as P,ck as Q,Vy as R,_5 as S,wa as T,Pl as U,qx as V,dt as W,lr as X,od as Y,Ro as Z,md as _,De as a,Ie as a0,fd as a1,pc as a2,vk as a3,$H as a4,ot as a5,qs as a6,gd as a7,b$ as a8,ld as a9,bq as aA,S$ as aB,gq as aC,Na as aD,wi as aE,Mk as aF,kN as aG,w$ as aH,ac as aI,Zx as aJ,Kx as aK,Yx as aL,x9 as aM,yo as aN,k5 as aO,h$ as aP,KO as aQ,yd as aR,xd as aS,wd as aT,Dk as aU,pd as aa,cd as ab,Or as ac,tO as ad,nF as ae,$h as af,Kh as ag,Zh as ah,Yh as ai,Vu as aj,rF as ak,Eo as al,p$ as am,xx as an,Qh as ao,g$ as ap,v$ as aq,CR as ar,lq as as,Bx as at,qu as au,QR as av,Y7 as aw,x$ as ax,y$ as ay,E$ as az,On as b,Yt as c,Wt as d,kt as e,y7 as f,gC as g,cn as h,x7 as i,d as j,Du as k,Qe as l,Q3 as m,lc as n,ir as o,mn as p,ud as q,y as r,No as s,Ti as t,Xe as u,YB as v,mc as w,dd as x,Vr as y,Me as z};
|