@bymos/agentkit-sdk 0.1.5 → 0.2.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/README.md +2 -2
- package/agentkit-widget.iife.js +105 -42
- package/agentkit-widget.js +4593 -4222
- package/index.cjs +105 -42
- package/index.js +4230 -3901
- package/package.json +2 -2
package/agentkit-widget.iife.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T,pe)=>T in re?Zo(re,T,{enumerable:!0,configurable:!0,writable:!0,value:pe}):re[T]=pe;var me=(re,T,pe)=>Vo(re,typeof T!="symbol"?T+"":T,pe);var T;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return t.objectValues(s)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},t.find=(a,i)=>{for(const s of a)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(T||(T={}));var pe;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(pe||(pe={}));const k=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),de=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},p=T.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ae extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return a(this),r}static assert(e){if(!(e instanceof ae))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ae.create=t=>new ae(t);const ut=(t,e)=>{let n;switch(t.code){case p.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case p.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,T.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:n=`Unrecognized key(s) in object: ${T.joinValues(t.keys,", ")}`;break;case p.invalid_union:n="Invalid input";break;case p.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${T.joinValues(t.options)}`;break;case p.invalid_enum_value:n=`Invalid enum value. Expected ${T.joinValues(t.options)}, received '${t.received}'`;break;case p.invalid_arguments:n="Invalid function arguments";break;case p.invalid_return_type:n="Invalid function return type";break;case p.invalid_date:n="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:T.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case p.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case p.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case p.custom:n="Invalid input";break;case p.invalid_intersection_types:n="Intersection results could not be merged";break;case p.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case p.not_finite:n="Number must be finite";break;default:n=e.defaultError,T.assertNever(t)}return{message:n}};let Mr=ut;function jr(){return Mr}const Or=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...a,path:i,message:o}};function g(t,e){const n=jr(),r=Or({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ut?void 0:ut].filter(a=>!!a)});t.common.issues.push(r)}class F{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return S;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,s=await a.value;r.push({key:i,value:s})}return F.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return S;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const S=Object.freeze({status:"aborted"}),Te=t=>({status:"dirty",value:t}),B=t=>({status:"valid",value:t}),zt=t=>t.status==="aborted",Dt=t=>t.status==="dirty",ye=t=>t.status==="valid",Ue=t=>typeof Promise<"u"&&t instanceof Promise;var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));class q{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bt=(t,e)=>{if(ye(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ae(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:a}}class A{get description(){return this._def.description}_getType(e){return de(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ue(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Bt(r,a)}"~validate"(e){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ye(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ye(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(Ue(a)?a:Promise.resolve(a));return Bt(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const s=e(a),o=()=>i.addIssue({code:p.custom,...r(a)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new xe({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return fe.create(this,this._def)}nullable(){return we.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this)}promise(){return He.create(this,this._def)}or(e){return De.create([this,e],this._def)}and(e){return Be.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new gt({...L(this._def),innerType:this,defaultValue:n,typeName:w.ZodDefault})}brand(){return new aa({typeName:w.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new _t({...L(this._def),innerType:this,catchValue:n,typeName:w.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vt.create(this,e)}readonly(){return yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pr=/^c[^\s-]{8,}$/i,Zr=/^[0-9a-z]+$/,Vr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Wr=/^[a-z0-9_-]{21}$/i,$r=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ur=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ft;const Br=/^(?:(?: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])$/,Gr=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Hr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gt="((\\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])))",Kr=new RegExp(`^${Gt}$`);function Ht(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Qr(t){return new RegExp(`^${Ht(t)}$`)}function qr(t){let e=`${Gt}T${Ht(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function ea(t,e){return!!((e==="v4"||!e)&&Br.test(t)||(e==="v6"||!e)&&Hr.test(t))}function ta(t,e){if(!$r.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function na(t,e){return!!((e==="v4"||!e)&&Gr.test(t)||(e==="v6"||!e)&&Yr.test(t))}class ie extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.string,received:i.parsedType}),S}const r=new F;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?g(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&g(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")zr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"email",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")ft||(ft=new RegExp(Dr,"u")),ft.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"emoji",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Fr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"uuid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Wr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"nanoid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Zr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid2",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Vr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ulid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),g(a,{validation:"url",code:p.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"regex",code:p.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?qr(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Kr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Qr(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ur.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"duration",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?ea(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ip",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?ta(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"jwt",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?na(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cidr",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Xr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Jr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64url",code:p.invalid_string,message:i.message}),r.dirty()):T.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:p.invalid_string,...b.errToObj(r)})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...b.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...b.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...b.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...b.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...b.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...b.errToObj(n)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new ie({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ie.create=t=>new ie({checks:[],typeName:w.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function ra(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(t.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}class Le extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==k.number){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.number,received:i.parsedType}),S}let r;const a=new F;for(const i of this._def.checks)i.kind==="int"?T.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:p.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?ra(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_finite,message:i.message}),a.dirty()):T.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,a){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(a)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&T.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Le.create=t=>new Le({checks:[],typeName:w.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ae extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let r;const a=new F;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):T.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:k.bigint,received:n.parsedType}),S}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,a){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(a)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ae.create=t=>new Ae({checks:[],typeName:w.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class ht extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.boolean,received:r.parsedType}),S}return B(e.data)}}ht.create=t=>new ht({typeName:w.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class ze extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.date,received:i.parsedType}),S}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_date}),S}const r=new F;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):T.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}ze.create=t=>new ze({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:w.ZodDate,...L(t)});class Yt extends A{_parse(e){if(this._getType(e)!==k.symbol){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.symbol,received:r.parsedType}),S}return B(e.data)}}Yt.create=t=>new Yt({typeName:w.ZodSymbol,...L(t)});class Xt extends A{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.undefined,received:r.parsedType}),S}return B(e.data)}}Xt.create=t=>new Xt({typeName:w.ZodUndefined,...L(t)});class Jt extends A{_parse(e){if(this._getType(e)!==k.null){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.null,received:r.parsedType}),S}return B(e.data)}}Jt.create=t=>new Jt({typeName:w.ZodNull,...L(t)});class Kt extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}}Kt.create=t=>new Kt({typeName:w.ZodAny,...L(t)});class mt extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}}mt.create=t=>new mt({typeName:w.ZodUnknown,...L(t)});class ue extends A{_parse(e){const n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:k.never,received:n.parsedType}),S}}ue.create=t=>new ue({typeName:w.ZodNever,...L(t)});class Qt extends A{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.void,received:r.parsedType}),S}return B(e.data)}}Qt.create=t=>new Qt({typeName:w.ZodVoid,...L(t)});class ee extends A{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==k.array)return g(n,{code:p.invalid_type,expected:k.array,received:n.parsedType}),S;if(a.exactLength!==null){const s=n.data.length>a.exactLength.value,o=n.data.length<a.exactLength.value;(s||o)&&(g(n,{code:s?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(g(n,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(g(n,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>a.type._parseAsync(new q(n,s,n.path,o)))).then(s=>F.mergeArray(r,s));const i=[...n.data].map((s,o)=>a.type._parseSync(new q(n,s,n.path,o)));return F.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new ee({...this._def,minLength:{value:e,message:b.toString(n)}})}max(e,n){return new ee({...this._def,maxLength:{value:e,message:b.toString(n)}})}length(e,n){return new ee({...this._def,exactLength:{value:e,message:b.toString(n)}})}nonempty(e){return this.min(1,e)}}ee.create=(t,e)=>new ee({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...L(e)});function ke(t){if(t instanceof O){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=fe.create(ke(r))}return new O({...t._def,shape:()=>e})}else return t instanceof ee?new ee({...t._def,type:ke(t.element)}):t instanceof fe?fe.create(ke(t.unwrap())):t instanceof we?we.create(ke(t.unwrap())):t instanceof ge?ge.create(t.items.map(e=>ke(e))):t}class O extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=T.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const c=this._getOrReturnCtx(e);return g(c,{code:p.invalid_type,expected:k.object,received:c.parsedType}),S}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys==="strip"))for(const c in a.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=i[c],d=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new q(a,d,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof ue){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(c==="strict")o.length>0&&(g(a,{code:p.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new q(a,d,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,m=await u.value;c.push({key:d,value:m,alwaysSet:u.alwaysSet})}return c}).then(c=>F.mergeObjectSync(r,c)):F.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const a=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:b.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const n={};for(const r of T.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new O({...this._def,shape:()=>n})}omit(e){const n={};for(const r of T.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new O({...this._def,shape:()=>n})}deepPartial(){return ke(this)}partial(e){const n={};for(const r of T.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}return new O({...this._def,shape:()=>n})}required(e){const n={};for(const r of T.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof fe;)i=i._def.innerType;n[r]=i}return new O({...this._def,shape:()=>n})}keyof(){return nn(T.objectKeys(this.shape))}}O.create=(t,e)=>new O({shape:()=>t,unknownKeys:"strip",catchall:ue.create(),typeName:w.ZodObject,...L(e)}),O.strictCreate=(t,e)=>new O({shape:()=>t,unknownKeys:"strict",catchall:ue.create(),typeName:w.ZodObject,...L(e)}),O.lazycreate=(t,e)=>new O({shape:t,unknownKeys:"strip",catchall:ue.create(),typeName:w.ZodObject,...L(e)});class De extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new ae(o.ctx.common.issues));return g(n,{code:p.invalid_union,unionErrors:s}),S}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(a);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(l=>new ae(l));return g(n,{code:p.invalid_union,unionErrors:o}),S}}get options(){return this._def.options}}De.create=(t,e)=>new De({options:t,typeName:w.ZodUnion,...L(e)});function pt(t,e){const n=de(t),r=de(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&r===k.object){const a=T.objectKeys(e),i=T.objectKeys(t).filter(o=>a.indexOf(o)!==-1),s={...t,...e};for(const o of i){const l=pt(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===k.array&&r===k.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const s=t[i],o=e[i],l=pt(s,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===k.date&&r===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Be extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,s)=>{if(zt(i)||zt(s))return S;const o=pt(i.value,s.value);return o.valid?((Dt(i)||Dt(s))&&n.dirty(),{status:n.value,value:o.data}):(g(r,{code:p.invalid_intersection_types}),S)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Be.create=(t,e,n)=>new Be({left:t,right:e,typeName:w.ZodIntersection,...L(n)});class ge extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.array)return g(r,{code:p.invalid_type,expected:k.array,received:r.parsedType}),S;if(r.data.length<this._def.items.length)return g(r,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&r.data.length>this._def.items.length&&(g(r,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new q(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>F.mergeArray(n,s)):F.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:t,typeName:w.ZodTuple,rest:null,...L(e)})};class Ge extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return g(r,{code:p.invalid_type,expected:k.object,received:r.parsedType}),S;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in r.data)a.push({key:i._parse(new q(r,o,r.path,o)),value:s._parse(new q(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?F.mergeObjectAsync(n,a):F.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof A?new Ge({keyType:e,valueType:n,typeName:w.ZodRecord,...L(r)}):new Ge({keyType:ie.create(),valueType:e,typeName:w.ZodRecord,...L(n)})}}class qt extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.map)return g(r,{code:p.invalid_type,expected:k.map,received:r.parsedType}),S;const a=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:a._parse(new q(r,o,r.path,[c,"key"])),value:i._parse(new q(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}qt.create=(t,e,n)=>new qt({valueType:e,keyType:t,typeName:w.ZodMap,...L(n)});class Re extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.set)return g(r,{code:p.invalid_type,expected:k.set,received:r.parsedType}),S;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(g(r,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(g(r,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return S;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>i._parse(new q(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new Re({...this._def,minSize:{value:e,message:b.toString(n)}})}max(e,n){return new Re({...this._def,maxSize:{value:e,message:b.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Re.create=(t,e)=>new Re({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...L(e)});class en extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}en.create=(t,e)=>new en({getter:t,typeName:w.ZodLazy,...L(e)});class tn extends A{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return g(n,{received:n.data,code:p.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}tn.create=(t,e)=>new tn({value:t,typeName:w.ZodLiteral,...L(e)});function nn(t,e){return new be({values:t,typeName:w.ZodEnum,...L(e)})}class be extends A{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{expected:T.joinValues(r),received:n.parsedType,code:p.invalid_type}),S}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{received:n.data,code:p.invalid_enum_value,options:r}),S}return B(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return be.create(e,{...this._def,...n})}exclude(e,n=this._def){return be.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}be.create=nn;class rn extends A{_parse(e){const n=T.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==k.string&&r.parsedType!==k.number){const a=T.objectValues(n);return g(r,{expected:T.joinValues(a),received:r.parsedType,code:p.invalid_type}),S}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=T.objectValues(n);return g(r,{received:r.data,code:p.invalid_enum_value,options:a}),S}return B(e.data)}get enum(){return this._def.values}}rn.create=(t,e)=>new rn({values:t,typeName:w.ZodNativeEnum,...L(e)});class He extends A{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return g(n,{code:p.invalid_type,expected:k.promise,received:n.parsedType}),S;const r=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return B(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}He.create=(t,e)=>new He({type:t,typeName:w.ZodPromise,...L(e)});class xe extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{g(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const s=a.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return S;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?S:l.status==="dirty"||n.value==="dirty"?Te(l.value):l});{if(n.value==="aborted")return S;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?S:o.status==="dirty"||n.value==="dirty"?Te(o.value):o}}if(a.type==="refinement"){const s=o=>{const l=a.refinement(o,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?S:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?S:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ye(s))return S;const o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ye(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:n.value,value:o})):S);T.assertNever(a)}}xe.create=(t,e,n)=>new xe({schema:t,typeName:w.ZodEffects,effect:e,...L(n)}),xe.createWithPreprocess=(t,e,n)=>new xe({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...L(n)});class fe extends A{_parse(e){return this._getType(e)===k.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(t,e)=>new fe({innerType:t,typeName:w.ZodOptional,...L(e)});class we extends A{_parse(e){return this._getType(e)===k.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}we.create=(t,e)=>new we({innerType:t,typeName:w.ZodNullable,...L(e)});class gt extends A{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===k.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}gt.create=(t,e)=>new gt({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class _t extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ue(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_t.create=(t,e)=>new _t({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class an extends A{_parse(e){if(this._getType(e)!==k.nan){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.nan,received:r.parsedType}),S}return{status:"valid",value:e.data}}}an.create=t=>new an({typeName:w.ZodNaN,...L(t)});class aa extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vt extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?S:i.status==="dirty"?(n.dirty(),Te(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?S:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new vt({in:e,out:n,typeName:w.ZodPipeline})}}class yt extends A{_parse(e){const n=this._def.innerType._parse(e),r=a=>(ye(a)&&(a.value=Object.freeze(a.value)),a);return Ue(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}yt.create=(t,e)=>new yt({innerType:t,typeName:w.ZodReadonly,...L(e)});var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const V=ie.create,ia=ht.create,sa=mt.create;ue.create,ee.create;const sn=O.create;De.create,Be.create,ge.create;const oa=Ge.create,on=be.create;He.create,fe.create,we.create;const ca=sn({mode:on(["light","dark","system"]).optional(),accentColor:V().optional(),fontFamily:V().optional(),borderRadius:V().optional()}),cn=sn({agentId:V().min(1,"agentId is required"),apiBaseUrl:V().url("apiBaseUrl must be a valid URL"),tenantId:V().optional(),userId:V().optional(),name:V().optional(),email:V().optional(),authUserId:V().optional(),sessionId:V().optional(),mode:on(["floating","inline"]).optional(),title:V().optional(),subtitle:V().optional(),greeting:V().optional(),avatarUrl:V().optional(),privacyPolicyUrl:V().optional(),streaming:ia().optional(),metadata:oa(sa()).optional(),theme:ca.optional()}),la=cn.omit({agentId:!0,apiBaseUrl:!0}).partial(),_e={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Ee(t,e){var o,l,c,u;cn.parse(t);let n;const r=e?{...e}:void 0;r&&typeof r.theme=="object"&&r.theme!==null?(n=r.theme,delete r.theme):r&&typeof r.theme=="string"&&(n={mode:r.theme},delete r.theme);const a=r?la.passthrough().safeParse(r).data:void 0,i=a?ln(a,t):t,s={mode:((o=i.theme)==null?void 0:o.mode)??(n==null?void 0:n.mode)??_e.theme.mode,accentColor:((l=i.theme)==null?void 0:l.accentColor)??(n==null?void 0:n.accentColor)??_e.theme.accentColor,fontFamily:((c=i.theme)==null?void 0:c.fontFamily)??(n==null?void 0:n.fontFamily)??_e.theme.fontFamily,borderRadius:((u=i.theme)==null?void 0:u.borderRadius)??(n==null?void 0:n.borderRadius)??_e.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,userId:i.userId,name:i.name,email:i.email,authUserId:i.authUserId,sessionId:i.sessionId,mode:i.mode??_e.mode,title:i.title??_e.title,subtitle:i.subtitle,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??_e.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:(a==null?void 0:a.thinkingEnabled)===!0,thinkingViewable:(a==null?void 0:a.thinkingViewable)===!0}}function ln(t,e){const n={...t};for(const r of Object.keys(e)){const a=e[r];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&n[r]!==null&&typeof n[r]=="object"?n[r]=ln(n[r],a):n[r]=a)}return n}var kt=function(){return kt=Object.assign||function(e){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},kt.apply(this,arguments)};function te(t,e,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):a(u.value).then(o,l)}c((r=r.apply(t,e||[])).next())})}function ne(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,a=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],a=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function dn(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,i;r<a;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var un="4.6.2";function Ye(t,e){return new Promise(function(n){return setTimeout(n,t,e)})}function da(){return new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})}function ua(t,e){e===void 0&&(e=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:e})}):Ye(Math.min(t,e))}function fn(t){return!!t&&typeof t.then=="function"}function hn(t,e){try{var n=t();fn(n)?n.then(function(r){return e(!0,r)},function(r){return e(!1,r)}):e(!0,n)}catch(r){e(!1,r)}}function mn(t,e,n){return n===void 0&&(n=16),te(this,void 0,void 0,function(){var r,a,i,s;return ne(this,function(o){switch(o.label){case 0:r=Array(t.length),a=Date.now(),i=0,o.label=1;case 1:return i<t.length?(r[i]=e(t[i],i),s=Date.now(),s>=a+n?(a=s,[4,da()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,r]}})})}function Me(t){return t.then(void 0,function(){}),t}function fa(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return!0;return!1}function ha(t,e){return!fa(t,e)}function bt(t){return parseInt(t)}function H(t){return parseFloat(t)}function se(t,e){return typeof t=="number"&&isNaN(t)?e:t}function W(t){return t.reduce(function(e,n){return e+(n?1:0)},0)}function pn(t,e){if(e===void 0&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var n=1/e;return Math.round(t*n)/n}function ma(t){for(var e,n,r="Unexpected syntax '".concat(t,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(t),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,l=function(m,h){s[m]=s[m]||[],s[m].push(h)};;){var c=o.exec(a[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(n=(e=d[4])!==null&&e!==void 0?e:d[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[i,s]}function pa(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r>127)return new TextEncoder().encode(t);e[n]=r}return e}function he(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,l=e[1]>>>16,c=e[1]&65535,u=0,d=0,m=0,h=0;h+=i+c,m+=h>>>16,h&=65535,m+=a+l,d+=m>>>16,m&=65535,d+=r+o,u+=d>>>16,d&=65535,u+=n+s,u&=65535,t[0]=u<<16|d,t[1]=m<<16|h}function G(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,l=e[1]>>>16,c=e[1]&65535,u=0,d=0,m=0,h=0;h+=i*c,m+=h>>>16,h&=65535,m+=a*c,d+=m>>>16,m&=65535,m+=i*l,d+=m>>>16,m&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=a*l,u+=d>>>16,d&=65535,d+=i*o,u+=d>>>16,d&=65535,u+=n*c+r*l+a*o+i*s,u&=65535,t[0]=u<<16|d,t[1]=m<<16|h}function Se(t,e){var n=t[0];e%=64,e===32?(t[0]=t[1],t[1]=n):e<32?(t[0]=n<<e|t[1]>>>32-e,t[1]=t[1]<<e|n>>>32-e):(e-=32,t[0]=t[1]<<e|n>>>32-e,t[1]=n<<e|t[1]>>>32-e)}function U(t,e){e%=64,e!==0&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function M(t,e){t[0]^=e[0],t[1]^=e[1]}var ga=[4283543511,3981806797],_a=[3301882366,444984403];function gn(t){var e=[0,t[0]>>>1];M(t,e),G(t,ga),e[1]=t[0]>>>1,M(t,e),G(t,_a),e[1]=t[0]>>>1,M(t,e)}var Xe=[2277735313,289559509],Je=[1291169091,658871167],_n=[0,5],va=[0,1390208809],ya=[0,944331445];function ka(t,e){var n=pa(t);e=e||0;var r=[0,n.length],a=r[1]%16,i=r[1]-a,s=[0,e],o=[0,e],l=[0,0],c=[0,0],u;for(u=0;u<i;u=u+16)l[0]=n[u+4]|n[u+5]<<8|n[u+6]<<16|n[u+7]<<24,l[1]=n[u]|n[u+1]<<8|n[u+2]<<16|n[u+3]<<24,c[0]=n[u+12]|n[u+13]<<8|n[u+14]<<16|n[u+15]<<24,c[1]=n[u+8]|n[u+9]<<8|n[u+10]<<16|n[u+11]<<24,G(l,Xe),Se(l,31),G(l,Je),M(s,l),Se(s,27),he(s,o),G(s,_n),he(s,va),G(c,Je),Se(c,33),G(c,Xe),M(o,c),Se(o,31),he(o,s),G(o,_n),he(o,ya);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(a){case 15:d[1]=n[u+14],U(d,48),M(c,d);case 14:d[1]=n[u+13],U(d,40),M(c,d);case 13:d[1]=n[u+12],U(d,32),M(c,d);case 12:d[1]=n[u+11],U(d,24),M(c,d);case 11:d[1]=n[u+10],U(d,16),M(c,d);case 10:d[1]=n[u+9],U(d,8),M(c,d);case 9:d[1]=n[u+8],M(c,d),G(c,Je),Se(c,33),G(c,Xe),M(o,c);case 8:d[1]=n[u+7],U(d,56),M(l,d);case 7:d[1]=n[u+6],U(d,48),M(l,d);case 6:d[1]=n[u+5],U(d,40),M(l,d);case 5:d[1]=n[u+4],U(d,32),M(l,d);case 4:d[1]=n[u+3],U(d,24),M(l,d);case 3:d[1]=n[u+2],U(d,16),M(l,d);case 2:d[1]=n[u+1],U(d,8),M(l,d);case 1:d[1]=n[u],M(l,d),G(l,Xe),Se(l,31),G(l,Je),M(s,l)}return M(s,r),M(o,r),he(s,o),he(o,s),gn(s),gn(o),he(s,o),he(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function ba(t){var e;return kt({name:t.name,message:t.message,stack:(e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
2
|
-
`)},t)}function xa(t){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))}function wa(t){return typeof t!="function"}function Sa(t,e){var n=Me(new Promise(function(r){var a=Date.now();hn(t.bind(null,e),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return r(function(){return{error:i[1],duration:o}});var l=i[1];if(wa(l))return r(function(){return{value:l,duration:o}});r(function(){return new Promise(function(c){var u=Date.now();hn(l,function(){for(var d=[],m=0;m<arguments.length;m++)d[m]=arguments[m];var h=o+Date.now()-u;if(!d[0])return c({error:d[1],duration:h});c({value:d[1],duration:h})})})})})}));return function(){return n.then(function(a){return a()})}}function Ca(t,e,n,r){var a=Object.keys(t).filter(function(s){return ha(n,s)}),i=Me(mn(a,function(s){return Sa(t[s],e)},r));return function(){return te(this,void 0,void 0,function(){var o,l,c,u,d;return ne(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,mn(o,function(h){return Me(h())},r)];case 2:return l=m.sent(),[4,Promise.all(l)];case 3:for(c=m.sent(),u={},d=0;d<a.length;++d)u[a[d]]=c[d];return[2,u]}})})}}function vn(){var t=window,e=navigator;return W(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function Ia(){var t=window,e=navigator;return W(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!vn()}function je(){var t=window,e=navigator;return W(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,(e.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function Y(){var t=window,e=navigator;return W(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,e.vendor.indexOf("Apple")===0,"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function xt(){var t=window,e=t.HTMLElement,n=t.Document;return W(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Oe(){var t=window;return xa(t.print)&&String(t.browser)==="[object WebPageNamespace]"}function yn(){var t,e,n=window;return W(["buildID"in navigator,"MozAppearance"in((e=(t=document.documentElement)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Na(){var t=window;return W([!("MediaSettingsRange"in t),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3}function Ta(){var t=window,e=t.URLPattern;return W(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function La(){var t=window;return W(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}function Pe(){var t=window,e=navigator,n=t.CSS,r=t.HTMLButtonElement;return W([!("getStorageUpdates"in e),r&&"popover"in r.prototype,"CSSCounterStyleRule"in t,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Aa(){if(navigator.platform==="iPad")return!0;var t=screen,e=t.width/t.height;return W(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}function Ra(){var t=document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||null}function Ea(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function wt(){var t=je(),e=yn(),n=window,r=navigator,a="connection";return t?W([!("SharedWorker"in n),r[a]&&"ontypechange"in r[a],!("sinkId"in new Audio)])>=2:e?W(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Ma(){var t=navigator,e=window,n=Audio.prototype,r=e.visualViewport;return W(["srLatency"in n,"srChannelCount"in n,"devicePosture"in t,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function ja(){return Za()?-4:Oa()}function Oa(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Pa())return-1;var n=4500,r=5e3,a=new e(1,r,44100),i=a.createOscillator();i.type="triangle",i.frequency.value=1e4;var s=a.createDynamicsCompressor();s.threshold.value=-50,s.knee.value=40,s.ratio.value=12,s.attack.value=0,s.release.value=.25,i.connect(s),s.connect(a.destination),i.start(0);var o=Va(a),l=o[0],c=o[1],u=Me(l.then(function(d){return Fa(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return c(),u}}function Pa(){return Y()&&!xt()&&!La()}function Za(){return Y()&&Pe()&&Oe()||je()&&Ma()&&Ta()}function Va(t){var e=3,n=500,r=500,a=5e3,i=function(){},s=new Promise(function(o,l){var c=!1,u=0,d=0;t.oncomplete=function(x){return o(x.renderedBuffer)};var m=function(){setTimeout(function(){return l(kn("timeout"))},Math.min(r,d+a-Date.now()))},h=function(){try{var x=t.startRendering();switch(fn(x)&&Me(x),t.state){case"running":d=Date.now(),c&&m();break;case"suspended":document.hidden||u++,c&&u>=e?l(kn("suspended")):setTimeout(h,n);break}}catch(_){l(_)}};h(),i=function(){c||(c=!0,d>0&&m())}});return[s,i]}function Fa(t){for(var e=0,n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}function kn(t){var e=new Error(t);return e.name=t,e}function bn(t,e,n){var r,a,i;return n===void 0&&(n=50),te(this,void 0,void 0,function(){var s,o;return ne(this,function(l){switch(l.label){case 0:s=document,l.label=1;case 1:return s.body?[3,3]:[4,Ye(n)];case 2:return l.sent(),[3,1];case 3:o=s.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(c,u){var d=!1,m=function(){d=!0,c()},h=function(I){d=!0,u(I)};o.onload=m,o.onerror=h;var x=o.style;x.setProperty("display","block","important"),x.position="absolute",x.top="0",x.left="0",x.visibility="hidden",e&&"srcdoc"in o?o.srcdoc=e:o.src="about:blank",s.body.appendChild(o);var _=function(){var I,v;d||(((v=(I=o.contentWindow)===null||I===void 0?void 0:I.document)===null||v===void 0?void 0:v.readyState)==="complete"?m():setTimeout(_,10))};_()})];case 5:l.sent(),l.label=6;case 6:return!((a=(r=o.contentWindow)===null||r===void 0?void 0:r.document)===null||a===void 0)&&a.body?[3,8]:[4,Ye(n)];case 7:return l.sent(),[3,6];case 8:return[4,t(o,o.contentWindow)];case 9:return[2,l.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function Wa(t){for(var e=ma(t),n=e[0],r=e[1],a=document.createElement(n??"div"),i=0,s=Object.keys(r);i<s.length;i++){var o=s[i],l=r[o].join(" ");o==="style"?$a(a.style,l):a.setAttribute(o,l)}return a}function $a(t,e){for(var n=0,r=e.split(";");n<r.length;n++){var a=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],l=i[4];t.setProperty(s,o,l||"")}}}function Ua(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}t=e}}var za="mmMwWLliI0O&1",Da="48px",Ce=["monospace","sans-serif","serif"],xn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Ba(){var t=this;return bn(function(e,n){var r=n.document;return te(t,void 0,void 0,function(){var a,i,s,o,l,c,u,d,m,h,x,_;return ne(this,function(I){for(a=r.body,a.style.fontSize=Da,i=r.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},l=function(v){var y=r.createElement("span"),C=y.style;return C.position="absolute",C.top="0",C.left="0",C.fontFamily=v,y.textContent=za,i.appendChild(y),y},c=function(v,y){return l("'".concat(v,"',").concat(y))},u=function(){return Ce.map(l)},d=function(){for(var v={},y=function(K){v[K]=Ce.map(function(Q){return c(K,Q)})},C=0,Z=xn;C<Z.length;C++){var z=Z[C];y(z)}return v},m=function(v){return Ce.some(function(y,C){return v[C].offsetWidth!==s[y]||v[C].offsetHeight!==o[y]})},h=u(),x=d(),a.appendChild(i),_=0;_<Ce.length;_++)s[Ce[_]]=h[_].offsetWidth,o[Ce[_]]=h[_].offsetHeight;return[2,xn.filter(function(v){return m(x[v])})]})})})}function Ga(){var t=navigator.plugins;if(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];if(r){for(var a=[],i=0;i<r.length;++i){var s=r[i];a.push({type:s.type,suffixes:s.suffixes})}e.push({name:r.name,description:r.description,mimeTypes:a})}}return e}}function Ha(){return Ya(ti())}function Ya(t){var e,n=!1,r,a,i=Xa(),s=i[0],o=i[1];return Ja(s,o)?(n=Ka(o),t?r=a="skipped":(e=Qa(s,o),r=e[0],a=e[1])):r=a="unsupported",{winding:n,geometry:r,text:a}}function Xa(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}function Ja(t,e){return!!(e&&t.toDataURL)}function Ka(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}function Qa(t,e){qa(t,e);var n=St(t),r=St(t);if(n!==r)return["unstable","unstable"];ei(t,e);var a=St(t);return[a,n]}function qa(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(n,4,45)}function ei(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var a=r[n],i=a[0],s=a[1],o=a[2];e.fillStyle=i,e.beginPath(),e.arc(s,o,40,0,Math.PI*2,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,Math.PI*2,!0),e.arc(60,60,20,0,Math.PI*2,!0),e.fill("evenodd")}function St(t){return t.toDataURL()}function ti(){return Y()&&Pe()&&Oe()}function ni(){var t=navigator,e=0,n;t.maxTouchPoints!==void 0?e=bt(t.maxTouchPoints):t.msMaxTouchPoints!==void 0&&(e=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:e,touchEvent:n,touchStart:r}}function ri(){return navigator.oscpu}function ai(){var t=navigator,e=[],n=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(n!==void 0&&e.push([n]),Array.isArray(t.languages))je()&&Na()||e.push(t.languages);else if(typeof t.languages=="string"){var r=t.languages;r&&e.push(r.split(","))}return e}function ii(){return window.screen.colorDepth}function si(){return se(H(navigator.deviceMemory),void 0)}function oi(){if(!(Y()&&Pe()&&Oe()))return ci()}function ci(){var t=screen,e=function(r){return se(bt(r),null)},n=[e(t.width),e(t.height)];return n.sort().reverse(),n}var li=2500,di=10,Ke,Ct;function ui(){if(Ct===void 0){var t=function(){var e=It();Nt(e)?Ct=setTimeout(t,li):(Ke=e,Ct=void 0)};t()}}function fi(){var t=this;return ui(),function(){return te(t,void 0,void 0,function(){var e;return ne(this,function(n){switch(n.label){case 0:return e=It(),Nt(e)?Ke?[2,dn([],Ke,!0)]:Ra()?[4,Ea()]:[3,2]:[3,2];case 1:n.sent(),e=It(),n.label=2;case 2:return Nt(e)||(Ke=e),[2,e]}})})}}function hi(){var t=this;if(Y()&&Pe()&&Oe())return function(){return Promise.resolve(void 0)};var e=fi();return function(){return te(t,void 0,void 0,function(){var n,r;return ne(this,function(a){switch(a.label){case 0:return[4,e()];case 1:return n=a.sent(),r=function(i){return i===null?null:pn(i,di)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function It(){var t=screen;return[se(H(t.availTop),null),se(H(t.width)-H(t.availWidth)-se(H(t.availLeft),0),null),se(H(t.height)-H(t.availHeight)-se(H(t.availTop),0),null),se(H(t.availLeft),null)]}function Nt(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function mi(){return se(bt(navigator.hardwareConcurrency),void 0)}function pi(){var t,e=(t=window.Intl)===null||t===void 0?void 0:t.DateTimeFormat;if(e){var n=new e().resolvedOptions().timeZone;if(n)return n}var r=-gi();return"UTC".concat(r>=0?"+":"").concat(r)}function gi(){var t=new Date().getFullYear();return Math.max(H(new Date(t,0,1).getTimezoneOffset()),H(new Date(t,6,1).getTimezoneOffset()))}function _i(){try{return!!window.sessionStorage}catch{return!0}}function vi(){try{return!!window.localStorage}catch{return!0}}function yi(){if(!(vn()||Ia()))try{return!!window.indexedDB}catch{return!0}}function ki(){return!!window.openDatabase}function bi(){return navigator.cpuClass}function xi(){var t=navigator.platform;return t==="MacIntel"&&Y()&&!xt()?Aa()?"iPad":"iPhone":t}function wi(){return navigator.vendor||""}function Si(){for(var t=[],e=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<n.length;e++){var r=n[e],a=window[r];a&&typeof a=="object"&&t.push(r)}return t.sort()}function Ci(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=t.cookie.indexOf("cookietest=")!==-1;return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch{return!1}}function Ii(){var t=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',t("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",t("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",t("LnNwb25zb3JpdA=="),".ylamainos",t("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",t("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",t("LmhlYWRlci1ibG9ja2VkLWFk"),t("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",t("I2FkXzMwMFgyNTA="),t("I2Jhbm5lcmZsb2F0MjI="),t("I2NhbXBhaWduLWJhbm5lcg=="),t("I0FkLUNvbnRlbnQ=")],adGuardChinese:[t("LlppX2FkX2FfSA=="),t("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",t("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),t("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",t("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",t("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",t("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),t("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),t("LmFkZ29vZ2xl"),t("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[t("YW1wLWF1dG8tYWRz"),t("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",t("I2FkX2ludmlld19hcmVh")],adGuardRussian:[t("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),t("LnJlY2xhbWE="),'div[id^="smi2adblock"]',t("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[t("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),t("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",t("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),t("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),t("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",t("I3Jla2xhbWk="),t("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),t("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),t("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[t("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",t("LndpZGdldF9wb19hZHNfd2lkZ2V0"),t("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",t("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[t("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),t("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",t("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",t("I3Jla2xhbW5pLWJveA=="),t("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",t("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[t("I2FkdmVydGVudGll"),t("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",t("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",t("LnNwb25zb3JsaW5rZ3J1ZW4="),t("I3dlcmJ1bmdza3k="),t("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),t("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[t("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",t("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[t("LnJla2xhbW9zX3RhcnBhcw=="),t("LnJla2xhbW9zX251b3JvZG9z"),t("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),t("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),t("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[t("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[t("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),t("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",t("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[t("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),t("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),t("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",t("LmFkX19tYWlu"),t("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[t("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[t("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),t("I2xpdmVyZUFkV3JhcHBlcg=="),t("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),t("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[t("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",t("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),t("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),t("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[t("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),t("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),t("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",t("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),t("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),t("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),t("ZGl2I3NrYXBpZWNfYWQ=")],ro:[t("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),t("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[t("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),t("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),t("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",t("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),t("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",t("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Ni(t){var e=t===void 0?{}:t,n=e.debug;return te(this,void 0,void 0,function(){var r,a,i,s,o,l;return ne(this,function(c){switch(c.label){case 0:return Ti()?(r=Ii(),a=Object.keys(r),i=(l=[]).concat.apply(l,a.map(function(u){return r[u]})),[4,Li(i)]):[2,void 0];case 1:return s=c.sent(),n&&Ai(r,s),o=a.filter(function(u){var d=r[u],m=W(d.map(function(h){return s[h]}));return m>d.length*.6}),o.sort(),[2,o]}})})}function Ti(){return Y()||wt()}function Li(t){var e;return te(this,void 0,void 0,function(){var n,r,a,i,l,s,o,l;return ne(this,function(c){switch(c.label){case 0:for(n=document,r=n.createElement("div"),a=new Array(t.length),i={},wn(r),l=0;l<t.length;++l)s=Wa(t[l]),s.tagName==="DIALOG"&&s.show(),o=n.createElement("div"),wn(o),o.appendChild(s),r.appendChild(o),a[l]=s;c.label=1;case 1:return n.body?[3,3]:[4,Ye(50)];case 2:return c.sent(),[3,1];case 3:n.body.appendChild(r);try{for(l=0;l<t.length;++l)a[l].offsetParent||(i[t[l]]=!0)}finally{(e=r.parentNode)===null||e===void 0||e.removeChild(r)}return[2,i]}})})}function wn(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function Ai(t,e){for(var n="DOM blockers debug:\n```",r=0,a=Object.keys(t);r<a.length;r++){var i=a[r];n+=`
|
|
3
|
-
`.concat(i,":");for(var s=0,o=
|
|
4
|
-
`.concat(e[l]?"🚫":"➡️"," ").concat(l)}}}function Ri(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var n=e[t];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Ei(){if(Sn("inverted"))return!0;if(Sn("none"))return!1}function Sn(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function Mi(){if(Cn("active"))return!0;if(Cn("none"))return!1}function Cn(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}var ji=100;function Oi(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=ji;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}}function Pi(){if(Ie("no-preference"))return 0;if(Ie("high")||Ie("more"))return 1;if(Ie("low")||Ie("less"))return-1;if(Ie("forced"))return 10}function Ie(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function Zi(){if(In("reduce"))return!0;if(In("no-preference"))return!1}function In(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function Vi(){if(Nn("reduce"))return!0;if(Nn("no-preference"))return!1}function Nn(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function Fi(){if(Tn("high"))return!0;if(Tn("standard"))return!1}function Tn(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var E=Math,$=function(){return 0};function Wi(){var t=E.acos||$,e=E.acosh||$,n=E.asin||$,r=E.asinh||$,a=E.atanh||$,i=E.atan||$,s=E.sin||$,o=E.sinh||$,l=E.cos||$,c=E.cosh||$,u=E.tan||$,d=E.tanh||$,m=E.exp||$,h=E.expm1||$,x=E.log1p||$,_=function(R){return E.pow(E.PI,R)},I=function(R){return E.log(R+E.sqrt(R*R-1))},v=function(R){return E.log(R+E.sqrt(R*R+1))},y=function(R){return E.log((1+R)/(1-R))/2},C=function(R){return E.exp(R)-1/E.exp(R)/2},Z=function(R){return(E.exp(R)+1/E.exp(R))/2},z=function(R){return E.exp(R)-1},K=function(R){return(E.exp(2*R)-1)/(E.exp(2*R)+1)},Q=function(R){return E.log(1+R)};return{acos:t(.12312423423423424),acosh:e(1e308),acoshPf:I(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:v(1),atanh:a(.5),atanhPf:y(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:C(1),cos:l(10.000000000123),cosh:c(1),coshPf:Z(1),tan:u(-1e300),tanh:d(1),tanhPf:K(1),exp:m(1),expm1:h(1),expm1Pf:z(1),log1p:x(10),log1pPf:Q(10),powPI:_(-100)}}var $i="mmMwWLliI0fiflO&1",Tt={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function Ui(){return zi(function(t,e){for(var n={},r={},a=0,i=Object.keys(Tt);a<i.length;a++){var s=i[a],o=Tt[s],l=o[0],c=l===void 0?{}:l,u=o[1],d=u===void 0?$i:u,m=t.createElement("span");m.textContent=d,m.style.whiteSpace="nowrap";for(var h=0,x=Object.keys(c);h<x.length;h++){var _=x[h],I=c[_];I!==void 0&&(m.style[_]=I)}n[s]=m,e.append(t.createElement("br"),m)}for(var v=0,y=Object.keys(Tt);v<y.length;v++){var s=y[v];r[s]=n[s].getBoundingClientRect().width}return r})}function zi(t,e){return e===void 0&&(e=4e3),bn(function(n,r){var a=r.document,i=a.body,s=i.style;s.width="".concat(e,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",je()?i.style.zoom="".concat(1/r.devicePixelRatio):Y()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=dn([],Array(e/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),t(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Di(){return navigator.pdfViewerEnabled}function Bi(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}function Gi(){var t=window.ApplePaySession;if(typeof(t==null?void 0:t.canMakePayments)!="function")return-1;if(Hi())return-3;try{return t.canMakePayments()?1:0}catch(e){return Yi(e)}}var Hi=Ua;function Yi(t){if(t instanceof Error&&t.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}function Xi(){var t,e=document.createElement("a"),n=(t=e.attributionSourceId)!==null&&t!==void 0?t:e.attributionsourceid;return n===void 0?void 0:String(n)}var Ln=-1,An=-2,Ji=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Ki=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Qi=["FRAGMENT_SHADER","VERTEX_SHADER"],qi=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Rn="WEBGL_debug_renderer_info",es="WEBGL_polygon_mode";function ts(t){var e,n,r,a,i,s,o=t.cache,l=En(o);if(!l)return Ln;if(!On(l))return An;var c=jn()?null:l.getExtension(Rn);return{version:((e=l.getParameter(l.VERSION))===null||e===void 0?void 0:e.toString())||"",vendor:((n=l.getParameter(l.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:c?(r=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((a=l.getParameter(l.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:c?(i=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function ns(t){var e=t.cache,n=En(e);if(!n)return Ln;if(!On(n))return An;var r=n.getSupportedExtensions(),a=n.getContextAttributes(),i=[],s=[],o=[],l=[],c=[];if(a)for(var u=0,d=Object.keys(a);u<d.length;u++){var m=d[u];s.push("".concat(m,"=").concat(a[m]))}for(var h=Mn(n),x=0,_=h;x<_.length;x++){var I=_[x],v=n[I];o.push("".concat(I,"=").concat(v).concat(Ji.has(v)?"=".concat(n.getParameter(v)):""))}if(r)for(var y=0,C=r;y<C.length;y++){var Z=C[y];if(!(Z===Rn&&jn()||Z===es&&is())){var z=n.getExtension(Z);if(!z){i.push(Z);continue}for(var K=0,Q=Mn(z);K<Q.length;K++){var I=Q[K],v=z[I];l.push("".concat(I,"=").concat(v).concat(Ki.has(v)?"=".concat(n.getParameter(v)):""))}}}for(var R=0,D=Qi;R<D.length;R++)for(var le=D[R],Ut=0,Rr=qi;Ut<Rr.length;Ut++){var Er=Rr[Ut],Po=rs(n,le,Er);c.push("".concat(le,".").concat(Er,"=").concat(Po.join(",")))}return l.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:c,extensions:r,extensionParameters:l,unsupportedExtensions:i}}function En(t){if(t.webgl)return t.webgl.context;var e=document.createElement("canvas"),n;e.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,a=["webgl","experimental-webgl"];r<a.length;r++){var i=a[r];try{n=e.getContext(i)}catch{}if(n)break}return t.webgl={context:n},n}function rs(t,e,n){var r=t.getShaderPrecisionFormat(t[e],t[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Mn(t){var e=Object.keys(t.__proto__);return e.filter(as)}function as(t){return typeof t=="string"&&!t.match(/[^A-Z0-9_x]/)}function jn(){return yn()}function is(){return je()||Y()}function On(t){return typeof t.getParameter=="function"}function ss(){var t=wt()||Y();if(!t)return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function os(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return!e&&e!==""?-3:e}var cs={fonts:Ba,domBlockers:Ni,fontPreferences:Ui,audio:ja,screenFrame:hi,canvas:Ha,osCpu:ri,languages:ai,colorDepth:ii,deviceMemory:si,screenResolution:oi,hardwareConcurrency:mi,timezone:pi,sessionStorage:_i,localStorage:vi,indexedDB:yi,openDatabase:ki,cpuClass:bi,platform:xi,plugins:Ga,touchSupport:ni,vendor:wi,vendorFlavors:Si,cookiesEnabled:Ci,colorGamut:Ri,invertedColors:Ei,forcedColors:Mi,monochrome:Oi,contrast:Pi,reducedMotion:Zi,reducedTransparency:Vi,hdr:Fi,math:Wi,pdfViewerEnabled:Di,architecture:Bi,applePay:Gi,privateClickMeasurement:Xi,audioBaseLatency:ss,dateTimeLocale:os,webGlBasics:ts,webGlExtensions:ns};function ls(t){return Ca(cs,t,[])}var ds="$ if upgrade to Pro: https://fpjs.dev/pro";function us(t){var e=fs(t),n=hs(e);return{score:e,comment:ds.replace(/\$/g,"".concat(n))}}function fs(t){if(wt())return .4;if(Y())return xt()&&!(Pe()&&Oe())?.5:.3;var e="value"in t.platform?t.platform.value:"";return/^Win/.test(e)?.6:/^Mac/.test(e)?.5:.7}function hs(t){return pn(.99+.01*t,1e-4)}function ms(t){for(var e="",n=0,r=Object.keys(t).sort();n<r.length;n++){var a=r[n],i=t[a],s="error"in i?"error":JSON.stringify(i.value);e+="".concat(e?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return e}function ps(t){return JSON.stringify(t,function(e,n){return n instanceof Error?ba(n):n},2)}function Pn(t){return ka(ms(t))}function gs(t){var e,n=us(t);return{get visitorId(){return e===void 0&&(e=Pn(this.components)),e},set visitorId(r){e=r},confidence:n,components:t,version:un}}function _s(t){return t===void 0&&(t=50),ua(t,t*2)}function vs(t,e){var n=Date.now();return{get:function(r){return te(this,void 0,void 0,function(){var a,i,s;return ne(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,t()];case 1:return i=o.sent(),s=gs(i),e||r!=null&&r.debug,[2,s]}})})}}}function ys(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(un,"/npm-monitoring"),!0),t.send()}catch{}}function ks(t){var e;return t===void 0&&(t={}),te(this,void 0,void 0,function(){var n,r,a;return ne(this,function(i){switch(i.label){case 0:return(!((e=t.monitoring)!==null&&e!==void 0)||e)&&ys(),n=t.delayFallback,r=t.debug,[4,_s(n)];case 1:return i.sent(),a=ls({cache:{},debug:r}),[2,vs(a,r)]}})})}var bs={load:ks,hashComponents:Pn,componentsToDebugString:ps};class xs{constructor(e){this.baseUrl=e}async validateWidget(e,n){if(!n)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:n}),a=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),i=await a.json();return a.ok&&i.success?{valid:!0,agentId:i.data.agentId,tenantId:i.data.tenantId}:{valid:!1,error:i.error??`Widget configuration is invalid (${a.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){var a,i,s;const n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!n.ok)throw new Error(`API error: ${n.status} ${n.statusText}`);const r=await n.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:((a=r.data)==null?void 0:a.text)??"",sessionId:(i=r.data)==null?void 0:i.sessionId,images:(s=r.data)==null?void 0:s.images}}async fetchSessionMessages(e){var n;try{const r=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(r.status===410||!r.ok)return null;const a=await r.json();return a.success?((n=a.data)==null?void 0:n.messages)??null:null}catch{return null}}async uploadImage(e,n,r){const a=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:n,fileName:r})});if(!a.ok)throw new Error(`Upload error: ${a.status} ${a.statusText}`);const i=await a.json();if(!i.success)throw new Error(i.error??"Upload failed");return{url:i.data.url}}async fetchWidgetConfig(e,n){try{const r=n?`?tenantId=${encodeURIComponent(n)}`:"",a=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!a.ok)return null;const i=await a.json();return i.success?i.data:null}catch{return null}}}const ws=6e4;function Ss(t){return Promise.race([t.read(),new Promise((e,n)=>setTimeout(()=>n(new Error("Stream timed out — no data received for 60s")),ws))])}async function Cs(t,e,n){let r="",a="";try{const i=await fetch(`${t}/v1/agents/${encodeURIComponent(e.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!i.ok||!i.body)throw new Error(`Stream error: ${i.status} ${i.statusText}`);const s=i.headers.get("x-session-id");s&&n.onSession&&n.onSession(s);const o=i.body.getReader(),l=new TextDecoder;let c="";const u=d=>{if(!d.startsWith("data: "))return!1;const m=d.slice(6).trim();if(!m)return!1;if(m==="[DONE]")return n.onEnd(r),!0;try{const h=JSON.parse(m);if(h.type==="session"){const _=h.sessionId;return _&&n.onSession&&n.onSession(_),!1}if(h.type==="done"||h.type==="stop")return n.onEnd(r),!0;if(h.type==="error")throw new Error(h.message??"Stream error");if(h.type==="images"){const _=h.images;return _&&n.onImages&&n.onImages(_),!1}if(h.type==="thinking_chunk"){const _=h.content;return _&&n.onThinkingDelta&&(a+=_,n.onThinkingDelta(_,a)),!1}const x=Is(h);x&&(r+=x,n.onDelta(x,r))}catch(h){if(!(h instanceof SyntaxError))throw h}return!1};e:for(;;){const{done:d,value:m}=await Ss(o);if(d)break;c+=l.decode(m,{stream:!0});const h=c.lastIndexOf(`
|
|
5
|
-
`);if(h===-1)continue;const x=c.slice(0,h);c=c.slice(h+1);for(const
|
|
6
|
-
`))if(u(_))break e}n.onEnd(r)}catch(i){n.onError(i instanceof Error?i:new Error(String(i)))}}function Is(t){var a;const e=t.choices;if(Array.isArray(e)&&e.length>0){const i=(a=e[0])==null?void 0:a.delta,s=(i==null?void 0:i.content)??(i==null?void 0:i.text)??"";if(s)return s}const n=t.delta;if(n){const i=n.content??n.text??"";if(i)return i}const r=t.response;return r||(t.text??t.content??"")}class Ns{constructor(){me(this,"listeners",new Map)}on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n)}off(e,n){var r;(r=this.listeners.get(e))==null||r.delete(n)}emit(...e){var a;const[n,r]=e;(a=this.listeners.get(n))==null||a.forEach(i=>i(r))}removeAllListeners(){this.listeners.clear()}}const Ts="agentforge";function Lt(t){return`${Ts}:session:${t}`}function Ls(t){try{return sessionStorage.getItem(Lt(t))??void 0}catch{return}}function At(t,e){try{sessionStorage.setItem(Lt(t),e)}catch{}}function Zn(t){try{sessionStorage.removeItem(Lt(t))}catch{}}function Ze(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function As(t){return{id:Ze(),role:"assistant",content:t,createdAt:new Date().toISOString(),status:"sent"}}class Rs{constructor(e,n,r){me(this,"config");me(this,"apiClient");me(this,"state");me(this,"greetingShown",!1);me(this,"fingerprint");me(this,"emitter");this.hostConfig=n,this.onStateChange=r,this.config=e,this.apiClient=new xs(e.apiBaseUrl),this.emitter=new Ns,this.initializeFingerprint();const a=e.sessionId??Ls(e.agentId);e.sessionId&&At(e.agentId,e.sessionId);const i=e.mode==="inline";this.state={isOpen:i,messages:[],isLoading:!1,error:null,sessionId:a,initStatus:"validating",initError:null},i&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{const n=await(await bs.load()).get();this.fingerprint=n.visitorId}catch{this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){if(this.state.initStatus==="error")return;const e=!this.greetingShown&&!!this.config.greeting;e&&(this.greetingShown=!0),this.setState({isOpen:!0,messages:e?[As(this.config.greeting),...this.state.messages]:this.state.messages})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const n=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(n&&(this.config=Ee(this.hostConfig,n),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const a=r.map(i=>({id:Ze(),role:i.role,content:i.content,images:i.images&&i.images.length>0?i.images:void 0,createdAt:new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...a]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,n){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...n}:r)},this.onStateChange(this.getState(),this.config)}reset(){Zn(this.config.agentId),this.greetingShown=!1,this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){Zn(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,n){if(this.state.isLoading||!e.trim()||this.state.initStatus!=="ready")return;let r;if(n)try{const s=await Es(n);r=(await this.apiClient.uploadImage(s,n.type,n.name)).url}catch(s){const o=s instanceof Error?s.message:"Image upload failed";this.setState({error:o});return}const a={id:Ze(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},i=!this.state.messages.some(s=>s.role==="user");this.setState({messages:[...this.state.messages,a],isLoading:!0,error:null}),this.emitter.emit("message:sent",a),i&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,n,r=!1){try{const a=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n}),i={id:Ze(),role:"assistant",content:a.content,images:a.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,i],isLoading:!1,...a.sessionId?{sessionId:a.sessionId}:{}}),a.sessionId&&At(this.config.agentId,a.sessionId),this.emitter.emit("message:received",i)}catch(a){const i=a instanceof Error?a.message:"Failed to send message";if(!r&&i.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,n,!0);this.setState({isLoading:!1,error:i}),this.emitter.emit("message:error",{error:i,message:null})}}async sendStreaming(e,n,r=!1){const a=Ze(),i={id:a,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,i]}),this.emitter.emit("stream:start");let s=!1;await Cs(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n},{onSession:o=>{this.setState({sessionId:o}),At(this.config.agentId,o)},onImages:o=>{this.updateMessage(a,{images:o})},onThinkingDelta:(o,l)=>{this.updateMessage(a,{thinking:l,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:o,accumulated:l})},onDelta:(o,l)=>{this.updateMessage(a,{content:l,isThinking:!1}),this.emitter.emit("stream:delta",{delta:o,accumulated:l})},onEnd:o=>{this.updateMessage(a,{content:o,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:o});const l=this.state.messages.find(c=>c.id===a);l&&(l.thinking&&this.emitter.emit("thinking:end",{content:l.thinking}),this.emitter.emit("message:received",l))},onError:o=>{var c;if(!r&&o.message.includes("410")){s=!0,this.setState({messages:this.state.messages.filter(u=>u.id!==a),isLoading:!1});return}const l=((c=this.state.messages.find(u=>u.id===a))==null?void 0:c.content)??"";this.updateMessage(a,{content:l||"Something went wrong. Please try again.",status:"error"}),this.setState({isLoading:!1,error:"Something went wrong. Please try again."}),this.emitter.emit("message:error",{error:o.message,message:null})}}),s&&(this.handleSessionExpired(),await this.sendStreaming(e,n,!0))}}function Es(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;e(a.split(",")[1]??"")},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function Ms(t){const e=document.createElement("div");e.setAttribute("data-agentkit-widget",""),t.appendChild(e);const n=e.attachShadow({mode:"open"}),r=document.createElement("style");n.appendChild(r);const a=document.createElement("div");return a.style.cssText="display: contents;",n.appendChild(a),{host:e,shadowRoot:n,styleSlot:r,mountPoint:a}}function js(t,e){t.textContent=e}function Os(t){t.remove()}function Ps(){const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(t),t}function Zs(t){getComputedStyle(t).position==="static"&&(t.style.position="relative");const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),t.appendChild(e),e}function Vs(t){return t.setAttribute("data-agentkit-root","inline"),getComputedStyle(t).position==="static"&&(t.style.position="relative"),t}function Fs(t){t.remove()}function Ws(t){t.removeAttribute("data-agentkit-root")}function Vn(t,e,n,r,a){const i=t.mode==="inline";let s=!1;const o=i&&a?Vs(a):!i&&a?Zs(a):Ps(),l=Ms(o);js(l.styleSlot,r);const c=new Rs(t,e,(m,h)=>{s||u.update(m,h)}),u=n(l.mountPoint,t,c.getState(),{onOpen:()=>d.open(),onClose:()=>d.close(),onSendMessage:(m,h)=>{c.sendMessage(m,h)}});c.hydrate(),setTimeout(()=>{s||c.emitter.emit("ready",c.getState())},0);const d={open(){s||(c.setOpen(!0),c.emitter.emit("open"))},close(){s||(c.setOpen(!1),c.emitter.emit("close"))},toggle(){c.getState().isOpen?d.close():d.open()},async sendMessage(m,h){await c.sendMessage(m,h)},reset(){s||(c.reset(),c.emitter.emit("reset"))},destroy(){s||(s=!0,u.destroy(),Os(l.host),i&&a?Ws(a):Fs(o),c.emitter.emit("destroy"),c.emitter.removeAllListeners())},on(m,h){c.emitter.on(m,h)},off(m,h){c.emitter.off(m,h)},getState(){return c.getState()}};return d}const Ve=new Map;let $s=0;function Fn(t){const e=`agentkit-widget-${++$s}`,n=t.destroy.bind(t);return t.destroy=()=>{Ve.delete(e),n()},Ve.set(e,t),e}function Us(t,e,n){const r={...t,mode:"floating"},a=Ee(r),i=Vn(a,r,e,n);return Fn(i),i}function zs(t,e,n,r){const a={...e,mode:"inline"},i=Ee(a),s=Vn(i,a,n,r,t);return Fn(s),s}function Ds(t){var e;t?(e=Ve.get(t))==null||e.destroy():(Ve.forEach(n=>n.destroy()),Ve.clear())}var Qe,N,Wn,ve,$n,Un,zn,Dn,Rt,Et,Mt,qe={},et=[],Bs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function oe(t,e){for(var n in e)t[n]=e[n];return t}function jt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function We(t,e,n){var r,a,i,s={};for(i in e)i=="key"?r=e[i]:i=="ref"?a=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?Qe.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return tt(t,s,r,a,null)}function tt(t,e,n,r,a){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Wn,__i:-1,__u:0};return a==null&&N.vnode!=null&&N.vnode(i),i}function X(t){return t.children}function ce(t,e){this.props=t,this.context=e}function Ne(t,e){if(e==null)return t.__?Ne(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Ne(t):null}function Gs(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],a=[],i=oe({},e);i.__v=e.__v+1,N.vnode&&N.vnode(i),Ot(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??Ne(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,Kn(r,i,a),e.__e=e.__=null,i.__e!=n&&Bn(i)}}function Bn(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Bn(t)}function Gn(t){(!t.__d&&(t.__d=!0)&&ve.push(t)&&!nt.__r++||$n!=N.debounceRendering)&&(($n=N.debounceRendering)||Un)(nt)}function nt(){for(var t,e=1;ve.length;)ve.length>e&&ve.sort(zn),t=ve.shift(),e=ve.length,Gs(t);nt.__r=0}function Hn(t,e,n,r,a,i,s,o,l,c,u){var d,m,h,x,_,I,v,y=r&&r.__k||et,C=e.length;for(l=Hs(n,e,y,l,C),d=0;d<C;d++)(h=n.__k[d])!=null&&(m=h.__i!=-1&&y[h.__i]||qe,h.__i=d,I=Ot(t,h,m,a,i,s,o,l,c,u),x=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&Zt(m.ref,null,h),u.push(h.ref,h.__c||x,h)),_==null&&x!=null&&(_=x),(v=!!(4&h.__u))||m.__k===h.__k?l=Yn(h,l,t,v):typeof h.type=="function"&&I!==void 0?l=I:x&&(l=x.nextSibling),h.__u&=-7);return n.__e=_,l}function Hs(t,e,n,r,a){var i,s,o,l,c,u=n.length,d=u,m=0;for(t.__k=new Array(a),i=0;i<a;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[i]=tt(null,s,null,null,null):Fe(s)?s=t.__k[i]=tt(X,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[i]=tt(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[i]=s,l=i+m,s.__=t,s.__b=t.__b+1,o=null,(c=s.__i=Ys(s,n,l,d))!=-1&&(d--,(o=n[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(a>u?m--:a<u&&m++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,s.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<u;i++)(o=n[i])!=null&&!(2&o.__u)&&(o.__e==r&&(r=Ne(o)),qn(o,o));return r}function Yn(t,e,n,r){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=Yn(a[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Ne(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function rt(t,e){return e=e||[],t==null||typeof t=="boolean"||(Fe(t)?t.some(function(n){rt(n,e)}):e.push(t)),e}function Ys(t,e,n,r){var a,i,s,o=t.key,l=t.type,c=e[n],u=c!=null&&(2&c.__u)==0;if(c===null&&o==null||u&&o==c.key&&l==c.type)return n;if(r>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<e.length;)if((c=e[s=a>=0?a--:i++])!=null&&!(2&c.__u)&&o==c.key&&l==c.type)return s}return-1}function Xn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Bs.test(e)?n:n+"px"}function at(t,e,n,r,a){var i,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Xn(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Xn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Dn,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Rt,t.addEventListener(e,i?Mt:Et,i)):t.removeEventListener(e,i?Mt:Et,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Jn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Rt++;else if(e.t<n.u)return;return n(N.event?N.event(e):e)}}}function Ot(t,e,n,r,a,i,s,o,l,c){var u,d,m,h,x,_,I,v,y,C,Z,z,K,Q,R,D=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[o=e.__e=n.__e]),(u=N.__b)&&u(e);e:if(typeof D=="function")try{if(v=e.props,y="prototype"in D&&D.prototype.render,C=(u=D.contextType)&&r[u.__c],Z=u?C?C.props.value:u.__:r,n.__c?I=(d=e.__c=n.__c).__=d.__E:(y?e.__c=d=new D(v,Z):(e.__c=d=new ce(v,Z),d.constructor=D,d.render=Js),C&&C.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=oe({},d.__s)),oe(d.__s,D.getDerivedStateFromProps(v,d.__s))),h=d.props,x=d.state,d.__v=e,m)y&&D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,Z),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,Z)===!1){e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(le){le&&(le.__=e)}),et.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,Z),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,x,_)})}if(d.context=Z,d.props=v,d.__P=t,d.__e=!1,z=N.__r,K=0,y)d.state=d.__s,d.__d=!1,z&&z(e),u=d.render(d.props,d.state,d.context),et.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,z&&z(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++K<25);d.state=d.__s,d.getChildContext!=null&&(r=oe(oe({},r),d.getChildContext())),y&&!m&&d.getSnapshotBeforeUpdate!=null&&(_=d.getSnapshotBeforeUpdate(h,x)),Q=u!=null&&u.type===X&&u.key==null?Qn(u.props.children):u,o=Hn(t,Fe(Q)?Q:[Q],e,n,r,a,i,s,o,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),I&&(d.__E=d.__=null)}catch(le){if(e.__v=null,l||i!=null)if(le.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,e.__e=o}else{for(R=i.length;R--;)jt(i[R]);Pt(e)}else e.__e=n.__e,e.__k=n.__k,le.then||Pt(e);N.__e(le,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):o=e.__e=Xs(n.__e,e,n,r,a,i,s,l,c);return(u=N.diffed)&&u(e),128&e.__u?void 0:o}function Pt(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Pt))}function Kn(t,e,n){for(var r=0;r<n.length;r++)Zt(n[r],n[++r],n[++r]);N.__c&&N.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){N.__e(i,a.__v)}})}function Qn(t){return typeof t!="object"||t==null||t.__b>0?t:Fe(t)?t.map(Qn):oe({},t)}function Xs(t,e,n,r,a,i,s,o,l){var c,u,d,m,h,x,_,I=n.props||qe,v=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){t=h,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(v);t=document.createElementNS(a,y,v.is&&v),o&&(N.__m&&N.__m(e,i),o=!1),i=null}if(y==null)I===v||o&&t.data==v||(t.data=v);else{if(i=i&&Qe.call(t.childNodes),!o&&i!=null)for(I={},c=0;c<t.attributes.length;c++)I[(h=t.attributes[c]).name]=h.value;for(c in I)h=I[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||at(t,c,null,h,a);for(c in v)h=v[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?x=h:c=="checked"?_=h:o&&typeof h!="function"||I[c]===h||at(t,c,h,I[c],a);if(u)o||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),Hn(e.type=="template"?t.content:t,Fe(m)?m:[m],e,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,s,i?i[0]:n.__k&&Ne(n,0),o,l),i!=null)for(c=i.length;c--;)jt(i[c]);o||(c="value",y=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[c]||y=="progress"&&!x||y=="option"&&x!=I[c])&&at(t,c,x,I[c],a),c="checked",_!=null&&_!=t[c]&&at(t,c,_,I[c],a))}return t}function Zt(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(a){N.__e(a,n)}}function qn(t,e,n){var r,a;if(N.unmount&&N.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Zt(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){N.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(a=0;a<r.length;a++)r[a]&&qn(r[a],e,n||typeof t.type!="function");n||jt(t.__e),t.__c=t.__=t.__e=void 0}function Js(t,e,n){return this.constructor(t,n)}function er(t,e,n){var r,a,i,s;e==document&&(e=document.documentElement),N.__&&N.__(t,e),a=(r=!1)?null:e.__k,i=[],s=[],Ot(e,t=e.__k=We(X,null,[t]),a||qe,qe,e.namespaceURI,a?null:e.firstChild?Qe.call(e.childNodes):null,i,a?a.__e:e.firstChild,r,s),Kn(i,t,s)}Qe=et.slice,N={__e:function(t,e,n,r){for(var a,i,s;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,r||{}),s=a.__d),s)return a.__E=a}catch(o){t=o}throw t}},Wn=0,ce.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof t=="function"&&(t=t(oe({},n),this.props)),t&&oe(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Gn(this))},ce.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Gn(this))},ce.prototype.render=X,ve=[],Un=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zn=function(t,e){return t.__v.__b-e.__v.__b},nt.__r=0,Dn=/(PointerCapture)$|Capture$/i,Rt=0,Et=Jn(!1),Mt=Jn(!0);var $e,j,Vt,tr,it=0,nr=[],P=N,rr=P.__b,ar=P.__r,ir=P.diffed,sr=P.__c,or=P.unmount,cr=P.__;function Ft(t,e){P.__h&&P.__h(j,t,it||e),it=0;var n=j.__H||(j.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function st(t){return it=1,Ks(ur,t)}function Ks(t,e,n){var r=Ft($e++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):ur(void 0,e),function(o){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,o);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var a=function(o,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(m){return m.__c});if(u.every(function(m){return!m.__N}))return!i||i.call(this,o,l,c);var d=r.__c.props!==o;return u.some(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),i&&i.call(this,o,l,c)||d};j.__f=!0;var i=j.shouldComponentUpdate,s=j.componentWillUpdate;j.componentWillUpdate=function(o,l,c){if(this.__e){var u=i;i=void 0,a(o,l,c),i=u}s&&s.call(this,o,l,c)},j.shouldComponentUpdate=a}return r.__N||r.__}function ot(t,e){var n=Ft($e++,3);!P.__s&&dr(n.__H,e)&&(n.__=t,n.u=e,j.__H.__h.push(n))}function ct(t){return it=5,Qs(function(){return{current:t}},[])}function Qs(t,e){var n=Ft($e++,7);return dr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qs(){for(var t;t=nr.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(lt),e.__h.some(Wt),e.__h=[]}catch(n){e.__h=[],P.__e(n,t.__v)}}}P.__b=function(t){j=null,rr&&rr(t)},P.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),cr&&cr(t,e)},P.__r=function(t){ar&&ar(t),$e=0;var e=(j=t.__c).__H;e&&(Vt===j?(e.__h=[],j.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(lt),e.__h.some(Wt),e.__h=[],$e=0)),Vt=j},P.diffed=function(t){ir&&ir(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(nr.push(e)!==1&&tr===P.requestAnimationFrame||((tr=P.requestAnimationFrame)||eo)(qs)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Vt=j=null},P.__c=function(t,e){e.some(function(n){try{n.__h.some(lt),n.__h=n.__h.filter(function(r){return!r.__||Wt(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],P.__e(r,n.__v)}}),sr&&sr(t,e)},P.unmount=function(t){or&&or(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{lt(r)}catch(a){e=a}}),n.__H=void 0,e&&P.__e(e,n.__v))};var lr=typeof requestAnimationFrame=="function";function eo(t){var e,n=function(){clearTimeout(r),lr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);lr&&(e=requestAnimationFrame(n))}function lt(t){var e=j,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),j=e}function Wt(t){var e=j;t.__c=t.__(),j=e}function dr(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function ur(t,e){return typeof e=="function"?e(t):e}function to(t,e){for(var n in e)t[n]=e[n];return t}function fr(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function hr(t,e){this.props=t,this.context=e}(hr.prototype=new ce).isPureReactComponent=!0,hr.prototype.shouldComponentUpdate=function(t,e){return fr(this.props,t)||fr(this.state,e)};var mr=N.__b;N.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),mr&&mr(t)};var no=N.__e;N.__e=function(t,e,n,r){if(t.then){for(var a,i=e;i=i.__;)if((a=i.__c)&&a.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),a.__c(t,e)}no(t,e,n,r)};var pr=N.unmount;function gr(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=to({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return gr(r,e,n)})),t}function _r(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return _r(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function $t(){this.__u=0,this.o=null,this.__b=null}function vr(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function dt(){this.i=null,this.l=null}N.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),pr&&pr(t)},($t.prototype=new ce).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=vr(r.__v),i=!1,s=function(){i||r.__z||(i=!0,n.__R=null,a?a(l):l())};n.__R=s;var o=n.__P;n.__P=null;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=_r(c,c.__c.__P,c.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=o,u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(s,s)},$t.prototype.componentWillUnmount=function(){this.o=[]},$t.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=gr(this.__b,n,r.__O=r.__P)}this.__b=null}var a=e.__a&&We(X,null,t.fallback);return a&&(a.__u&=-33),[We(X,null,e.__a?null:t.children),a]};var yr=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(dt.prototype=new ce).__a=function(t){var e=this,n=vr(e.__v),r=e.l.get(t);return r[0]++,function(a){var i=function(){e.props.revealOrder?(r.push(a),yr(e,t,r)):a()};n?n(i):i()}},dt.prototype.render=function(t){this.i=null,this.l=new Map;var e=rt(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},dt.prototype.componentDidUpdate=dt.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){yr(t,n,e)})};var ro=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ao=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,io=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,so=/[A-Z0-9]/g,oo=typeof document<"u",co=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function lo(t,e,n){return e.__k==null&&(e.textContent=""),er(t,e),typeof n=="function"&&n(),t?t.__c:null}ce.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ce.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var kr=N.event;function uo(){}function fo(){return this.cancelBubble}function ho(){return this.defaultPrevented}N.event=function(t){return kr&&(t=kr(t)),t.persist=uo,t.isPropagationStopped=fo,t.isDefaultPrevented=ho,t.nativeEvent=t};var mo={enumerable:!1,configurable:!0,get:function(){return this.class}},br=N.vnode;N.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,a={},i=r.indexOf("-")===-1;for(var s in n){var o=n[s];if(!(s==="value"&&"defaultValue"in n&&o==null||oo&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&o===!0?o="":l==="translate"&&o==="no"?o=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||co(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":io.test(s)&&(s=l):l=s="oninput":i&&ao.test(s)?s=s.replace(so,"-$&").toLowerCase():o===null&&(o=void 0),l==="oninput"&&a[s=l]&&(s="oninputCapture"),a[s]=o}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=rt(n.children).forEach(function(c){c.props.selected=a.value.indexOf(c.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=rt(n.children).forEach(function(c){c.props.selected=a.multiple?a.defaultValue.indexOf(c.props.value)!=-1:a.defaultValue==c.props.value})),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",mo)):n.className&&(a.class=a.className=n.className),e.props=a}(t),t.$$typeof=ro,br&&br(t)};var xr=N.__r;N.__r=function(t){xr&&xr(t),t.__c};var wr=N.diffed;N.diffed=function(t){wr&&wr(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};function po(t){return!!t.__k&&(er(null,t),!0)}function go(t){return{render:function(e){lo(e,t)},unmount:function(){po(t)}}}function _o(t){const{theme:e}=t,n=[`--ak-accent: ${e.accentColor}`,`--ak-font: ${e.fontFamily}`,`--ak-radius: ${e.borderRadius}`];return n.push(`--ak-accent-hover: color-mix(in srgb, ${e.accentColor} 85%, black)`),`:host { ${n.join("; ")} }`}function vo(t){return t!=="system"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const yo=`
|
|
1
|
+
var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"});var A;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return e.objectValues(s)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},e.find=(a,i)=>{for(const s of a)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(A||(A={}));var or;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(or||(or={}));var v=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fe=e=>{switch(typeof e){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(e)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(e)?v.array:e===null?v.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?v.promise:typeof Map<"u"&&e instanceof Map?v.map:typeof Set<"u"&&e instanceof Set?v.set:typeof Date<"u"&&e instanceof Date?v.date:v.object;default:return v.unknown}},p=A.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ee=class Hn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,l=0;for(;l<s.path.length;){const c=s.path[l];l!==s.path.length-1?o[c]=o[c]||{_errors:[]}:(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(s))),o=o[c],l++}}};return a(this),n}static assert(t){if(!(t instanceof Hn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ee.create=e=>new ee(e);var Ne=(e,t)=>{let r;switch(e.code){case p.invalid_type:e.received===v.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,A.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${A.joinValues(e.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${A.joinValues(e.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${A.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:A.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case p.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case p.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=t.defaultError,A.assertNever(e)}return{message:r}},Qn=Ne;function yt(){return Qn}var bt=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:t,defaultError:o}).message;return{...a,path:i,message:o}};function g(e,t){const r=yt(),n=bt({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ne?void 0:Ne].filter(a=>!!a)});e.common.issues.push(n)}var $=class Gn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return w;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,s=await a.value;n.push({key:i,value:s})}return Gn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return w;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},w=Object.freeze({status:"aborted"}),Te=e=>({status:"dirty",value:e}),W=e=>({status:"valid",value:e}),cr=e=>e.status==="aborted",lr=e=>e.status==="dirty",ye=e=>e.status==="valid",$e=e=>typeof Promise<"u"&&e instanceof Promise,k;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(k||(k={}));var te=class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},dr=(e,t)=>{if(ye(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){return this._error?this._error:(this._error=new ee(e.common.issues),this._error)}}};function C(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(s,o)=>{const{message:l}=e;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:a}}var T=class{get description(){return this._def.description}_getType(e){return fe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $,ctx:{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if($e(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)};return dr(r,this._parseSync({data:e,path:r.path,parent:r}))}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return ye(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>ye(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)},n=this._parse({data:e,path:r.path,parent:r});return dr(r,await($e(n)?n:Promise.resolve(n)))}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),s=()=>a.addIssue({code:p.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(o=>o?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new ie({schema:this,typeName:S.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return se.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ke.create(this)}promise(){return Le.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return He.create(this,e,this._def)}transform(e){return new ie({...C(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ke({...C(this._def),innerType:this,defaultValue:t,typeName:S.ZodDefault})}brand(){return new mr({typeName:S.ZodBranded,type:this,...C(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Qe({...C(this._def),innerType:this,catchValue:t,typeName:S.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return pr.create(this,e)}readonly(){return qe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qn=/^c[^\s-]{8,}$/i,ea=/^[0-9a-z]+$/,ta=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ra=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,na=/^[a-z0-9_-]{21}$/i,aa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ia=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oa="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kt,ca=/^(?:(?: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])$/,la=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,da=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ua=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fa=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ha=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ur="((\\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])))",ma=new RegExp(`^${ur}$`);function fr(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function pa(e){return new RegExp(`^${fr(e)}$`)}function ga(e){let t=`${ur}T${fr(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function _a(e,t){return!!((t==="v4"||!t)&&ca.test(e)||(t==="v6"||!t)&&da.test(e))}function va(e,t){if(!aa.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function ya(e,t){return!!((t==="v4"||!t)&&la.test(e)||(t==="v6"||!t)&&ua.test(e))}var Ue=class We extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==v.string){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.string,received:a.parsedType}),w}const r=new $;let n;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,s=t.data.length<a.value;(i||s)&&(n=this._getOrReturnCtx(t,n),i?g(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&g(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")sa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"email",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")kt||(kt=new RegExp(oa,"u")),kt.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"emoji",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")ra.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"uuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")na.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"nanoid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")qn.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")ea.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid2",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")ta.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ulid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),g(n,{validation:"url",code:p.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"regex",code:p.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?ga(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?ma.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?pa(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?ia.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"duration",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?_a(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ip",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?va(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"jwt",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?ya(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cidr",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?fa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?ha.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64url",code:p.invalid_string,message:a.message}),r.dirty()):A.assertNever(a);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:p.invalid_string,...k.errToObj(n)})}_addCheck(t){return new We({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...k.errToObj(t)})}url(t){return this._addCheck({kind:"url",...k.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...k.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...k.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...k.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...k.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...k.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...k.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...k.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...k.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...k.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...k.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...k.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...k.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...k.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...k.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...k.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...k.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...k.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...k.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...k.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...k.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...k.errToObj(r)})}nonempty(t){return this.min(1,k.errToObj(t))}trim(){return new We({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new We({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new We({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ue.create=e=>new Ue({checks:[],typeName:S.ZodString,coerce:e?.coerce??!1,...C(e)});function ba(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}var xt=class rr extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==v.number){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.number,received:a.parsedType}),w}let r;const n=new $;for(const a of this._def.checks)a.kind==="int"?A.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:p.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?ba(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_finite,message:a.message}),n.dirty()):A.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new rr({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new rr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:k.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:k.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&A.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};xt.create=e=>new xt({checks:[],typeName:S.ZodNumber,coerce:e?.coerce||!1,...C(e)});var wt=class nr extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==v.bigint)return this._getInvalidInput(t);let r;const n=new $;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):A.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return g(r,{code:p.invalid_type,expected:v.bigint,received:r.parsedType}),w}gte(t,r){return this.setLimit("min",t,!0,k.toString(r))}gt(t,r){return this.setLimit("min",t,!1,k.toString(r))}lte(t,r){return this.setLimit("max",t,!0,k.toString(r))}lt(t,r){return this.setLimit("max",t,!1,k.toString(r))}setLimit(t,r,n,a){return new nr({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(t){return new nr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:k.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wt.create=e=>new wt({checks:[],typeName:S.ZodBigInt,coerce:e?.coerce??!1,...C(e)});var St=class extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.boolean,received:t.parsedType}),w}return W(e.data)}};St.create=e=>new St({typeName:S.ZodBoolean,coerce:e?.coerce||!1,...C(e)});var Ct=class Yn extends T{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==v.date){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.date,received:a.parsedType}),w}if(Number.isNaN(t.data.getTime()))return g(this._getOrReturnCtx(t),{code:p.invalid_date}),w;const r=new $;let n;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):A.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Yn({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:k.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:k.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ct.create=e=>new Ct({checks:[],coerce:e?.coerce||!1,typeName:S.ZodDate,...C(e)});var It=class extends T{_parse(e){if(this._getType(e)!==v.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.symbol,received:t.parsedType}),w}return W(e.data)}};It.create=e=>new It({typeName:S.ZodSymbol,...C(e)});var De=class extends T{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.undefined,received:t.parsedType}),w}return W(e.data)}};De.create=e=>new De({typeName:S.ZodUndefined,...C(e)});var ze=class extends T{_parse(e){if(this._getType(e)!==v.null){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.null,received:t.parsedType}),w}return W(e.data)}};ze.create=e=>new ze({typeName:S.ZodNull,...C(e)});var Nt=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return W(e.data)}};Nt.create=e=>new Nt({typeName:S.ZodAny,...C(e)});var be=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return W(e.data)}};be.create=e=>new be({typeName:S.ZodUnknown,...C(e)});var he=class extends T{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.never,received:t.parsedType}),w}};he.create=e=>new he({typeName:S.ZodNever,...C(e)});var Tt=class extends T{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.void,received:t.parsedType}),w}return W(e.data)}};Tt.create=e=>new Tt({typeName:S.ZodVoid,...C(e)});var ke=class gt extends T{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==v.array)return g(r,{code:p.invalid_type,expected:v.array,received:r.parsedType}),w;if(a.exactLength!==null){const s=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(s||o)&&(g(r,{code:s?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(g(r,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(g(r,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>a.type._parseAsync(new te(r,s,r.path,o)))).then(s=>$.mergeArray(n,s));const i=[...r.data].map((s,o)=>a.type._parseSync(new te(r,s,r.path,o)));return $.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new gt({...this._def,minLength:{value:t,message:k.toString(r)}})}max(t,r){return new gt({...this._def,maxLength:{value:t,message:k.toString(r)}})}length(t,r){return new gt({...this._def,exactLength:{value:t,message:k.toString(r)}})}nonempty(t){return this.min(1,t)}};ke.create=(e,t)=>new ke({type:e,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...C(t)});function xe(e){if(e instanceof H){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=se.create(xe(n))}return new H({...e._def,shape:()=>t})}else return e instanceof ke?new ke({...e._def,type:xe(e.element)}):e instanceof se?se.create(xe(e.unwrap())):e instanceof _e?_e.create(xe(e.unwrap())):e instanceof ge?ge.create(e.items.map(t=>xe(t))):e}var H=class q extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape();return this._cached={shape:t,keys:A.objectKeys(t)},this._cached}_parse(t){if(this._getType(t)!==v.object){const l=this._getOrReturnCtx(t);return g(l,{code:p.invalid_type,expected:v.object,received:l.parsedType}),w}const{status:r,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof he&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||s.push(l);const o=[];for(const l of i){const c=a[l],u=n.data[l];o.push({key:{status:"valid",value:l},value:c._parse(new te(n,u,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof he){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)o.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(l==="strict")s.length>0&&(g(n,{code:p.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const u=n.data[c];o.push({key:{status:"valid",value:c},value:l._parse(new te(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of o){const u=await c.key,d=await c.value;l.push({key:u,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>$.mergeObjectSync(r,l)):$.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return k.errToObj,new q({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new q({...this._def,unknownKeys:"strip"})}passthrough(){return new q({...this._def,unknownKeys:"passthrough"})}extend(t){return new q({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new q({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:S.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new q({...this._def,catchall:t})}pick(t){const r={};for(const n of A.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new q({...this._def,shape:()=>r})}omit(t){const r={};for(const n of A.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new q({...this._def,shape:()=>r})}deepPartial(){return xe(this)}partial(t){const r={};for(const n of A.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new q({...this._def,shape:()=>r})}required(t){const r={};for(const n of A.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof se;)a=a._def.innerType;r[n]=a}return new q({...this._def,shape:()=>r})}keyof(){return hr(A.objectKeys(this.shape))}};H.create=(e,t)=>new H({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...C(t)}),H.strictCreate=(e,t)=>new H({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:S.ZodObject,...C(t)}),H.lazycreate=(e,t)=>new H({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...C(t)});var Be=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const i=a.map(s=>new ee(s.ctx.common.issues));return g(t,{code:p.invalid_union,unionErrors:i}),w}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const o of r){const l={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(o=>new ee(o));return g(t,{code:p.invalid_union,unionErrors:s}),w}}get options(){return this._def.options}};Be.create=(e,t)=>new Be({options:e,typeName:S.ZodUnion,...C(t)});var ae=e=>e instanceof Ge?ae(e.schema):e instanceof ie?ae(e.innerType()):e instanceof Ye?[e.value]:e instanceof Xe?e.options:e instanceof Je?A.objectValues(e.enum):e instanceof Ke?ae(e._def.innerType):e instanceof De?[void 0]:e instanceof ze?[null]:e instanceof se?[void 0,...ae(e.unwrap())]:e instanceof _e?[null,...ae(e.unwrap())]:e instanceof mr||e instanceof qe?ae(e.unwrap()):e instanceof Qe?ae(e._def.innerType):[],ka=class Xn extends T{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.object)return g(r,{code:p.invalid_type,expected:v.object,received:r.parsedType}),w;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const i of r){const s=ae(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const o of s){if(a.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);a.set(o,i)}}return new Xn({typeName:S.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...C(n)})}};function Lt(e,t){const r=fe(e),n=fe(t);if(e===t)return{valid:!0,data:e};if(r===v.object&&n===v.object){const a=A.objectKeys(t),i=A.objectKeys(e).filter(o=>a.indexOf(o)!==-1),s={...e,...t};for(const o of i){const l=Lt(e[o],t[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(r===v.array&&n===v.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const s=e[i],o=t[i],l=Lt(s,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return r===v.date&&n===v.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var He=class extends T{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(cr(a)||cr(i))return w;const s=Lt(a.value,i.value);return s.valid?((lr(a)||lr(i))&&t.dirty(),{status:t.value,value:s.data}):(g(r,{code:p.invalid_intersection_types}),w)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};He.create=(e,t,r)=>new He({left:e,right:t,typeName:S.ZodIntersection,...C(r)});var ge=class Jn extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.array)return g(n,{code:p.invalid_type,expected:v.array,received:n.parsedType}),w;if(n.data.length<this._def.items.length)return g(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,s)=>{const o=this._def.items[s]||this._def.rest;return o?o._parse(new te(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>$.mergeArray(r,i)):$.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Jn({...this._def,rest:t})}};ge.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:e,typeName:S.ZodTuple,rest:null,...C(t)})};var xa=class ar extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.object)return g(n,{code:p.invalid_type,expected:v.object,received:n.parsedType}),w;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in n.data)a.push({key:i._parse(new te(n,o,n.path,o)),value:s._parse(new te(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?$.mergeObjectAsync(r,a):$.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new ar({keyType:t,valueType:r,typeName:S.ZodRecord,...C(n)}):new ar({keyType:Ue.create(),valueType:t,typeName:S.ZodRecord,...C(r)})}},At=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.map)return g(r,{code:p.invalid_type,expected:v.map,received:r.parsedType}),w;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([s,o],l)=>({key:n._parse(new te(r,s,r.path,[l,"key"])),value:a._parse(new te(r,o,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const o of i){const l=await o.key,c=await o.value;if(l.status==="aborted"||c.status==="aborted")return w;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),s.set(l.value,c.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const o of i){const l=o.key,c=o.value;if(l.status==="aborted"||c.status==="aborted")return w;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),s.set(l.value,c.value)}return{status:t.value,value:s}}}};At.create=(e,t,r)=>new At({valueType:t,keyType:e,typeName:S.ZodMap,...C(r)});var Rt=class ir extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.set)return g(n,{code:p.invalid_type,expected:v.set,received:n.parsedType}),w;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(g(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(g(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return w;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const o=[...n.data.values()].map((l,c)=>i._parse(new te(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(t,r){return new ir({...this._def,minSize:{value:t,message:k.toString(r)}})}max(t,r){return new ir({...this._def,maxSize:{value:t,message:k.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Rt.create=(e,t)=>new Rt({valueType:e,minSize:null,maxSize:null,typeName:S.ZodSet,...C(t)});var wa=class _t extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.function)return g(r,{code:p.invalid_type,expected:v.function,received:r.parsedType}),w;function n(o,l){return bt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yt(),Ne].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function a(o,l){return bt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yt(),Ne].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Le){const o=this;return W(async function(...l){const c=new ee([]),u=await o._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(n(l,m)),c}),d=await Reflect.apply(s,this,u);return await o._def.returns._def.type.parseAsync(d,i).catch(m=>{throw c.addIssue(a(d,m)),c})})}else{const o=this;return W(function(...l){const c=o._def.args.safeParse(l,i);if(!c.success)throw new ee([n(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=o._def.returns.safeParse(u,i);if(!d.success)throw new ee([a(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new _t({...this._def,args:ge.create(t).rest(be.create())})}returns(t){return new _t({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new _t({args:t||ge.create([]).rest(be.create()),returns:r||be.create(),typeName:S.ZodFunction,...C(n)})}},Ge=class extends T{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ge.create=(e,t)=>new Ge({getter:e,typeName:S.ZodLazy,...C(t)});var Ye=class extends T{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ye.create=(e,t)=>new Ye({value:e,typeName:S.ZodLiteral,...C(t)});function hr(e,t){return new Xe({values:e,typeName:S.ZodEnum,...C(t)})}var Xe=class sr extends T{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{expected:A.joinValues(n),received:r.parsedType,code:p.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),w}return W(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return sr.create(t,{...this._def,...r})}exclude(t,r=this._def){return sr.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Xe.create=hr;var Je=class extends T{_parse(e){const t=A.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==v.string&&r.parsedType!==v.number){const n=A.objectValues(t);return g(r,{expected:A.joinValues(n),received:r.parsedType,code:p.invalid_type}),w}if(this._cache||(this._cache=new Set(A.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=A.objectValues(t);return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),w}return W(e.data)}get enum(){return this._def.values}};Je.create=(e,t)=>new Je({values:e,typeName:S.ZodNativeEnum,...C(t)});var Le=class extends T{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);return t.parsedType!==v.promise&&t.common.async===!1?(g(t,{code:p.invalid_type,expected:v.promise,received:t.parsedType}),w):W((t.parsedType===v.promise?t.data:Promise.resolve(t.data)).then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Le.create=(e,t)=>new Le({type:e,typeName:S.ZodPromise,...C(t)});var ie=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===S.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{g(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async s=>{if(t.value==="aborted")return w;const o=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return o.status==="aborted"?w:o.status==="dirty"||t.value==="dirty"?Te(o.value):o});{if(t.value==="aborted")return w;const s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?w:s.status==="dirty"||t.value==="dirty"?Te(s.value):s}}if(n.type==="refinement"){const i=s=>{const o=n.refinement(s,a);if(r.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?w:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?w:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ye(i))return w;const s=n.transform(i.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ye(i)?Promise.resolve(n.transform(i.value,a)).then(s=>({status:t.value,value:s})):w);A.assertNever(n)}};ie.create=(e,t,r)=>new ie({schema:e,typeName:S.ZodEffects,effect:t,...C(r)}),ie.createWithPreprocess=(e,t,r)=>new ie({schema:t,effect:{type:"preprocess",transform:e},typeName:S.ZodEffects,...C(r)});var se=class extends T{_parse(e){return this._getType(e)===v.undefined?W(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};se.create=(e,t)=>new se({innerType:e,typeName:S.ZodOptional,...C(t)});var _e=class extends T{_parse(e){return this._getType(e)===v.null?W(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_e.create=(e,t)=>new _e({innerType:e,typeName:S.ZodNullable,...C(t)});var Ke=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===v.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ke.create=(e,t)=>new Ke({innerType:e,typeName:S.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...C(t)});var Qe=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $e(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ee(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ee(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Qe.create=(e,t)=>new Qe({innerType:e,typeName:S.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...C(t)});var Zt=class extends T{_parse(e){if(this._getType(e)!==v.nan){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.nan,received:t.parsedType}),w}return{status:"valid",value:e.data}}};Zt.create=e=>new Zt({typeName:S.ZodNaN,...C(e)});var mr=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},pr=class Kn extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?w:i.status==="dirty"?(r.dirty(),Te(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?w:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new Kn({in:t,out:r,typeName:S.ZodPipeline})}},qe=class extends T{_parse(e){const t=this._def.innerType._parse(e),r=n=>(ye(n)&&(n.value=Object.freeze(n.value)),n);return $e(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};qe.create=(e,t)=>new qe({innerType:e,typeName:S.ZodReadonly,...C(t)});var ac={object:H.lazycreate},S;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(S||(S={}));var P=Ue.create,ic=xt.create,sc=Zt.create,oc=wt.create,Sa=St.create,cc=Ct.create,lc=It.create,dc=De.create,uc=ze.create,fc=Nt.create,Ca=be.create,hc=he.create,mc=Tt.create,pc=ke.create,gr=H.create,gc=H.strictCreate,_c=Be.create,vc=ka.create,yc=He.create,bc=ge.create,Ia=xa.create,kc=At.create,xc=Rt.create,wc=wa.create,Sc=Ge.create,Cc=Ye.create,_r=Xe.create,Ic=Je.create,Nc=Le.create,Tc=ie.create,Lc=se.create,Ac=_e.create,Rc=ie.createWithPreprocess,Zc=pr.create,Na=gr({mode:_r(["light","dark","system"]).optional(),accentColor:P().optional(),fontFamily:P().optional(),borderRadius:P().optional()}),vr=gr({agentId:P().min(1,"agentId is required"),apiBaseUrl:P().url("apiBaseUrl must be a valid URL"),tenantId:P().optional(),userId:P().optional(),name:P().optional(),email:P().optional(),authUserId:P().optional(),sessionId:P().optional(),mode:_r(["floating","inline"]).optional(),title:P().optional(),subtitle:P().optional(),greeting:P().optional(),avatarUrl:P().optional(),privacyPolicyUrl:P().optional(),streaming:Sa().optional(),metadata:Ia(Ca()).optional(),theme:Na.optional()}),Ta=vr.omit({agentId:!0,apiBaseUrl:!0}).partial(),ve={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Ae(e,t){vr.parse(e);let r;const n=t?{...t}:void 0;n&&typeof n.theme=="object"&&n.theme!==null?(r=n.theme,delete n.theme):n&&typeof n.theme=="string"&&(r={mode:n.theme},delete n.theme);const a=n?Ta.passthrough().safeParse(n).data:void 0,i=a?yr(a,e):e,s={mode:i.theme?.mode??r?.mode??ve.theme.mode,accentColor:i.theme?.accentColor??r?.accentColor??ve.theme.accentColor,fontFamily:i.theme?.fontFamily??r?.fontFamily??ve.theme.fontFamily,borderRadius:i.theme?.borderRadius??r?.borderRadius??ve.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,userId:i.userId,name:i.name,email:i.email,authUserId:i.authUserId,sessionId:i.sessionId,mode:i.mode??ve.mode,title:i.title??ve.title,subtitle:i.subtitle,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??ve.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:a?.thinkingEnabled===!0,thinkingViewable:a?.thinkingViewable===!0}}function yr(e,t){const r={...e};for(const n of Object.keys(t)){const a=t[n];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&r[n]!==null&&typeof r[n]=="object"?r[n]=yr(r[n],a):r[n]=a)}return r}var Et=function(){return Et=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Et.apply(this,arguments)};function re(e,t,r,n){function a(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function o(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):a(u.value).then(o,l)}c((n=n.apply(e,t||[])).next())})}function ne(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,a=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function br(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var kr="4.6.2";function et(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function La(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Aa(e,t){t===void 0&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(n){return r.call(window,function(){return n()},{timeout:t})}):et(Math.min(e,t))}function xr(e){return!!e&&typeof e.then=="function"}function wr(e,t){try{var r=e();xr(r)?r.then(function(n){return t(!0,n)},function(n){return t(!1,n)}):t(!0,r)}catch(n){t(!1,n)}}function Sr(e,t,r){return r===void 0&&(r=16),re(this,void 0,void 0,function(){var n,a,i,s;return ne(this,function(o){switch(o.label){case 0:n=Array(e.length),a=Date.now(),i=0,o.label=1;case 1:return i<e.length?(n[i]=t(e[i],i),s=Date.now(),s>=a+r?(a=s,[4,La()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,n]}})})}function Re(e){return e.then(void 0,function(){}),e}function Ra(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}function Za(e,t){return!Ra(e,t)}function Mt(e){return parseInt(e)}function G(e){return parseFloat(e)}function oe(e,t){return typeof e=="number"&&isNaN(e)?t:e}function V(e){return e.reduce(function(t,r){return t+(r?1:0)},0)}function Cr(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function Ea(e){for(var t,r,n="Unexpected syntax '".concat(e,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,l=function(m,h){s[m]=s[m]||[],s[m].push(h)};;){var c=o.exec(a[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(r=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&r!==void 0?r:"");else throw new Error(n);break;default:throw new Error(n)}}return[i,s]}function Ma(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>127)return new TextEncoder().encode(e);t[r]=n}return t}function me(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,m=0,h=0;h+=i+c,m+=h>>>16,h&=65535,m+=a+l,d+=m>>>16,m&=65535,d+=n+o,u+=d>>>16,d&=65535,u+=r+s,u&=65535,e[0]=u<<16|d,e[1]=m<<16|h}function B(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,m=0,h=0;h+=i*c,m+=h>>>16,h&=65535,m+=a*c,d+=m>>>16,m&=65535,m+=i*l,d+=m>>>16,m&=65535,d+=n*c,u+=d>>>16,d&=65535,d+=a*l,u+=d>>>16,d&=65535,d+=i*o,u+=d>>>16,d&=65535,u+=r*c+n*l+a*o+i*s,u&=65535,e[0]=u<<16|d,e[1]=m<<16|h}function we(e,t){var r=e[0];t%=64,t===32?(e[0]=e[1],e[1]=r):t<32?(e[0]=r<<t|e[1]>>>32-t,e[1]=e[1]<<t|r>>>32-t):(t-=32,e[0]=e[1]<<t|r>>>32-t,e[1]=r<<t|e[1]>>>32-t)}function U(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function E(e,t){e[0]^=t[0],e[1]^=t[1]}var ja=[4283543511,3981806797],Oa=[3301882366,444984403];function Ir(e){var t=[0,e[0]>>>1];E(e,t),B(e,ja),t[1]=e[0]>>>1,E(e,t),B(e,Oa),t[1]=e[0]>>>1,E(e,t)}var tt=[2277735313,289559509],rt=[1291169091,658871167],Nr=[0,5],Pa=[0,1390208809],Va=[0,944331445];function Fa(e,t){var r=Ma(e);t=t||0;var n=[0,r.length],a=n[1]%16,i=n[1]-a,s=[0,t],o=[0,t],l=[0,0],c=[0,0],u;for(u=0;u<i;u=u+16)l[0]=r[u+4]|r[u+5]<<8|r[u+6]<<16|r[u+7]<<24,l[1]=r[u]|r[u+1]<<8|r[u+2]<<16|r[u+3]<<24,c[0]=r[u+12]|r[u+13]<<8|r[u+14]<<16|r[u+15]<<24,c[1]=r[u+8]|r[u+9]<<8|r[u+10]<<16|r[u+11]<<24,B(l,tt),we(l,31),B(l,rt),E(s,l),we(s,27),me(s,o),B(s,Nr),me(s,Pa),B(c,rt),we(c,33),B(c,tt),E(o,c),we(o,31),me(o,s),B(o,Nr),me(o,Va);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(a){case 15:d[1]=r[u+14],U(d,48),E(c,d);case 14:d[1]=r[u+13],U(d,40),E(c,d);case 13:d[1]=r[u+12],U(d,32),E(c,d);case 12:d[1]=r[u+11],U(d,24),E(c,d);case 11:d[1]=r[u+10],U(d,16),E(c,d);case 10:d[1]=r[u+9],U(d,8),E(c,d);case 9:d[1]=r[u+8],E(c,d),B(c,rt),we(c,33),B(c,tt),E(o,c);case 8:d[1]=r[u+7],U(d,56),E(l,d);case 7:d[1]=r[u+6],U(d,48),E(l,d);case 6:d[1]=r[u+5],U(d,40),E(l,d);case 5:d[1]=r[u+4],U(d,32),E(l,d);case 4:d[1]=r[u+3],U(d,24),E(l,d);case 3:d[1]=r[u+2],U(d,16),E(l,d);case 2:d[1]=r[u+1],U(d,8),E(l,d);case 1:d[1]=r[u],E(l,d),B(l,tt),we(l,31),B(l,rt),E(s,l)}return E(s,n),E(o,n),me(s,o),me(o,s),Ir(s),Ir(o),me(s,o),me(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function Wa(e){var t;return Et({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
2
|
+
`)},e)}function $a(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Ua(e){return typeof e!="function"}function Da(e,t){var r=Re(new Promise(function(n){var a=Date.now();wr(e.bind(null,t),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return n(function(){return{error:i[1],duration:o}});var l=i[1];if(Ua(l))return n(function(){return{value:l,duration:o}});n(function(){return new Promise(function(c){var u=Date.now();wr(l,function(){for(var d=[],m=0;m<arguments.length;m++)d[m]=arguments[m];var h=o+Date.now()-u;if(!d[0])return c({error:d[1],duration:h});c({value:d[1],duration:h})})})})})}));return function(){return r.then(function(a){return a()})}}function za(e,t,r,n){var a=Object.keys(e).filter(function(s){return Za(r,s)}),i=Re(Sr(a,function(s){return Da(e[s],t)},n));return function(){return re(this,void 0,void 0,function(){var o,l,c,u,d;return ne(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,Sr(o,function(h){return Re(h())},n)];case 2:return l=m.sent(),[4,Promise.all(l)];case 3:for(c=m.sent(),u={},d=0;d<a.length;++d)u[a[d]]=c[d];return[2,u]}})})}}function Tr(){var e=window,t=navigator;return V(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Ba(){var e=window,t=navigator;return V(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Tr()}function Ze(){var e=window,t=navigator;return V(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Y(){var e=window,t=navigator;return V(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function jt(){var e=window,t=e.HTMLElement,r=e.Document;return V(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),r&&"pointerLockElement"in r.prototype])>=4}function Ee(){var e=window;return $a(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Lr(){var e,t,r=window;return V(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function Ha(){var e=window;return V([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Ga(){var e=window,t=e.URLPattern;return V(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Ya(){var e=window;return V(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Me(){var e=window,t=navigator,r=e.CSS,n=e.HTMLButtonElement;return V([!("getStorageUpdates"in t),n&&"popover"in n.prototype,"CSSCounterStyleRule"in e,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function Xa(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return V(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Ja(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Ka(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ot(){var e=Ze(),t=Lr(),r=window,n=navigator,a="connection";return e?V([!("SharedWorker"in r),n[a]&&"ontypechange"in n[a],!("sinkId"in new Audio)])>=2:t?V(["onorientationchange"in r,"orientation"in r,/android/i.test(n.appVersion)])>=2:!1}function Qa(){var e=navigator,t=window,r=Audio.prototype,n=t.visualViewport;return V(["srLatency"in r,"srChannelCount"in r,"devicePosture"in e,n&&"segments"in n,"getTextInformation"in Image.prototype])>=3}function qa(){return ri()?-4:ei()}function ei(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ti())return-1;var r=4500,n=new t(1,5e3,44100),a=n.createOscillator();a.type="triangle",a.frequency.value=1e4;var i=n.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,a.connect(i),i.connect(n.destination),a.start(0);var s=ni(n),o=s[0],l=s[1],c=Re(o.then(function(u){return ai(u.getChannelData(0).subarray(r))},function(u){if(u.name==="timeout"||u.name==="suspended")return-3;throw u}));return function(){return l(),c}}function ti(){return Y()&&!jt()&&!Ya()}function ri(){return Y()&&Me()&&Ee()||Ze()&&Qa()&&Ga()}function ni(e){var t=3,r=500,n=500,a=5e3,i=function(){};return[new Promise(function(s,o){var l=!1,c=0,u=0;e.oncomplete=function(h){return s(h.renderedBuffer)};var d=function(){setTimeout(function(){return o(Ar("timeout"))},Math.min(n,u+a-Date.now()))},m=function(){try{var h=e.startRendering();switch(xr(h)&&Re(h),e.state){case"running":u=Date.now(),l&&d();break;case"suspended":document.hidden||c++,l&&c>=t?o(Ar("suspended")):setTimeout(m,r);break}}catch(x){o(x)}};m(),i=function(){l||(l=!0,u>0&&d())}}),i]}function ai(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function Ar(e){var t=new Error(e);return t.name=e,t}function Rr(e,t,r){var n,a,i;return r===void 0&&(r=50),re(this,void 0,void 0,function(){var s,o;return ne(this,function(l){switch(l.label){case 0:s=document,l.label=1;case 1:return s.body?[3,3]:[4,et(r)];case 2:return l.sent(),[3,1];case 3:o=s.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(c,u){var d=!1,m=function(){d=!0,c()},h=function(N){d=!0,u(N)};o.onload=m,o.onerror=h;var x=o.style;x.setProperty("display","block","important"),x.position="absolute",x.top="0",x.left="0",x.visibility="hidden",t&&"srcdoc"in o?o.srcdoc=t:o.src="about:blank",s.body.appendChild(o);var b=function(){var N,y;d||(((y=(N=o.contentWindow)===null||N===void 0?void 0:N.document)===null||y===void 0?void 0:y.readyState)==="complete"?m():setTimeout(b,10))};b()})];case 5:l.sent(),l.label=6;case 6:return!((a=(n=o.contentWindow)===null||n===void 0?void 0:n.document)===null||a===void 0)&&a.body?[3,8]:[4,et(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(o,o.contentWindow)];case 9:return[2,l.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function ii(e){for(var t=Ea(e),r=t[0],n=t[1],a=document.createElement(r??"div"),i=0,s=Object.keys(n);i<s.length;i++){var o=s[i],l=n[o].join(" ");o==="style"?si(a.style,l):a.setAttribute(o,l)}return a}function si(e,t){for(var r=0,n=t.split(";");r<n.length;r++){var a=n[r],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],l=i[4];e.setProperty(s,o,l||"")}}}function oi(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(r){if(r instanceof Error&&r.name==="SecurityError")return!0;throw r}e=t}}var ci="mmMwWLliI0O&1",li="48px",Se=["monospace","sans-serif","serif"],Zr=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function di(){var e=this;return Rr(function(t,r){var n=r.document;return re(e,void 0,void 0,function(){var a,i,s,o,l,c,u,d,m,h,x,b;return ne(this,function(N){for(a=n.body,a.style.fontSize=li,i=n.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},l=function(y){var _=n.createElement("span"),L=_.style;return L.position="absolute",L.top="0",L.left="0",L.fontFamily=y,_.textContent=ci,i.appendChild(_),_},c=function(y,_){return l("'".concat(y,"',").concat(_))},u=function(){return Se.map(l)},d=function(){for(var y={},_=function(K){y[K]=Se.map(function(Q){return c(K,Q)})},L=0,O=Zr;L<O.length;L++){var D=O[L];_(D)}return y},m=function(y){return Se.some(function(_,L){return y[L].offsetWidth!==s[_]||y[L].offsetHeight!==o[_]})},h=u(),x=d(),a.appendChild(i),b=0;b<Se.length;b++)s[Se[b]]=h[b].offsetWidth,o[Se[b]]=h[b].offsetHeight;return[2,Zr.filter(function(y){return m(x[y])})]})})})}function ui(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];if(n){for(var a=[],i=0;i<n.length;++i){var s=n[i];a.push({type:s.type,suffixes:s.suffixes})}t.push({name:n.name,description:n.description,mimeTypes:a})}}return t}}function fi(){return hi(bi())}function hi(e){var t,r=!1,n,a,i=mi(),s=i[0],o=i[1];return pi(s,o)?(r=gi(o),e?n=a="skipped":(t=_i(s,o),n=t[0],a=t[1])):n=a="unsupported",{winding:r,geometry:n,text:a}}function mi(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function pi(e,t){return!!(t&&e.toDataURL)}function gi(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function _i(e,t){vi(e,t);var r=Pt(e);return r!==Pt(e)?["unstable","unstable"]:(yi(e,t),[Pt(e),r])}function vi(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat("😃");t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}function yi(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var a=n[r],i=a[0],s=a[1],o=a[2];t.fillStyle=i,t.beginPath(),t.arc(s,o,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Pt(e){return e.toDataURL()}function bi(){return Y()&&Me()&&Ee()}function ki(){var e=navigator,t=0,r;e.maxTouchPoints!==void 0?t=Mt(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),r=!0}catch{r=!1}var n="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:r,touchStart:n}}function xi(){return navigator.oscpu}function wi(){var e=navigator,t=[],r=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(r!==void 0&&t.push([r]),Array.isArray(e.languages))Ze()&&Ha()||t.push(e.languages);else if(typeof e.languages=="string"){var n=e.languages;n&&t.push(n.split(","))}return t}function Si(){return window.screen.colorDepth}function Ci(){return oe(G(navigator.deviceMemory),void 0)}function Ii(){if(!(Y()&&Me()&&Ee()))return Ni()}function Ni(){var e=screen,t=function(n){return oe(Mt(n),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r}var Ti=2500,Li=10,nt,Vt;function Ai(){if(Vt===void 0){var e=function(){var t=Ft();Wt(t)?Vt=setTimeout(e,Ti):(nt=t,Vt=void 0)};e()}}function Ri(){var e=this;return Ai(),function(){return re(e,void 0,void 0,function(){var t;return ne(this,function(r){switch(r.label){case 0:return t=Ft(),Wt(t)?nt?[2,br([],nt,!0)]:Ja()?[4,Ka()]:[3,2]:[3,2];case 1:r.sent(),t=Ft(),r.label=2;case 2:return Wt(t)||(nt=t),[2,t]}})})}}function Zi(){var e=this;if(Y()&&Me()&&Ee())return function(){return Promise.resolve(void 0)};var t=Ri();return function(){return re(e,void 0,void 0,function(){var r,n;return ne(this,function(a){switch(a.label){case 0:return[4,t()];case 1:return r=a.sent(),n=function(i){return i===null?null:Cr(i,Li)},[2,[n(r[0]),n(r[1]),n(r[2]),n(r[3])]]}})})}}function Ft(){var e=screen;return[oe(G(e.availTop),null),oe(G(e.width)-G(e.availWidth)-oe(G(e.availLeft),0),null),oe(G(e.height)-G(e.availHeight)-oe(G(e.availTop),0),null),oe(G(e.availLeft),null)]}function Wt(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Ei(){return oe(Mt(navigator.hardwareConcurrency),void 0)}function Mi(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var r=new t().resolvedOptions().timeZone;if(r)return r}var n=-ji();return"UTC".concat(n>=0?"+":"").concat(n)}function ji(){var e=new Date().getFullYear();return Math.max(G(new Date(e,0,1).getTimezoneOffset()),G(new Date(e,6,1).getTimezoneOffset()))}function Oi(){try{return!!window.sessionStorage}catch{return!0}}function Pi(){try{return!!window.localStorage}catch{return!0}}function Vi(){if(!(Tr()||Ba()))try{return!!window.indexedDB}catch{return!0}}function Fi(){return!!window.openDatabase}function Wi(){return navigator.cpuClass}function $i(){var e=navigator.platform;return e==="MacIntel"&&Y()&&!jt()?Xa()?"iPad":"iPhone":e}function Ui(){return navigator.vendor||""}function Di(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var n=r[t],a=window[n];a&&typeof a=="object"&&e.push(n)}return e.sort()}function zi(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Bi(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Hi(e){var t=(e===void 0?{}:e).debug;return re(this,void 0,void 0,function(){var r,n,a,i,s,o;return ne(this,function(l){switch(l.label){case 0:return Gi()?(r=Bi(),n=Object.keys(r),a=(o=[]).concat.apply(o,n.map(function(c){return r[c]})),[4,Yi(a)]):[2,void 0];case 1:return i=l.sent(),t&&Xi(r,i),s=n.filter(function(c){var u=r[c];return V(u.map(function(d){return i[d]}))>u.length*.6}),s.sort(),[2,s]}})})}function Gi(){return Y()||Ot()}function Yi(e){var t;return re(this,void 0,void 0,function(){var r,n,a,i,l,s,o,l;return ne(this,function(c){switch(c.label){case 0:for(r=document,n=r.createElement("div"),a=new Array(e.length),i={},Er(n),l=0;l<e.length;++l)s=ii(e[l]),s.tagName==="DIALOG"&&s.show(),o=r.createElement("div"),Er(o),o.appendChild(s),n.appendChild(o),a[l]=s;c.label=1;case 1:return r.body?[3,3]:[4,et(50)];case 2:return c.sent(),[3,1];case 3:r.body.appendChild(n);try{for(l=0;l<e.length;++l)a[l].offsetParent||(i[e[l]]=!0)}finally{(t=n.parentNode)===null||t===void 0||t.removeChild(n)}return[2,i]}})})}function Er(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Xi(e,t){for(var r="DOM blockers debug:\n```",n=0,a=Object.keys(e);n<a.length;n++){var i=a[n];r+=`
|
|
3
|
+
`.concat(i,":");for(var s=0,o=e[i];s<o.length;s++){var l=o[s];r+=`
|
|
4
|
+
`.concat(t[l]?"🚫":"➡️"," ").concat(l)}}}function Ji(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}}function Ki(){if(Mr("inverted"))return!0;if(Mr("none"))return!1}function Mr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Qi(){if(jr("active"))return!0;if(jr("none"))return!1}function jr(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var qi=100;function es(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=qi;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function ts(){if(Ce("no-preference"))return 0;if(Ce("high")||Ce("more"))return 1;if(Ce("low")||Ce("less"))return-1;if(Ce("forced"))return 10}function Ce(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function rs(){if(Or("reduce"))return!0;if(Or("no-preference"))return!1}function Or(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function ns(){if(Pr("reduce"))return!0;if(Pr("no-preference"))return!1}function Pr(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function as(){if(Vr("high"))return!0;if(Vr("standard"))return!1}function Vr(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Z=Math,F=function(){return 0};function is(){var e=Z.acos||F,t=Z.acosh||F,r=Z.asin||F,n=Z.asinh||F,a=Z.atanh||F,i=Z.atan||F,s=Z.sin||F,o=Z.sinh||F,l=Z.cos||F,c=Z.cosh||F,u=Z.tan||F,d=Z.tanh||F,m=Z.exp||F,h=Z.expm1||F,x=Z.log1p||F,b=function(R){return Z.pow(Z.PI,R)},N=function(R){return Z.log(R+Z.sqrt(R*R-1))},y=function(R){return Z.log(R+Z.sqrt(R*R+1))},_=function(R){return Z.log((1+R)/(1-R))/2},L=function(R){return Z.exp(R)-1/Z.exp(R)/2},O=function(R){return(Z.exp(R)+1/Z.exp(R))/2},D=function(R){return Z.exp(R)-1},K=function(R){return(Z.exp(2*R)-1)/(Z.exp(2*R)+1)},Q=function(R){return Z.log(1+R)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:N(1e154),asin:r(.12312423423423424),asinh:n(1),asinhPf:y(1),atanh:a(.5),atanhPf:_(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:L(1),cos:l(10.000000000123),cosh:c(1),coshPf:O(1),tan:u(-1e300),tanh:d(1),tanhPf:K(1),exp:m(1),expm1:h(1),expm1Pf:D(1),log1p:x(10),log1pPf:Q(10),powPI:b(-100)}}var ss="mmMwWLliI0fiflO&1",$t={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function os(){return cs(function(e,t){for(var r={},n={},a=0,i=Object.keys($t);a<i.length;a++){var s=i[a],o=$t[s],l=o[0],c=l===void 0?{}:l,u=o[1],d=u===void 0?ss:u,m=e.createElement("span");m.textContent=d,m.style.whiteSpace="nowrap";for(var h=0,x=Object.keys(c);h<x.length;h++){var b=x[h],N=c[b];N!==void 0&&(m.style[b]=N)}r[s]=m,t.append(e.createElement("br"),m)}for(var y=0,_=Object.keys($t);y<_.length;y++){var s=_[y];n[s]=r[s].getBoundingClientRect().width}return n})}function cs(e,t){return t===void 0&&(t=4e3),Rr(function(r,n){var a=n.document,i=a.body,s=i.style;s.width="".concat(t,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Ze()?i.style.zoom="".concat(1/n.devicePixelRatio):Y()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=br([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),e(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function ls(){return navigator.pdfViewerEnabled}function ds(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function us(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(fs())return-3;try{return e.canMakePayments()?1:0}catch(t){return hs(t)}}var fs=oi;function hs(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function ms(){var e,t=document.createElement("a"),r=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return r===void 0?void 0:String(r)}var Fr=-1,Wr=-2,ps=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),gs=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),_s=["FRAGMENT_SHADER","VERTEX_SHADER"],vs=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],$r="WEBGL_debug_renderer_info",ys="WEBGL_polygon_mode";function bs(e){var t,r,n,a,i,s,o=e.cache,l=Ur(o);if(!l)return Fr;if(!Br(l))return Wr;var c=zr()?null:l.getExtension($r);return{version:((t=l.getParameter(l.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((r=l.getParameter(l.VENDOR))===null||r===void 0?void 0:r.toString())||"",vendorUnmasked:c?(n=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||n===void 0?void 0:n.toString():"",renderer:((a=l.getParameter(l.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:c?(i=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function ks(e){var t=e.cache,r=Ur(t);if(!r)return Fr;if(!Br(r))return Wr;var n=r.getSupportedExtensions(),a=r.getContextAttributes(),i=[],s=[],o=[],l=[],c=[];if(a)for(var u=0,d=Object.keys(a);u<d.length;u++){var m=d[u];s.push("".concat(m,"=").concat(a[m]))}for(var h=Dr(r),x=0,b=h;x<b.length;x++){var N=b[x],y=r[N];o.push("".concat(N,"=").concat(y).concat(ps.has(y)?"=".concat(r.getParameter(y)):""))}if(n)for(var _=0,L=n;_<L.length;_++){var O=L[_];if(!(O===$r&&zr()||O===ys&&Ss())){var D=r.getExtension(O);if(!D){i.push(O);continue}for(var K=0,Q=Dr(D);K<Q.length;K++){var N=Q[K],y=D[N];l.push("".concat(N,"=").concat(y).concat(gs.has(y)?"=".concat(r.getParameter(y)):""))}}}for(var R=0,z=_s;R<z.length;R++)for(var ue=z[R],tr=0,zn=vs;tr<zn.length;tr++){var Bn=zn[tr],nc=xs(r,ue,Bn);c.push("".concat(ue,".").concat(Bn,"=").concat(nc.join(",")))}return l.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:c,extensions:n,extensionParameters:l,unsupportedExtensions:i}}function Ur(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),r;t.addEventListener("webglCreateContextError",function(){r=void 0});for(var n=0,a=["webgl","experimental-webgl"];n<a.length;n++){var i=a[n];try{r=t.getContext(i)}catch{}if(r)break}return e.webgl={context:r},r}function xs(e,t,r){var n=e.getShaderPrecisionFormat(e[t],e[r]);return n?[n.rangeMin,n.rangeMax,n.precision]:[]}function Dr(e){return Object.keys(e.__proto__).filter(ws)}function ws(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function zr(){return Lr()}function Ss(){return Ze()||Y()}function Br(e){return typeof e.getParameter=="function"}function Cs(){if(!(Ot()||Y()))return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function Is(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var Ns={fonts:di,domBlockers:Hi,fontPreferences:os,audio:qa,screenFrame:Zi,canvas:fi,osCpu:xi,languages:wi,colorDepth:Si,deviceMemory:Ci,screenResolution:Ii,hardwareConcurrency:Ei,timezone:Mi,sessionStorage:Oi,localStorage:Pi,indexedDB:Vi,openDatabase:Fi,cpuClass:Wi,platform:$i,plugins:ui,touchSupport:ki,vendor:Ui,vendorFlavors:Di,cookiesEnabled:zi,colorGamut:Ji,invertedColors:Ki,forcedColors:Qi,monochrome:es,contrast:ts,reducedMotion:rs,reducedTransparency:ns,hdr:as,math:is,pdfViewerEnabled:ls,architecture:ds,applePay:us,privateClickMeasurement:ms,audioBaseLatency:Cs,dateTimeLocale:Is,webGlBasics:bs,webGlExtensions:ks};function Ts(e){return za(Ns,e,[])}var Ls="$ if upgrade to Pro: https://fpjs.dev/pro";function As(e){var t=Rs(e),r=Zs(t);return{score:t,comment:Ls.replace(/\$/g,"".concat(r))}}function Rs(e){if(Ot())return .4;if(Y())return jt()&&!(Me()&&Ee())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Zs(e){return Cr(.99+.01*e,1e-4)}function Es(e){for(var t="",r=0,n=Object.keys(e).sort();r<n.length;r++){var a=n[r],i=e[a],s="error"in i?"error":JSON.stringify(i.value);t+="".concat(t?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return t}function Ms(e){return JSON.stringify(e,function(t,r){return r instanceof Error?Wa(r):r},2)}function Hr(e){return Fa(Es(e))}function js(e){var t;return{get visitorId(){return t===void 0&&(t=Hr(this.components)),t},set visitorId(r){t=r},confidence:As(e),components:e,version:kr}}function Os(e){return e===void 0&&(e=50),Aa(e,e*2)}function Ps(e,t){var r=Date.now();return{get:function(n){return re(this,void 0,void 0,function(){var a,i,s;return ne(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,e()];case 1:return i=o.sent(),s=js(i),t||n?.debug,[2,s]}})})}}}function Vs(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(kr,"/npm-monitoring"),!0),e.send()}catch{}}function Fs(e){var t;return e===void 0&&(e={}),re(this,void 0,void 0,function(){var r,n,a;return ne(this,function(i){switch(i.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Vs(),r=e.delayFallback,n=e.debug,[4,Os(r)];case 1:return i.sent(),a=Ts({cache:{},debug:n}),[2,Ps(a,n)]}})})}var Ws={load:Fs,hashComponents:Hr,componentsToDebugString:Ms},$s=class{constructor(e){this.baseUrl=e}async validateWidget(e,t){if(!t)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:t}),n=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),a=await n.json();return n.ok&&a.success?{valid:!0,agentId:a.data.agentId,tenantId:a.data.tenantId}:{valid:!1,error:a.error??`Widget configuration is invalid (${n.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){const t=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);const r=await t.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:r.data?.text??"",sessionId:r.data?.sessionId,images:r.data?.images}}async fetchSessionMessages(e){try{const t=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(t.status===410||!t.ok)return null;const r=await t.json();return r.success?r.data?.messages??null:null}catch{return null}}async uploadImage(e,t,r){const n=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:t,fileName:r})});if(!n.ok)throw new Error(`Upload error: ${n.status} ${n.statusText}`);const a=await n.json();if(!a.success)throw new Error(a.error??"Upload failed");return{url:a.data.url}}async fetchWidgetConfig(e,t){try{const r=t?`?tenantId=${encodeURIComponent(t)}`:"",n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!n.ok)return null;const a=await n.json();return a.success?a.data:null}catch{return null}}},Us=6e4;function Ds(e){return Promise.race([e.read(),new Promise((t,r)=>setTimeout(()=>r(new Error("Stream timed out — no data received for 60s")),Us))])}async function zs(e,t,r){let n="",a="";try{const i=await fetch(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t.message,sessionId:t.sessionId,tenantId:t.tenantId,userId:t.userId,name:t.name,email:t.email,authUserId:t.authUserId,fingerprint:t.fingerprint,metadata:t.metadata,imageUrl:t.imageUrl})});if(!i.ok||!i.body)throw new Error(`Stream error: ${i.status} ${i.statusText}`);const s=i.headers.get("x-session-id");s&&r.onSession&&r.onSession(s);const o=i.body.getReader(),l=new TextDecoder;let c="";const u=d=>{if(!d.startsWith("data: "))return!1;const m=d.slice(6).trim();if(!m)return!1;if(m==="[DONE]")return r.onEnd(n),!0;try{const h=JSON.parse(m);if(h.type==="session"){const b=h.sessionId;return b&&r.onSession&&r.onSession(b),!1}if(h.type==="done"||h.type==="stop")return r.onEnd(n),!0;if(h.type==="error")throw new Error(h.message??"Stream error");if(h.type==="images"){const b=h.images;return b&&r.onImages&&r.onImages(b),!1}if(h.type==="thinking_chunk"){const b=h.content;return b&&r.onThinkingDelta&&(a+=b,r.onThinkingDelta(b,a)),!1}const x=Bs(h);x&&(n+=x,r.onDelta(x,n))}catch(h){if(!(h instanceof SyntaxError))throw h}return!1};e:for(;;){const{done:d,value:m}=await Ds(o);if(d)break;c+=l.decode(m,{stream:!0});const h=c.lastIndexOf(`
|
|
5
|
+
`);if(h===-1)continue;const x=c.slice(0,h);c=c.slice(h+1);for(const b of x.split(`
|
|
6
|
+
`))if(u(b))break e}r.onEnd(n)}catch(i){r.onError(i instanceof Error?i:new Error(String(i)))}}function Bs(e){const t=e.choices;if(Array.isArray(t)&&t.length>0){const a=t[0]?.delta,i=a?.content??a?.text??"";if(i)return i}const r=e.delta;if(r){const a=r.content??r.text??"";if(a)return a}const n=e.response;return n||(e.text??e.content??"")}var Hs=class{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(...e){const[t,r]=e;this.listeners.get(t)?.forEach(n=>n(r))}removeAllListeners(){this.listeners.clear()}},Gs="agentforge";function Ut(e){return`${Gs}:session:${e}`}function Ys(e){try{return sessionStorage.getItem(Ut(e))??void 0}catch{return}}function Dt(e,t){try{sessionStorage.setItem(Ut(e),t)}catch{}}function Gr(e){try{sessionStorage.removeItem(Ut(e))}catch{}}function je(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function Xs(e){return{id:je(),role:"assistant",content:e,createdAt:new Date().toISOString(),status:"sent"}}var Js=class{config;apiClient;state;greetingShown=!1;fingerprint;emitter;constructor(e,t,r){this.hostConfig=t,this.onStateChange=r,this.config=e,this.apiClient=new $s(e.apiBaseUrl),this.emitter=new Hs,this.initializeFingerprint();const n=e.sessionId??Ys(e.agentId);e.sessionId&&Dt(e.agentId,e.sessionId);const a=e.mode==="inline";this.state={isOpen:a,messages:[],isLoading:!1,error:null,sessionId:n,initStatus:"validating",initError:null},a&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{this.fingerprint=(await(await Ws.load()).get()).visitorId}catch{this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){if(this.state.initStatus==="error")return;const e=!this.greetingShown&&!!this.config.greeting;e&&(this.greetingShown=!0),this.setState({isOpen:!0,messages:e?[Xs(this.config.greeting),...this.state.messages]:this.state.messages})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const t=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(t&&(this.config=Ae(this.hostConfig,t),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const n=r.map(a=>({id:je(),role:a.role,content:a.content,images:a.images&&a.images.length>0?a.images:void 0,createdAt:new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...n]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,t){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...t}:r)},this.onStateChange(this.getState(),this.config)}reset(){Gr(this.config.agentId),this.greetingShown=!1,this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){Gr(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,t){if(this.state.isLoading||!e.trim()||this.state.initStatus!=="ready")return;let r;if(t)try{const i=await Ks(t);r=(await this.apiClient.uploadImage(i,t.type,t.name)).url}catch(i){const s=i instanceof Error?i.message:"Image upload failed";this.setState({error:s});return}const n={id:je(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},a=!this.state.messages.some(i=>i.role==="user");this.setState({messages:[...this.state.messages,n],isLoading:!0,error:null}),this.emitter.emit("message:sent",n),a&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,t,r=!1){try{const n=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t}),a={id:je(),role:"assistant",content:n.content,images:n.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,a],isLoading:!1,...n.sessionId?{sessionId:n.sessionId}:{}}),n.sessionId&&Dt(this.config.agentId,n.sessionId),this.emitter.emit("message:received",a)}catch(n){const a=n instanceof Error?n.message:"Failed to send message";if(!r&&a.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,t,!0);this.setState({isLoading:!1,error:a}),this.emitter.emit("message:error",{error:a,message:null})}}async sendStreaming(e,t,r=!1){const n=je(),a={id:n,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,a]}),this.emitter.emit("stream:start");let i=!1;await zs(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t},{onSession:s=>{this.setState({sessionId:s}),Dt(this.config.agentId,s)},onImages:s=>{this.updateMessage(n,{images:s})},onThinkingDelta:(s,o)=>{this.updateMessage(n,{thinking:o,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:s,accumulated:o})},onDelta:(s,o)=>{this.updateMessage(n,{content:o,isThinking:!1}),this.emitter.emit("stream:delta",{delta:s,accumulated:o})},onEnd:s=>{this.updateMessage(n,{content:s,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:s});const o=this.state.messages.find(l=>l.id===n);o&&(o.thinking&&this.emitter.emit("thinking:end",{content:o.thinking}),this.emitter.emit("message:received",o))},onError:s=>{if(!r&&s.message.includes("410")){i=!0,this.setState({messages:this.state.messages.filter(l=>l.id!==n),isLoading:!1});return}const o=this.state.messages.find(l=>l.id===n)?.content??"";this.updateMessage(n,{content:o||"Something went wrong. Please try again.",status:"error"}),this.setState({isLoading:!1,error:"Something went wrong. Please try again."}),this.emitter.emit("message:error",{error:s.message,message:null})}}),i&&(this.handleSessionExpired(),await this.sendStreaming(e,t,!0))}};function Ks(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const a=n.result;t(a.split(",")[1]??"")},n.onerror=()=>r(new Error("Failed to read file")),n.readAsDataURL(e)})}function Qs(e){const t=document.createElement("div");t.setAttribute("data-agentkit-widget",""),e.appendChild(t);const r=t.attachShadow({mode:"open"}),n=document.createElement("style");r.appendChild(n);const a=document.createElement("div");return a.style.cssText="display: contents;",r.appendChild(a),{host:t,shadowRoot:r,styleSlot:n,mountPoint:a}}function qs(e,t){e.textContent=t}function eo(e){e.remove()}function to(){const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(e),e}function ro(e){getComputedStyle(e).position==="static"&&(e.style.position="relative");const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),e.appendChild(t),t}function no(e){return e.setAttribute("data-agentkit-root","inline"),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e}function ao(e){e.remove()}function io(e){e.removeAttribute("data-agentkit-root")}function Yr(e,t,r,n,a){const i=e.mode==="inline";let s=!1;const o=i&&a?no(a):!i&&a?ro(a):to(),l=Qs(o);qs(l.styleSlot,n);const c=new Js(e,t,(m,h)=>{s||u.update(m,h)}),u=r(l.mountPoint,e,c.getState(),{onOpen:()=>d.open(),onClose:()=>d.close(),onSendMessage:(m,h)=>{c.sendMessage(m,h)}});c.hydrate(),setTimeout(()=>{s||c.emitter.emit("ready",c.getState())},0);const d={open(){s||(c.setOpen(!0),c.emitter.emit("open"))},close(){s||(c.setOpen(!1),c.emitter.emit("close"))},toggle(){c.getState().isOpen?d.close():d.open()},async sendMessage(m,h){await c.sendMessage(m,h)},reset(){s||(c.reset(),c.emitter.emit("reset"))},destroy(){s||(s=!0,u.destroy(),eo(l.host),i&&a?io(a):ao(o),c.emitter.emit("destroy"),c.emitter.removeAllListeners())},on(m,h){c.emitter.on(m,h)},off(m,h){c.emitter.off(m,h)},getState(){return c.getState()}};return d}var Oe=new Map,so=0;function Xr(e){const t=`agentkit-widget-${++so}`,r=e.destroy.bind(e);return e.destroy=()=>{Oe.delete(t),r()},Oe.set(t,e),t}function oo(e,t,r){const n={...e,mode:"floating"},a=Yr(Ae(n),n,t,r);return Xr(a),a}function co(e,t,r,n){const a={...t,mode:"inline"},i=Yr(Ae(a),a,r,n,e);return Xr(i),i}function lo(e){e?Oe.get(e)?.destroy():(Oe.forEach(t=>t.destroy()),Oe.clear())}var at,I,Jr,uo,pe,Kr,Qr,qr,en,zt,Bt,Ht,fo,it={},st=[],ho=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pe=Array.isArray;function ce(e,t){for(var r in t)e[r]=t[r];return e}function Gt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ve(e,t,r){var n,a,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?a=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?at.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return ot(e,s,n,a,null)}function ot(e,t,r,n,a){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Jr,__i:-1,__u:0};return a==null&&I.vnode!=null&&I.vnode(i),i}function X(e){return e.children}function le(e,t){this.props=e,this.context=t}function Ie(e,t){if(t==null)return e.__?Ie(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ie(e):null}function mo(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],a=[],i=ce({},t);i.__v=t.__v+1,I.vnode&&I.vnode(i),Yt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??Ie(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,cn(n,i,a),t.__e=t.__=null,i.__e!=r&&tn(i)}}function tn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),tn(e)}function rn(e){(!e.__d&&(e.__d=!0)&&pe.push(e)&&!ct.__r++||Kr!=I.debounceRendering)&&((Kr=I.debounceRendering)||Qr)(ct)}function ct(){try{for(var e,t=1;pe.length;)pe.length>t&&pe.sort(qr),e=pe.shift(),t=pe.length,mo(e)}finally{pe.length=ct.__r=0}}function nn(e,t,r,n,a,i,s,o,l,c,u){var d,m,h,x,b,N,y,_=n&&n.__k||st,L=t.length;for(l=po(r,t,_,l,L),d=0;d<L;d++)(h=r.__k[d])!=null&&(m=h.__i!=-1&&_[h.__i]||it,h.__i=d,N=Yt(e,h,m,a,i,s,o,l,c,u),x=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&Jt(m.ref,null,h),u.push(h.ref,h.__c||x,h)),b==null&&x!=null&&(b=x),(y=!!(4&h.__u))||m.__k===h.__k?l=an(h,l,e,y):typeof h.type=="function"&&N!==void 0?l=N:x&&(l=x.nextSibling),h.__u&=-7);return r.__e=b,l}function po(e,t,r,n,a){var i,s,o,l,c,u=r.length,d=u,m=0;for(e.__k=new Array(a),i=0;i<a;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=ot(null,s,null,null,null):Pe(s)?s=e.__k[i]=ot(X,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=ot(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,l=i+m,s.__=e,s.__b=e.__b+1,o=null,(c=s.__i=go(s,r,l,d))!=-1&&(d--,(o=r[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(a>u?m--:a<u&&m++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)(o=r[i])!=null&&(2&o.__u)==0&&(o.__e==n&&(n=Ie(o)),dn(o,o));return n}function an(e,t,r,n){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=an(a[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Ie(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function de(e,t){return t=t||[],e==null||typeof e=="boolean"||(Pe(e)?e.some(function(r){de(r,t)}):t.push(e)),t}function go(e,t,r,n){var a,i,s,o=e.key,l=e.type,c=t[r],u=c!=null&&(2&c.__u)==0;if(c===null&&o==null||u&&o==c.key&&l==c.type)return r;if(n>(u?1:0)){for(a=r-1,i=r+1;a>=0||i<t.length;)if((c=t[s=a>=0?a--:i++])!=null&&(2&c.__u)==0&&o==c.key&&l==c.type)return s}return-1}function sn(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||ho.test(t)?r:r+"px"}function lt(e,t,r,n,a){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||sn(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||sn(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(en,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=zt,e.addEventListener(t,i?Ht:Bt,i)):e.removeEventListener(t,i?Ht:Bt,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function on(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=zt++;else if(t.t<r.u)return;return r(I.event?I.event(t):t)}}}function Yt(e,t,r,n,a,i,s,o,l,c){var u,d,m,h,x,b,N,y,_,L,O,D,K,Q,R,z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[o=t.__e=r.__e]),(u=I.__b)&&u(t);e:if(typeof z=="function")try{if(y=t.props,_=z.prototype&&z.prototype.render,L=(u=z.contextType)&&n[u.__c],O=u?L?L.props.value:u.__:n,r.__c?N=(d=t.__c=r.__c).__=d.__E:(_?t.__c=d=new z(y,O):(t.__c=d=new le(y,O),d.constructor=z,d.render=vo),L&&L.sub(d),d.state||(d.state={}),d.__n=n,m=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&z.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ce({},d.__s)),ce(d.__s,z.getDerivedStateFromProps(y,d.__s))),h=d.props,x=d.state,d.__v=t,m)_&&z.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(_&&z.getDerivedStateFromProps==null&&y!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,O),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,O)===!1){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ue){ue&&(ue.__=t)}),st.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,O),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,x,b)})}if(d.context=O,d.props=y,d.__P=e,d.__e=!1,D=I.__r,K=0,_)d.state=d.__s,d.__d=!1,D&&D(t),u=d.render(d.props,d.state,d.context),st.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,D&&D(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++K<25);d.state=d.__s,d.getChildContext!=null&&(n=ce(ce({},n),d.getChildContext())),_&&!m&&d.getSnapshotBeforeUpdate!=null&&(b=d.getSnapshotBeforeUpdate(h,x)),Q=u!=null&&u.type===X&&u.key==null?ln(u.props.children):u,o=nn(e,Pe(Q)?Q:[Q],t,r,n,a,i,s,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),N&&(d.__E=d.__=null)}catch(ue){if(t.__v=null,l||i!=null)if(ue.then){for(t.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,t.__e=o}else{for(R=i.length;R--;)Gt(i[R]);Xt(t)}else t.__e=r.__e,t.__k=r.__k,ue.then||Xt(t);I.__e(ue,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):o=t.__e=_o(r.__e,t,r,n,a,i,s,l,c);return(u=I.diffed)&&u(t),128&t.__u?void 0:o}function Xt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Xt))}function cn(e,t,r){for(var n=0;n<r.length;n++)Jt(r[n],r[++n],r[++n]);I.__c&&I.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){I.__e(i,a.__v)}})}function ln(e){return typeof e!="object"||e==null||e.__b>0?e:Pe(e)?e.map(ln):ce({},e)}function _o(e,t,r,n,a,i,s,o,l){var c,u,d,m,h,x,b,N=r.props||it,y=t.props,_=t.type;if(_=="svg"?a="http://www.w3.org/2000/svg":_=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!_&&(_?h.localName==_:h.nodeType==3)){e=h,i[c]=null;break}}if(e==null){if(_==null)return document.createTextNode(y);e=document.createElementNS(a,_,y.is&&y),o&&(I.__m&&I.__m(t,i),o=!1),i=null}if(_==null)N===y||o&&e.data==y||(e.data=y);else{if(i=i&&at.call(e.childNodes),!o&&i!=null)for(N={},c=0;c<e.attributes.length;c++)N[(h=e.attributes[c]).name]=h.value;for(c in N)h=N[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in y||c=="value"&&"defaultValue"in y||c=="checked"&&"defaultChecked"in y||lt(e,c,null,h,a);for(c in y)h=y[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?x=h:c=="checked"?b=h:o&&typeof h!="function"||N[c]===h||lt(e,c,h,N[c],a);if(u)o||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),nn(t.type=="template"?e.content:e,Pe(m)?m:[m],t,r,n,_=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,s,i?i[0]:r.__k&&Ie(r,0),o,l),i!=null)for(c=i.length;c--;)Gt(i[c]);o||(c="value",_=="progress"&&x==null?e.removeAttribute("value"):x!=null&&(x!==e[c]||_=="progress"&&!x||_=="option"&&x!=N[c])&<(e,c,x,N[c],a),c="checked",b!=null&&b!=e[c]&<(e,c,b,N[c],a))}return e}function Jt(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(a){I.__e(a,r)}}function dn(e,t,r){var n,a;if(I.unmount&&I.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Jt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){I.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&dn(n[a],t,r||typeof e.type!="function");r||Gt(e.__e),e.__c=e.__=e.__e=void 0}function vo(e,t,r){return this.constructor(e,r)}function un(e,t,r){var n,a,i,s;t==document&&(t=document.documentElement),I.__&&I.__(e,t),a=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],s=[],Yt(t,e=(!n&&r||t).__k=Ve(X,null,[e]),a||it,it,t.namespaceURI,!n&&r?[r]:a?null:t.firstChild?at.call(t.childNodes):null,i,!n&&r?r:a?a.__e:t.firstChild,n,s),cn(i,e,s)}at=st.slice,I={__e:function(e,t,r,n){for(var a,i,s;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,n||{}),s=a.__d),s)return a.__E=a}catch(o){e=o}throw e}},Jr=0,uo=function(e){return e!=null&&e.constructor===void 0},le.prototype.setState=function(e,t){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ce({},this.state);typeof e=="function"&&(e=e(ce({},r),this.props)),e&&ce(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),rn(this))},le.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rn(this))},le.prototype.render=X,pe=[],Qr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qr=function(e,t){return e.__v.__b-t.__v.__b},ct.__r=0,en=/(PointerCapture)$|Capture$/i,zt=0,Bt=on(!1),Ht=on(!0),fo=0;var Fe,M,Kt,fn,dt=0,hn=[],j=I,mn=j.__b,pn=j.__r,gn=j.diffed,_n=j.__c,vn=j.unmount,yn=j.__;function Qt(e,t){j.__h&&j.__h(M,e,dt||t),dt=0;var r=M.__H||(M.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ut(e){return dt=1,yo(xn,e)}function yo(e,t,r){var n=Qt(Fe++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):xn(void 0,t),function(o){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,o);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=M,!M.__f)){var a=function(o,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(m){return m.__c});if(u.every(function(m){return!m.__N}))return!i||i.call(this,o,l,c);var d=n.__c.props!==o;return u.some(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),i&&i.call(this,o,l,c)||d};M.__f=!0;var i=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(o,l,c){if(this.__e){var u=i;i=void 0,a(o,l,c),i=u}s&&s.call(this,o,l,c)},M.shouldComponentUpdate=a}return n.__N||n.__}function ft(e,t){var r=Qt(Fe++,3);!j.__s&&kn(r.__H,t)&&(r.__=e,r.u=t,M.__H.__h.push(r))}function ht(e){return dt=5,bo(function(){return{current:e}},[])}function bo(e,t){var r=Qt(Fe++,7);return kn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ko(){for(var e;e=hn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(mt),t.__h.some(qt),t.__h=[]}catch(r){t.__h=[],j.__e(r,e.__v)}}}j.__b=function(e){M=null,mn&&mn(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yn&&yn(e,t)},j.__r=function(e){pn&&pn(e),Fe=0;var t=(M=e.__c).__H;t&&(Kt===M?(t.__h=[],M.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(mt),t.__h.some(qt),t.__h=[],Fe=0)),Kt=M},j.diffed=function(e){gn&&gn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(hn.push(t)!==1&&fn===j.requestAnimationFrame||((fn=j.requestAnimationFrame)||xo)(ko)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Kt=M=null},j.__c=function(e,t){t.some(function(r){try{r.__h.some(mt),r.__h=r.__h.filter(function(n){return!n.__||qt(n)})}catch(n){t.some(function(a){a.__h&&(a.__h=[])}),t=[],j.__e(n,r.__v)}}),_n&&_n(e,t)},j.unmount=function(e){vn&&vn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{mt(n)}catch(a){t=a}}),r.__H=void 0,t&&j.__e(t,r.__v))};var bn=typeof requestAnimationFrame=="function";function xo(e){var t,r=function(){clearTimeout(n),bn&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);bn&&(t=requestAnimationFrame(r))}function mt(e){var t=M,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),M=t}function qt(e){var t=M;e.__c=e.__(),M=t}function kn(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function xn(e,t){return typeof t=="function"?t(e):t}function wo(e,t){for(var r in t)e[r]=t[r];return e}function wn(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Sn(e,t){this.props=e,this.context=t}(Sn.prototype=new le).isPureReactComponent=!0,Sn.prototype.shouldComponentUpdate=function(e,t){return wn(this.props,e)||wn(this.state,t)};var Cn=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Cn&&Cn(e)};var Ec=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,In=function(e,t){return e==null?null:de(de(e).map(t))},Mc={map:In,forEach:In,count:function(e){return e?de(e).length:0},only:function(e){var t=de(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:de},So=I.__e;I.__e=function(e,t,r,n){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),a.__c(e,t)}So(e,t,r,n)};var Nn=I.unmount;function Tn(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=wo({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Tn(n,t,r)})),e}function Ln(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Ln(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function er(){this.__u=0,this.o=null,this.__b=null}function An(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function pt(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Nn&&Nn(e)},(er.prototype=new le).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var a=An(n.__v),i=!1,s=function(){i||n.__z||(i=!0,r.__R=null,a?a(l):l())};r.__R=s;var o=r.__P;r.__P=null;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Ln(c,c.__c.__P,c.__c.__O)}var u;for(n.setState({__a:n.__b=null});u=n.o.pop();)u.__P=o,u.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},er.prototype.componentWillUnmount=function(){this.o=[]},er.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Tn(this.__b,r,n.__O=n.__P)}this.__b=null}var a=t.__a&&Ve(X,null,e.fallback);return a&&(a.__u&=-33),[Ve(X,null,t.__a?null:e.children),a]};var Rn=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(pt.prototype=new le).__a=function(e){var t=this,r=An(t.__v),n=t.l.get(e);return n[0]++,function(a){var i=function(){t.props.revealOrder?(n.push(a),Rn(t,e,n)):a()};r?r(i):i()}},pt.prototype.render=function(e){this.i=null,this.l=new Map;var t=de(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},pt.prototype.componentDidUpdate=pt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Rn(e,r,t)})};var Co=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Io=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,No=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,To=/[A-Z0-9]/g,Lo=typeof document<"u",Ao=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Ro(e,t,r){return t.__k??(t.textContent=""),un(e,t),typeof r=="function"&&r(),e?e.__c:null}le.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(le.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Zn=I.event;I.event=function(e){return Zn&&(e=Zn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var En,Zo={configurable:!0,get:function(){return this.class}},Mn=I.vnode;I.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,a={},i=n.indexOf("-")==-1;for(var s in r){var o=r[s];if(!(s==="value"&&"defaultValue"in r&&o==null||Lo&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&o===!0?o="":l==="translate"&&o==="no"?o=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||Ao(r.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":No.test(s)&&(s=l):l=s="oninput":i&&Io.test(s)?s=s.replace(To,"-$&").toLowerCase():o===null&&(o=void 0),l==="oninput"&&a[s=l]&&(s="oninputCapture"),a[s]=o}}n=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=de(r.children).forEach(function(c){c.props.selected=a.value.indexOf(c.props.value)!=-1})),a.defaultValue!=null&&(a.value=de(r.children).forEach(function(c){c.props.selected=a.multiple?a.defaultValue.indexOf(c.props.value)!=-1:a.defaultValue==c.props.value}))),r.class&&!r.className?(a.class=r.class,Object.defineProperty(a,"className",Zo)):r.className&&(a.class=a.className=r.className),t.props=a})(e),e.$$typeof=Co,Mn&&Mn(e)};var jn=I.__r;I.__r=function(e){jn&&jn(e),En=e.__c};var On=I.diffed;I.diffed=function(e){On&&On(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),En=null};function Eo(e){return!!e.__k&&(un(null,e),!0)}function Mo(e){return{render:function(t){Ro(t,e)},unmount:function(){Eo(e)}}}function jo(e){const{theme:t}=e,r=[`--ak-accent: ${t.accentColor}`,`--ak-font: ${t.fontFamily}`,`--ak-radius: ${t.borderRadius}`];return r.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`),`:host { ${r.join("; ")} }`}function Oo(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Po=`
|
|
7
7
|
*, *::before, *::after {
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
margin: 0;
|
|
@@ -47,7 +47,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
align-items: flex-end;
|
|
50
|
-
gap:
|
|
50
|
+
gap: 6px;
|
|
51
51
|
pointer-events: none;
|
|
52
52
|
}
|
|
53
53
|
.ak-floating > * {
|
|
@@ -104,6 +104,13 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
104
104
|
pointer-events: none;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/* ── Shell wrapper (positions the hanging branding tab) ─────── */
|
|
108
|
+
.ak-shell-wrap {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
align-items: flex-start;
|
|
112
|
+
}
|
|
113
|
+
|
|
107
114
|
/* ── Widget shell / panel ────────────────────────────────────── */
|
|
108
115
|
.ak-shell {
|
|
109
116
|
background: var(--ak-bg);
|
|
@@ -200,6 +207,17 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
200
207
|
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
201
208
|
background: rgba(255, 255, 255, 0.15);
|
|
202
209
|
}
|
|
210
|
+
.ak-header__bot-icon {
|
|
211
|
+
width: 28px;
|
|
212
|
+
height: 28px;
|
|
213
|
+
border-radius: 50%;
|
|
214
|
+
background: rgba(255, 255, 255, 0.2);
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
color: #fff;
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
}
|
|
203
221
|
|
|
204
222
|
/* ── Message list ────────────────────────────────────────────── */
|
|
205
223
|
.ak-messages {
|
|
@@ -257,6 +275,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
257
275
|
background: var(--ak-bot-bg);
|
|
258
276
|
color: var(--ak-bot-text);
|
|
259
277
|
border-bottom-left-radius: 4px;
|
|
278
|
+
border: 1px solid var(--ak-border);
|
|
260
279
|
}
|
|
261
280
|
.ak-message--error .ak-message__bubble {
|
|
262
281
|
background: #fee2e2;
|
|
@@ -371,6 +390,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
371
390
|
background: var(--ak-bot-bg);
|
|
372
391
|
border-radius: 16px;
|
|
373
392
|
border-bottom-left-radius: 4px;
|
|
393
|
+
border: 1px solid var(--ak-border);
|
|
374
394
|
align-self: flex-start;
|
|
375
395
|
width: fit-content;
|
|
376
396
|
animation: ak-msg-in 0.15s ease-out;
|
|
@@ -424,70 +444,76 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
424
444
|
flex-shrink: 0;
|
|
425
445
|
}
|
|
426
446
|
|
|
427
|
-
/* Inner row: photo button + textarea + send button */
|
|
428
|
-
.ak-composer__row {
|
|
429
|
-
display: flex;
|
|
430
|
-
gap: 8px;
|
|
431
|
-
align-items: flex-end;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
447
|
/* Hidden native file input */
|
|
435
448
|
.ak-composer__file-input {
|
|
436
449
|
display: none;
|
|
437
450
|
}
|
|
438
451
|
|
|
439
|
-
/*
|
|
440
|
-
.ak-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
background:
|
|
452
|
+
/* Unified input container — wraps +, textarea, send as one row */
|
|
453
|
+
.ak-composer__input-wrap {
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
gap: 6px;
|
|
457
|
+
background: var(--ak-surface);
|
|
458
|
+
border: 1px solid var(--ak-border);
|
|
459
|
+
border-radius: 14px;
|
|
460
|
+
padding: 5px 5px 5px 6px;
|
|
461
|
+
transition: border-color 0.15s;
|
|
462
|
+
}
|
|
463
|
+
.ak-composer__input-wrap:focus-within {
|
|
464
|
+
border-color: var(--ak-accent);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* "+" attachment button — square with rounded corners */
|
|
468
|
+
.ak-composer__attach {
|
|
469
|
+
width: 28px;
|
|
470
|
+
height: 28px;
|
|
471
|
+
border-radius: 8px;
|
|
472
|
+
background: var(--ak-bg);
|
|
445
473
|
border: 1px solid var(--ak-border);
|
|
446
474
|
cursor: pointer;
|
|
447
475
|
display: flex;
|
|
448
476
|
align-items: center;
|
|
449
477
|
justify-content: center;
|
|
450
478
|
color: var(--ak-text-muted);
|
|
451
|
-
transition:
|
|
479
|
+
transition: color 0.15s, border-color 0.15s;
|
|
452
480
|
flex-shrink: 0;
|
|
453
481
|
}
|
|
454
|
-
.ak-
|
|
455
|
-
background: var(--ak-surface);
|
|
482
|
+
.ak-composer__attach:hover:not(:disabled) {
|
|
456
483
|
color: var(--ak-accent);
|
|
457
484
|
border-color: var(--ak-accent);
|
|
458
485
|
}
|
|
459
|
-
.ak-
|
|
486
|
+
.ak-composer__attach:disabled {
|
|
460
487
|
opacity: 0.4;
|
|
461
488
|
cursor: not-allowed;
|
|
462
489
|
}
|
|
463
490
|
|
|
491
|
+
/* Textarea — borderless, transparent, sits inside the container */
|
|
464
492
|
.ak-composer__input {
|
|
465
493
|
flex: 1;
|
|
466
|
-
padding:
|
|
467
|
-
border:
|
|
468
|
-
border-radius:
|
|
469
|
-
background:
|
|
494
|
+
padding: 4px 6px;
|
|
495
|
+
border: none;
|
|
496
|
+
border-radius: 0;
|
|
497
|
+
background: transparent;
|
|
470
498
|
color: var(--ak-text);
|
|
471
499
|
font-family: var(--ak-font);
|
|
472
500
|
font-size: 14px;
|
|
473
501
|
line-height: 1.45;
|
|
474
502
|
resize: none;
|
|
475
503
|
outline: none;
|
|
476
|
-
|
|
477
|
-
min-height: 38px;
|
|
504
|
+
min-height: 28px;
|
|
478
505
|
max-height: 110px;
|
|
479
506
|
overflow-y: auto;
|
|
480
507
|
}
|
|
481
|
-
.ak-composer__input:focus {
|
|
482
|
-
border-color: var(--ak-accent);
|
|
483
|
-
}
|
|
484
508
|
.ak-composer__input::placeholder {
|
|
485
509
|
color: var(--ak-text-muted);
|
|
486
510
|
}
|
|
511
|
+
|
|
512
|
+
/* Send button — square with rounded corners */
|
|
487
513
|
.ak-composer__send {
|
|
488
|
-
width:
|
|
489
|
-
height:
|
|
490
|
-
border-radius:
|
|
514
|
+
width: 28px;
|
|
515
|
+
height: 28px;
|
|
516
|
+
border-radius: 8px;
|
|
491
517
|
background: var(--ak-accent);
|
|
492
518
|
border: none;
|
|
493
519
|
cursor: pointer;
|
|
@@ -495,18 +521,22 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
495
521
|
align-items: center;
|
|
496
522
|
justify-content: center;
|
|
497
523
|
color: white;
|
|
498
|
-
transition: background 0.15s,
|
|
524
|
+
transition: background 0.15s, opacity 0.15s;
|
|
499
525
|
flex-shrink: 0;
|
|
500
526
|
}
|
|
501
527
|
.ak-composer__send:hover:not(:disabled) {
|
|
502
528
|
background: var(--ak-accent-hover);
|
|
503
|
-
transform: scale(1.06);
|
|
504
529
|
}
|
|
505
530
|
.ak-composer__send:disabled {
|
|
506
531
|
opacity: 0.45;
|
|
507
532
|
cursor: not-allowed;
|
|
508
533
|
}
|
|
509
534
|
|
|
535
|
+
/* Old photo button — hidden but keep so file-input trigger still works */
|
|
536
|
+
.ak-composer__photo {
|
|
537
|
+
display: none;
|
|
538
|
+
}
|
|
539
|
+
|
|
510
540
|
/* Image preview strip above the input row */
|
|
511
541
|
.ak-composer__preview {
|
|
512
542
|
display: flex;
|
|
@@ -796,7 +826,40 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
|
|
|
796
826
|
overflow-y: auto;
|
|
797
827
|
line-height: 1.5;
|
|
798
828
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
`)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const c=o[1].length,u=o[2]?J(o[2].trim()):"";c===1?n.push(f("h1",{className:"ak-md-h1",children:u},a++)):c===2?n.push(f("h2",{className:"ak-md-h2",children:u},a++)):c===3?n.push(f("h3",{className:"ak-md-h3",children:u},a++)):c===4?n.push(f("h4",{className:"ak-md-h4",children:u},a++)):c===5?n.push(f("h5",{className:"ak-md-h5",children:u},a++)):n.push(f("h6",{className:"ak-md-h6",children:u},a++)),r++;continue}if(/^[-*_]{3,}$/.test(i.trim())){n.push(f("hr",{className:"ak-md-hr"},a++)),r++;continue}if(/^[-*+]\s/.test(i)){const c=[];let u=r;for(;u<e.length&&(/^[-*+]\s/.test(e[u])||e[u].trim()==="");){if(e[u].trim()===""){u++;continue}const d=e[u].length-e[u].trimStart().length,m=e[u].replace(/^[-*+]\s+/,""),h=[],x=[];let _=u+1;for(;_<e.length&&_<u+20;){const v=e[_];if(v.length-v.trimStart().length>d&&v.trim()!==""){const C=v.trim();/^[-*+]\s/.test(C)?h.push(f("li",{children:J(C.replace(/^[-*+]\s+/,""))},`nested-${_}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(C)},`cont-${_}`)),_++}else break}const I=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:I},`item-${u}`)),u=_}n.push(f("ul",{className:"ak-md-ul",children:c},a++)),r=u;continue}if(/^\d+\.\s/.test(i)){const c=[];let u=r;for(;u<e.length&&(/^\d+\.\s/.test(e[u])||e[u].trim()==="");){if(e[u].trim()===""){u++;continue}const d=e[u].length-e[u].trimStart().length,m=e[u].replace(/^\d+\.\s+/,""),h=[],x=[];let _=u+1;for(;_<e.length&&_<u+20;){const v=e[_];if(v.length-v.trimStart().length>d&&v.trim()!==""){const C=v.trim();/^\d+\.\s/.test(C)?h.push(f("li",{children:J(C.replace(/^\d+\.\s+/,""))},`nested-order-${_}`)):/^[-*+]\s/.test(C)?h.push(f("li",{children:J(C.replace(/^[-*+]\s+/,""))},`nested-unorder-${_}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(C)},`cont-${_}`)),_++}else break}const I=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:I},`order-item-${u}`)),u=_}n.push(f("ol",{className:"ak-md-ol",children:c},a++)),r=u;continue}if(i.trim()===""){r++;continue}const l=[];for(;r<e.length&&e[r].trim()!==""&&!e[r].startsWith("#")&&!/^\s*```/.test(e[r])&&!/^[-*+]\s/.test(e[r])&&!/^\d+\.\s/.test(e[r])&&!/^[-*_]{3,}$/.test(e[r].trim());)l.push(e[r]),r++;if(l.length>0){const c=[];l.forEach((u,d)=>{c.push(...J(u)),d<l.length-1&&c.push(f("br",{},`br-${d}`))}),n.push(f("p",{className:"ak-md-p",children:c},a++))}}return f(X,{children:n})}function Io({message:t,thinkingViewable:e=!1}){const n=t.role==="user",r=t.status==="error",a=t.status==="streaming",i=!!(t.images&&t.images.length>0),s=!!(n&&t.uploadedImageUrl),o=i||s,l=!n&&!r,c=n?"ak-message--user":r?"ak-message--assistant ak-message--error":"ak-message--assistant",u=["ak-message__bubble",l?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),d=f(X,{children:[f("div",{className:u,children:[s&&f("div",{className:"ak-message__images",children:f("div",{className:"ak-message__image-wrap",children:[f("a",{href:t.uploadedImageUrl,className:"ak-message__image-link",children:f("img",{src:t.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),f("a",{href:t.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:h=>h.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&f("div",{className:"ak-message__images",children:t.images.map((h,x)=>{const _=h.url??(h.base64?`data:${h.mimeType};base64,${h.base64}`:null);return _?f("div",{className:"ak-message__image-wrap",children:[f("a",{href:_,className:"ak-message__image-link",children:f("img",{src:_,alt:"Generated image",className:"ak-message__image"})}),f("a",{href:_,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:I=>I.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},x):null})}),(t.content||a&&!t.isThinking)&&f("div",{className:o?"ak-message__image-caption":void 0,children:[l?Co(t.content):t.content,a&&!t.isThinking&&f("span",{className:"ak-cursor","aria-hidden":"true",children:[f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"})]})]})]}),f("span",{className:"ak-message__time",children:So(t.createdAt)})]}),m=!t.isThinking||!!t.content;return f("div",{className:`ak-message ${c}`,children:[!n&&f(wo,{thinking:t.thinking,isThinking:t.isThinking??!1,thinkingViewable:e}),m&&d]})}function No(){return f("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"})]})}function To({messages:t,isLoading:e,thinkingViewable:n}){var s,o;const r=ct(null),a=((s=t.find(l=>l.status==="streaming"))==null?void 0:s.content)??"",i=((o=t.find(l=>l.isThinking))==null?void 0:o.thinking)??"";return ot(()=>{var l;(l=r.current)==null||l.scrollIntoView({behavior:"smooth"})},[t.length,e,a,i]),f("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[t.map(l=>f(Io,{message:l,thinkingViewable:n},l.id)),e&&!t.some(l=>l.status==="streaming")&&f(No,{}),f("div",{ref:r})]})}function Lo(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),f("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Ao(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),f("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),f("polyline",{points:"21 15 16 10 5 21"})]})}function Ro(){return f("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Eo({onSend:t,disabled:e=!1,placeholder:n="Type a message…",privacyPolicyUrl:r}){const[a,i]=st(""),[s,o]=st(null),[l,c]=st(null),u=ct(null),d=ct(null);ot(()=>()=>{l&&URL.revokeObjectURL(l)},[l]),ot(()=>{var y;e||(y=u.current)==null||y.focus()},[e]);function m(){o(null),l&&URL.revokeObjectURL(l),c(null),d.current&&(d.current.value="")}function h(){const y=a.trim();!y&&!s||e||(t(y,s??void 0),i(""),m(),u.current&&(u.current.style.height="auto"))}function x(y){y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),h())}function _(y){const C=y.currentTarget;i(C.value),C.style.height="auto",C.style.height=`${C.scrollHeight}px`}function I(y){var Z;const C=(Z=y.currentTarget.files)==null?void 0:Z[0];if(C){if(C.size>5242880){alert("Image must be smaller than 5 MB."),y.currentTarget.value="";return}l&&URL.revokeObjectURL(l),o(C),c(URL.createObjectURL(C))}}const v=!e&&(!!a.trim()||!!s);return f("div",{className:"ak-composer",children:[l&&f("div",{className:"ak-composer__preview",children:f("div",{className:"ak-composer__preview-wrap",children:[f("img",{src:l,alt:"Selected",className:"ak-composer__preview-img"}),f("button",{className:"ak-composer__preview-remove",onClick:m,type:"button","aria-label":"Remove image",disabled:e,children:f(Ro,{})})]})}),f("div",{className:"ak-composer__row",children:[f("input",{ref:d,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:I,disabled:e,"aria-label":"Attach image"}),f("button",{className:"ak-composer__photo",onClick:()=>{var y;return(y=d.current)==null?void 0:y.click()},disabled:e,"aria-label":"Attach image",type:"button",children:f(Ao,{})}),f("textarea",{ref:u,className:"ak-composer__input",value:a,onInput:_,onKeyDown:x,placeholder:n,disabled:e,rows:1,"aria-label":"Message input"}),f("button",{className:"ak-composer__send",onClick:h,disabled:!v,"aria-label":"Send message",type:"button",children:f(Lo,{})})]}),r&&f("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",f("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}function Cr({message:t}){return t.includes("Origin not allowed")?f("div",{className:"ak-error ak-error--origin",role:"alert",children:[f("div",{className:"ak-error__icon",children:"🔒"}),f("div",{className:"ak-error__content",children:[f("h3",{className:"ak-error__title",children:"Access Restricted"}),f("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only."}),f("p",{className:"ak-error__message",children:"Contact the website administrator if you believe this is an error."})]})]}):f("div",{className:"ak-error",role:"alert",children:[f("div",{className:"ak-error__icon",children:"⚠️"}),f("div",{className:"ak-error__content",children:f("p",{className:"ak-error__message",children:t})})]})}function Ir({config:t,messages:e,isLoading:n,error:r,isInline:a,initStatus:i,initError:s,callbacks:o}){return f("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating ak-shell-enter",role:"dialog","aria-label":t.title,children:[f(xo,{title:t.title,subtitle:t.subtitle,avatarUrl:t.avatarUrl,onClose:o.onClose,hideClose:a}),i==="validating"&&f("div",{className:"ak-init-status",children:f("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&f("div",{className:"ak-init-status ak-init-status--error",children:f(Cr,{message:s??"Widget configuration is invalid."})}),i==="ready"&&f(X,{children:[f(To,{messages:e,isLoading:n,thinkingViewable:t.thinkingViewable}),r&&f(Cr,{message:r}),f(Eo,{onSend:o.onSendMessage,disabled:n,placeholder:"Type a message…",privacyPolicyUrl:t.privacyPolicyUrl})]})]})}function Mo(){return f("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function jo(){return f("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Oo({isOpen:t,onClick:e,avatarUrl:n,ariaLabel:r="Toggle chat"}){const a=!t&&!!n;return f("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:e,"aria-label":r,"aria-expanded":t,type:"button",children:t?f(jo,{}):a?f("img",{src:n,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):f(Mo,{})})}function Nr({config:t,state:e,callbacks:n}){const r=t.mode==="inline",a=ct(null);return ot(()=>{var l;const i=(l=a.current)==null?void 0:l.getRootNode(),s=i==null?void 0:i.host;if(!s)return;const o=vo(t.theme.mode);s.setAttribute("data-theme",o)},[t.theme.mode]),r?f("div",{ref:a,className:"ak-inline",children:f(Ir,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!0,initStatus:e.initStatus,initError:e.initError,callbacks:n})}):f("div",{ref:a,className:"ak-floating",children:[e.isOpen&&f(Ir,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!1,initStatus:e.initStatus,initError:e.initError,callbacks:n}),f(Oo,{isOpen:e.isOpen,onClick:e.isOpen?n.onClose:n.onOpen,avatarUrl:t.avatarUrl})]})}const Tr=(t,e,n,r)=>{const a=go(t);return a.render(We(Nr,{config:e,state:n,callbacks:r})),{update(i,s){a.render(We(Nr,{config:s,state:i,callbacks:r}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Lr(t){return yo+`
|
|
802
|
-
|
|
829
|
+
|
|
830
|
+
/* ── Powered by hanging tab ──────────────────────────────────── */
|
|
831
|
+
.ak-branding {
|
|
832
|
+
display: inline-flex;
|
|
833
|
+
align-items: center;
|
|
834
|
+
gap: 4px;
|
|
835
|
+
padding: 4px 10px 5px;
|
|
836
|
+
background: var(--ak-bg);
|
|
837
|
+
border: 1px solid var(--ak-border);
|
|
838
|
+
border-top: none;
|
|
839
|
+
border-radius: 0 0 8px 8px;
|
|
840
|
+
margin-left: 16px;
|
|
841
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
|
|
842
|
+
}
|
|
843
|
+
.ak-branding__logo {
|
|
844
|
+
width: 11px;
|
|
845
|
+
height: 11px;
|
|
846
|
+
flex-shrink: 0;
|
|
847
|
+
color: var(--ak-accent);
|
|
848
|
+
opacity: 0.75;
|
|
849
|
+
}
|
|
850
|
+
.ak-branding__label {
|
|
851
|
+
font-size: 9px;
|
|
852
|
+
color: var(--ak-text-muted);
|
|
853
|
+
opacity: 0.75;
|
|
854
|
+
}
|
|
855
|
+
.ak-branding__name {
|
|
856
|
+
font-size: 9px;
|
|
857
|
+
font-weight: 600;
|
|
858
|
+
color: var(--ak-accent);
|
|
859
|
+
opacity: 0.75;
|
|
860
|
+
letter-spacing: -0.01em;
|
|
861
|
+
}
|
|
862
|
+
`,jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vo=0,Oc=Array.isArray;function f(e,t,r,n,a,i){t||(t={});var s,o,l=t;if("ref"in l)for(o in l={},t)o=="ref"?s=t[o]:l[o]=t[o];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Vo,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(o in s)l[o]===void 0&&(l[o]=s[o]);return I.vnode&&I.vnode(c),c}function Fo(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),f("circle",{cx:"12",cy:"5",r:"2"}),f("path",{d:"M12 7v4"}),f("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),f("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function Wo(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function $o({title:e,subtitle:t,avatarUrl:r,onClose:n,hideClose:a=!1}){return f("div",{className:"ak-header",children:[r?f("img",{src:r,alt:"",className:"ak-header__avatar","aria-hidden":"true"}):f("span",{className:"ak-header__bot-icon","aria-hidden":"true",children:f(Fo,{})}),f("div",{className:"ak-header__title-group",children:[f("span",{className:"ak-header__title",children:e}),t&&f("span",{className:"ak-header__subtitle",children:t})]}),f("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[f("span",{className:"ak-header__status","aria-hidden":"true"}),!a&&f("button",{className:"ak-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:f(Wo,{})})]})]})}function Uo({thinking:e,isThinking:t,thinkingViewable:r}){const[n,a]=ut(!1);return!t&&!e?null:t?f("div",{className:"ak-thinking",children:f("div",{className:"ak-thinking__indicator",children:[f("span",{className:"ak-thinking__label",children:"Thinking"}),f("span",{className:"ak-cursor","aria-hidden":"true",children:[f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"})]})]})}):!r||!e?null:f("div",{className:"ak-thinking ak-thinking--done",children:[f("button",{className:"ak-thinking__toggle",onClick:()=>a(i=>!i),"aria-expanded":n,type:"button",children:[f("svg",{className:`ak-thinking__chevron${n?" ak-thinking__chevron--open":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f("polyline",{points:"6 9 12 15 18 9"})}),f("span",{children:"Thought for a moment"})]}),n&&f("div",{className:"ak-thinking__content",children:e})]})}function Do(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}var Pn=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;function J(e){const t=[];let r=0,n=0;Pn.lastIndex=0;let a;for(;(a=Pn.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));const i=a[0];if(i.startsWith("`"))t.push(f("code",{className:"ak-md-ic",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))t.push(f("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("*"))t.push(f("em",{children:i.slice(1,-1)},n++));else if(i.startsWith("![")){const s=i.match(/!\[([^\]]*)\]\(([^)]+)\)/);s&&t.push(f("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]||"image"},n++))}else{const s=i.match(/\[(.+?)\]\((.+?)\)/);s?t.push(f("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]},n++)):t.push(i)}r=a.index+i.length}return r<e.length&&t.push(e.slice(r)),t}function zo(e){const t=e.split(`
|
|
863
|
+
`),r=[];let n=0,a=0;for(;n<t.length;){const i=t[n],s=i.match(/^(\s*)```/);if(s){const c=s[1],u=i.trimStart().match(/^```(\w+)?\s*$/)?.[1]||"",d=[];for(n++;n<t.length&&!t[n].trimStart().startsWith("```");)d.push(t[n].startsWith(c)?t[n].slice(c.length):t[n]),n++;n<t.length&&t[n].trimStart().startsWith("```")&&n++,r.push(f("div",{className:"ak-md-pre-wrap",children:[u&&f("span",{className:"ak-md-pre-lang",children:u}),f("pre",{className:`ak-md-pre${u?` ak-md-pre--${u}`:""}`,children:f("code",{className:"ak-md-code",children:d.join(`
|
|
864
|
+
`)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const c=o[1].length,u=o[2]?J(o[2].trim()):"";c===1?r.push(f("h1",{className:"ak-md-h1",children:u},a++)):c===2?r.push(f("h2",{className:"ak-md-h2",children:u},a++)):c===3?r.push(f("h3",{className:"ak-md-h3",children:u},a++)):c===4?r.push(f("h4",{className:"ak-md-h4",children:u},a++)):c===5?r.push(f("h5",{className:"ak-md-h5",children:u},a++)):r.push(f("h6",{className:"ak-md-h6",children:u},a++)),n++;continue}if(/^[-*_]{3,}$/.test(i.trim())){r.push(f("hr",{className:"ak-md-hr"},a++)),n++;continue}if(/^[-*+]\s/.test(i)){const c=[];let u=n;for(;u<t.length&&(/^[-*+]\s/.test(t[u])||t[u].trim()==="");){if(t[u].trim()===""){u++;continue}const d=t[u].length-t[u].trimStart().length,m=t[u].replace(/^[-*+]\s+/,""),h=[],x=[];let b=u+1;for(;b<t.length&&b<u+20;){const y=t[b];if(y.length-y.trimStart().length>d&&y.trim()!==""){const _=y.trim();/^[-*+]\s/.test(_)?h.push(f("li",{children:J(_.replace(/^[-*+]\s+/,""))},`nested-${b}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(_)},`cont-${b}`)),b++}else break}const N=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:N},`item-${u}`)),u=b}r.push(f("ul",{className:"ak-md-ul",children:c},a++)),n=u;continue}if(/^\d+\.\s/.test(i)){const c=[];let u=n;for(;u<t.length&&(/^\d+\.\s/.test(t[u])||t[u].trim()==="");){if(t[u].trim()===""){u++;continue}const d=t[u].length-t[u].trimStart().length,m=t[u].replace(/^\d+\.\s+/,""),h=[],x=[];let b=u+1;for(;b<t.length&&b<u+20;){const y=t[b];if(y.length-y.trimStart().length>d&&y.trim()!==""){const _=y.trim();/^\d+\.\s/.test(_)?h.push(f("li",{children:J(_.replace(/^\d+\.\s+/,""))},`nested-order-${b}`)):/^[-*+]\s/.test(_)?h.push(f("li",{children:J(_.replace(/^[-*+]\s+/,""))},`nested-unorder-${b}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(_)},`cont-${b}`)),b++}else break}const N=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:N},`order-item-${u}`)),u=b}r.push(f("ol",{className:"ak-md-ol",children:c},a++)),n=u;continue}if(i.trim()===""){n++;continue}const l=[];for(;n<t.length&&t[n].trim()!==""&&!t[n].startsWith("#")&&!/^\s*```/.test(t[n])&&!/^[-*+]\s/.test(t[n])&&!/^\d+\.\s/.test(t[n])&&!/^[-*_]{3,}$/.test(t[n].trim());)l.push(t[n]),n++;if(l.length>0){const c=[];l.forEach((u,d)=>{c.push(...J(u)),d<l.length-1&&c.push(f("br",{},`br-${d}`))}),r.push(f("p",{className:"ak-md-p",children:c},a++))}}return f(X,{children:r})}function Bo({message:e,thinkingViewable:t=!1}){const r=e.role==="user",n=e.status==="error",a=e.status==="streaming",i=!!(e.images&&e.images.length>0),s=!!(r&&e.uploadedImageUrl),o=i||s,l=!r&&!n,c=r?"ak-message--user":n?"ak-message--assistant ak-message--error":"ak-message--assistant",u=f(X,{children:[f("div",{className:["ak-message__bubble",l?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),children:[s&&f("div",{className:"ak-message__images",children:f("div",{className:"ak-message__image-wrap",children:[f("a",{href:e.uploadedImageUrl,className:"ak-message__image-link",children:f("img",{src:e.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),f("a",{href:e.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:m=>m.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&f("div",{className:"ak-message__images",children:e.images.map((m,h)=>{const x=m.url??(m.base64?`data:${m.mimeType};base64,${m.base64}`:null);return x?f("div",{className:"ak-message__image-wrap",children:[f("a",{href:x,className:"ak-message__image-link",children:f("img",{src:x,alt:"Generated image",className:"ak-message__image"})}),f("a",{href:x,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:b=>b.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},h):null})}),(e.content||a&&!e.isThinking)&&f("div",{className:o?"ak-message__image-caption":void 0,children:[l?zo(e.content):e.content,a&&!e.isThinking&&f("span",{className:"ak-cursor","aria-hidden":"true",children:[f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"})]})]})]}),f("span",{className:"ak-message__time",children:Do(e.createdAt)})]}),d=!e.isThinking||!!e.content;return f("div",{className:`ak-message ${c}`,children:[!r&&f(Uo,{thinking:e.thinking,isThinking:e.isThinking??!1,thinkingViewable:t}),d&&u]})}function Ho(){return f("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"})]})}function Go({messages:e,isLoading:t,thinkingViewable:r}){const n=ht(null),a=e.find(s=>s.status==="streaming")?.content??"",i=e.find(s=>s.isThinking)?.thinking??"";return ft(()=>{n.current?.scrollIntoView({behavior:"smooth"})},[e.length,t,a,i]),f("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[e.map(s=>f(Bo,{message:s,thinkingViewable:r},s.id)),t&&!e.some(s=>s.status==="streaming")&&f(Ho,{}),f("div",{ref:n})]})}function Yo(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),f("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Xo(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),f("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function Jo(){return f("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Ko({onSend:e,disabled:t=!1,placeholder:r="Type a message…",privacyPolicyUrl:n}){const[a,i]=ut(""),[s,o]=ut(null),[l,c]=ut(null),u=ht(null),d=ht(null);ft(()=>()=>{l&&URL.revokeObjectURL(l)},[l]),ft(()=>{t||u.current?.focus()},[t]);function m(){o(null),l&&URL.revokeObjectURL(l),c(null),d.current&&(d.current.value="")}function h(){const _=a.trim();!_&&!s||t||(e(_,s??void 0),i(""),m(),u.current&&(u.current.style.height="auto"))}function x(_){_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),h())}function b(_){const L=_.currentTarget;i(L.value),L.style.height="auto",L.style.height=`${L.scrollHeight}px`}function N(_){const L=_.currentTarget.files?.[0];if(L){if(L.size>5242880){alert("Image must be smaller than 5 MB."),_.currentTarget.value="";return}l&&URL.revokeObjectURL(l),o(L),c(URL.createObjectURL(L))}}const y=!t&&(!!a.trim()||!!s);return f("div",{className:"ak-composer",children:[l&&f("div",{className:"ak-composer__preview",children:f("div",{className:"ak-composer__preview-wrap",children:[f("img",{src:l,alt:"Selected",className:"ak-composer__preview-img"}),f("button",{className:"ak-composer__preview-remove",onClick:m,type:"button","aria-label":"Remove image",disabled:t,children:f(Jo,{})})]})}),f("div",{className:"ak-composer__input-wrap",children:[f("input",{ref:d,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:N,disabled:t,"aria-label":"Attach image"}),f("button",{className:"ak-composer__attach",onClick:()=>d.current?.click(),disabled:t,"aria-label":"Attach image",type:"button",children:f(Xo,{})}),f("textarea",{ref:u,className:"ak-composer__input",value:a,onInput:b,onKeyDown:x,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),f("button",{className:"ak-composer__send",onClick:h,disabled:!y,"aria-label":"Send message",type:"button",children:f(Yo,{})})]}),f("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",n?f("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}):"Privacy Policy"]})]})}function Vn({message:e}){return e.includes("Origin not allowed")?f("div",{className:"ak-error ak-error--origin",role:"alert",children:[f("div",{className:"ak-error__icon",children:"🔒"}),f("div",{className:"ak-error__content",children:[f("h3",{className:"ak-error__title",children:"Access Restricted"}),f("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only."}),f("p",{className:"ak-error__message",children:"Contact the website administrator if you believe this is an error."})]})]}):f("div",{className:"ak-error",role:"alert",children:[f("div",{className:"ak-error__icon",children:"⚠️"}),f("div",{className:"ak-error__content",children:f("p",{className:"ak-error__message",children:e})})]})}function Qo(){return f("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"ak-branding__logo",children:[f("rect",{width:"24",height:"24",rx:"5",fill:"currentColor"}),f("path",{d:"M12 5L7 13h3.5v6l6.5-9H13.5V5z",fill:"white"})]})}function qo(){return f("div",{className:"ak-branding",children:[f(Qo,{}),f("span",{className:"ak-branding__label",children:"Powered by"}),f("span",{className:"ak-branding__name",children:"AgentForge"})]})}function Fn({config:e,messages:t,isLoading:r,error:n,isInline:a,initStatus:i,initError:s,callbacks:o}){return f("div",{className:a?"ak-shell-wrap":"ak-shell-wrap ak-shell-enter",children:[f("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating",role:"dialog","aria-label":e.title,children:[f($o,{title:e.title,subtitle:e.subtitle,avatarUrl:e.avatarUrl,onClose:o.onClose,hideClose:a}),i==="validating"&&f("div",{className:"ak-init-status",children:f("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&f("div",{className:"ak-init-status ak-init-status--error",children:f(Vn,{message:s??"Widget configuration is invalid."})}),i==="ready"&&f(X,{children:[f(Go,{messages:t,isLoading:r,thinkingViewable:e.thinkingViewable}),n&&f(Vn,{message:n}),f(Ko,{onSend:o.onSendMessage,disabled:r,placeholder:"Type a message…",privacyPolicyUrl:e.privacyPolicyUrl})]})]}),!a&&f(qo,{})]})}function ec(){return f("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function tc(){return f("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function rc({isOpen:e,onClick:t,avatarUrl:r,ariaLabel:n="Toggle chat"}){const a=!e&&!!r;return f("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:t,"aria-label":n,"aria-expanded":e,type:"button",children:e?f(tc,{}):a?f("img",{src:r,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):f(ec,{})})}function Wn({config:e,state:t,callbacks:r}){const n=e.mode==="inline",a=ht(null);return ft(()=>{const i=a.current?.getRootNode()?.host;if(!i)return;const s=Oo(e.theme.mode);i.setAttribute("data-theme",s)},[e.theme.mode]),n?f("div",{ref:a,className:"ak-inline",children:f(Fn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!0,initStatus:t.initStatus,initError:t.initError,callbacks:r})}):f("div",{ref:a,className:"ak-floating",children:[t.isOpen&&f(Fn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!1,initStatus:t.initStatus,initError:t.initError,callbacks:r}),f(rc,{isOpen:t.isOpen,onClick:t.isOpen?r.onClose:r.onOpen,avatarUrl:e.avatarUrl})]})}var $n=(e,t,r,n)=>{const a=Mo(e);return a.render(Ve(Wn,{config:t,state:r,callbacks:n})),{update(i,s){a.render(Ve(Wn,{config:s,state:i,callbacks:n}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Un(e){return Po+`
|
|
865
|
+
`+jo(e)}var Dn={init(e){return oo(e,$n,Un(Ae(e)))},mount(e,t){return co(e,t,$n,Un(Ae({...t,mode:"inline"})))},destroy(e){lo(e)}};return window.AgentKit=Dn,vt.AgentKit=Dn,vt})({});
|