@bymos/agentkit-sdk 0.2.0 → 0.3.1

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.
@@ -1,9 +1,9 @@
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+=`
1
+ var AgentKit=(function(kt){Object.defineProperty(kt,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 lr;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lr||(lr={}));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"]),te=class Gn 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 Gn))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()}};te.create=e=>new te(e);var Ae=(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=Ae;function bt(){return qn}var xt=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=bt(),n=xt({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ae?void 0:Ae].filter(a=>!!a)});e.common.issues.push(n)}var U=class Yn{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 Yn.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"}),Re=e=>({status:"dirty",value:e}),D=e=>({status:"valid",value:e}),dr=e=>e.status==="aborted",ur=e=>e.status==="dirty",ye=e=>e.status==="valid",Be=e=>typeof Promise<"u"&&e instanceof Promise,b;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(b||(b={}));var re=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}},fr=(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 te(e.common.issues),this._error)}}};function I(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 U,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(Be(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 fr(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 fr(r,await(Be(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 se({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 oe.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Ee.create(this,this._def)}or(e){return Xe.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new se({...I(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new tt({...I(this._def),innerType:this,defaultValue:t,typeName:S.ZodDefault})}brand(){return new gr({typeName:S.ZodBranded,type:this,...I(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new rt({...I(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 _r.create(this,e)}readonly(){return nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ea=/^c[^\s-]{8,}$/i,ta=/^[0-9a-z]+$/,ra=/^[0-9A-HJKMNP-TV-Z]{26}$/i,na=/^[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,aa=/^[a-z0-9_-]{21}$/i,ia=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sa=/^[-+]?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)?)??$/,oa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ca="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wt,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])$/,da=/^(?:(?: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])$/,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]))$/,fa=/^(([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])$/,ha=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ma=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hr="((\\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])))",pa=new RegExp(`^${hr}$`);function mr(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 ga(e){return new RegExp(`^${mr(e)}$`)}function _a(e){let t=`${hr}T${mr(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 va(e,t){return!!((t==="v4"||!t)&&la.test(e)||(t==="v6"||!t)&&ua.test(e))}function ya(e,t){if(!ia.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 ka(e,t){return!!((t==="v4"||!t)&&da.test(e)||(t==="v6"||!t)&&fa.test(e))}var He=class Ue 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 U;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")oa.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")wt||(wt=new RegExp(ca,"u")),wt.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")na.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")aa.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")ea.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")ta.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")ra.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"?_a(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"?pa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?ga(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"?sa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"duration",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?va(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"?ya(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"?ka(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"?ha.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?ma.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,...b.errToObj(n)})}_addCheck(t){return new Ue({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...b.errToObj(t)})}url(t){return this._addCheck({kind:"url",...b.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...b.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...b.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...b.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...b.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...b.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...b.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...b.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...b.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...b.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...b.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...b.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,...b.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,...b.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...b.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...b.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...b.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...b.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...b.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...b.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...b.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...b.errToObj(r)})}nonempty(t){return this.min(1,b.errToObj(t))}trim(){return new Ue({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ue({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ue({...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}};He.create=e=>new He({checks:[],typeName:S.ZodString,coerce:e?.coerce??!1,...I(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 St=class ar 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 U;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,b.toString(r))}gt(t,r){return this.setLimit("min",t,!1,b.toString(r))}lte(t,r){return this.setLimit("max",t,!0,b.toString(r))}lt(t,r){return this.setLimit("max",t,!1,b.toString(r))}setLimit(t,r,n,a){return new ar({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(t){return new ar({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:b.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:b.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:b.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.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)}};St.create=e=>new St({checks:[],typeName:S.ZodNumber,coerce:e?.coerce||!1,...I(e)});var Ct=class ir 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 U;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,b.toString(r))}gt(t,r){return this.setLimit("min",t,!1,b.toString(r))}lte(t,r){return this.setLimit("max",t,!0,b.toString(r))}lt(t,r){return this.setLimit("max",t,!1,b.toString(r))}setLimit(t,r,n,a){return new ir({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(t){return new ir({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:b.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}};Ct.create=e=>new Ct({checks:[],typeName:S.ZodBigInt,coerce:e?.coerce??!1,...I(e)});var It=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 D(e.data)}};It.create=e=>new It({typeName:S.ZodBoolean,coerce:e?.coerce||!1,...I(e)});var Nt=class Xn 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 U;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 Xn({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:b.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:b.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}};Nt.create=e=>new Nt({checks:[],coerce:e?.coerce||!1,typeName:S.ZodDate,...I(e)});var Tt=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 D(e.data)}};Tt.create=e=>new Tt({typeName:S.ZodSymbol,...I(e)});var Ge=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 D(e.data)}};Ge.create=e=>new Ge({typeName:S.ZodUndefined,...I(e)});var Ye=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 D(e.data)}};Ye.create=e=>new Ye({typeName:S.ZodNull,...I(e)});var Lt=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return D(e.data)}};Lt.create=e=>new Lt({typeName:S.ZodAny,...I(e)});var ke=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return D(e.data)}};ke.create=e=>new ke({typeName:S.ZodUnknown,...I(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,...I(e)});var At=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 D(e.data)}};At.create=e=>new At({typeName:S.ZodVoid,...I(e)});var be=class vt 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 re(r,s,r.path,o)))).then(s=>U.mergeArray(n,s));const i=[...r.data].map((s,o)=>a.type._parseSync(new re(r,s,r.path,o)));return U.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new vt({...this._def,minLength:{value:t,message:b.toString(r)}})}max(t,r){return new vt({...this._def,maxLength:{value:t,message:b.toString(r)}})}length(t,r){return new vt({...this._def,exactLength:{value:t,message:b.toString(r)}})}nonempty(t){return this.min(1,t)}};be.create=(e,t)=>new be({type:e,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...I(t)});function xe(e){if(e instanceof J){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=oe.create(xe(n))}return new J({...e._def,shape:()=>t})}else return e instanceof be?new be({...e._def,type:xe(e.element)}):e instanceof oe?oe.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 J=class ee 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],f=n.data[l];o.push({key:{status:"valid",value:l},value:c._parse(new re(n,f,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 f=n.data[c];o.push({key:{status:"valid",value:c},value:l._parse(new re(n,f,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of o){const f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>U.mergeObjectSync(r,l)):U.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return b.errToObj,new ee({...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:b.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(t){return new ee({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ee({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 ee({...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 ee({...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 ee({...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 ee({...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 oe;)a=a._def.innerType;r[n]=a}return new ee({...this._def,shape:()=>r})}keyof(){return pr(A.objectKeys(this.shape))}};J.create=(e,t)=>new J({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...I(t)}),J.strictCreate=(e,t)=>new J({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:S.ZodObject,...I(t)}),J.lazycreate=(e,t)=>new J({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...I(t)});var Xe=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 te(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 te(o));return g(t,{code:p.invalid_union,unionErrors:s}),w}}get options(){return this._def.options}};Xe.create=(e,t)=>new Xe({options:e,typeName:S.ZodUnion,...I(t)});var ie=e=>e instanceof Qe?ie(e.schema):e instanceof se?ie(e.innerType()):e instanceof Ke?[e.value]:e instanceof qe?e.options:e instanceof et?A.objectValues(e.enum):e instanceof tt?ie(e._def.innerType):e instanceof Ge?[void 0]:e instanceof Ye?[null]:e instanceof oe?[void 0,...ie(e.unwrap())]:e instanceof _e?[null,...ie(e.unwrap())]:e instanceof gr||e instanceof nt?ie(e.unwrap()):e instanceof rt?ie(e._def.innerType):[],xa=class Jn 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=ie(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 Jn({typeName:S.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...I(n)})}};function Rt(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=Rt(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=Rt(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 Je=class extends T{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(dr(a)||dr(i))return w;const s=Rt(a.value,i.value);return s.valid?((ur(a)||ur(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}))}};Je.create=(e,t,r)=>new Je({left:e,right:t,typeName:S.ZodIntersection,...I(r)});var ge=class Qn 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 re(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>U.mergeArray(r,i)):U.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Qn({...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,...I(t)})};var wa=class sr 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 re(n,o,n.path,o)),value:s._parse(new re(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?U.mergeObjectAsync(r,a):U.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new sr({keyType:t,valueType:r,typeName:S.ZodRecord,...I(n)}):new sr({keyType:He.create(),valueType:t,typeName:S.ZodRecord,...I(r)})}},Et=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 re(r,s,r.path,[l,"key"])),value:a._parse(new re(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}}}};Et.create=(e,t,r)=>new Et({valueType:t,keyType:e,typeName:S.ZodMap,...I(r)});var Zt=class or 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 f of l){if(f.status==="aborted")return w;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}const o=[...n.data.values()].map((l,c)=>i._parse(new re(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(t,r){return new or({...this._def,minSize:{value:t,message:b.toString(r)}})}max(t,r){return new or({...this._def,maxSize:{value:t,message:b.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Zt.create=(e,t)=>new Zt({valueType:e,minSize:null,maxSize:null,typeName:S.ZodSet,...I(t)});var Sa=class yt 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 xt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bt(),Ae].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function a(o,l){return xt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bt(),Ae].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 Ee){const o=this;return D(async function(...l){const c=new te([]),f=await o._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(n(l,m)),c}),d=await Reflect.apply(s,this,f);return await o._def.returns._def.type.parseAsync(d,i).catch(m=>{throw c.addIssue(a(d,m)),c})})}else{const o=this;return D(function(...l){const c=o._def.args.safeParse(l,i);if(!c.success)throw new te([n(l,c.error)]);const f=Reflect.apply(s,this,c.data),d=o._def.returns.safeParse(f,i);if(!d.success)throw new te([a(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new yt({...this._def,args:ge.create(t).rest(ke.create())})}returns(t){return new yt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new yt({args:t||ge.create([]).rest(ke.create()),returns:r||ke.create(),typeName:S.ZodFunction,...I(n)})}},Qe=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})}};Qe.create=(e,t)=>new Qe({getter:e,typeName:S.ZodLazy,...I(t)});var Ke=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}};Ke.create=(e,t)=>new Ke({value:e,typeName:S.ZodLiteral,...I(t)});function pr(e,t){return new qe({values:e,typeName:S.ZodEnum,...I(t)})}var qe=class cr 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 D(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 cr.create(t,{...this._def,...r})}exclude(t,r=this._def){return cr.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};qe.create=pr;var et=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 D(e.data)}get enum(){return this._def.values}};et.create=(e,t)=>new et({values:e,typeName:S.ZodNativeEnum,...I(t)});var Ee=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):D((t.parsedType===v.promise?t.data:Promise.resolve(t.data)).then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ee.create=(e,t)=>new Ee({type:e,typeName:S.ZodPromise,...I(t)});var se=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"?Re(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"?Re(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)}};se.create=(e,t,r)=>new se({schema:e,typeName:S.ZodEffects,effect:t,...I(r)}),se.createWithPreprocess=(e,t,r)=>new se({schema:t,effect:{type:"preprocess",transform:e},typeName:S.ZodEffects,...I(r)});var oe=class extends T{_parse(e){return this._getType(e)===v.undefined?D(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};oe.create=(e,t)=>new oe({innerType:e,typeName:S.ZodOptional,...I(t)});var _e=class extends T{_parse(e){return this._getType(e)===v.null?D(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_e.create=(e,t)=>new _e({innerType:e,typeName:S.ZodNullable,...I(t)});var tt=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}};tt.create=(e,t)=>new tt({innerType:e,typeName:S.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...I(t)});var rt=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 Be(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new te(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new te(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};rt.create=(e,t)=>new rt({innerType:e,typeName:S.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...I(t)});var jt=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}}};jt.create=e=>new jt({typeName:S.ZodNaN,...I(e)});var gr=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}},_r=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(),Re(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})}},nt=class extends T{_parse(e){const t=this._def.innerType._parse(e),r=n=>(ye(n)&&(n.value=Object.freeze(n.value)),n);return Be(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};nt.create=(e,t)=>new nt({innerType:e,typeName:S.ZodReadonly,...I(t)});var lc={object:J.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 $=He.create,dc=St.create,uc=jt.create,fc=Ct.create,Ca=It.create,hc=Nt.create,mc=Tt.create,pc=Ge.create,gc=Ye.create,_c=Lt.create,Ia=ke.create,vc=he.create,yc=At.create,kc=be.create,Mt=J.create,bc=J.strictCreate,xc=Xe.create,wc=xa.create,Sc=Je.create,Cc=ge.create,Na=wa.create,Ic=Et.create,Nc=Zt.create,Tc=Sa.create,Lc=Qe.create,Ac=Ke.create,vr=qe.create,Rc=et.create,Ec=Ee.create,Zc=se.create,jc=oe.create,Mc=_e.create,Oc=se.createWithPreprocess,Pc=_r.create,Ta=Mt({mode:vr(["light","dark","system"]).optional(),accentColor:$().optional(),fontFamily:$().optional(),borderRadius:$().optional()}),La=Mt({externalId:$().optional(),authId:$().optional(),name:$().optional(),email:$().optional()}),yr=Mt({agentId:$().min(1,"agentId is required"),apiBaseUrl:$().url("apiBaseUrl must be a valid URL"),tenantId:$().optional(),user:La.optional(),sessionId:$().optional(),mode:vr(["floating","inline"]).optional(),title:$().optional(),subtitle:$().optional(),description:$().optional(),greeting:$().optional(),avatarUrl:$().optional(),privacyPolicyUrl:$().optional(),streaming:Ca().optional(),metadata:Na(Ia()).optional(),theme:Ta.optional()}),Aa=yr.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 Ze(e,t){yr.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?Aa.passthrough().safeParse(n).data:void 0,i=a?kr(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,user:{externalId:i.user?.externalId,authId:i.user?.authId,name:i.user?.name,email:i.user?.email},sessionId:i.sessionId,mode:i.mode??ve.mode,title:i.title??ve.title,subtitle:i.subtitle,description:i.description,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,photoSendingEnabled:a?.photoSendingEnabled===!0}}function kr(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]=kr(r[n],a):r[n]=a)}return r}var Ot=function(){return Ot=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},Ot.apply(this,arguments)};function ne(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(f){try{c(n.next(f))}catch(d){s(d)}}function l(f){try{c(n.throw(f))}catch(d){s(d)}}function c(f){f.done?i(f.value):a(f.value).then(o,l)}c((n=n.apply(e,t||[])).next())})}function ae(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(f){return l([c,f])}}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(f){c=[6,f],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 xr="4.6.2";function at(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function Ra(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Ea(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})}):at(Math.min(e,t))}function wr(e){return!!e&&typeof e.then=="function"}function Sr(e,t){try{var r=e();wr(r)?r.then(function(n){return t(!0,n)},function(n){return t(!1,n)}):t(!0,r)}catch(n){t(!1,n)}}function Cr(e,t,r){return r===void 0&&(r=16),ne(this,void 0,void 0,function(){var n,a,i,s;return ae(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,Ra()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,n]}})})}function je(e){return e.then(void 0,function(){}),e}function Za(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}function ja(e,t){return!Za(e,t)}function Pt(e){return parseInt(e)}function Q(e){return parseFloat(e)}function ce(e,t){return typeof e=="number"&&isNaN(e)?t:e}function F(e){return e.reduce(function(t,r){return t+(r?1:0)},0)}function Ir(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 Ma(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 f=c[0];switch(f[0]){case".":l("class",f.slice(1));break;case"#":l("id",f.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(f);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 Oa(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,f=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,f+=d>>>16,d&=65535,f+=r+s,f&=65535,e[0]=f<<16|d,e[1]=m<<16|h}function Y(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,f=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,f+=d>>>16,d&=65535,d+=a*l,f+=d>>>16,d&=65535,d+=i*o,f+=d>>>16,d&=65535,f+=r*c+n*l+a*o+i*s,f&=65535,e[0]=f<<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 B(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 j(e,t){e[0]^=t[0],e[1]^=t[1]}var Pa=[4283543511,3981806797],Va=[3301882366,444984403];function Nr(e){var t=[0,e[0]>>>1];j(e,t),Y(e,Pa),t[1]=e[0]>>>1,j(e,t),Y(e,Va),t[1]=e[0]>>>1,j(e,t)}var it=[2277735313,289559509],st=[1291169091,658871167],Tr=[0,5],$a=[0,1390208809],Fa=[0,944331445];function Wa(e,t){var r=Oa(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],f;for(f=0;f<i;f=f+16)l[0]=r[f+4]|r[f+5]<<8|r[f+6]<<16|r[f+7]<<24,l[1]=r[f]|r[f+1]<<8|r[f+2]<<16|r[f+3]<<24,c[0]=r[f+12]|r[f+13]<<8|r[f+14]<<16|r[f+15]<<24,c[1]=r[f+8]|r[f+9]<<8|r[f+10]<<16|r[f+11]<<24,Y(l,it),we(l,31),Y(l,st),j(s,l),we(s,27),me(s,o),Y(s,Tr),me(s,$a),Y(c,st),we(c,33),Y(c,it),j(o,c),we(o,31),me(o,s),Y(o,Tr),me(o,Fa);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(a){case 15:d[1]=r[f+14],B(d,48),j(c,d);case 14:d[1]=r[f+13],B(d,40),j(c,d);case 13:d[1]=r[f+12],B(d,32),j(c,d);case 12:d[1]=r[f+11],B(d,24),j(c,d);case 11:d[1]=r[f+10],B(d,16),j(c,d);case 10:d[1]=r[f+9],B(d,8),j(c,d);case 9:d[1]=r[f+8],j(c,d),Y(c,st),we(c,33),Y(c,it),j(o,c);case 8:d[1]=r[f+7],B(d,56),j(l,d);case 7:d[1]=r[f+6],B(d,48),j(l,d);case 6:d[1]=r[f+5],B(d,40),j(l,d);case 5:d[1]=r[f+4],B(d,32),j(l,d);case 4:d[1]=r[f+3],B(d,24),j(l,d);case 3:d[1]=r[f+2],B(d,16),j(l,d);case 2:d[1]=r[f+1],B(d,8),j(l,d);case 1:d[1]=r[f],j(l,d),Y(l,it),we(l,31),Y(l,st),j(s,l)}return j(s,n),j(o,n),me(s,o),me(o,s),Nr(s),Nr(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 za(e){var t;return Ot({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
2
+ `)},e)}function Da(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Ua(e){return typeof e!="function"}function Ba(e,t){var r=je(new Promise(function(n){var a=Date.now();Sr(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 f=Date.now();Sr(l,function(){for(var d=[],m=0;m<arguments.length;m++)d[m]=arguments[m];var h=o+Date.now()-f;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 Ha(e,t,r,n){var a=Object.keys(e).filter(function(s){return ja(r,s)}),i=je(Cr(a,function(s){return Ba(e[s],t)},n));return function(){return ne(this,void 0,void 0,function(){var o,l,c,f,d;return ae(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,Cr(o,function(h){return je(h())},n)];case 2:return l=m.sent(),[4,Promise.all(l)];case 3:for(c=m.sent(),f={},d=0;d<a.length;++d)f[a[d]]=c[d];return[2,f]}})})}}function Lr(){var e=window,t=navigator;return F(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Ga(){var e=window,t=navigator;return F(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Lr()}function Me(){var e=window,t=navigator;return F(["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 K(){var e=window,t=navigator;return F(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Vt(){var e=window,t=e.HTMLElement,r=e.Document;return F(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),r&&"pointerLockElement"in r.prototype])>=4}function Oe(){var e=window;return Da(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Ar(){var e,t,r=window;return F(["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 Ya(){var e=window;return F([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Xa(){var e=window,t=e.URLPattern;return F(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Ja(){var e=window;return F(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Pe(){var e=window,t=navigator,r=e.CSS,n=e.HTMLButtonElement;return F([!("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 Qa(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return F(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Ka(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function qa(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function $t(){var e=Me(),t=Ar(),r=window,n=navigator,a="connection";return e?F([!("SharedWorker"in r),n[a]&&"ontypechange"in n[a],!("sinkId"in new Audio)])>=2:t?F(["onorientationchange"in r,"orientation"in r,/android/i.test(n.appVersion)])>=2:!1}function ei(){var e=navigator,t=window,r=Audio.prototype,n=t.visualViewport;return F(["srLatency"in r,"srChannelCount"in r,"devicePosture"in e,n&&"segments"in n,"getTextInformation"in Image.prototype])>=3}function ti(){return ai()?-4:ri()}function ri(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ni())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=ii(n),o=s[0],l=s[1],c=je(o.then(function(f){return si(f.getChannelData(0).subarray(r))},function(f){if(f.name==="timeout"||f.name==="suspended")return-3;throw f}));return function(){return l(),c}}function ni(){return K()&&!Vt()&&!Ja()}function ai(){return K()&&Pe()&&Oe()||Me()&&ei()&&Xa()}function ii(e){var t=3,r=500,n=500,a=5e3,i=function(){};return[new Promise(function(s,o){var l=!1,c=0,f=0;e.oncomplete=function(h){return s(h.renderedBuffer)};var d=function(){setTimeout(function(){return o(Rr("timeout"))},Math.min(n,f+a-Date.now()))},m=function(){try{var h=e.startRendering();switch(wr(h)&&je(h),e.state){case"running":f=Date.now(),l&&d();break;case"suspended":document.hidden||c++,l&&c>=t?o(Rr("suspended")):setTimeout(m,r);break}}catch(k){o(k)}};m(),i=function(){l||(l=!0,f>0&&d())}}),i]}function si(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function Rr(e){var t=new Error(e);return t.name=e,t}function Er(e,t,r){var n,a,i;return r===void 0&&(r=50),ne(this,void 0,void 0,function(){var s,o;return ae(this,function(l){switch(l.label){case 0:s=document,l.label=1;case 1:return s.body?[3,3]:[4,at(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,f){var d=!1,m=function(){d=!0,c()},h=function(C){d=!0,f(C)};o.onload=m,o.onerror=h;var k=o.style;k.setProperty("display","block","important"),k.position="absolute",k.top="0",k.left="0",k.visibility="hidden",t&&"srcdoc"in o?o.srcdoc=t:o.src="about:blank",s.body.appendChild(o);var y=function(){var C,_;d||(((_=(C=o.contentWindow)===null||C===void 0?void 0:C.document)===null||_===void 0?void 0:_.readyState)==="complete"?m():setTimeout(y,10))};y()})];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,at(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 oi(e){for(var t=Ma(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"?ci(a.style,l):a.setAttribute(o,l)}return a}function ci(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 li(){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 di="mmMwWLliI0O&1",ui="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 fi(){var e=this;return Er(function(t,r){var n=r.document;return ne(e,void 0,void 0,function(){var a,i,s,o,l,c,f,d,m,h,k,y;return ae(this,function(C){for(a=n.body,a.style.fontSize=ui,i=n.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},l=function(_){var x=n.createElement("span"),Z=x.style;return Z.position="absolute",Z.top="0",Z.left="0",Z.fontFamily=_,x.textContent=di,i.appendChild(x),x},c=function(_,x){return l("'".concat(_,"',").concat(x))},f=function(){return Se.map(l)},d=function(){for(var _={},x=function(H){_[H]=Se.map(function(G){return c(H,G)})},Z=0,V=Zr;Z<V.length;Z++){var z=V[Z];x(z)}return _},m=function(_){return Se.some(function(x,Z){return _[Z].offsetWidth!==s[x]||_[Z].offsetHeight!==o[x]})},h=f(),k=d(),a.appendChild(i),y=0;y<Se.length;y++)s[Se[y]]=h[y].offsetWidth,o[Se[y]]=h[y].offsetHeight;return[2,Zr.filter(function(_){return m(k[_])})]})})})}function hi(){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 mi(){return pi(xi())}function pi(e){var t,r=!1,n,a,i=gi(),s=i[0],o=i[1];return _i(s,o)?(r=vi(o),e?n=a="skipped":(t=yi(s,o),n=t[0],a=t[1])):n=a="unsupported",{winding:r,geometry:n,text:a}}function gi(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function _i(e,t){return!!(t&&e.toDataURL)}function vi(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function yi(e,t){ki(e,t);var r=Ft(e);return r!==Ft(e)?["unstable","unstable"]:(bi(e,t),[Ft(e),r])}function ki(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 bi(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 Ft(e){return e.toDataURL()}function xi(){return K()&&Pe()&&Oe()}function wi(){var e=navigator,t=0,r;e.maxTouchPoints!==void 0?t=Pt(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 Si(){return navigator.oscpu}function Ci(){var e=navigator,t=[],r=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(r!==void 0&&t.push([r]),Array.isArray(e.languages))Me()&&Ya()||t.push(e.languages);else if(typeof e.languages=="string"){var n=e.languages;n&&t.push(n.split(","))}return t}function Ii(){return window.screen.colorDepth}function Ni(){return ce(Q(navigator.deviceMemory),void 0)}function Ti(){if(!(K()&&Pe()&&Oe()))return Li()}function Li(){var e=screen,t=function(n){return ce(Pt(n),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r}var Ai=2500,Ri=10,ot,Wt;function Ei(){if(Wt===void 0){var e=function(){var t=zt();Dt(t)?Wt=setTimeout(e,Ai):(ot=t,Wt=void 0)};e()}}function Zi(){var e=this;return Ei(),function(){return ne(e,void 0,void 0,function(){var t;return ae(this,function(r){switch(r.label){case 0:return t=zt(),Dt(t)?ot?[2,br([],ot,!0)]:Ka()?[4,qa()]:[3,2]:[3,2];case 1:r.sent(),t=zt(),r.label=2;case 2:return Dt(t)||(ot=t),[2,t]}})})}}function ji(){var e=this;if(K()&&Pe()&&Oe())return function(){return Promise.resolve(void 0)};var t=Zi();return function(){return ne(e,void 0,void 0,function(){var r,n;return ae(this,function(a){switch(a.label){case 0:return[4,t()];case 1:return r=a.sent(),n=function(i){return i===null?null:Ir(i,Ri)},[2,[n(r[0]),n(r[1]),n(r[2]),n(r[3])]]}})})}}function zt(){var e=screen;return[ce(Q(e.availTop),null),ce(Q(e.width)-Q(e.availWidth)-ce(Q(e.availLeft),0),null),ce(Q(e.height)-Q(e.availHeight)-ce(Q(e.availTop),0),null),ce(Q(e.availLeft),null)]}function Dt(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Mi(){return ce(Pt(navigator.hardwareConcurrency),void 0)}function Oi(){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=-Pi();return"UTC".concat(n>=0?"+":"").concat(n)}function Pi(){var e=new Date().getFullYear();return Math.max(Q(new Date(e,0,1).getTimezoneOffset()),Q(new Date(e,6,1).getTimezoneOffset()))}function Vi(){try{return!!window.sessionStorage}catch{return!0}}function $i(){try{return!!window.localStorage}catch{return!0}}function Fi(){if(!(Lr()||Ga()))try{return!!window.indexedDB}catch{return!0}}function Wi(){return!!window.openDatabase}function zi(){return navigator.cpuClass}function Di(){var e=navigator.platform;return e==="MacIntel"&&K()&&!Vt()?Qa()?"iPad":"iPhone":e}function Ui(){return navigator.vendor||""}function Bi(){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 Hi(){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 Gi(){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 Yi(e){var t=(e===void 0?{}:e).debug;return ne(this,void 0,void 0,function(){var r,n,a,i,s,o;return ae(this,function(l){switch(l.label){case 0:return Xi()?(r=Gi(),n=Object.keys(r),a=(o=[]).concat.apply(o,n.map(function(c){return r[c]})),[4,Ji(a)]):[2,void 0];case 1:return i=l.sent(),t&&Qi(r,i),s=n.filter(function(c){var f=r[c];return F(f.map(function(d){return i[d]}))>f.length*.6}),s.sort(),[2,s]}})})}function Xi(){return K()||$t()}function Ji(e){var t;return ne(this,void 0,void 0,function(){var r,n,a,i,l,s,o,l;return ae(this,function(c){switch(c.label){case 0:for(r=document,n=r.createElement("div"),a=new Array(e.length),i={},jr(n),l=0;l<e.length;++l)s=oi(e[l]),s.tagName==="DIALOG"&&s.show(),o=r.createElement("div"),jr(o),o.appendChild(s),n.appendChild(o),a[l]=s;c.label=1;case 1:return r.body?[3,3]:[4,at(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 jr(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Qi(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
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])&&lt(e,c,x,N[c],a),c="checked",b!=null&&b!=e[c]&&lt(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=`
4
+ `.concat(t[l]?"🚫":"➡️"," ").concat(l)}}}function Ki(){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 qi(){if(Mr("inverted"))return!0;if(Mr("none"))return!1}function Mr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function es(){if(Or("active"))return!0;if(Or("none"))return!1}function Or(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var ts=100;function rs(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=ts;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function ns(){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 as(){if(Pr("reduce"))return!0;if(Pr("no-preference"))return!1}function Pr(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function is(){if(Vr("reduce"))return!0;if(Vr("no-preference"))return!1}function Vr(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function ss(){if($r("high"))return!0;if($r("standard"))return!1}function $r(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var R=Math,W=function(){return 0};function os(){var e=R.acos||W,t=R.acosh||W,r=R.asin||W,n=R.asinh||W,a=R.atanh||W,i=R.atan||W,s=R.sin||W,o=R.sinh||W,l=R.cos||W,c=R.cosh||W,f=R.tan||W,d=R.tanh||W,m=R.exp||W,h=R.expm1||W,k=R.log1p||W,y=function(L){return R.pow(R.PI,L)},C=function(L){return R.log(L+R.sqrt(L*L-1))},_=function(L){return R.log(L+R.sqrt(L*L+1))},x=function(L){return R.log((1+L)/(1-L))/2},Z=function(L){return R.exp(L)-1/R.exp(L)/2},V=function(L){return(R.exp(L)+1/R.exp(L))/2},z=function(L){return R.exp(L)-1},H=function(L){return(R.exp(2*L)-1)/(R.exp(2*L)+1)},G=function(L){return R.log(1+L)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:C(1e154),asin:r(.12312423423423424),asinh:n(1),asinhPf:_(1),atanh:a(.5),atanhPf:x(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:Z(1),cos:l(10.000000000123),cosh:c(1),coshPf:V(1),tan:f(-1e300),tanh:d(1),tanhPf:H(1),exp:m(1),expm1:h(1),expm1Pf:z(1),log1p:k(10),log1pPf:G(10),powPI:y(-100)}}var cs="mmMwWLliI0fiflO&1",Ut={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ls(){return ds(function(e,t){for(var r={},n={},a=0,i=Object.keys(Ut);a<i.length;a++){var s=i[a],o=Ut[s],l=o[0],c=l===void 0?{}:l,f=o[1],d=f===void 0?cs:f,m=e.createElement("span");m.textContent=d,m.style.whiteSpace="nowrap";for(var h=0,k=Object.keys(c);h<k.length;h++){var y=k[h],C=c[y];C!==void 0&&(m.style[y]=C)}r[s]=m,t.append(e.createElement("br"),m)}for(var _=0,x=Object.keys(Ut);_<x.length;_++){var s=x[_];n[s]=r[s].getBoundingClientRect().width}return n})}function ds(e,t){return t===void 0&&(t=4e3),Er(function(r,n){var a=n.document,i=a.body,s=i.style;s.width="".concat(t,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Me()?i.style.zoom="".concat(1/n.devicePixelRatio):K()&&(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 us(){return navigator.pdfViewerEnabled}function fs(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function hs(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(ms())return-3;try{return e.canMakePayments()?1:0}catch(t){return ps(t)}}var ms=li;function ps(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function gs(){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,_s=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]),vs=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ys=["FRAGMENT_SHADER","VERTEX_SHADER"],ks=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],zr="WEBGL_debug_renderer_info",bs="WEBGL_polygon_mode";function xs(e){var t,r,n,a,i,s,o=e.cache,l=Dr(o);if(!l)return Fr;if(!Hr(l))return Wr;var c=Br()?null:l.getExtension(zr);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 ws(e){var t=e.cache,r=Dr(t);if(!r)return Fr;if(!Hr(r))return Wr;var n=r.getSupportedExtensions(),a=r.getContextAttributes(),i=[],s=[],o=[],l=[],c=[];if(a)for(var f=0,d=Object.keys(a);f<d.length;f++){var m=d[f];s.push("".concat(m,"=").concat(a[m]))}for(var h=Ur(r),k=0,y=h;k<y.length;k++){var C=y[k],_=r[C];o.push("".concat(C,"=").concat(_).concat(_s.has(_)?"=".concat(r.getParameter(_)):""))}if(n)for(var x=0,Z=n;x<Z.length;x++){var V=Z[x];if(!(V===zr&&Br()||V===bs&&Is())){var z=r.getExtension(V);if(!z){i.push(V);continue}for(var H=0,G=Ur(z);H<G.length;H++){var C=G[H],_=z[C];l.push("".concat(C,"=").concat(_).concat(vs.has(_)?"=".concat(r.getParameter(_)):""))}}}for(var L=0,E=ys;L<E.length;L++)for(var M=E[L],De=0,_t=ks;De<_t.length;De++){var Hn=_t[De],cc=Ss(r,M,Hn);c.push("".concat(M,".").concat(Hn,"=").concat(cc.join(",")))}return l.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:c,extensions:n,extensionParameters:l,unsupportedExtensions:i}}function Dr(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 Ss(e,t,r){var n=e.getShaderPrecisionFormat(e[t],e[r]);return n?[n.rangeMin,n.rangeMax,n.precision]:[]}function Ur(e){return Object.keys(e.__proto__).filter(Cs)}function Cs(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Br(){return Ar()}function Is(){return Me()||K()}function Hr(e){return typeof e.getParameter=="function"}function Ns(){if(!($t()||K()))return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function Ts(){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 Ls={fonts:fi,domBlockers:Yi,fontPreferences:ls,audio:ti,screenFrame:ji,canvas:mi,osCpu:Si,languages:Ci,colorDepth:Ii,deviceMemory:Ni,screenResolution:Ti,hardwareConcurrency:Mi,timezone:Oi,sessionStorage:Vi,localStorage:$i,indexedDB:Fi,openDatabase:Wi,cpuClass:zi,platform:Di,plugins:hi,touchSupport:wi,vendor:Ui,vendorFlavors:Bi,cookiesEnabled:Hi,colorGamut:Ki,invertedColors:qi,forcedColors:es,monochrome:rs,contrast:ns,reducedMotion:as,reducedTransparency:is,hdr:ss,math:os,pdfViewerEnabled:us,architecture:fs,applePay:hs,privateClickMeasurement:gs,audioBaseLatency:Ns,dateTimeLocale:Ts,webGlBasics:xs,webGlExtensions:ws};function As(e){return Ha(Ls,e,[])}var Rs="$ if upgrade to Pro: https://fpjs.dev/pro";function Es(e){var t=Zs(e),r=js(t);return{score:t,comment:Rs.replace(/\$/g,"".concat(r))}}function Zs(e){if($t())return .4;if(K())return Vt()&&!(Pe()&&Oe())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function js(e){return Ir(.99+.01*e,1e-4)}function Ms(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 Os(e){return JSON.stringify(e,function(t,r){return r instanceof Error?za(r):r},2)}function Gr(e){return Wa(Ms(e))}function Ps(e){var t;return{get visitorId(){return t===void 0&&(t=Gr(this.components)),t},set visitorId(r){t=r},confidence:Es(e),components:e,version:xr}}function Vs(e){return e===void 0&&(e=50),Ea(e,e*2)}function $s(e,t){var r=Date.now();return{get:function(n){return ne(this,void 0,void 0,function(){var a,i,s;return ae(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,e()];case 1:return i=o.sent(),s=Ps(i),t||n?.debug,[2,s]}})})}}}function Fs(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(xr,"/npm-monitoring"),!0),e.send()}catch{}}function Ws(e){var t;return e===void 0&&(e={}),ne(this,void 0,void 0,function(){var r,n,a;return ae(this,function(i){switch(i.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Fs(),r=e.delayFallback,n=e.debug,[4,Vs(r)];case 1:return i.sent(),a=As({cache:{},debug:n}),[2,$s(a,n)]}})})}var zs={load:Ws,hashComponents:Gr,componentsToDebugString:Os},Ds=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,externalId:e.externalId,name:e.name,email:e.email,authId:e.authId,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,n,a){const i=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:t,fileName:r,agentId:n,tenantId:a})});if(!i.ok)throw new Error(`Upload error: ${i.status} ${i.statusText}`);const s=await i.json();if(!s.success)throw new Error(s.error??"Upload failed");return{url:s.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}}async endSession(e,t,r,n,a){const i=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenantId:t,agentId:r,fingerprint:n,externalId:a})});if(!i.ok)throw new Error(`Failed to end session: ${i.status} ${i.statusText}`);const s=await i.json();if(!s.success)throw new Error(s.error??"Failed to end session")}},Us=12e4;function Bs(e){return Promise.race([e.read(),new Promise((t,r)=>setTimeout(()=>r(new Error("Stream timed out — no data received for 120s")),Us))])}async function Hs(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,externalId:t.externalId,name:t.name,email:t.email,authId:t.authId,fingerprint:t.fingerprint,metadata:t.metadata,imageUrl:t.imageUrl})});if(!i.ok||!i.body){let d=`${i.status} ${i.statusText}`;try{const m=await i.json();m.error&&(d=m.error)}catch{}throw new Error(d)}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 f=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 y=h.sessionId;return y&&r.onSession&&r.onSession(y),!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 y=h.images;return y&&r.onImages&&r.onImages(y),!1}if(h.type==="thinking_chunk"){const y=h.content;return y&&r.onThinkingDelta&&(a+=y,r.onThinkingDelta(y,a)),!1}const k=Gs(h);k&&(n+=k,r.onDelta(k,n))}catch(h){if(!(h instanceof SyntaxError))throw h}return!1};e:for(;;){const{done:d,value:m}=await Bs(o);if(d)break;c+=l.decode(m,{stream:!0});const h=c.lastIndexOf(`
5
+ `);if(h===-1)continue;const k=c.slice(0,h);c=c.slice(h+1);for(const y of k.split(`
6
+ `))if(f(y))break e}r.onEnd(n)}catch(i){r.onError(i instanceof Error?i:new Error(String(i)))}}function Gs(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 Ys=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()}},Xs="agentforge";function Bt(e){return`${Xs}:session:${e}`}function Js(e){try{return sessionStorage.getItem(Bt(e))??void 0}catch{return}}function Ht(e,t){try{sessionStorage.setItem(Bt(e),t)}catch{}}function Yr(e){try{sessionStorage.removeItem(Bt(e))}catch{}}function ct(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}var Qs=class{config;apiClient;state;fingerprint;emitter;constructor(e,t,r){this.hostConfig=t,this.onStateChange=r,this.config=e,this.apiClient=new Ds(e.apiBaseUrl),this.emitter=new Ys,this.initializeFingerprint();const n=e.sessionId??Js(e.agentId);e.sessionId&&Ht(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 zs.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(){this.state.initStatus!=="error"&&this.setState({isOpen:!0})}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=Ze(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:ct(),role:a.role,content:a.content,images:a.images&&a.images.length>0?a.images:void 0,uploadedImageUrl:a.imageUrl||void 0,createdAt:a.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)}async resetConversation(){if(this.state.sessionId)try{await this.apiClient.endSession(this.state.sessionId,this.config.tenantId,this.config.agentId,this.fingerprint,this.config.user.externalId)}catch{}Yr(this.config.agentId),this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.emitter.emit("reset",void 0),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){Yr(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,t){if(this.state.isLoading||!e.trim()&&!t||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,this.config.agentId,this.config.tenantId)).url}catch(i){const s=i instanceof Error?i.message:"Image upload failed";this.setState({error:s});return}const n={id:ct(),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,externalId:this.config.user.externalId,name:this.config.user.name,email:this.config.user.email,authId:this.config.user.authId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t}),a={id:ct(),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&&Ht(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=ct(),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 Hs(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,externalId:this.config.user.externalId,name:this.config.user.name,email:this.config.user.email,authId:this.config.user.authId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t},{onSession:s=>{this.setState({sessionId:s}),Ht(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(c=>c.id!==n),isLoading:!1});return}const o=this.state.messages.find(c=>c.id===n)?.content??"",l=s.message||"Something went wrong. Please try again.";this.updateMessage(n,{content:o||l,status:"error"}),this.setState({isLoading:!1,error:l}),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 eo(e,t){e.textContent=t}function to(e){e.remove()}function ro(){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 no(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 ao(e){return e.setAttribute("data-agentkit-root","inline"),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e}function io(e){e.remove()}function so(e){e.removeAttribute("data-agentkit-root")}function Xr(e,t,r,n,a){const i=e.mode==="inline";let s=!1;const o=i&&a?ao(a):!i&&a?no(a):ro(),l=qs(o);eo(l.styleSlot,n);const c=new Qs(e,t,(m,h)=>{s||f.update(m,h)}),f=r(l.mountPoint,e,c.getState(),{onOpen:()=>d.open(),onClose:()=>d.close(),onSendMessage:(m,h)=>{c.sendMessage(m,h)},onReset:()=>{c.resetConversation()}});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.resetConversation(),c.emitter.emit("reset"))},destroy(){s||(s=!0,f.destroy(),to(l.host),i&&a?so(a):io(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 Ve=new Map,oo=0;function Jr(e){const t=`agentkit-widget-${++oo}`,r=e.destroy.bind(e);return e.destroy=()=>{Ve.delete(t),r()},Ve.set(t,e),t}function co(e,t,r){const n={...e,mode:"floating"},a=Xr(Ze(n),n,t,r);return Jr(a),a}function lo(e,t,r,n){const a={...t,mode:"inline"},i=Xr(Ze(a),a,r,n,e);return Jr(i),i}function uo(e){e?Ve.get(e)?.destroy():(Ve.forEach(t=>t.destroy()),Ve.clear())}var lt,N,Qr,fo,pe,Kr,qr,en,tn,Gt,Yt,Xt,ho,dt={},ut=[],mo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$e=Array.isArray;function le(e,t){for(var r in t)e[r]=t[r];return e}function Jt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Fe(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?lt.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 ft(e,s,n,a,null)}function ft(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??++Qr,__i:-1,__u:0};return a==null&&N.vnode!=null&&N.vnode(i),i}function X(e){return e.children}function de(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 po(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],a=[],i=le({},t);i.__v=t.__v+1,N.vnode&&N.vnode(i),Qt(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,ln(n,i,a),t.__e=t.__=null,i.__e!=r&&rn(i)}}function rn(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}),rn(e)}function nn(e){(!e.__d&&(e.__d=!0)&&pe.push(e)&&!ht.__r++||Kr!=N.debounceRendering)&&((Kr=N.debounceRendering)||qr)(ht)}function ht(){try{for(var e,t=1;pe.length;)pe.length>t&&pe.sort(en),e=pe.shift(),t=pe.length,po(e)}finally{pe.length=ht.__r=0}}function an(e,t,r,n,a,i,s,o,l,c,f){var d,m,h,k,y,C,_,x=n&&n.__k||ut,Z=t.length;for(l=go(r,t,x,l,Z),d=0;d<Z;d++)(h=r.__k[d])!=null&&(m=h.__i!=-1&&x[h.__i]||dt,h.__i=d,C=Qt(e,h,m,a,i,s,o,l,c,f),k=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&qt(m.ref,null,h),f.push(h.ref,h.__c||k,h)),y==null&&k!=null&&(y=k),(_=!!(4&h.__u))||m.__k===h.__k?l=sn(h,l,e,_):typeof h.type=="function"&&C!==void 0?l=C:k&&(l=k.nextSibling),h.__u&=-7);return r.__e=y,l}function go(e,t,r,n,a){var i,s,o,l,c,f=r.length,d=f,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]=ft(null,s,null,null,null):$e(s)?s=e.__k[i]=ft(X,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=ft(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=_o(s,r,l,d))!=-1&&(d--,(o=r[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(a>f?m--:a<f&&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<f;i++)(o=r[i])!=null&&(2&o.__u)==0&&(o.__e==n&&(n=Ie(o)),un(o,o));return n}function sn(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=sn(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 ue(e,t){return t=t||[],e==null||typeof e=="boolean"||($e(e)?e.some(function(r){ue(r,t)}):t.push(e)),t}function _o(e,t,r,n){var a,i,s,o=e.key,l=e.type,c=t[r],f=c!=null&&(2&c.__u)==0;if(c===null&&o==null||f&&o==c.key&&l==c.type)return r;if(n>(f?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 on(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||mo.test(t)?r:r+"px"}function mt(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||on(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||on(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(tn,"$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=Gt,e.addEventListener(t,i?Xt:Yt,i)):e.removeEventListener(t,i?Xt:Yt,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 cn(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Gt++;else if(t.t<r.u)return;return r(N.event?N.event(t):t)}}}function Qt(e,t,r,n,a,i,s,o,l,c){var f,d,m,h,k,y,C,_,x,Z,V,z,H,G,L,E=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[o=t.__e=r.__e]),(f=N.__b)&&f(t);e:if(typeof E=="function")try{if(_=t.props,x=E.prototype&&E.prototype.render,Z=(f=E.contextType)&&n[f.__c],V=f?Z?Z.props.value:f.__:n,r.__c?C=(d=t.__c=r.__c).__=d.__E:(x?t.__c=d=new E(_,V):(t.__c=d=new de(_,V),d.constructor=E,d.render=yo),Z&&Z.sub(d),d.state||(d.state={}),d.__n=n,m=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&E.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=le({},d.__s)),le(d.__s,E.getDerivedStateFromProps(_,d.__s))),h=d.props,k=d.state,d.__v=t,m)x&&E.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&E.getDerivedStateFromProps==null&&_!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,V),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(_,d.__s,V)===!1){t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(M){M&&(M.__=t)}),ut.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,V),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,k,y)})}if(d.context=V,d.props=_,d.__P=e,d.__e=!1,z=N.__r,H=0,x)d.state=d.__s,d.__d=!1,z&&z(t),f=d.render(d.props,d.state,d.context),ut.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,z&&z(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++H<25);d.state=d.__s,d.getChildContext!=null&&(n=le(le({},n),d.getChildContext())),x&&!m&&d.getSnapshotBeforeUpdate!=null&&(y=d.getSnapshotBeforeUpdate(h,k)),G=f!=null&&f.type===X&&f.key==null?dn(f.props.children):f,o=an(e,$e(G)?G:[G],t,r,n,a,i,s,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),C&&(d.__E=d.__=null)}catch(M){if(t.__v=null,l||i!=null)if(M.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(L=i.length;L--;)Jt(i[L]);Kt(t)}else t.__e=r.__e,t.__k=r.__k,M.then||Kt(t);N.__e(M,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):o=t.__e=vo(r.__e,t,r,n,a,i,s,l,c);return(f=N.diffed)&&f(t),128&t.__u?void 0:o}function Kt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Kt))}function ln(e,t,r){for(var n=0;n<r.length;n++)qt(r[n],r[++n],r[++n]);N.__c&&N.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){N.__e(i,a.__v)}})}function dn(e){return typeof e!="object"||e==null||e.__b>0?e:$e(e)?e.map(dn):le({},e)}function vo(e,t,r,n,a,i,s,o,l){var c,f,d,m,h,k,y,C=r.props||dt,_=t.props,x=t.type;if(x=="svg"?a="http://www.w3.org/2000/svg":x=="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==!!x&&(x?h.localName==x:h.nodeType==3)){e=h,i[c]=null;break}}if(e==null){if(x==null)return document.createTextNode(_);e=document.createElementNS(a,x,_.is&&_),o&&(N.__m&&N.__m(t,i),o=!1),i=null}if(x==null)C===_||o&&e.data==_||(e.data=_);else{if(i=i&&lt.call(e.childNodes),!o&&i!=null)for(C={},c=0;c<e.attributes.length;c++)C[(h=e.attributes[c]).name]=h.value;for(c in C)h=C[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in _||c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _||mt(e,c,null,h,a);for(c in _)h=_[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?f=h:c=="value"?k=h:c=="checked"?y=h:o&&typeof h!="function"||C[c]===h||mt(e,c,h,C[c],a);if(f)o||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=""),an(t.type=="template"?e.content:e,$e(m)?m:[m],t,r,n,x=="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--;)Jt(i[c]);o||(c="value",x=="progress"&&k==null?e.removeAttribute("value"):k!=null&&(k!==e[c]||x=="progress"&&!k||x=="option"&&k!=C[c])&&mt(e,c,k,C[c],a),c="checked",y!=null&&y!=e[c]&&mt(e,c,y,C[c],a))}return e}function qt(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){N.__e(a,r)}}function un(e,t,r){var n,a;if(N.unmount&&N.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){N.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&un(n[a],t,r||typeof e.type!="function");r||Jt(e.__e),e.__c=e.__=e.__e=void 0}function yo(e,t,r){return this.constructor(e,r)}function fn(e,t,r){var n,a,i,s;t==document&&(t=document.documentElement),N.__&&N.__(e,t),a=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],s=[],Qt(t,e=(!n&&r||t).__k=Fe(X,null,[e]),a||dt,dt,t.namespaceURI,!n&&r?[r]:a?null:t.firstChild?lt.call(t.childNodes):null,i,!n&&r?r:a?a.__e:t.firstChild,n,s),ln(i,e,s)}lt=ut.slice,N={__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}},Qr=0,fo=function(e){return e!=null&&e.constructor===void 0},de.prototype.setState=function(e,t){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=le({},this.state);typeof e=="function"&&(e=e(le({},r),this.props)),e&&le(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),nn(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nn(this))},de.prototype.render=X,pe=[],qr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,en=function(e,t){return e.__v.__b-t.__v.__b},ht.__r=0,tn=/(PointerCapture)$|Capture$/i,Gt=0,Yt=cn(!1),Xt=cn(!0),ho=0;var We,O,er,hn,ze=0,mn=[],P=N,pn=P.__b,gn=P.__r,_n=P.diffed,vn=P.__c,yn=P.unmount,kn=P.__;function tr(e,t){P.__h&&P.__h(O,e,ze||t),ze=0;var r=O.__H||(O.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ne(e){return ze=1,ko(Sn,e)}function ko(e,t,r){var n=tr(We++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Sn(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=O,!O.__f)){var a=function(o,l,c){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return!m.__N}))return!i||i.call(this,o,l,c);var d=n.__c.props!==o;return f.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};O.__f=!0;var i=O.shouldComponentUpdate,s=O.componentWillUpdate;O.componentWillUpdate=function(o,l,c){if(this.__e){var f=i;i=void 0,a(o,l,c),i=f}s&&s.call(this,o,l,c)},O.shouldComponentUpdate=a}return n.__N||n.__}function Te(e,t){var r=tr(We++,3);!P.__s&&wn(r.__H,t)&&(r.__=e,r.u=t,O.__H.__h.push(r))}function Le(e){return ze=5,bn(function(){return{current:e}},[])}function bn(e,t){var r=tr(We++,7);return wn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function bo(e,t){return ze=8,bn(function(){return e},t)}function xo(){for(var e;e=mn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(pt),t.__h.some(rr),t.__h=[]}catch(r){t.__h=[],P.__e(r,e.__v)}}}P.__b=function(e){O=null,pn&&pn(e)},P.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kn&&kn(e,t)},P.__r=function(e){gn&&gn(e),We=0;var t=(O=e.__c).__H;t&&(er===O?(t.__h=[],O.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(pt),t.__h.some(rr),t.__h=[],We=0)),er=O},P.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mn.push(t)!==1&&hn===P.requestAnimationFrame||((hn=P.requestAnimationFrame)||wo)(xo)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),er=O=null},P.__c=function(e,t){t.some(function(r){try{r.__h.some(pt),r.__h=r.__h.filter(function(n){return!n.__||rr(n)})}catch(n){t.some(function(a){a.__h&&(a.__h=[])}),t=[],P.__e(n,r.__v)}}),vn&&vn(e,t)},P.unmount=function(e){yn&&yn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{pt(n)}catch(a){t=a}}),r.__H=void 0,t&&P.__e(t,r.__v))};var xn=typeof requestAnimationFrame=="function";function wo(e){var t,r=function(){clearTimeout(n),xn&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);xn&&(t=requestAnimationFrame(r))}function pt(e){var t=O,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),O=t}function rr(e){var t=O;e.__c=e.__(),O=t}function wn(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Sn(e,t){return typeof t=="function"?t(e):t}function So(e,t){for(var r in t)e[r]=t[r];return e}function Cn(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 In(e,t){this.props=e,this.context=t}(In.prototype=new de).isPureReactComponent=!0,In.prototype.shouldComponentUpdate=function(e,t){return Cn(this.props,e)||Cn(this.state,t)};var Nn=N.__b;N.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Nn&&Nn(e)};var Vc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Tn=function(e,t){return e==null?null:ue(ue(e).map(t))},$c={map:Tn,forEach:Tn,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},Co=N.__e;N.__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)}Co(e,t,r,n)};var Ln=N.unmount;function An(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=So({},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 An(n,t,r)})),e}function Rn(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Rn(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 nr(){this.__u=0,this.o=null,this.__b=null}function En(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function gt(){this.i=null,this.l=null}N.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ln&&Ln(e)},(nr.prototype=new de).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var a=En(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]=Rn(c,c.__c.__P,c.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.__P=o,f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},nr.prototype.componentWillUnmount=function(){this.o=[]},nr.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]=An(this.__b,r,n.__O=n.__P)}this.__b=null}var a=t.__a&&Fe(X,null,e.fallback);return a&&(a.__u&=-33),[Fe(X,null,t.__a?null:e.children),a]};var Zn=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]}};(gt.prototype=new de).__a=function(e){var t=this,r=En(t.__v),n=t.l.get(e);return n[0]++,function(a){var i=function(){t.props.revealOrder?(n.push(a),Zn(t,e,n)):a()};r?r(i):i()}},gt.prototype.render=function(e){this.i=null,this.l=new Map;var t=ue(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},gt.prototype.componentDidUpdate=gt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Zn(e,r,t)})};var Io=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,No=/^(?: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]/,To=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Lo=/[A-Z0-9]/g,Ao=typeof document<"u",Ro=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Eo(e,t,r){return t.__k??(t.textContent=""),fn(e,t),typeof r=="function"&&r(),e?e.__c:null}de.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(de.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var jn=N.event;N.event=function(e){return jn&&(e=jn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Mn,Zo={configurable:!0,get:function(){return this.class}},On=N.vnode;N.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||Ao&&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"||Ro(r.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":To.test(s)&&(s=l):l=s="oninput":i&&No.test(s)?s=s.replace(Lo,"-$&").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=ue(r.children).forEach(function(c){c.props.selected=a.value.indexOf(c.props.value)!=-1})),a.defaultValue!=null&&(a.value=ue(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=Io,On&&On(e)};var Pn=N.__r;N.__r=function(e){Pn&&Pn(e),Mn=e.__c};var Vn=N.diffed;N.diffed=function(e){Vn&&Vn(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),Mn=null};function jo(e){return!!e.__k&&(fn(null,e),!0)}function Mo(e){return{render:function(t){Eo(t,e)},unmount:function(){jo(e)}}}function Oo(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 Po(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Vo=`
7
7
  *, *::before, *::after {
8
8
  box-sizing: border-box;
9
9
  margin: 0;
@@ -146,6 +146,7 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
146
146
  /* ── Header ──────────────────────────────────────────────────── */
147
147
  .ak-header {
148
148
  display: flex;
149
+ flex-direction: row;
149
150
  align-items: center;
150
151
  justify-content: space-between;
151
152
  padding: 14px 18px;
@@ -154,6 +155,19 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
154
155
  flex-shrink: 0;
155
156
  gap: 8px;
156
157
  }
158
+ .ak-header--confirming {
159
+ flex-direction: column;
160
+ align-items: stretch;
161
+ justify-content: flex-start;
162
+ gap: 0;
163
+ }
164
+ .ak-header__row {
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: space-between;
168
+ width: 100%;
169
+ gap: 8px;
170
+ }
157
171
  .ak-header__status {
158
172
  width: 8px;
159
173
  height: 8px;
@@ -218,6 +232,103 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
218
232
  color: #fff;
219
233
  flex-shrink: 0;
220
234
  }
235
+ .ak-header__button {
236
+ width: 28px;
237
+ height: 28px;
238
+ border-radius: 50%;
239
+ background: transparent;
240
+ border: none;
241
+ cursor: pointer;
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: center;
245
+ color: #fff;
246
+ transition: background 0.15s;
247
+ flex-shrink: 0;
248
+ }
249
+ .ak-header__button:hover {
250
+ background: rgba(255, 255, 255, 0.15);
251
+ }
252
+ .ak-header__button--active {
253
+ background: rgba(255, 255, 255, 0.3);
254
+ }
255
+ .ak-header__confirm {
256
+ width: 100%;
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: space-between;
260
+ gap: 8px;
261
+ padding: 8px 0 0;
262
+ margin: 8px 0 0;
263
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
264
+ animation: ak-confirm-in 0.18s ease-out;
265
+ }
266
+ @keyframes ak-confirm-in {
267
+ from { opacity: 0; transform: translateY(-4px); }
268
+ to { opacity: 1; transform: translateY(0); }
269
+ }
270
+ .ak-header__confirm-text {
271
+ display: flex;
272
+ flex-direction: column;
273
+ gap: 1px;
274
+ flex: 1;
275
+ min-width: 0;
276
+ }
277
+ .ak-header__confirm-title {
278
+ font-size: 13px;
279
+ font-weight: 600;
280
+ color: #fff;
281
+ line-height: 1.3;
282
+ }
283
+ .ak-header__confirm-sub {
284
+ font-size: 11px;
285
+ color: rgba(255, 255, 255, 0.75);
286
+ line-height: 1.3;
287
+ }
288
+ .ak-header__confirm-actions {
289
+ display: flex;
290
+ align-items: center;
291
+ gap: 6px;
292
+ flex-shrink: 0;
293
+ }
294
+ .ak-header__confirm-cancel {
295
+ padding: 5px 10px;
296
+ border-radius: 6px;
297
+ border: 1px solid rgba(255, 255, 255, 0.4);
298
+ background: transparent;
299
+ color: #fff;
300
+ font-family: var(--ak-font);
301
+ font-size: 12px;
302
+ font-weight: 500;
303
+ cursor: pointer;
304
+ transition: background 0.15s;
305
+ white-space: nowrap;
306
+ }
307
+ .ak-header__confirm-cancel:hover {
308
+ background: rgba(255, 255, 255, 0.15);
309
+ }
310
+ .ak-header__confirm-cancel:active {
311
+ background: rgba(255, 255, 255, 0.25);
312
+ }
313
+ .ak-header__confirm-ok {
314
+ padding: 5px 10px;
315
+ border-radius: 6px;
316
+ border: none;
317
+ background: rgba(255, 255, 255, 0.2);
318
+ color: #fff;
319
+ font-family: var(--ak-font);
320
+ font-size: 12px;
321
+ font-weight: 600;
322
+ cursor: pointer;
323
+ transition: background 0.15s;
324
+ white-space: nowrap;
325
+ }
326
+ .ak-header__confirm-ok:hover {
327
+ background: rgba(239, 68, 68, 0.7);
328
+ }
329
+ .ak-header__confirm-ok:active {
330
+ background: rgba(239, 68, 68, 0.85);
331
+ }
221
332
 
222
333
  /* ── Message list ────────────────────────────────────────────── */
223
334
  .ak-messages {
@@ -237,6 +348,115 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
237
348
  border-radius: 4px;
238
349
  }
239
350
 
351
+ /* ── Empty state ─────────────────────────────────────────────── */
352
+ .ak-empty-state {
353
+ flex: 1;
354
+ position: relative;
355
+ display: flex;
356
+ flex-direction: column;
357
+ align-items: center;
358
+ justify-content: center;
359
+ padding: 0;
360
+ text-align: center;
361
+ gap: 16px;
362
+ overflow-y: auto;
363
+ overflow-x: hidden;
364
+ min-height: 0;
365
+ background: radial-gradient(ellipse 110% 55% at 50% 0%,
366
+ color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg)),
367
+ var(--ak-bg) 72%
368
+ );
369
+ }
370
+ /* Decorative blurred orb behind the avatar */
371
+ .ak-empty-state__glow {
372
+ position: absolute;
373
+ top: -24px;
374
+ left: 50%;
375
+ transform: translateX(-50%);
376
+ width: 180px;
377
+ height: 180px;
378
+ border-radius: 50%;
379
+ background: color-mix(in srgb, var(--ak-accent) 18%, transparent);
380
+ filter: blur(48px);
381
+ pointer-events: none;
382
+ }
383
+ .ak-empty-state__body {
384
+ display: flex;
385
+ flex-direction: column;
386
+ align-items: center;
387
+ gap: 8px;
388
+ position: relative;
389
+ }
390
+ .ak-empty-state__avatar {
391
+ width: 64px;
392
+ height: 64px;
393
+ border-radius: 50%;
394
+ background: var(--ak-bg);
395
+ border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));
396
+ box-shadow:
397
+ 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),
398
+ 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);
399
+ display: flex;
400
+ align-items: center;
401
+ justify-content: center;
402
+ color: var(--ak-accent);
403
+ margin-bottom: 4px;
404
+ flex-shrink: 0;
405
+ }
406
+ .ak-empty-state__avatar-img {
407
+ width: 64px;
408
+ height: 64px;
409
+ border-radius: 50%;
410
+ object-fit: cover;
411
+ }
412
+ .ak-empty-state__bot-icon {
413
+ display: flex;
414
+ align-items: center;
415
+ justify-content: center;
416
+ }
417
+ .ak-empty-state__title {
418
+ margin: 0;
419
+ font-size: 16px;
420
+ font-weight: 700;
421
+ color: var(--ak-text);
422
+ line-height: 1.3;
423
+ letter-spacing: -0.01em;
424
+ }
425
+ .ak-empty-state__description {
426
+ margin: 0;
427
+ font-size: 13px;
428
+ color: var(--ak-text-muted);
429
+ line-height: 1.55;
430
+ max-width: 260px;
431
+ }
432
+ /* Quoted greeting block */
433
+ .ak-empty-state__quote {
434
+ position: relative;
435
+ max-width: 280px;
436
+ width: calc(100% - 32px);
437
+ background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));
438
+ border: 1px solid color-mix(in srgb, var(--ak-accent) 18%, var(--ak-border));
439
+ border-radius: 12px;
440
+ padding: 12px 14px 12px 16px;
441
+ text-align: left;
442
+ }
443
+ .ak-empty-state__quote-mark {
444
+ display: block;
445
+ font-size: 32px;
446
+ line-height: 1;
447
+ color: var(--ak-accent);
448
+ margin-bottom: 2px;
449
+ font-family: Georgia, serif;
450
+ opacity: 0.7;
451
+ }
452
+ .ak-empty-state__quote-text {
453
+ margin: 0;
454
+ font-size: 13px;
455
+ color: var(--ak-text-muted);
456
+ line-height: 1.55;
457
+ font-style: italic;
458
+ }
459
+
240
460
  /* ── Message bubbles ─────────────────────────────────────────── */
241
461
  .ak-message {
242
462
  display: flex;
@@ -266,6 +486,9 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
266
486
  max-width: 100%;
267
487
  min-width: 0;
268
488
  }
489
+ .ak-message__bubble--md {
490
+ white-space: normal;
491
+ }
269
492
  .ak-message--user .ak-message__bubble {
270
493
  background: var(--ak-user-bg);
271
494
  color: var(--ak-user-text);
@@ -435,6 +658,7 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
435
658
 
436
659
  /* ── Composer ────────────────────────────────────────────────── */
437
660
  .ak-composer {
661
+ position: relative; /* establishes positioning context for the attachment submenu */
438
662
  padding: 10px 14px 12px;
439
663
  border-top: 1px solid var(--ak-border);
440
664
  display: flex;
@@ -464,6 +688,11 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
464
688
  border-color: var(--ak-accent);
465
689
  }
466
690
 
691
+ /* Attach button wrapper */
692
+ .ak-composer__attach-wrap {
693
+ flex-shrink: 0;
694
+ }
695
+
467
696
  /* "+" attachment button — square with rounded corners */
468
697
  .ak-composer__attach {
469
698
  width: 28px;
@@ -476,18 +705,62 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
476
705
  align-items: center;
477
706
  justify-content: center;
478
707
  color: var(--ak-text-muted);
479
- transition: color 0.15s, border-color 0.15s;
708
+ transition: color 0.15s, border-color 0.15s, background 0.15s;
480
709
  flex-shrink: 0;
481
710
  }
482
711
  .ak-composer__attach:hover:not(:disabled) {
483
712
  color: var(--ak-accent);
484
713
  border-color: var(--ak-accent);
485
714
  }
715
+ .ak-composer__attach--open {
716
+ color: var(--ak-accent);
717
+ border-color: var(--ak-accent);
718
+ background: color-mix(in srgb, var(--ak-accent) 8%, transparent);
719
+ }
486
720
  .ak-composer__attach:disabled {
487
721
  opacity: 0.4;
488
722
  cursor: not-allowed;
489
723
  }
490
724
 
725
+ /* Attachment submenu — floats above the composer, positioned relative to .ak-composer */
726
+ .ak-composer__attach-menu {
727
+ position: absolute;
728
+ bottom: calc(100% + 6px);
729
+ left: 14px;
730
+ background: var(--ak-surface);
731
+ border: 1px solid var(--ak-border);
732
+ border-radius: 10px;
733
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
734
+ padding: 4px;
735
+ min-width: 130px;
736
+ z-index: 10;
737
+ }
738
+
739
+ /* Individual item inside the attachment submenu */
740
+ .ak-composer__attach-menu-item {
741
+ display: flex;
742
+ align-items: center;
743
+ gap: 8px;
744
+ width: 100%;
745
+ padding: 7px 10px;
746
+ border: none;
747
+ border-radius: 7px;
748
+ background: transparent;
749
+ color: var(--ak-text);
750
+ font-family: var(--ak-font);
751
+ font-size: 13px;
752
+ cursor: pointer;
753
+ transition: background 0.12s;
754
+ text-align: left;
755
+ }
756
+ .ak-composer__attach-menu-item:hover:not(:disabled) {
757
+ background: var(--ak-bg);
758
+ }
759
+ .ak-composer__attach-menu-item:disabled {
760
+ opacity: 0.4;
761
+ cursor: not-allowed;
762
+ }
763
+
491
764
  /* Textarea — borderless, transparent, sits inside the container */
492
765
  .ak-composer__input {
493
766
  flex: 1;
@@ -605,11 +878,16 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
605
878
  min-width: 0;
606
879
  }
607
880
  .ak-message__bubble--md .ak-md-p {
608
- margin-bottom: 0.5em;
881
+ margin: 0 0 0.4em 0;
609
882
  }
610
883
  .ak-message__bubble--md .ak-md-p:last-child {
611
884
  margin-bottom: 0;
612
885
  }
886
+ /* Collapse margins between paragraph and following list */
887
+ .ak-message__bubble--md .ak-md-p + .ak-md-ul,
888
+ .ak-message__bubble--md .ak-md-p + .ak-md-ol {
889
+ margin-top: 0;
890
+ }
613
891
  .ak-message__bubble--md .ak-md-h1,
614
892
  .ak-message__bubble--md .ak-md-h2,
615
893
  .ak-message__bubble--md .ak-md-h3 {
@@ -628,7 +906,7 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
628
906
  .ak-message__bubble--md .ak-md-ul,
629
907
  .ak-message__bubble--md .ak-md-ol {
630
908
  padding-left: 1.4em;
631
- margin: 0.25em 0;
909
+ margin: 0.4em 0;
632
910
  }
633
911
  .ak-message__bubble--md .ak-md-ul li,
634
912
  .ak-message__bubble--md .ak-md-ol li {
@@ -859,7 +1137,9 @@ var AgentKit=(function(vt){Object.defineProperty(vt,Symbol.toStringTag,{value:"M
859
1137
  opacity: 0.75;
860
1138
  letter-spacing: -0.01em;
861
1139
  }
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})({});
1140
+ `,Fc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$o=0,Wc=Array.isArray;function u(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:--$o,__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 N.vnode&&N.vnode(c),c}function Fo(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u("circle",{cx:"12",cy:"5",r:"2"}),u("path",{d:"M12 7v4"}),u("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),u("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function Wo(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[u("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function zo(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),u("path",{d:"M3 3v5h5"})]})}function Do({title:e,subtitle:t,avatarUrl:r,onClose:n,onReset:a,hideClose:i=!1}){const[s,o]=Ne(!1);return u("div",{className:`ak-header${s?" ak-header--confirming":""}`,children:[u("div",{className:"ak-header__row",children:[r?u("img",{src:r,alt:"",className:"ak-header__avatar","aria-hidden":"true"}):u("span",{className:"ak-header__bot-icon","aria-hidden":"true",children:u(Fo,{})}),u("div",{className:"ak-header__title-group",children:[u("span",{className:"ak-header__title",children:e}),t&&u("span",{className:"ak-header__subtitle",children:t})]}),u("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u("span",{className:"ak-header__status","aria-hidden":"true"}),a&&u("button",{className:`ak-header__button${s?" ak-header__button--active":""}`,onClick:()=>o(!0),"aria-label":"New conversation",type:"button",title:"Start a new conversation (Retains current conversation to memory)",children:u(zo,{})}),!i&&u("button",{className:"ak-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:u(Wo,{})})]})]}),s&&u("div",{className:"ak-header__confirm",role:"alert",children:[u("div",{className:"ak-header__confirm-text",children:[u("span",{className:"ak-header__confirm-title",children:"End this conversation?"}),u("span",{className:"ak-header__confirm-sub",children:"All messages will be removed"})]}),u("div",{className:"ak-header__confirm-actions",children:[u("button",{className:"ak-header__confirm-cancel",type:"button",onClick:()=>o(!1),children:"Cancel"}),u("button",{className:"ak-header__confirm-ok",type:"button",onClick:()=>{a?.(),o(!1)},children:"End chat"})]})]})]})}function Uo({thinking:e,isThinking:t,thinkingViewable:r}){const[n,a]=Ne(!1);return!t&&!e?null:t?u("div",{className:"ak-thinking",children:u("div",{className:"ak-thinking__indicator",children:[u("span",{className:"ak-thinking__label",children:"Thinking"}),u("span",{className:"ak-cursor","aria-hidden":"true",children:[u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"})]})]})}):!r||!e?null:u("div",{className:"ak-thinking ak-thinking--done",children:[u("button",{className:"ak-thinking__toggle",onClick:()=>a(i=>!i),"aria-expanded":n,type:"button",children:[u("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:u("polyline",{points:"6 9 12 15 18 9"})}),u("span",{children:"Thought for a moment"})]}),n&&u("div",{className:"ak-thinking__content",children:e})]})}function Bo(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}var $n=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;function q(e){const t=[];let r=0,n=0;$n.lastIndex=0;let a;for(;(a=$n.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));const i=a[0];if(i.startsWith("`"))t.push(u("code",{className:"ak-md-ic",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))t.push(u("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("*"))t.push(u("em",{children:i.slice(1,-1)},n++));else if(i.startsWith("![")){const s=i.match(/!\[([^\]]*)\]\(([^)]+)\)/);s&&t.push(u("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]||"image"},n++))}else{const s=i.match(/\[(.+?)\]\((.+?)\)/);s?t.push(u("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 Ho(e){e=e.replace(/\\text\{([^}]*)\}/g,"$1").replace(/\\implies/g,"→").replace(/\\Rightarrow/g,"⟹").replace(/\\times/g,"×").replace(/\\div/g,"÷").replace(/\\cdot/g,"·").replace(/\\quad/g," ").replace(/\\qquad/g," ").replace(/\\leq/g,"≤").replace(/\\geq/g,"≥").replace(/\\neq/g,"≠").replace(/\\approx/g,"≈").replace(/\\infty/g,"∞").replace(/\\\((.+?)\\\)/gs,"$1").replace(/\\\[[\s\S]+?\\\]/g,"").replace(/\\\$/g,"\0DOLLAR\0").replace(/\$\$[\s\S]+?\$\$/g,"").replace(/\$([^$]+)\$/g,"$1").replace(/\x00DOLLAR\x00/g,"$").replace(/\\[a-zA-Z]+\*?/g,"").replace(/\n{3,}/g,`
1141
+
1142
+ `);const t=e.split(`
1143
+ `),r=[];let n=0,a=0;for(;n<t.length;){const i=t[n],s=i.match(/^(\s*)```/);if(s){const c=s[1],f=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(u("div",{className:"ak-md-pre-wrap",children:[f&&u("span",{className:"ak-md-pre-lang",children:f}),u("pre",{className:`ak-md-pre${f?` ak-md-pre--${f}`:""}`,children:u("code",{className:"ak-md-code",children:d.join(`
1144
+ `)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const c=o[1].length,f=o[2]?q(o[2].trim()):"";c===1?r.push(u("h1",{className:"ak-md-h1",children:f},a++)):c===2?r.push(u("h2",{className:"ak-md-h2",children:f},a++)):c===3?r.push(u("h3",{className:"ak-md-h3",children:f},a++)):c===4?r.push(u("h4",{className:"ak-md-h4",children:f},a++)):c===5?r.push(u("h5",{className:"ak-md-h5",children:f},a++)):r.push(u("h6",{className:"ak-md-h6",children:f},a++)),n++;continue}if(/^[-*_]{3,}$/.test(i.trim())){r.push(u("hr",{className:"ak-md-hr"},a++)),n++;continue}if(/^[-*+]\s/.test(i)){const c=[];let f=n;for(;f<t.length&&(/^[-*+]\s/.test(t[f])||t[f].trim()==="");){if(t[f].trim()===""){f++;continue}const d=t[f].length-t[f].trimStart().length,m=t[f].replace(/^[-*+]\s+/,""),h=[],k=[];let y=f+1;for(;y<t.length&&y<f+20;){const _=t[y];if(_.length-_.trimStart().length>d&&_.trim()!==""){const x=_.trim();/^[-*+]\s/.test(x)?h.push(u("li",{children:q(x.replace(/^[-*+]\s+/,""))},`nested-${y}`)):k.push(u("p",{style:{margin:"0.2em 0 0"},children:q(x)},`cont-${y}`)),y++}else break}const C=k.length>0||h.length>0?u(X,{children:[q(m),k,h.length>0&&u("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):q(m);c.push(u("li",{children:C},`item-${f}`)),f=y}r.push(u("ul",{className:"ak-md-ul",children:c},a++)),n=f;continue}if(/^\d+\.\s/.test(i)){const c=[];let f=n;for(;f<t.length&&(/^\d+\.\s/.test(t[f])||t[f].trim()==="");){if(t[f].trim()===""){f++;continue}const d=t[f].length-t[f].trimStart().length,m=t[f].replace(/^\d+\.\s+/,""),h=[],k=[];let y=f+1;for(;y<t.length&&y<f+20;){const _=t[y];if(_.length-_.trimStart().length>d&&_.trim()!==""){const x=_.trim();/^\d+\.\s/.test(x)?h.push(u("li",{children:q(x.replace(/^\d+\.\s+/,""))},`nested-order-${y}`)):/^[-*+]\s/.test(x)?h.push(u("li",{children:q(x.replace(/^[-*+]\s+/,""))},`nested-unorder-${y}`)):k.push(u("p",{style:{margin:"0.2em 0 0"},children:q(x)},`cont-${y}`)),y++}else break}const C=k.length>0||h.length>0?u(X,{children:[q(m),k,h.length>0&&u("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):q(m);c.push(u("li",{children:C},`order-item-${f}`)),f=y}r.push(u("ol",{className:"ak-md-ol",children:c},a++)),n=f;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((f,d)=>{c.push(...q(f)),d<l.length-1&&c.push(u("br",{},`br-${d}`))}),r.push(u("p",{className:"ak-md-p",children:c},a++))}}return u(X,{children:r})}function Go({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",f=u(X,{children:[u("div",{className:["ak-message__bubble",l?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),children:[s&&u("div",{className:"ak-message__images",children:u("div",{className:"ak-message__image-wrap",children:[u("a",{href:e.uploadedImageUrl,className:"ak-message__image-link",children:u("img",{src:e.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),u("a",{href:e.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:m=>m.stopPropagation(),children:u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u("polyline",{points:"7 10 12 15 17 10"}),u("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&u("div",{className:"ak-message__images",children:e.images.map((m,h)=>{const k=m.url??(m.base64?`data:${m.mimeType};base64,${m.base64}`:null);return k?u("div",{className:"ak-message__image-wrap",children:[u("a",{href:k,className:"ak-message__image-link",children:u("img",{src:k,alt:"Generated image",className:"ak-message__image"})}),u("a",{href:k,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:y=>y.stopPropagation(),children:u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u("polyline",{points:"7 10 12 15 17 10"}),u("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},`${e.id}-img-${h}`):null})}),(e.content||a&&!e.isThinking)&&u("div",{className:o?"ak-message__image-caption":void 0,children:[l?Ho(e.content):e.content,a&&!e.isThinking&&u("span",{className:"ak-cursor","aria-hidden":"true",children:[u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"})]})]})]}),u("span",{className:"ak-message__time",children:Bo(e.createdAt)})]}),d=!e.isThinking||!!e.content;return u("div",{className:`ak-message ${c}`,children:[!r&&u(Uo,{thinking:e.thinking,isThinking:e.isThinking??!1,thinkingViewable:t}),d&&f]})}function Yo(){return u("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[u("span",{className:"ak-typing__dot"}),u("span",{className:"ak-typing__dot"}),u("span",{className:"ak-typing__dot"})]})}function Xo({messages:e,isLoading:t,thinkingViewable:r}){const n=Le(null),a=e.find(s=>s.status==="streaming")?.content??"",i=e.find(s=>s.isThinking)?.thinking??"";return Te(()=>{n.current?.scrollIntoView({behavior:"smooth"})},[e.length,t,a,i]),u("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[e.map(s=>u(Go,{message:s,thinkingViewable:r},s.id)),t&&!e.some(s=>s.status==="streaming")&&u(Yo,{}),u("div",{ref:n})]})}function Jo(){return u("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u("circle",{cx:"12",cy:"5",r:"2"}),u("path",{d:"M12 7v4"}),u("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),u("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function Qo({title:e,description:t,greeting:r,avatarUrl:n}){return u("div",{className:"ak-empty-state","aria-label":"Start a conversation",children:[u("div",{className:"ak-empty-state__glow","aria-hidden":"true"}),u("div",{className:"ak-empty-state__body",children:[u("div",{className:"ak-empty-state__avatar",children:n?u("img",{src:n,alt:"",className:"ak-empty-state__avatar-img","aria-hidden":"true"}):u("span",{className:"ak-empty-state__bot-icon","aria-hidden":"true",children:u(Jo,{})})}),u("p",{className:"ak-empty-state__title",children:e}),t&&u("p",{className:"ak-empty-state__description",children:t})]}),r&&u("div",{className:"ak-empty-state__quote",children:[u("span",{className:"ak-empty-state__quote-mark","aria-hidden":"true",children:'"'}),u("p",{className:"ak-empty-state__quote-text",children:r})]})]})}function Ko(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function qo(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[u("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),u("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function ec(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),u("circle",{cx:"12",cy:"13",r:"4"})]})}function tc(){return u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[u("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function rc({onSend:e,disabled:t=!1,placeholder:r="Type a message…",privacyPolicyUrl:n,photoSendingEnabled:a=!1}){const[i,s]=Ne(""),[o,l]=Ne(null),[c,f]=Ne(null),[d,m]=Ne(!1),h=Le(null),k=Le(null),y=Le(null),C=Le(null);Te(()=>()=>{c&&URL.revokeObjectURL(c)},[c]),Te(()=>{t||h.current?.focus()},[t]);const _=bo(E=>{if(!d)return;const M=E.composedPath?E.composedPath():[],De=!!y.current&&M.includes(y.current),_t=!!C.current&&M.includes(C.current);!De&&!_t&&m(!1)},[d]);Te(()=>{if(d)return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[d,_]),Te(()=>{a||m(!1)},[a]);function x(){l(null),c&&URL.revokeObjectURL(c),f(null),k.current&&(k.current.value="")}function Z(){const E=i.trim();!E&&!o||t||(e(E,o??void 0),s(""),x(),h.current&&(h.current.style.height="auto"))}function V(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),Z())}function z(E){const M=E.currentTarget;s(M.value),M.style.height="auto",M.style.height=`${M.scrollHeight}px`}function H(E){const M=E.currentTarget.files?.[0];if(M){if(M.size>5242880){alert("Image must be smaller than 5 MB."),E.currentTarget.value="";return}c&&URL.revokeObjectURL(c),l(M),f(URL.createObjectURL(M))}}function G(){m(!1),k.current?.click()}const L=!t&&(!!i.trim()||!!o);return u("div",{className:"ak-composer",children:[a&&d&&u("div",{ref:y,className:"ak-composer__attach-menu",role:"menu",children:u("button",{className:"ak-composer__attach-menu-item",onClick:G,type:"button",role:"menuitem",disabled:t,children:[u(ec,{}),u("span",{children:"Photo"})]})}),c&&u("div",{className:"ak-composer__preview",children:u("div",{className:"ak-composer__preview-wrap",children:[u("img",{src:c,alt:"Selected",className:"ak-composer__preview-img"}),u("button",{className:"ak-composer__preview-remove",onClick:x,type:"button","aria-label":"Remove image",disabled:t,children:u(tc,{})})]})}),u("div",{className:"ak-composer__input-wrap",children:[a&&u(X,{children:[u("input",{ref:k,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:H,disabled:t,"aria-label":"Attach image"}),u("div",{className:"ak-composer__attach-wrap",children:u("button",{ref:C,className:`ak-composer__attach${d?" ak-composer__attach--open":""}`,onClick:()=>m(E=>!E),disabled:t,"aria-label":"Attachment options","aria-haspopup":"true","aria-expanded":d,type:"button",children:u(qo,{})})})]}),u("textarea",{ref:h,className:"ak-composer__input",value:i,onInput:z,onKeyDown:V,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),u("button",{className:"ak-composer__send",onClick:Z,disabled:!L,"aria-label":"Send message",type:"button",children:u(Ko,{})})]}),u("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",n?u("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}):"Privacy Policy"]})]})}function Fn({message:e}){return e.includes("Origin not allowed")?u("div",{className:"ak-error ak-error--origin",role:"alert",children:[u("div",{className:"ak-error__icon",children:"🔒"}),u("div",{className:"ak-error__content",children:[u("h3",{className:"ak-error__title",children:"Access Restricted"}),u("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only. Contact the website administrator if you believe this is an error."})]})]}):u("div",{className:"ak-error",role:"alert",children:[u("div",{className:"ak-error__icon",children:"⚠️"}),u("div",{className:"ak-error__content",children:u("p",{className:"ak-error__message",children:e})})]})}function nc(){return u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"ak-branding__logo",children:[u("rect",{width:"24",height:"24",rx:"5",fill:"currentColor"}),u("path",{d:"M12 5L7 13h3.5v6l6.5-9H13.5V5z",fill:"white"})]})}function ac(){return u("div",{className:"ak-branding",children:[u(nc,{}),u("span",{className:"ak-branding__label",children:"Powered by"}),u("span",{className:"ak-branding__name",children:"AgentForge"})]})}function Wn({config:e,messages:t,isLoading:r,error:n,isInline:a,initStatus:i,initError:s,callbacks:o}){return u("div",{className:a?"ak-shell-wrap":"ak-shell-wrap ak-shell-enter",children:[u("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating",role:"dialog","aria-label":e.title,children:[u(Do,{title:e.title,subtitle:e.subtitle,avatarUrl:e.avatarUrl,onClose:o.onClose,onReset:o.onReset,hideClose:!0}),i==="validating"&&u("div",{className:"ak-init-status",children:u("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&u("div",{className:"ak-init-status ak-init-status--error",children:u(Fn,{message:s??"Widget configuration is invalid."})}),i==="ready"&&u(X,{children:[t.length===0?u(Qo,{title:e.title,description:e.description??e.subtitle,greeting:e.greeting,avatarUrl:e.avatarUrl}):u(Xo,{messages:t,isLoading:r,thinkingViewable:e.thinkingViewable}),n&&u(Fn,{message:n}),u(rc,{onSend:o.onSendMessage,disabled:r,placeholder:"Type a message…",privacyPolicyUrl:e.privacyPolicyUrl,photoSendingEnabled:e.photoSendingEnabled})]})]}),!a&&u(ac,{})]})}function ic(){return u("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:u("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 sc(){return u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:u("polyline",{points:"6,9 12,15 18,9"})})}function oc({isOpen:e,onClick:t,avatarUrl:r,ariaLabel:n="Toggle chat"}){const a=!e&&!!r;return u("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:t,"aria-label":n,"aria-expanded":e,type:"button",children:e?u(sc,{}):a?u("img",{src:r,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):u(ic,{})})}function zn({config:e,state:t,callbacks:r}){const n=e.mode==="inline",a=Le(null);return Te(()=>{const i=a.current?.getRootNode()?.host;if(!i)return;const s=Po(e.theme.mode);i.setAttribute("data-theme",s)},[e.theme.mode]),n?u("div",{ref:a,className:"ak-inline",children:u(Wn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!0,initStatus:t.initStatus,initError:t.initError,callbacks:r})}):u("div",{ref:a,className:"ak-floating",children:[t.isOpen&&u(Wn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!1,initStatus:t.initStatus,initError:t.initError,callbacks:r}),u(oc,{isOpen:t.isOpen,onClick:t.isOpen?r.onClose:r.onOpen,avatarUrl:e.avatarUrl})]})}var Dn=(e,t,r,n)=>{const a=Mo(e);return a.render(Fe(zn,{config:t,state:r,callbacks:n})),{update(i,s){a.render(Fe(zn,{config:s,state:i,callbacks:n}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Un(e){return Vo+`
1145
+ `+Oo(e)}var Bn={init(e){return co(e,Dn,Un(Ze(e)))},mount(e,t){return lo(e,t,Dn,Un(Ze({...t,mode:"inline"})))},destroy(e){uo(e)}};return window.AgentKit=Bn,kt.AgentKit=Bn,kt})({});