/*!TikTok attaches importance to your privacy and safety. We use this script to control webapi usages and make sure they are within our privacy policy.*/ !function(){"use strict";var e,t;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of n)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const n=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return Number.isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":return Array.isArray(e)?n.array:null===e?n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?n.promise:"undefined"!=typeof Map&&e instanceof Map?n.map:"undefined"!=typeof Set&&e instanceof Set?n.set:"undefined"!=typeof Date&&e instanceof Date?n.date:n.object;default:return n.unknown}},r=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},i=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(i);else if("invalid_return_type"===r.code)i(r.returnTypeError);else if("invalid_arguments"===r.code)i(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,i=0;for(;ie.message)){const t={},n=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e);const s=(t,i)=>{let a;switch(t.code){case r.invalid_type:a=t.received===n.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case r.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case r.unrecognized_keys:a=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case r.invalid_union:a="Invalid input";break;case r.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case r.invalid_enum_value:a=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case r.invalid_arguments:a="Invalid function arguments";break;case r.invalid_return_type:a="Invalid function return type";break;case r.invalid_date:a="Invalid date";break;case r.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):a="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case r.too_small:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case r.too_big:a="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case r.custom:a="Invalid input";break;case r.invalid_intersection_types:a="Intersection results could not be merged";break;case r.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case r.not_finite:a="Number must be finite";break;default:a=i.defaultError,e.assertNever(t)}return{message:a}};let o=s;function l(e,t){const n=o,i=(e=>{const{data:t,path:n,errorMaps:i,issueData:r}=e,a=[...n,...r.path||[]],s={...r,path:a};if(void 0!==r.message)return{...r,path:a,message:r.message};let o="";const l=i.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(s,{data:t,defaultError:o}).message;return{...r,path:a,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===s?void 0:s].filter((e=>!!e))});e.common.issues.push(i)}class c{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const i of t){if("aborted"===i.status)return d;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,i=await e.value;n.push({key:t,value:i})}return c.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const i of t){const{key:t,value:r}=i;if("aborted"===t.status)return d;if("aborted"===r.status)return d;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!i.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const d=Object.freeze({status:"aborted"}),u=e=>({status:"dirty",value:e}),h=e=>({status:"valid",value:e}),m=e=>"aborted"===e.status,p=e=>"dirty"===e.status,f=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;var b;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(b||(b={}));class v{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const y=(e,t)=>{if(f(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(){if(this._error)return this._error;const t=new a(e.common.issues);return this._error=t,this._error}}};function _(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??r.defaultError}:void 0===r.data?{message:a??i??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:a??n??r.defaultError}},description:r}}class w{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parseSync({data:e,path:n.path,parent:n});return y(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return f(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>f(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(I(r)?r:Promise.resolve(r));return y(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const a=e(t),s=()=>i.addIssue({code:r.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,i)=>!!e(n)||(i.addIssue("function"==typeof t?t(n,i):t),!1)))}_refinement(e){return new be({schema:this,typeName:Re.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:e=>this["~validate"](e)}}optional(){return ve.create(this,this._def)}nullable(){return ye.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ne.create(this)}promise(){return Ie.create(this,this._def)}or(e){return ae.create([this,e],this._def)}and(e){return oe.create(this,e,this._def)}transform(e){return new be({..._(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new _e({..._(this._def),innerType:this,defaultValue:t,typeName:Re.ZodDefault})}brand(){return new Je({typeName:Re.ZodBranded,type:this,..._(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new we({..._(this._def),innerType:this,catchValue:t,typeName:Re.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return je.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,J=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,g=/^[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,R=/^[a-z0-9_-]{21}$/i,x=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,X=/^[-+]?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)?)??$/,G=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let S;const W=/^(?:(?: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])$/,Y=/^(?:(?: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])$/,O=/^(([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]))$/,k=/^(([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])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,C=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,F="((\\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])))",L=new RegExp(`^${F}$`);function N(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function U(e){let t=`${F}T${N(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function H(e,t){if(!x.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===r?.typ)&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function B(e,t){return!("v4"!==t&&t||!Y.test(e))||!("v6"!==t&&t||!k.test(e))}class M extends w{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==n.string){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:n.string,received:e.parsedType}),d}const i=new c;let a;for(const n of this._def.checks)if("min"===n.kind)t.data.lengthn.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if("length"===n.kind){const e=t.data.length>n.value,s=t.data.lengthe.test(t)),{validation:t,code:r.invalid_string,...b.errToObj(n)})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...b.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new M({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuei?n:i;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}M.create=e=>new M({checks:[],typeName:Re.ZodString,coerce:e?.coerce??!1,..._(e)});class A extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==n.number){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:n.number,received:e.parsedType}),d}let i;const a=new c;for(const n of this._def.checks)if("int"===n.kind)e.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),l(i,{code:r.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?t.datan.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),l(i,{code:r.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==z(t.data,n.value)&&(i=this._getOrReturnCtx(t,i),l(i,{code:r.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),l(i,{code:r.not_finite,message:n.message}),a.dirty()):e.assertNever(n);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,i){return new A({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(i)}]})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.valuenew A({checks:[],typeName:Re.ZodNumber,coerce:e?.coerce||!1,..._(e)});class T extends w{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)!==n.bigint)return this._getInvalidInput(t);let i;const a=new c;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?t.datan.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),l(i,{code:r.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),l(i,{code:r.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):e.assertNever(n);return{status:a.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.bigint,received:t.parsedType}),d}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,i){return new T({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(i)}]})}_addCheck(e){return new T({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew T({checks:[],typeName:Re.ZodBigInt,coerce:e?.coerce??!1,..._(e)});class E extends w{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==n.boolean){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.boolean,received:t.parsedType}),d}return h(e.data)}}E.create=e=>new E({typeName:Re.ZodBoolean,coerce:e?.coerce||!1,..._(e)});class P extends w{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==n.date){const e=this._getOrReturnCtx(t);return l(e,{code:r.invalid_type,expected:n.date,received:e.parsedType}),d}if(Number.isNaN(t.data.getTime())){return l(this._getOrReturnCtx(t),{code:r.invalid_date}),d}const i=new c;let a;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()n.value&&(a=this._getOrReturnCtx(t,a),l(a,{code:r.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):e.assertNever(n);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew P({checks:[],coerce:e?.coerce||!1,typeName:Re.ZodDate,..._(e)});class Q extends w{_parse(e){if(this._getType(e)!==n.symbol){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.symbol,received:t.parsedType}),d}return h(e.data)}}Q.create=e=>new Q({typeName:Re.ZodSymbol,..._(e)});class D extends w{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.undefined,received:t.parsedType}),d}return h(e.data)}}D.create=e=>new D({typeName:Re.ZodUndefined,..._(e)});class $ extends w{_parse(e){if(this._getType(e)!==n.null){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.null,received:t.parsedType}),d}return h(e.data)}}$.create=e=>new $({typeName:Re.ZodNull,..._(e)});class q extends w{constructor(){super(...arguments),this._any=!0}_parse(e){return h(e.data)}}q.create=e=>new q({typeName:Re.ZodAny,..._(e)});class K extends w{constructor(){super(...arguments),this._unknown=!0}_parse(e){return h(e.data)}}K.create=e=>new K({typeName:Re.ZodUnknown,..._(e)});class ee extends w{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.never,received:t.parsedType}),d}}ee.create=e=>new ee({typeName:Re.ZodNever,..._(e)});class te extends w{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.void,received:t.parsedType}),d}return h(e.data)}}te.create=e=>new te({typeName:Re.ZodVoid,..._(e)});class ne extends w{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),a=this._def;if(t.parsedType!==n.array)return l(t,{code:r.invalid_type,expected:n.array,received:t.parsedType}),d;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,n=t.data.lengtha.maxLength.value&&(l(t,{code:r.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new v(t,e,t.path,n))))).then((e=>c.mergeArray(i,e)));const s=[...t.data].map(((e,n)=>a.type._parseSync(new v(t,e,t.path,n))));return c.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new ne({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new ne({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new ne({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}function ie(e){if(e instanceof re){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=ve.create(ie(i))}return new re({...e._def,shape:()=>t})}return e instanceof ne?new ne({...e._def,type:ie(e.element)}):e instanceof ve?ve.create(ie(e.unwrap())):e instanceof ye?ye.create(ie(e.unwrap())):e instanceof le?le.create(e.items.map((e=>ie(e)))):e}ne.create=(e,t)=>new ne({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,..._(t)});class re extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),n=e.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(e){if(this._getType(e)!==n.object){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.object,received:t.parsedType}),d}const{status:t,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(const e in i.data)s.includes(e)||o.push(e);const u=[];for(const e of s){const t=a[e],n=i.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new v(i,n,i.path,e)),alwaysSet:e in i.data})}if(this._def.catchall instanceof ee){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)u.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)o.length>0&&(l(i,{code:r.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const n=i.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new v(i,n,i.path,t)),alwaysSet:t in i.data})}}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const n=await t.key,i=await t.value;e.push({key:n,value:i,alwaysSet:t.alwaysSet})}return e})).then((e=>c.mergeObjectSync(t,e))):c.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new re({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const i=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:b.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new re({...this._def,unknownKeys:"strip"})}passthrough(){return new re({...this._def,unknownKeys:"passthrough"})}extend(e){return new re({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new re({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Re.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new re({...this._def,catchall:e})}pick(t){const n={};for(const i of e.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new re({...this._def,shape:()=>n})}omit(t){const n={};for(const i of e.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new re({...this._def,shape:()=>n})}deepPartial(){return ie(this)}partial(t){const n={};for(const i of e.objectKeys(this.shape)){const e=this.shape[i];t&&!t[i]?n[i]=e:n[i]=e.optional()}return new re({...this._def,shape:()=>n})}required(t){const n={};for(const i of e.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof ve;)e=e._def.innerType;n[i]=e}return new re({...this._def,shape:()=>n})}keyof(){return me(e.objectKeys(this.shape))}}re.create=(e,t)=>new re({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:Re.ZodObject,..._(t)}),re.strictCreate=(e,t)=>new re({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:Re.ZodObject,..._(t)}),re.lazycreate=(e,t)=>new re({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:Re.ZodObject,..._(t)});class ae extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new a(e.ctx.common.issues)));return l(t,{code:r.invalid_union,unionErrors:n}),d}));{let e;const i=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&i.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=i.map((e=>new a(e)));return l(t,{code:r.invalid_union,unionErrors:s}),d}}get options(){return this._def.options}}function se(t,r){const a=i(t),s=i(r);if(t===r)return{valid:!0,data:t};if(a===n.object&&s===n.object){const n=e.objectKeys(r),i=e.objectKeys(t).filter((e=>-1!==n.indexOf(e))),a={...t,...r};for(const e of i){const n=se(t[e],r[e]);if(!n.valid)return{valid:!1};a[e]=n.data}return{valid:!0,data:a}}if(a===n.array&&s===n.array){if(t.length!==r.length)return{valid:!1};const e=[];for(let n=0;nnew ae({options:e,typeName:Re.ZodUnion,..._(t)});class oe extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),i=(e,i)=>{if(m(e)||m(i))return d;const a=se(e.value,i.value);return a.valid?((p(e)||p(i))&&t.dirty(),{status:t.value,value:a.data}):(l(n,{code:r.invalid_intersection_types}),d)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}oe.create=(e,t,n)=>new oe({left:e,right:t,typeName:Re.ZodIntersection,..._(n)});class le extends w{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==n.array)return l(i,{code:r.invalid_type,expected:n.array,received:i.parsedType}),d;if(i.data.lengththis._def.items.length&&(l(i,{code:r.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new v(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(a).then((e=>c.mergeArray(t,e))):c.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new le({...this._def,rest:e})}}le.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:e,typeName:Re.ZodTuple,rest:null,..._(t)})};class ce extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==n.map)return l(i,{code:r.invalid_type,expected:n.map,received:i.parsedType}),d;const a=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map((([e,t],n)=>({key:a._parse(new v(i,e,i.path,[n,"key"])),value:s._parse(new v(i,t,i.path,[n,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const i=await n.key,r=await n.value;if("aborted"===i.status||"aborted"===r.status)return d;"dirty"!==i.status&&"dirty"!==r.status||t.dirty(),e.set(i.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const i=n.key,r=n.value;if("aborted"===i.status||"aborted"===r.status)return d;"dirty"!==i.status&&"dirty"!==r.status||t.dirty(),e.set(i.value,r.value)}return{status:t.value,value:e}}}}ce.create=(e,t,n)=>new ce({valueType:t,keyType:e,typeName:Re.ZodMap,..._(n)});class de extends w{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==n.set)return l(i,{code:r.invalid_type,expected:n.set,received:i.parsedType}),d;const a=this._def;null!==a.minSize&&i.data.sizea.maxSize.value&&(l(i,{code:r.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(e){const n=new Set;for(const i of e){if("aborted"===i.status)return d;"dirty"===i.status&&t.dirty(),n.add(i.value)}return{status:t.value,value:n}}const c=[...i.data.values()].map(((e,t)=>s._parse(new v(i,e,i.path,t))));return i.common.async?Promise.all(c).then((e=>o(e))):o(c)}min(e,t){return new de({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new de({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}de.create=(e,t)=>new de({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,..._(t)});class ue extends w{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})}}ue.create=(e,t)=>new ue({getter:e,typeName:Re.ZodLazy,..._(t)});class he extends w{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:r.invalid_literal,expected:this._def.value}),d}return{status:"valid",value:e.data}}get value(){return this._def.value}}function me(e,t){return new pe({values:e,typeName:Re.ZodEnum,..._(t)})}he.create=(e,t)=>new he({value:e,typeName:Re.ZodLiteral,..._(t)});class pe extends w{_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),i=this._def.values;return l(n,{expected:e.joinValues(i),received:n.parsedType,code:r.invalid_type}),d}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),n=this._def.values;return l(e,{received:e.data,code:r.invalid_enum_value,options:n}),d}return h(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}pe.create=me;class fe extends w{_parse(t){const i=e.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==n.string&&a.parsedType!==n.number){const t=e.objectValues(i);return l(a,{expected:e.joinValues(t),received:a.parsedType,code:r.invalid_type}),d}if(this._cache||(this._cache=new Set(e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=e.objectValues(i);return l(a,{received:a.data,code:r.invalid_enum_value,options:t}),d}return h(t.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe({values:e,typeName:Re.ZodNativeEnum,..._(t)});class Ie extends w{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return l(t,{code:r.invalid_type,expected:n.promise,received:t.parsedType}),d;const i=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return h(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ie.create=(e,t)=>new Ie({type:e,typeName:Re.ZodPromise,..._(t)});class be extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,a={addIssue:e=>{l(i,e),e.fatal?n.abort():n.dirty()},get path(){return i.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(i.data,a);if(i.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===n.value)return d;const t=await this._def.schema._parseAsync({data:e,path:i.path,parent:i});return"aborted"===t.status?d:"dirty"===t.status||"dirty"===n.value?u(t.value):t}));{if("aborted"===n.value)return d;const t=this._def.schema._parseSync({data:e,path:i.path,parent:i});return"aborted"===t.status?d:"dirty"===t.status||"dirty"===n.value?u(t.value):t}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const t=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===t.status?d:("dirty"===t.status&&n.dirty(),e(t.value),{status:n.value,value:t.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((t=>"aborted"===t.status?d:("dirty"===t.status&&n.dirty(),e(t.value).then((()=>({status:n.value,value:t.value}))))))}if("transform"===r.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!f(e))return d;const t=r.transform(e.value,a);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:t}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>f(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:n.value,value:e}))):d))}e.assertNever(r)}}be.create=(e,t,n)=>new be({schema:e,typeName:Re.ZodEffects,effect:t,..._(n)}),be.createWithPreprocess=(e,t,n)=>new be({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,..._(n)});class ve extends w{_parse(e){return this._getType(e)===n.undefined?h(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Re.ZodOptional,..._(t)});class ye extends w{_parse(e){return this._getType(e)===n.null?h(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Re.ZodNullable,..._(t)});class _e extends w{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===n.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}_e.create=(e,t)=>new _e({innerType:e,typeName:Re.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,..._(t)});class we extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return I(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new a(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}we.create=(e,t)=>new we({innerType:e,typeName:Re.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,..._(t)});class Ze extends w{_parse(e){if(this._getType(e)!==n.nan){const t=this._getOrReturnCtx(e);return l(t,{code:r.invalid_type,expected:n.nan,received:t.parsedType}),d}return{status:"valid",value:e.data}}}Ze.create=e=>new Ze({typeName:Re.ZodNaN,..._(e)});class Je extends w{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class je extends w{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),u(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new je({in:e,out:t,typeName:Re.ZodPipeline})}}class ge extends w{_parse(e){const t=this._def.innerType._parse(e),n=e=>(f(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}var Re;ge.create=(e,t)=>new ge({innerType:e,typeName:Re.ZodReadonly,..._(t)}),re.lazycreate,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"}(Re||(Re={}));const xe=M.create,Xe=A.create,Ge=E.create,Se=$.create,We=q.create,Ye=K.create;ee.create;const Oe=ne.create,ke=re.create;re.strictCreate;const Ve=ae.create;oe.create,le.create;const Ce=ue.create,Fe=he.create,Le=pe.create;Ie.create,ve.create,ye.create;var Ne="main_thread",Ue="out_app",He="cookie_set_by_document",Be="cookie_blocked_on_start",Me="general_fetch",ze="request_log",Ae="webapi",Te="storage_use",Ee="sw_incompat",Pe="ready_for_msg",Qe="force_update_sw",De="frequency",$e="cost_time",qe="main_thread_ctx",Ke="network_rule",et="__PNS_RUNTIME_SW_EVENT__",tt="__PNS_RUNTIME_SE_ERROR__",nt="__PNS_RUNTIME__";function it(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:lt(),t=globalThis[e];return t||(t={pendingEvents:[],pendingConfig:{},pendingListeners:{},errors:[],pushEvent:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ne,r=arguments.length>3?arguments[3]:void 0;ct(t.pendingEvents,{eventName:e,eventDetail:n,source:i,options:r},dt)},pushError:function(e){ct(t.errors,e,20)},pageContextObservers:[]},globalThis[e]=t),t}function ht(){return"undefined"==typeof globalThis}function mt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt();return ht()?null:ut(e)}var pt=function(e){return e&&"function"==typeof e.then},ft=function(e){return function(t){return pt(e)?e.then(t):t(e)}};function It(e,t,n){return function(){for(var i=arguments.length,r=new Array(i),a=0;a0){var r,a=(r=Math).max.apply(r,st(Object.keys(n).map(Number)))+1,s=Array.from(at(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0){var h=!1,m=!0,p=!1,f=void 0;try{for(var I,b=i[Symbol.iterator]();!(m=(I=b.next()).done);m=!0){var v=I.value;e.startsWith(v)&&(h=!0)}}catch(e){p=!0,f=e}finally{try{m||null==b.return||b.return()}finally{if(p)throw f}}if(!h)return!0}return!1}var Mt=["127.0.0.1","localhost"],zt=["is_test_only=1","slardar_heatmap"];function At(e,t){var n=ot(t);if(n){var i=n.search;if(i)for(var r=0;r3&&void 0!==arguments[3])||arguments[3],r=encodeURIComponent(t),a="?"===e[0],s=(a?e.slice(1):e).split("&"),o=!1,l=0;l0||e._blocked||!1}function mn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location,t=e.href,n=e.host,i=e.pathname,r=e.search,a=e.hash;return{url:t,host:n,path:i,search:r,hash:a}}var pn=We(),fn=Ve([xe(),xe().array()]),In=Ve([xe(),Xe(),Ge(),Se()]),bn=ke({$eq:In.optional(),$ne:In.optional(),$exists:Ge().optional(),$regex:xe().optional(),$options:xe().optional(),$text:xe().optional(),$prefix:xe().optional(),$sufin:Oe(xe()).optional(),$sufnin:Oe(xe()).optional(),$in:Oe(In).optional(),$nin:Oe(In).optional()}),vn=Ve([Fe("context"),Fe("self")]),yn=Ve([Fe("url"),Fe("host"),Fe("path"),Fe("search"),Fe("body"),Fe("header"),Fe("method"),Fe("destination"),Fe("source")]);Ve([Fe("block"),Fe("remove"),Fe("empty"),Fe("replace"),Fe("report")]);var _n,wn=ke({type:Fe("self")}).and(Ve([ke({handler:Fe("report"),value:Xe()}),ke({handler:Fe("report_stack"),value:Xe()}),ke({handler:Fe("block")})])),Zn=ke({type:Ve([Fe("url"),Fe("host"),Fe("path"),Fe("search"),Fe("body"),Fe("header"),Fe("method"),Fe("destination")]),field:Ve([Oe(Ve([xe(),Xe()])),xe()]).optional()}).and(Ve([ke({handler:Fe("replace"),pattern:bn.optional(),value:Ye()}),ke({handler:Ve([Fe("remove"),Fe("empty")])})])),Jn=ke({type:Ve([vn,yn]),field:Ve([xe(),Oe(Ve([xe(),Xe()]))]).optional(),pattern:bn}),jn=ke({$or:Oe(Ce((function(){return _n}))).optional(),$and:Oe(Ce((function(){return _n}))).optional(),$not:Ce((function(){return _n})).optional()}),gn=Ve([Jn,ke({pattern:jn})]),Rn=Jn;_n=Ce((function(){return gn}));var xn=Ve([wn,Zn]),Xn=ke({ruleName:xe(),priority:Xe().optional(),global:Ge().optional(),conditions:Oe(gn),handlers:Oe(xn)}),Gn=ke({ruleName:xe(),priority:Xe().optional(),global:Ge().optional(),conditions:Oe(Rn),handlers:Oe(xn)}),Sn=ke({type:xe().optional(),field:fn,pattern:ke({$eq:In.optional(),$ne:In.optional(),$exists:Ge().optional(),$regex:xe().optional(),$options:xe().optional(),$text:xe().optional(),$prefix:xe().optional(),$sufin:Oe(In).optional(),$sufnin:Oe(In).optional(),$in:Oe(In).optional(),$nin:Oe(In).optional(),$or:Oe(ke({})).optional(),$and:Oe(ke({})).optional(),$not:ke({}).optional()})}),Wn=wn;ke({ruleName:xe(),priority:Xe().optional(),global:Ge().optional(),conditions:Oe(Sn),handlers:Oe(Wn)});var Yn=ke({type:xe(),field:fn.optional(),pattern:bn}),On=ke({type:xe(),handler:xe(),value:pn.optional(),field:fn.optional(),pattern:bn.optional()}),kn=ke({interval:Xe(),size:Xe(),freqInterval:Xe(),freqSize:Xe(),tenant:xe().optional(),domain:xe().optional()}),Vn=ke({enabled:Ge().optional(),sampleRate:Xe(),stackSampleRate:Xe().optional(),stackCollectCookies:Oe(xe()),blockers:Oe(ke({domains:Oe(xe()),cookies:Oe(xe())})),intercept:Oe(Xn).optional()}),Cn=ke({enabled:Ge().optional(),sampleRate:Xe(),stackCollectKeys:Oe(xe()).optional(),valueRate:Xe()}),Fn=ke({enabled:Ge().optional(),apis:Oe(ke({apiType:Le(["method","attribute_set","attribute_get","constructor"]),sampleRate:Xe(),apiObj:xe(),apiName:xe(),block:Ge().optional(),blockWithCallbackIdx:Xe().optional(),blockWithCallbackParams:ke({}).optional(),paramCondition:ke({}),withStack:Ge(),stackRate:Xe(),withRawArguments:Oe(Ge()),freqSampleRate:Xe().optional()}))});Le(["OFF","SCHEMA","RAW"]);var Ln=ke({enabled:Ge().optional(),enableGeneralReport:Ge(),generalRate:Xe(),methods:ke({})}),Nn=ke({ruleName:xe(),freqSampleRate:Xe(),urlPattern:Oe(xe()),reportList:Oe(xe())});ke({ruleName:xe(),priority:Xe().optional(),addReplaceHeader:Ge().optional(),conditions:Oe(Yn).optional(),handlers:Oe(On).optional()});var Un=ke({enabled:Ge().optional(),sampleRate:Xe(),fpBody:Xe().optional(),rawVal:Oe(ke({endpoint:Oe(xe()),keyPath:Oe(xe())})).optional(),respHeaders:Oe(xe()).optional(),intercept:Oe(Gn),freq:Oe(Nn).optional(),withStack:Oe(ke({urlPattern:Oe(xe()),endpoint:Oe(xe()),rate:Xe()})).optional()}),Hn=ke({listener:Oe(ke({type:Le(["navigation_navigate","a_click","submit_click"]),sampleRate:Xe()}))}),Bn=ke({plugins:Oe(ke({name:xe(),params:ke({charset:xe().optional(),desc:xe().optional(),src:xe().optional(),type:xe().optional()}).passthrough()}))});function Mn(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Mn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),s=new J(i||[]);return a._invoke=function(e,t,n){var i="suspendedStart";return function(r,a){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw a;return g()}for(n.method=r,n.arg=a;;){var s=n.delegate;if(s){var o=_(s,n);if(o){if(o===d)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}(e,n,s),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function u(){}function h(){}function m(){}var p={};o(p,r,(function(){return this}));var f=Object.getPrototypeOf,I=f&&f(f(j([])));I&&I!==t&&n.call(I,r)&&(p=I);var b=m.prototype=u.prototype=Object.create(p);function v(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(r,a,s,o){var l=c(e[r],e,a);if("throw"!==l.type){var d=l.arg,u=d.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,s,o)}),(function(e){i("throw",e,s,o)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return i("throw",e,s,o)}))}o(l.arg)}var r;this._invoke=function(e,n){function a(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(a,a):a()}}function _(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function J(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function j(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function t(){for(;++i=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var o=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(o&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Z(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;Z(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:j(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function zn(e){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(e)}function An(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}ke({reporter:kn,cookie:Vn,storage:Cn,webapi:Fn,jsb:Ln.optional(),network:Un,event:Hn.optional(),plugin:Bn.optional()});var li=function(e){return"function"==typeof e},ci=function(){};var di=function(){var e=Object.prototype.hasOwnProperty;return function(t,n){return e.call(t,n)}}(),ui=function(e,t,n){di(e,n)&&(t[n]=e[n])};function hi(e,t){if(!e)return[void 0,e];for(var n,i,r=e;r&&!i;)i=Object.getOwnPropertyDescriptor(r,t),n=r,r=Object.getPrototypeOf(r);return[i,n]}function mi(e,t,n){try{var i=ii(hi(e,t),2),r=i[0],a=i[1];if(!(null==r?void 0:r.configurable))return!1;var s={},o=r.set,l=r.get,c=n.set,d=n.get;return o&&c&&(s.set=function(e){c(e)||o.call(this,e)}),l&&d&&(s.get=function(){if(!d())return l.call(this)}),Object.defineProperty(a,t,s),!0}catch(e){}return!1}function pi(e,t,n,i){try{var r=ii(hi(e,t),2)[1];if("object"===zn(r)&&r&&li(r[t])){var a=r[t];r[t]=function(){for(var e=arguments.length,t=new Array(e),r=0;rMath.random()}function Ii(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=(new Error).stack;return null!==(e=null==n?void 0:n.split("\n").slice(t).map((function(e){return e.trim()})).join("\n"))&&void 0!==e?e:""}function bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="";for(var i in t)n+="; ".concat(i),n+="=".concat(t[i].split(";")[0]);document.cookie="".concat(e,"=; expires=").concat(new Date(Date.now()-864e5).toUTCString()).concat(n)}function vi(e){var t=e.split("=").slice(1).join("=");try{'"'===t[0]&&(t=t.slice(1,-1)),t=t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}catch(e){}return t}function yi(e,t){return function(){if(Math.random()0||t.stackSampleRate&&i.some((function(e){return e.test(o.name)}));o.stack=n?yi(Ii,l)():void 0,e(o)}),o._sample_rate)()}return o.name===Ji&&Yi().updatePageContext(xi(null!==(a=function(e){var t,n=e.split(";"),i=!1,r=n.shift(),a=r?decodeURIComponent(r.split("=")[1]):void 0,s=oi(n);try{for(s.s();!(t=s.n()).done;){var o=t.value,l=ii(Vi.apply(o).split("=")[0],2),c=l[0],d=l[1];if("max-age"===c&&Number(d)<0)return;"expires"===c&&(i=Date.parse(d)1&&s[e]<=2}));return I};function ar(e,t){for(var n in t){var i=t[n];if(e[n]!==i)return!1}return!0}var sr,or=ci,lr=function(e,t){var n,i=t.apis,r=e.webapiHook,a=e.webapiFreqHook,s=rr({webapi:i}),o=oi(i);try{var l=function(){var e=n.value,t=e.sampleRate,i=e.apiType,o=e.apiObj,l=e.block,c=e.blockUrls,d=void 0===c?[]:c,u=e.blockWithCallbackParams,h=e.blockWithCallbackIdx,m=e.apiName,p=e.paramCondition,f=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,i=oi(e.split(".").filter(Boolean));try{for(i.s();!(t=i.n()).done;){if(!(n=n[t.value]))return null}}catch(e){i.e(e)}finally{i.f()}return n}(o);if(!f)return"continue";var I=It((function(){for(var n=arguments.length,i=new Array(n),c=0;c0?e.reportRequestEventDetail=t.body.then((function(e){return Object.assign(Object.assign({},t),{body:e})})):t.body.then((function(e){var n=Object.assign(Object.assign({},t),{body:e});r.report(n)})):(null!==(l=null===(o=Oi().network.respHeaders)||void 0===o?void 0:o.length)&&void 0!==l?l:0)>0?e.reportRequestEventDetail=t:r.report(t),(null!==(d=null===(c=Oi().network.freq)||void 0===c?void 0:c.length)&&void 0!==d?d:0)>0&&a.freq&&(null===(u=r.freq)||void 0===u||u.call(r,t)),m)return m;t._remove_body=-1!==(null!==(h=t._replaced_fields)&&void 0!==h?h:[]).indexOf("method")&&-1!==["GET","HEAD"].indexOf(t.method);var p=function(e,t){if(!t._replaced_fields||0===t._replaced_fields.length)return e;var n=-1!==t._replaced_fields.indexOf("body"),i=function(){var i=Promise.resolve(void 0);return t._remove_body?Promise.resolve(void 0):(n?(t.body=JSON.stringify(t.body),i=Promise.resolve(t.body)):e.headers.get("Content-Type")&&-1===["GET","HEAD"].indexOf(e.method.toUpperCase())&&(i=e.blob()),i)},r=e;if(-1!==t._replaced_fields.indexOf("url")||t._remove_body)r=i().then((function(n){var i,r={method:t.method,headers:new Headers(null!==(i=t.header_map)&&void 0!==i?i:{}),referrer:e.referrer,referrerPolicy:e.referrerPolicy,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,integrity:e.integrity,keepalive:e.keepalive,signal:e.signal,body:n};return new Request(t.request_url,r)}));else{var a,s={};-1!==t._replaced_fields.indexOf("method")&&(s.method=t.method),-1!==t._replaced_fields.indexOf("header")&&(s.headers=new Headers(null!==(a=t.header_map)&&void 0!==a?a:{})),r=n?i().then((function(t){return s.body=t,new Request(e,s)})):new Request(e,s)}return r}(n,t);return p}))}!function(e){e[e.SW_READY=0]="SW_READY"}(sr||(sr={}));var vr={request_url:"",request_host:"",request_path:"",search:"",method:"",source:$t,_request_time:0,_sample_rate:0,_is_json_body:!1,_replaced_fields:[]};function yr(e,t,n){var i=!1,r=function(){i=!0;var r=(n.getAllResponseHeaders()||"").trim().split(/[\r\n]+/).reduce((function(e,t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1).trim();e[i]=r}return e}),{});pr(n.status,t,e,r)};n.addEventListener("load",r),setTimeout((function(){i||(t(e),n.removeEventListener("load",r))}),5e3)}var _r={};function wr(e){var t=e.OriginalXHR,n=e.rule,i=e.switcher;if(0===Object.keys(_r).length)for(var r in t.prototype)_r[r]={enumerable:!0};return function(){var e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dn(e,t)}(s,e);var t,r,a=(t=s,r=$n(),function(){var e,n=Qn(t);if(r){var i=Qn(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return ei(this,e)});function s(){var e;return An(this,s),(e=a.call(this)).__pumbaa_status=null,e.__pumbaa_readyState=null,e.__pumbaa_statusText=null,e.__pumbaa_detail=vr,Kn(e)instanceof s||Object.setPrototypeOf(Kn(e),(this instanceof s?this.constructor:void 0).prototype),e.__pumbaa_callbackEnabled=Object.assign({},i.callbackEnabled),e}return En(s,[{key:"status",get:function(){return null===this.__pumbaa_status?ni(Qn(s.prototype),"status",this):this.__pumbaa_status},set:function(e){this.__pumbaa_status=e}},{key:"statusText",get:function(){return null===this.__pumbaa_statusText?ni(Qn(s.prototype),"statusText",this):this.__pumbaa_statusText},set:function(e){this.__pumbaa_statusText=e}},{key:"readyState",get:function(){return null===this.__pumbaa_readyState?ni(Qn(s.prototype),"readyState",this):this.__pumbaa_readyState},set:function(e){this.__pumbaa_readyState=e}},{key:"__pumbaa_hookFunc",value:function(e){var t=this;return function(){for(var n,i,r=arguments.length,a=new Array(r),o=0;o0?yr(this.__pumbaa_detail,i.callback.report,this):i.callback.report(this.__pumbaa_detail),(null!==(u=null===(d=Oi().network.freq)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0&&this.__pumbaa_callbackEnabled.freq&&(null===(m=(h=i.callback).freq)||void 0===m||m.call(h,this.__pumbaa_detail))}if(Ir(this.__pumbaa_detail)){var V="1"===this.__pumbaa_detail["x-pns-block"]?Pt():Qt();return this.__pumbaa_is_aborted||(this.status=V.status,this.readyState=4,this.statusText=V.statusText,this.__pumbaa_res={headers:ri(V.headers).reduce((function(e,t){var n=ii(t,2),i=n[0],r=n[1];return e[i]=r,e}),{})},Gt.error("".concat(this.__pumbaa_detail.method," ").concat(this.__pumbaa_detail.request_url," ").concat(this.status," (").concat(this.statusText,")"))),!0}return void 0!==this.__pumbaa_detail._replaced_fields&&-1!==(null===(p=this.__pumbaa_detail._replaced_fields)||void 0===p?void 0:p.indexOf("body"))?(ni(Qn(s.prototype),"send",this).call(this,b?JSON.stringify(this.__pumbaa_detail.body):this.__pumbaa_detail.body),!0):(ni(Qn(s.prototype),"send",this).call(this,I),!0)}},{key:"__pumbaa_abort",value:function(){this.__pumbaa_is_aborted=!0}}]),s}(t);for(var r in e.prototype)delete _r[r];return Object.defineProperties(e.prototype,_r),e}()}var Zr="PerformanceObserver"in window,Jr=["xmlhttprequest","fetch","beacon"];function jr(e,t){var n=e.switcher.activeInterceptRules.map((function(e){return nn(e)?e:Object.assign(Object.assign({},e),{handlers:e.handlers.filter((function(e){return"report"===e.handler}))})}));t.getEntries().forEach((function(t){if(e.isBufferedEntry||!Jr.includes(t.initiatorType)){var i=function(e){var t=ot(e.name);if(void 0!==t)return{request_url:t.href,request_host:t.host,request_path:t.pathname,method:"UNKNOWN",source:Dt,search:t.search,_request_time:Math.trunc(e.startTime+performance.timeOrigin),initiator_type:e.initiatorType,resp_status:e.responseStatus,_is_json_body:!1,_sample_rate:0}}(t);if(i){i.perf_buf=e.isBufferedEntry;var r=e.switcher.getState(sr.SW_READY);void 0!==r&&(i.sw_ready="".concat(r));var a,s=Object.assign({},i),o=oi(n);try{for(o.s();!(a=o.n()).done;){var l=a.value;s=nn(l)?an(s,l):dr(s,l)}}catch(e){o.e(e)}finally{o.f()}s=Object.assign(Object.assign(Object.assign({},s),i),{_sample_rate:s._sample_rate}),setTimeout((function(){var n,i,r,a;-1===e.securityPolicyViolationURLs.indexOf(t.name)&&(e.switcher.callback.report(s),(null!==(i=null===(n=Oi().network.freq)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0&&e.switcher.callbackEnabled.freq&&(null===(a=(r=e.switcher.callback).freq)||void 0===a||a.call(r,s)))}),100)}}})),e.isBufferedEntry=!1}var gr,Rr,xr,Xr=_i((function(e){var t={isBufferedEntry:!0,securityPolicyViolationURLs:function(){var e=[];return document.addEventListener("securitypolicyviolation",(function(t){var n=ot(t.blockedURI);n&&"report"!==t.disposition&&-1===e.indexOf(n.href)&&(100===e.length&&e.shift(),e.push(n.href))})),e}(),switcher:e},n=Zr?new PerformanceObserver((function(e){return jr(t,e)})):null;try{null==n||n.observe({type:"resource",buffered:!0})}catch(e){jr(t,{getEntries:function(){return performance.getEntriesByType("resource")}}),null==n||n.observe({entryTypes:["resource"]})}})),Gr=function(){for(var e=arguments.length,t=new Array(e),n=0;n0){var l=fr(o.request_url,e.rule.withStack);l&&yi((function(){return o.stack=Ii(5)}),l.rate)()}var c={params:a,switcher:e,eventDetail:o},d=Sr(c),u=Ir(c.eventDetail),h=!u&&(t=xr).call.apply(t,[this].concat(ri(d)));return c.eventDetail.beacon_ret=h,(h||hn(c.eventDetail))&&Wr(c),h}}}},{key:"hookFetch",value:function(){var e=this;if(window.fetch){var t=this.callback;null!=gr||(gr=window.fetch),window.fetch=function(){for(var n,i,r=arguments.length,a=new Array(r),s=0;s0){var d=fr(c.request.url,e.rule.withStack);d&&yi((function(){return c.callstack=Ii(5)}),d.rate)()}var u=br(c);function h(e){var n,i=_i((function(e){var n,i,r=e.status,a=c.reportRequestEventDetail,s={};return e.headers.forEach((function(e,t){s[t.toLowerCase()]=e})),pr(r,t.reportLogid,a,s),(null!==(i=null===(n=Oi().network.respHeaders)||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0&&pr(r,t.report,a,s),e}));return(n=e instanceof Request?gr(e):Promise.resolve(e)).then(i).catch((function(){return n}))}return pt(u)?u.then(h):h(u)}}}},{key:"hookXHR",value:function(){null!=Rr||(Rr=window.XMLHttpRequest);var e=wr({OriginalXHR:Rr,rule:this.rule,reporter:this.callback,switcher:this});window.XMLHttpRequest=e}},{key:"initPerformance",value:function(){Xr(this)}}],[{key:"getInstance",value:function(){if(null===e._instance){for(var t=arguments.length,n=new Array(t),i=0;i=100&&n.shift(),n.push(e)}}}(),s=a.check,o=a.push,l={report:_i((function(t){var n;if((t.source!==Dt||!(null==s?void 0:s(t.request_url)))&&(!ki()||!(null===(n=t.resp_header)||void 0===n?void 0:n["x-tt-logid"])||t.rule_name||"analytics.tiktok.com"===t.request_host)){var i=t._sample_rate;yi((function(){return e.pushEvent(Me,{eventName:Me,eventMetrics:{count:1},eventDetail:t},Ne,{sample_rate:i})}),i)()}})),reportLogid:_i((function(t){var n,i;if(t.source!==Dt||!(null==s?void 0:s(t.request_url))){var r=null===(n=t.resp_header)||void 0===n?void 0:n["x-tt-traceflag"],a=null===(i=t.resp_header)||void 0===i?void 0:i["x-tt-logid"];r&&"02"==="".concat(r)&&a&&e.pushEvent(ze,{eventName:ze,eventMetrics:{count:1},eventDetail:t},Ne)}})),freq:i.length>0&&er?_i(Nr(i,e)):void 0},c=new Yr(l,t,{freq:i.length>0},Yi().pageContext);if(navigator&&"serviceWorker"in navigator){var d=Ri(),u=d.sw,h=d.sw_version,m=!1;navigator.serviceWorker.addEventListener("message",_i((function(t){var n,i,a,s;if(t.data.event===et){var l=t.data.data;if(Cr.indexOf(l.eventName),Me===l.eventName){if((null!==(n=l.eventDetail)&&void 0!==n?n:{}).rule_name){null==o||o(null!==(a=null===(i=l.eventDetail)||void 0===i?void 0:i._old_url)&&void 0!==a?a:l.eventDetail.request_url);var c=null!==(s=l.eventDetail._sample_rate)&&void 0!==s?s:r;yi((function(){e.pushEvent(l.eventName,l,Ne,{sample_rate:c})}),c)()}l.sw_version||Lr()}m||(m=!0,"string"==typeof u&&"string"==typeof h&&-1===h.split(",").indexOf(l.sw_version)&&setTimeout((function(){var e;navigator.serviceWorker.register((e=u).startsWith("http")?e:"".concat(location.origin).concat(e),{updateViaCache:"none"}),Lr()}),0))}else t.data.event===tt&&t.data.error&&e.pushError(t.data.error)}))),navigator.serviceWorker.ready.then((function(e){var n;c.setState(sr.SW_READY,1);var i=null!==(n=null==e?void 0:e.active)&&void 0!==n?n:navigator.serviceWorker.controller;(null==i?void 0:i.postMessage)&&([{eventName:Pe,source:Ne},{eventName:qe,source:Ne,data:Yi().pageContext},{eventName:Ke,source:Ne,data:t.intercept}].forEach((function(e){return i.postMessage(e)})),Gi((function(e){i.postMessage({eventName:qe,source:Ne,data:e})})))}))}else e.pushEvent(Ee)},Hr=function(e,t){!function(e,t){var n,i=t.listener,r=e.eventHook,a=oi(i);try{var s=function(){var e=n.value,t=e.type,i=e.sampleRate;switch(t){case"navigation_navigate":"undefined"!=typeof window&&"navigation"in window&&_i(yi((function(){window.navigation.addEventListener("navigate",(function(t){var n=new URL(t.destination.url,location.href);n.hostname!==location.hostname&&r({eventRule:e,url:n.href})}))}),i),void 0)();break;case"a_click":_i(yi((function(){document.addEventListener("DOMContentLoaded",(function(){document.body.addEventListener("click",(function(t){var n=t.target.closest("a");if(n&&"_self"!==n.target){var i=new URL(n.href,location.href);i.hostname!==location.hostname&&r({eventRule:e,url:i.href})}}),!0)}))}),i),void 0)();break;case"submit_click":_i(yi((function(){document.addEventListener("DOMContentLoaded",(function(){document.body.addEventListener("click",(function(t){var n=t.target;if(("BUTTON"===n.tagName&&"submit"===n.type||"INPUT"===n.tagName&&"submit"===n.type)&&n.form&&"_self"!==n.form.target){var i=new URL(n.formAction||n.form.action,location.href);i.hostname!==location.hostname&&r({eventRule:e,url:i.href})}}),!0)}))}),i),void 0)()}};for(a.s();!(n=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}}({eventHook:_i((function(t){e.pushEvent("event",t)}))},t)},Br="__extraContextReportedEvents__",Mr=function(e,t,n){try{var i=function(e){var t=e,n=t[Br];if(n instanceof Set)return n;var i=new Set;return t[Br]=i,i}(e);if(i.has(t))return;i.add(t),"function"==typeof e.pushEvent&&e.pushEvent(t,n)}catch(e){}},zr=function(e){try{if("undefined"==typeof window)return;var t,n=window,i=oi(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(!n||"object"!==zn(n))return;n=n[r]}}catch(e){i.e(e)}finally{i.f()}return n}catch(e){return}},Ar="https://www.tiktok.com/tiktok/pns/privacy_headers",Tr=function(e){if(!Array.isArray(e))return null;var t,n=oi(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i&&"object"===zn(i)){var r=i.key,a=i.value,s=i.error_code;if("rpc_persist_pdl_2"===r&&0===s&&"string"==typeof a&&""!==a)return a}}}catch(e){n.e(e)}finally{n.f()}return null},Er=function(e){if(!e)return Ar;try{return"".concat(Ar,"?aid=").concat(encodeURIComponent(e))}catch(e){return Ar}},Pr=function(){if("undefined"==typeof AbortController)return{signal:void 0,cancel:function(){}};var e=new AbortController,t=setTimeout((function(){return e.abort()}),5e3);return{signal:e.signal,cancel:function(){return clearTimeout(t)}}};function Qr(){return Ti(this,void 0,void 0,Mn().mark((function e(){var t,n,i,r,a,s,o,l;return Mn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof window&&"function"==typeof window.fetch){e.next=3;break}return e.abrupt("return",{ok:!1,reason:"no_fetch"});case 3:if(c=void 0,c=zr(["__$UNIVERSAL_DATA$__","__DEFAULT_SCOPE__","webapp.app-context","appId"]),t="string"==typeof c&&""!==c?c:"number"==typeof c&&Number.isFinite(c)?String(c):""){e.next=7;break}return e.abrupt("return",{ok:!1,reason:"no_aid"});case 7:return n=Er(t),i=Pr(),r=i.signal,a=i.cancel,e.prev=10,e.next=13,window.fetch(n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},signal:r});case 13:s=e.sent,e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(10),e.abrupt("return",{ok:!1,reason:"throw"});case 20:return e.prev=20,a(),e.finish(20);case 23:if(s.ok){e.next=26;break}return e.abrupt("return",{ok:!1,reason:"http"});case 26:return e.prev=26,e.next=29,s.json();case 29:o=e.sent,e.next=36;break;case 32:return e.prev=32,e.t1=e.catch(26),e.abrupt("return",{ok:!1,reason:"parse"});case 36:if(o&&"object"===zn(o)&&0===o.code){e.next=39;break}return e.abrupt("return",{ok:!1,reason:"biz_code"});case 39:if(null!==(l=Tr(o.results))){e.next=43;break}return e.abrupt("return",{ok:!1,reason:"no_match"});case 43:return e.abrupt("return",{ok:!0,value:l});case 45:case"end":return e.stop()}var c}),e,null,[[10,16,20,23],[26,32]])})))}var Dr=[1e3,5e3,15e3,3e4,6e4],$r=["sr","pdl_2"],qr=function(e){return $r.every((function(t){return e.has(t)}))},Kr=function(){var e=zr(["__$UNIVERSAL_DATA$__","__DEFAULT_SCOPE__","webapp.app-context","user","storeRegion"]);return"string"==typeof e&&""!==e?e:""};function ea(e){var t=Oi(),n=t.cookie;t.storage;var i=t.webapi,r=t.network,a=t.event,s=void 0===a?{listener:[]}:a,o=t.plugin,l=void 0===o?{plugins:[]}:o;Ai(e,n),$i(e),function(e,t){lr({webapiHook:_i((function(t){e.pushEvent(Ae,t)})),webapiFreqHook:er?_i((function(t){e.pushEvent(De,t)})):void 0},t)}(e,i),Ur(e,r),Hr(e,s),function(e){ki()&&wi((function(){return Ti(void 0,void 0,void 0,Mn().mark((function t(){var n,i,r,a;return Mn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new Set,i=0,a=function t(){return Ti(void 0,void 0,void 0,Mn().mark((function a(){var s,o,l,c,d;return Mn().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(a.prev=0,!qr(n)){a.next=3;break}return a.abrupt("return");case 3:if(n.has("sr")||(s=Kr())&&(Yi().updatePageContext({sr:s}),n.add("sr")),n.has("pdl_2")){a.next=12;break}return a.next=10,Qr();case 10:(o=a.sent).ok?(Yi().updatePageContext({pdl_2:o.value}),n.add("pdl_2")):r=o.reason;case 12:if(!qr(n)){a.next=15;break}return a.abrupt("return");case 15:if(!(i>=Dr.length)){a.next=23;break}return l=$r.filter((function(e){return!n.has(e)})).join(","),c={missing:l},n.has("pdl_2")||void 0===r||(c.pdl2_reason=r),Mr(e,"extra_context_failed",{metrics:{attempts:Dr.length+1},categories:c}),a.abrupt("return");case 23:d=Dr[i],i+=1,$r.filter((function(e){return!n.has(e)})).join(","),setTimeout((function(){t()}),d),a.next=33;break;case 30:a.prev=30,a.t0=a.catch(0);case 33:case"end":return a.stop()}}),a,null,[[0,30]])})))},t.next=5,a();case 5:case"end":return t.stop()}}),t)})))}))()}(e),l.plugins.forEach(_i((function(e){var t=document.createElement("script");Object.keys(e.params).forEach((function(n){var i=e.params[n];"dataset"===n?"object"===zn(i)&&null!==i&&Object.assign(t.dataset,i):Object.assign(t,Pn({},n,i))})),document.head.appendChild(t)})))}var ta="__PUMBAA_RUN_FLAG__";try{(function(){if(/ByteLocale/g.test(navigator.userAgent))return!1;var e=!0;return window.Garfish&&(e=window.Garfish.getGlobalObject()===window),!(!e||window[ta]||(window[ta]=1,0))})()&&function(e,t){return function(){var n=Date.now(),i=e.apply(void 0,arguments);return ut().pushEvent($e,{metrics:{time:Date.now()-n},categories:{version:"1.0.0.951",runtime_env:Ue,module:t}}),i}}((function(){if(window.Symbol){var e=ut();_i(ea)(e);var t=lt(),n=document.createElement("script"),i=document.currentScript,r=i.src,a=i.dataset,s=r.substring(0,r.lastIndexOf("/")),o="".concat(s,"/core.js","?globalName=").concat(t);n.src=o,n.crossOrigin="anonymous",n.async=!0,Object.assign(n.dataset,a),document.head.appendChild(n),document.head.removeChild(n)}}),"loader")()}catch(e){}}();