@heycatch/sdk 0.8.3-dev.2283 → 0.8.4-dev.2343

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,2 +1,2 @@
1
- "use strict";var ve=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var Mr=Object.prototype.hasOwnProperty;var tt=(e,t)=>{for(var r in t)ve(e,r,{get:t[r],enumerable:!0})},Nr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rr(t))!Mr.call(e,o)&&o!==r&&ve(e,o,{get:()=>t[o],enumerable:!(n=Tr(t,o))||n.enumerable});return e};var Dr=e=>Nr(ve({},"__esModule",{value:!0}),e);var Eo={};tt(Eo,{HeyCatchProvider:()=>Or,SDK_VERSION:()=>K,STAGE:()=>B,analytics:()=>Ao});module.exports=Dr(Eo);var rt="project",Lr="[a-z0-9]",Io=new RegExp(`^${Lr}$`);var jr=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function $e(e){let t=jr.exec(e);if(t===null)return!1;let[,r="",n=""]=t,o=Number(r),i=Number(n);return o>255||i>255?!1:o===0||o===10||o===127||o===100&&i>=64&&i<=127||o===169&&i===254||o===172&&i>=16&&i<=31||o===192&&i===168}var Fr=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/;function Hr(e){if(e==="::1"||e==="::")return!0;if(e.startsWith("::ffff:")){let t=Fr.exec(e);if(t===null)return $e(e.slice(7));let[,r="",n=""]=t,o=Number.parseInt(r,16),i=Number.parseInt(n,16);return $e(`${Math.floor(o/256)}.${o%256}.${Math.floor(i/256)}.${i%256}`)}return/^f[cd][0-9a-f]{2}:/.test(e)||/^fe[89ab][0-9a-f]:/.test(e)}function Ur(e){return e.toLowerCase().replace(/^\[/,"").replace(/\]$/,"").replace(/\.+$/,"")}function nt(e){let t=Ur(e);return t==="localhost"||t.endsWith(".localhost")||$e(t)||Hr(t)}var vr=require("posthog-react-native");var T={};tt(T,{BIGINT_FORMAT_RANGES:()=>ln,CONSTANT_CATCH:()=>zt,Class:()=>ke,NUMBER_FORMAT_RANGES:()=>an,aborted:()=>O,allowsEval:()=>lt,assert:()=>Jr,assertEqual:()=>Br,assertIs:()=>Gr,assertNever:()=>Wr,assertNotEqual:()=>Kr,assignProp:()=>ee,attachSchema:()=>ne,base64ToUint8Array:()=>vt,base64urlToUint8Array:()=>gn,cached:()=>ue,captureStackTrace:()=>ae,cleanEnum:()=>_n,cleanRegex:()=>Pe,clone:()=>Z,cloneDef:()=>tn,codePointLength:()=>dn,constantCatch:()=>wt,createTransparentProxy:()=>un,defineLazy:()=>it,defineLazyInternal:()=>S,derived:()=>vn,esc:()=>ut,escapeRegex:()=>re,explicitlyAborted:()=>Ce,extend:()=>ht,finalizeIssue:()=>N,floatSafeRemainder:()=>qr,getElementAtPath:()=>rn,getEnumValues:()=>ce,getLengthableOrigin:()=>mn,getParsedType:()=>cn,getSizableOrigin:()=>pn,hexToUint8Array:()=>yn,hide:()=>Oe,installLazyProp:()=>Te,isObject:()=>Q,isPlainObject:()=>te,issue:()=>me,joinValues:()=>Xr,jsonStringifyReplacer:()=>Ze,members:()=>Ie,merge:()=>xt,mergeDefs:()=>C,normalizeParams:()=>P,nullish:()=>Yr,numKeys:()=>sn,objectClone:()=>Qr,omit:()=>mt,optionalKeys:()=>Ee,own:()=>E,parsedType:()=>hn,partial:()=>yt,pick:()=>dt,prefixIssues:()=>fe,primitiveTypes:()=>pt,promiseAllObject:()=>nn,propertyKeyTypes:()=>Ae,randomString:()=>on,rawShape:()=>Se,required:()=>bt,safeExtend:()=>gt,shallowClone:()=>le,sizeCaps:()=>de,slugify:()=>at,stringifyPrimitive:()=>ft,toZod:()=>Vr,uint8ArrayToBase64:()=>$t,uint8ArrayToBase64url:()=>xn,uint8ArrayToHex:()=>bn,unwrapMessage:()=>W});function Br(e){return e}function Kr(e){return e}function Vr(){return e=>e}function Gr(e){}function Wr(e){throw new Error("Unexpected value in exhaustive check")}function Jr(e){}function ce(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Xr(e,t="|"){return e.map(r=>ft(r)).join(t)}function Ze(e,t){return typeof t=="bigint"?t.toString():t}var we=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function ue(e){return new we(e)}function Yr(e){return e==null}function Pe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qr(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var ot=Symbol("evaluating");function it(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ot)return n===void 0&&(n=ot,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Qr(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ee(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Se(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function I(e){return Se(e._zod.def)??e._zod.def.shape}function st(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return ee(this,t,n),n},enumerable:!0,configurable:!0})}function ct(e,t,r){t in e?ee(e,t,r):e[t]=r}function j(e,t,r,n){let o=I(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?st(e,i,()=>{let s=t._zod.def.shape[i];return n?n(s,i):s}):ct(e,i,n?n(c.value,i):c.value))}}function en(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?st(e,r,()=>t[r]):ct(e,r,n.value))}}function C(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function tn(e){return C(e._zod.def)}function rn(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function nn(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function on(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function ut(e){return JSON.stringify(e)}function at(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ae="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Q(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var lt=ue(()=>{if(F.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function te(e){if(Q(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Q(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function le(e){return te(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sn(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var cn=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ae=new Set(["string","number","symbol"]),pt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function un(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function ft(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ee(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var an={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ln={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function dt(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return j(i,e,pe(e,t)),Z(e,C(r,{shape:i,checks:[]}))}function pe(e,t){let r=I(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function mt(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(pe(e,t)),c={};return j(c,e,Reflect.ownKeys(I(e)).filter(s=>!i.has(s))),Z(e,C(r,{shape:c,checks:[]}))}function ht(e,t){if(!te(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=I(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Z(e,C(e._zod.def,{shape:_t(e,t)}))}function _t(e,t){let r={};return j(r,e,Reflect.ownKeys(I(e))),en(r,t),r}function gt(e,t){if(!te(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Z(e,C(e._zod.def,{shape:_t(e,t)}))}function xt(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};j(r,e,Reflect.ownKeys(I(e))),j(r,t,Reflect.ownKeys(I(t)));let n=C(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Z(e,n)}function yt(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let s=r?new Set(pe(t,r)):void 0,u={};return j(u,t,Reflect.ownKeys(I(t)),e&&((a,l)=>s&&!s.has(l)?a:new e({type:"optional",innerType:a}))),Z(t,C(t._zod.def,{shape:u,checks:[]}))}function bt(e,t,r){let n=r?new Set(pe(t,r)):void 0,o={};return j(o,t,Reflect.ownKeys(I(t)),(i,c)=>n&&!n.has(c)?i:new e({type:"nonoptional",innerType:i})),Z(t,C(t._zod.def,{shape:o}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function fe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function W(e){return typeof e=="string"?e:e?.message}function de(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function ne(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function N(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:W(e.inst?._zod.def?.error?.(e))??W(i?.(e))??W(t?.error?.(e))??W(r.customError?.(e))??W(r.localeError?.(e))??"Invalid input",s={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(s[u]=e[u]);return s.path??(s.path=[]),s.message=c,t?.reportInput&&(s.input=e.input),s}function pn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var fn=/[\uD800-\uDBFF]/;function dn(e){let t=e.length;if(!fn.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function mn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function hn(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function me(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function _n(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function vt(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function $t(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function gn(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return vt(t+r)}function xn(e){return $t(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function yn(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function bn(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var ke=class{constructor(...t){}};function Ie(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):$n(e,r,n.value)}}function E(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Oe(e,t,r){return E(e,t,r,!1)}function vn(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return E(this,r,n(this))},set(o){E(this,r,o)}})}return t}function $n(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:E(this,t,r.bind(this))},set(n){E(this,t,n)}})}function zn(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var ze,M=!1,wn={configurable:!0,get(){M=!0}};function S(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&ze!==e._zod){ze=void 0;return}ze=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,wn);let o=M;M=!1;try{let i=r(this);return M?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),M=M||o,i}catch(i){throw delete this[t],M=M||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Te(e,t,r,n){let o=zn(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var zt="~constantCatch";function wt(e){let t=()=>e;return t[zt]=!0,t}var kt;var Re={value:void 0,enumerable:!1},Zt="captureStackTrace"in Error?Error:null;function kn(e){let t=Zt;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Zt=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function d(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set}i.prototype=o;let c=r,s=c&&new WeakSet;function u(p,_){if(p._zod){if(p._zod.traits.has(e))return}else{Re.value=new i(_);try{Object.defineProperty(p,"_zod",Re)}finally{Re.value=void 0}}if(p._zod.traits.add(e),t(p,_),s){let x=Object.getPrototypeOf(p),z=p._zod.constr.prototype,g=x;for(;g&&g!==z;)g=Object.getPrototypeOf(g);let y=g??x;s.has(y)||(s.add(y),Ie(y,c))}let h=f.prototype;for(let x in h)Object.prototype.hasOwnProperty.call(h,x)&&(x in p||(p[x]=h[x].bind(p)))}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(p){let _=n?.Parent?kn(l):this;u(_,p);let h=_._zod.deferred;if(h){for(let z of h)z();_._zod.deferred=void 0}let x=globalThis.__zod_globalConfig?.postProcessor;return x&&x(_),_}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var R=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(kt=globalThis).__zod_globalConfig??(kt.__zod_globalConfig={});var F=globalThis.__zod_globalConfig;function H(e){return e&&Object.assign(F,e),F}function Zn(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ze,2)),e.message}function Pn(e){this._zod.message=e}var Sn={get:Zn,set:Pn,enumerable:!0,configurable:!0},Ne={value:void 0,enumerable:!1},Pt=new WeakSet([Object.prototype,Error.prototype]),St=(e,t)=>{e.name="$ZodError",Ne.value=t,Object.defineProperty(e,"issues",Ne),Ne.value=void 0,Object.defineProperty(e,"message",Sn);let r=Object.getPrototypeOf(e);Pt.has(r)||(Pt.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},No=d("$ZodError",St),oe=d("$ZodError",St,void 0,{Parent:Error});var En=e=>{let t=(r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)throw new R;if(s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>N(a,c,H())));throw ae(u,i?.callee??t),u}return s.value};return t},De=En(oe),Cn=e=>{let t=async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>N(a,c,H())));throw ae(u,i?.callee??t),u}return s.value};return t},Le=Cn(oe),In=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new R;return i.issues.length?At(e,i.issues,o):{success:!0,data:i.value}},je=In(oe);function At(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>N(o,r,H()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var On=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?At(e,i.issues,o):{success:!0,data:i.value}},Fe=On(oe);var Et=/^[\s\S]{0,}$/;var Ct=/^-?\d+(?:\.\d+)?$/,It=/^(?:true|false)$/i;var ie=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Ot=d("$ZodCheckStringFormat",(e,t)=>{var r,n;ie.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Tt=d("$ZodCheckRegex",(e,t)=>{Ot.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Mt={major:4,minor:6,patch:6};var w=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mt;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,u,a)=>{if(s.memo)return s;let l=O(s),f;for(let p of u){if(p._zod.def.when){if(Ce(s)||!p._zod.def.when(s))continue}else if(l)continue;let _=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&a?.async===!1)throw new R;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==_&&(ne(s.issues,_,e),l||(l=O(s,_)))});else{if(s.issues.length===_)continue;ne(s.issues,_,e),l||(l=O(s,_))}}return f?f.then(()=>s):s},c=(s,u,a)=>{if(O(s))return s.aborted=!0,s;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new R;return l.then(f=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>c(f,s,u)):c(l,s,u)}let a=e._zod.parse(s,u);if(a instanceof Promise){if(u.async===!1)throw new R;return a.then(l=>i(l,o,u))}return i(a,o,u)}}},{get"~standard"(){return Oe(this,"~standard",Rn(this))},set"~standard"(e){E(this,"~standard",e)}}),Ht=(e,t)=>e.issues.length?{issues:e.issues.map(r=>N(r,t,H()))}:{value:e.value};async function Tn(e,t){let r={async:!0};return Ht(await e._zod.run({value:t,issues:[]},r),r)}function Rn(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Ht(n,r)}catch{}return Tn(e,t)},vendor:"zod",version:1}}var Ut=d("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??Et,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}});var Bt=d("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=Ct,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}});var Kt=d("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=It,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});function Mn(e,t){let r=de(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,c)=>{let s=t(i.value);if(s>n&&!c?.skipChecks&&c?.direction!=="backward"){for(let[u,a]of de(e._zod.def.checks))if(s>u&&a._zod.def.when(i)){let l=i.issues.length;return a._zod.check(i),i.issues[l].continue=!1,ne(i.issues,l,e),i}}return o(i,c)}}var Nn=e=>Array.isArray(e)?e.length:-1;function Nt(e,t,r){e.issues.length&&t.issues.push(...fe(r,e.issues)),t.value[r]=e.value}var Vt=d("$ZodArray",(e,t)=>{w.init(e,t);let r=F.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],s=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)c.push(l.then(f=>Nt(f,n,u)));else if(Nt(l,n,u),s&&l.issues.length!==0&&O(l))break}return c.length?Promise.all(c).then(()=>n):n},Mn(e,Nn)});function he(e,t,r,n,o,i){let c=r in n,s=i==="optional";if(!(!c&&s&&o==="optional")){if(e.issues.length){if(o!==void 0&&s&&!c)return;t.issues.push(...fe(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}var Dn=[];function Ln(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Dn,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=Ee(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function jn(e,t,r,n,o,i,c){let s=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,f=a.optin,p=a.optout,_=0;for(let h in t){if(c&&r.issues.length!==_){if(O(r,_))break;_=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){l==="never"&&s.push(h);continue}if(l==="never"){s.push(h);continue}let x=a.run({value:t[h],issues:[]},n);x instanceof Promise?e.push(x.then(z=>he(z,r,h,t,f,p))):he(x,r,h,t,f,p)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Gt=d("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=ue(()=>Ln(t));S(e,"propValues",a=>{let l=a.def.shape,f={};for(let p in l){let _=l[p]._zod;if(_.values){Object.prototype.hasOwnProperty.call(f,p)||ee(f,p,new Set);for(let h of _.values)f[p].add(h);_.optin!==void 0&&f[p].add(void 0)}}return f});let i=Q,c=t.catchall,s,u=F.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{s??(s=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let p=[],_=s.shape,h=l?.abortEarly,x=a.issues.length;for(let z of s.allKeys){if(h&&a.issues.length!==x){if(O(a,x))break;x=a.issues.length}if(z==="__proto__")continue;let g=_[z],y=g._zod.optin,m=g._zod.optout,b=g._zod.run({value:f[z],issues:[]},l);b instanceof Promise?p.push(b.then(V=>he(V,a,z,f,y,m))):he(b,a,z,f,y,m)}return c?jn(p,f,a,l,o.value,e,h===!0):p.length?Promise.all(p).then(()=>a):a}});var Wt=d("$ZodEnum",(e,t)=>{w.init(e,t);let r=ce(t.entries),n=new Set(r);e._zod.values=n,S(e,"pattern",o=>{let i=ce(o.def.entries).filter(c=>Ae.has(typeof c));return new RegExp(i.length?`^(${i.map(c=>re(c.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Jt=d("$ZodLiteral",(e,t)=>{w.init(e,t);let r=new Set(t.values);e._zod.values=r,S(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?re(i):i?re(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});function Dt(e,t){return e.value=t.issues.length?void 0:t.value,e}var Xt=d("$ZodOptional",(e,t)=>{w.init(e,t),S(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",S(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),S(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Pe(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Dt(r,i)):Dt(r,o)}return t.innerType._zod.run(r,n)}});var Yt=d("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",S(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Lt(i,t)):Lt(o,t)}});function Lt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function jt(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>N(o,n,H()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var qt=d("$ZodCatch",(e,t)=>{w.init(e,t),S(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),S(e,"optout",r=>r.def.innerType._zod.optout),S(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>jt(r,i,t,n)):jt(r,o,t,n)}});var Qt=d("$ZodCustom",(e,t)=>{ie.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Ft(i,r,n,e));Ft(o,r,n,e)}});function Ft(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(me(o))}}function er(e){return e.checks&&(e.checks=[...e.checks]),e}function tr(e,t){return new e(er({type:"string",...P(t)}))}function rr(e,t){return new e(er({type:"number",checks:[],...P(t)}))}function nr(e,t){return new e({type:"boolean",...P(t)})}function Ue(e,t){return new Tt({check:"string_format",format:"regex",...P(t),pattern:e})}function or(e,t,r){let n=P(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}var A=d("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");w.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){E(this,"with",e)},parse(e,t){return De(this,e,t,{callee:this.parse})},parseAsync(e,t){return Le(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return je(this,e,t)},safeParseAsync(e,t){return Fe(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return Z(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Un=d("ZodMiniString",(e,t)=>{Ut.init(e,t),A.init(e,t)});function U(e){return tr(Un,e)}var Bn=d("ZodMiniNumber",(e,t)=>{Bt.init(e,t),A.init(e,t)});function Be(e){return rr(Bn,e)}var Kn=d("ZodMiniBoolean",(e,t)=>{Kt.init(e,t),A.init(e,t)});function D(e){return nr(Kn,e)}var Vn=d("ZodMiniArray",(e,t)=>{Vt.init(e,t),A.init(e,t)});function Ke(e,t){return new Vn({type:"array",element:e,...P(t)})}var Gn=d("ZodMiniObject",(e,t)=>{Gt.init(e,t),A.init(e,t),Te(e,"shape",r=>r._zod.def.shape,!1)});function Ve(e,t){let r={type:"object",shape:e??{},...P(t)};return new Gn(r)}var Wn=d("ZodMiniEnum",(e,t)=>{Wt.init(e,t),A.init(e,t),e.options=[...e._zod.values]});function ir(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Wn({type:"enum",entries:r,...P(t)})}var Jn=d("ZodMiniLiteral",(e,t)=>{Jt.init(e,t),A.init(e,t)});function sr(e,t){return new Jn({type:"literal",values:Array.isArray(e)?e:[e],...P(t)})}var Xn=d("ZodMiniOptional",(e,t)=>{Xt.init(e,t),A.init(e,t)});function $(e){return new Xn({type:"optional",innerType:e})}var Yn=d("ZodMiniDefault",(e,t)=>{Yt.init(e,t),A.init(e,t)});function J(e,t){return new Yn({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():le(t)}})}var qn=d("ZodMiniCatch",(e,t)=>{qt.init(e,t),A.init(e,t)});function cr(e,t){return new qn({type:"catch",innerType:e,catchValue:typeof t=="function"?t:T.constantCatch(t)})}var Qn=d("ZodMiniCustom",(e,t)=>{Qt.init(e,t),A.init(e,t)});function Ge(e,t){return or(Qn,e??(()=>!0),t)}var _e="https://in.dev.heycatch.ai",B="dev",K="0.8.3-dev.2283",ur="phc_CqKdgm7xbFBs3mSdtqzrHNTfzTRKrwRmCrEB9aftENY9";function ar(e=B){return e!=="dev"?null:`[HeyCatch] WARNING: this is an internal development build (v${K}). Events are being sent to the HeyCatch development environment and will NEVER appear in your dashboard. Reinstall the latest stable version - resolve it with \`npm view @heycatch/sdk version\` - or re-run the install guide: https://heycatch.ai/agents.md`}var X="unknown",no=["localStorage","cookie","memory","localStorage+cookie","sessionStorage"];var lr=Ve({projectKey:U({error:'config.projectKey is missing or malformed \u2014 expected a string starting with "hck_pk_". Copy it from your project page in the HeyCatch dashboard.'}).check(Ue(/^hck_pk_/,{error:'config.projectKey is missing or malformed \u2014 expected a string starting with "hck_pk_". Copy it from your project page in the HeyCatch dashboard.'})),tracingHosts:J(Ke(U()),[]),install:J(Ve({framework:J(U(),X),frameworkVersion:J(U(),X),agent:J(U(),X)}),{framework:X,frameworkVersion:X,agent:X}),autocapture:$(D()),maskAllText:$(D()),maskAllElementAttributes:$(D()),propertyDenylist:$(Ke(U())),sanitizeProperties:$(Ge(e=>typeof e=="function")),beforeSend:$(Ge(e=>typeof e=="function"||Array.isArray(e)&&e.every(t=>typeof t=="function"))),persistence:$(ir(no)),disablePersistence:$(D()),cookieExpirationDays:$(Be()),optOutCapturingByDefault:$(D()),respectDnt:$(D()),requestBatching:$(D()),flushIntervalMs:$(Be()),site:cr($(sr("landing")),e=>{let t=typeof e.value=="string"?JSON.stringify(e.value):`a ${typeof e.value}`;console.error(`[HeyCatch] config.site must be 'landing' or omitted - got ${t}. Ignoring it; this project is reported as untagged.`)})});var pr="[redacted]",oo=/(^|[#&?])(access_token|refresh_token|token_hash|token)=[^\s#&"'<>]+/gi,io=/(^|[^\w-])eyJ[\w-]+\.[\w-]+\.[\w-]+/g;function fr(e){return e.replaceAll(oo,`$1$2=${pr}`).replaceAll(io,`$1${pr}`)}var so=new Set(["$anon_distinct_id","distinct_id"]),co=["$set","$set_once"];function We(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){return typeof e=="string"?fr(e):Array.isArray(e)?uo(e):We(e)?dr(e,()=>!0):e}function uo(e){let t=e.map(r=>Je(r));return t.some((r,n)=>r!==e[n])?t:e}function dr(e,t){let r=!1,n=[];for(let[o,i]of Object.entries(e)){let c=t(o)?Je(i):i;c!==i&&(r=!0),n.push([o,c])}return r?Object.fromEntries(n):e}function mr(e){if(!We(e))return e;try{let t=!1,r={...e},{properties:n}=e;if(We(n)){let o=dr(n,i=>!so.has(i));o!==n&&(t=!0,r.properties=o)}for(let o of co){let i=e[o],c=Je(i);c!==i&&(t=!0,r[o]=c)}return t?r:e}catch{return e}}var ao=5e3,lo=60,po=1e3,fo=60,mo=new Set(["$set"]),Xe="heycatch_volume_cap_reached",hr=3,ho=6e4;function ge({bucket:e,perMinute:t,now:r}){if(e===void 0)return t;let n=Math.max(0,r-e.at);return Math.min(t,e.tokens+n*t/ho)}function _o(e){return e===void 0||e.length===0?!1:nt(go(e))}function go(e){if(e.startsWith("[")){let r=e.indexOf("]");return r===-1?e:e.slice(0,r+1)}let t=e.indexOf(":");return t!==-1&&t===e.lastIndexOf(":")?e.slice(0,t):e}function _r(e){let{$session_id:t,$host:r}=e.properties;return{sessionId:typeof t=="string"?t:"",host:typeof r=="string"?r:void 0}}var xr=4;function gr(e){if(e!==void 0)return typeof e=="object"&&e!==null&&"tokens"in e&&typeof e.tokens=="number"&&Number.isFinite(e.tokens)&&e.tokens>=0&&"at"in e&&typeof e.at=="number"&&Number.isFinite(e.at)?{tokens:e.tokens,at:e.at}:!1}function xo(e){if(typeof e=="object"&&e!==null&&"sessionId"in e&&typeof e.sessionId=="string"&&"count"in e&&typeof e.count=="number"&&Number.isInteger(e.count)&&e.count>=0&&"markerAttempts"in e&&typeof e.markerAttempts=="number"&&Number.isInteger(e.markerAttempts)&&e.markerAttempts>=0){let t=gr("person"in e?e.person:void 0),r=gr("localhost"in e?e.localhost:void 0);if(t!==!1&&r!==!1)return{sessionId:e.sessionId,count:e.count,markerAttempts:e.markerAttempts,person:t,localhost:r}}return null}function yo(e){if(e===null)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t.flatMap(r=>{let n=xo(r);return n===null?[]:[n]}).slice(0,xr)}catch{}return[]}function yr({store:e,warn:t,emitMarker:r,cap:n=ao,personUpdateBudget:o=lo,localhostFreeEvents:i=po,localhostRatePerMinute:c=fo,now:s=Date.now}){let u=[],a=!1,l=!1,f=!1,p=!1;function _(){if(e===void 0||a)return u;try{return yo(e.read())}catch{return u}}function h(g){let y=_().filter(m=>m.sessionId!==g.sessionId);u=[g,...y].slice(0,xr);try{e?.write(JSON.stringify(u))}catch{a=!0}}function x(g){let y=_().find(v=>v.sessionId===g),m=u.find(v=>v.sessionId===g),b=[y,m].filter(v=>v!==void 0),V=s();function Y(v,q){let L;for(let{[v]:G}of b)G!==void 0&&ge({bucket:G,perMinute:q,now:V})<ge({bucket:L,perMinute:q,now:V})&&(L=G);return L}return{sessionId:g,count:Math.max(0,...b.map(v=>v.count)),markerAttempts:Math.max(0,...b.map(v=>v.markerAttempts)),person:Y("person",o),localhost:Y("localhost",c)}}function z(g,y){let m=y,b=s(),{sessionId:V,host:Y}=_r(g);m.person!==void 0&&m.person.at>b&&(m={...m,person:{...m.person,at:b}},h(m)),m.localhost!==void 0&&m.localhost.at>b&&(m={...m,localhost:{...m.localhost,at:b}},h(m));let v=mo.has(g.event),q=v?ge({bucket:m.person,perMinute:o,now:b}):0;if(v&&q<1)return f||(f=!0,t(`[HeyCatch] setPersonProperties is being called more than ${o} times a minute - call it when a property changes, not on every render. Dropping the extra updates for now; other events are unaffected.`)),null;let L=m.count>=i&&_o(Y),G=L?ge({bucket:m.localhost,perMinute:c,now:b}):0;return L&&G<1?(p||(p=!0,t(`[HeyCatch] this local dev session (${Y??"unknown host"}, session ${V||"unknown"}) sent ${i} events - throttling it to ${c} a minute so a dev loop cannot flood your analytics. Production traffic is unaffected.`)),null):(h({...m,count:m.count+1,...v?{person:{tokens:q-1,at:b}}:{},...L?{localhost:{tokens:G-1,at:b}}:{}}),g)}return g=>{if(g===null||g.event===Xe)return g;let{sessionId:y}=_r(g),m=x(y);return m.count<n?z(g,m):(l||(l=!0,t(`[HeyCatch] this session sent ${n} events, the per-session cap - dropping the rest until a new session starts (session ${y||"unknown"}). A tracking call inside a render loop or an effect is the usual cause.`)),m.markerAttempts<hr&&(h({...m,markerAttempts:hr}),r({cap:n,sessionId:y})||h({...m,markerAttempts:m.markerAttempts+1})),null)}}function br(e){let t=yr({warn:r=>{console.warn(r)},emitMarker:({cap:r})=>{let n=e();return n?.capture(Xe,{heycatch_session_event_cap:r}),n!==null}});return r=>r===null||t({event:r.event,properties:r.properties??{}})===null?null:r}var xe=null;function k(){return xe}var Ye=null;function $r(){Ye?.()}function zr(e){if(xe!==null)return;let t=lr.safeParse(e);if(!t.success){let c=t.error.issues[0]?.message??"init() requires a config object with { projectKey }.";console.error(`[HeyCatch] ${c}`);return}let r=new vr.PostHog(ur,{host:_e,preloadFeatureFlags:!1,disableRemoteFeatureFlags:!0,sendFeatureFlagEvent:!1,disableSurveys:!0,...t.data.optOutCapturingByDefault===void 0?{}:{defaultOptIn:!t.data.optOutCapturingByDefault},before_send:[br(()=>xe),mr]}),{install:n}=t.data,o={heycatch_framework:n.framework,heycatch_framework_version:n.frameworkVersion,heycatch_agent:n.agent};Ye=()=>{r.register({heycatch_sdk_version:K,heycatch_sdk_stage:B,heycatch_project_key:t.data.projectKey,...o}),r.group(rt,t.data.projectKey,{key:t.data.projectKey,sdk_version:K,sdk_stage:B,framework:n.framework,framework_version:n.frameworkVersion,agent:n.agent,api_host:_e})},Ye(),xe=r,console.info(`[HeyCatch] SDK v${K} (${B}) initialized \u2192 ${_e}`);let i=ar();i!==null&&console.warn(i)}function wr(e){return t=>{console.error(`[HeyCatch] consent ${e} could not be saved - capture state may reset on the next app launch:`,t)}}function kr(){k()?.optIn().catch(wr("opt-in"))}function Zr(){k()?.optOut().catch(wr("opt-out"))}var Pr=require("posthog-react-native");function Sr(e,t,r){let n=k();if(n!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] setIdentity() requires a non-empty string user id. Pass a stable internal user id from your auth provider \u2014 not an email or session token.");return}n.getPersistedProperty(Pr.PostHogPersistedProperty.PersonMode)==="identified"&&n.getDistinctId()!==e&&qe(),n.identify(e,{...t?{$set:t}:{},...r?{$set_once:r}:{}})}}function qe(){let e=k();e!==null&&(e.reset(),$r())}function ye(e,t){let r=k();if(r!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] trackScreen() requires a non-empty screen name.");return}r.screen(e,t?t:void 0)}}function Ar(e,t,r){let n=k();if(n!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] trackEvent() requires a non-empty event name.");return}if(e.startsWith("$")){console.error(`[HeyCatch] trackEvent() event names cannot start with "$" (got "${e}") - that prefix is reserved for built-in events.`);return}n.capture(e,{...t,...r?.set?{$set:r.set}:{},...r?.setOnce?{$set_once:r.setOnce}:{},heycatch_custom_user_event:!0})}}function Er(e,t){let r=k();r!==null&&(!e&&!t||r.capture("$set",{...e?{$set:e}:{},...t?{$set_once:t}:{}}))}var Ir=require("posthog-react-native"),be=require("react");function bo(e){return typeof e=="object"&&e!==null&&"usePathname"in e&&typeof e.usePathname=="function"&&"useGlobalSearchParams"in e&&typeof e.useGlobalSearchParams=="function"}function vo(){try{if(typeof require!="function")return null;let e=require("expo-router");return bo(e)?e:null}catch{return null}}var Qe=vo();var $o=new Set(["code","jwt","otp","pin","pwd","sid","sig"]),zo=["credential","email","passcode","passwd","password","secret","session","signature","token"],wo="#",ko=/[^\s@,]+@[^\s@,]+\.[^\s@,]+/;function Zo(e){return e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[\s_-]+/).filter(t=>t.length>0)}function Po(e,t){if(e===wo)return!0;let r=e.toLowerCase().replaceAll(/[_-]/g,"");return r.startsWith("auth")||r.includes("key")||zo.some(n=>r.includes(n))||Zo(e).some(n=>$o.has(n))?!0:typeof t=="string"&&ko.test(t)}function Cr(e){let t=JSON.parse(e);if(typeof t!="object"||t===null)return{};let r={};for(let[n,o]of Object.entries(t)){let i;if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")i=o;else if(Array.isArray(o))i=o.filter(c=>typeof c=="string").join(",");else continue;Po(n,i)||(r[n]=i)}return r}var se=require("react/jsx-runtime");function So({router:e}){let{useGlobalSearchParams:t,usePathname:r}=e,n=r(),o=JSON.stringify(t());return(0,be.useEffect)(()=>{ye(n,Cr(o))},[n,o]),null}var et=class extends be.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(t){console.error("[HeyCatch] Automatic screen views are off: an Expo Router hook threw. Call analytics.trackScreen(name) from your navigation instead.",t)}render(){return this.state.failed?null:this.props.children}};function Or({children:e,trackScreens:t=!0}){let r=k();return r===null?(console.error("[HeyCatch] HeyCatchProvider mounted before init() - call analytics.init({ projectKey }) at module scope of the root layout."),e):(0,se.jsxs)(Ir.PostHogProvider,{autocapture:{captureScreens:!1,captureTouches:!0},client:r,children:[!t||Qe===null?null:(0,se.jsx)(et,{children:(0,se.jsx)(So,{router:Qe})}),e]})}var Ao={init:zr,optInCapturing:kr,optOutCapturing:Zr,resetIdentity:qe,setIdentity:Sr,setPersonProperties:Er,trackEvent:Ar,trackScreen:ye};0&&(module.exports={HeyCatchProvider,SDK_VERSION,STAGE,analytics});
1
+ "use strict";var be=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var Mr=Object.prototype.hasOwnProperty;var tt=(e,t)=>{for(var r in t)be(e,r,{get:t[r],enumerable:!0})},Nr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rr(t))!Mr.call(e,o)&&o!==r&&be(e,o,{get:()=>t[o],enumerable:!(n=Tr(t,o))||n.enumerable});return e};var Dr=e=>Nr(be({},"__esModule",{value:!0}),e);var Eo={};tt(Eo,{HeyCatchProvider:()=>Or,SDK_VERSION:()=>X,STAGE:()=>J,analytics:()=>Ao});module.exports=Dr(Eo);var vr=require("posthog-react-native");var Lr="[a-z0-9]",Io=new RegExp(`^${Lr}$`);var jr=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function ve(e){let t=jr.exec(e);if(t===null)return!1;let[,r="",n=""]=t,o=Number(r),i=Number(n);return o>255||i>255?!1:o===0||o===10||o===127||o===100&&i>=64&&i<=127||o===169&&i===254||o===172&&i>=16&&i<=31||o===192&&i===168}var Fr=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/;function Hr(e){if(e==="::1"||e==="::")return!0;if(e.startsWith("::ffff:")){let t=Fr.exec(e);if(t===null)return ve(e.slice(7));let[,r="",n=""]=t,o=Number.parseInt(r,16),i=Number.parseInt(n,16);return ve(`${Math.floor(o/256)}.${o%256}.${Math.floor(i/256)}.${i%256}`)}return/^f[cd][0-9a-f]{2}:/.test(e)||/^fe[89ab][0-9a-f]:/.test(e)}function Ur(e){return e.toLowerCase().replace(/^\[/,"").replace(/\]$/,"").replace(/\.+$/,"")}function rt(e){let t=Ur(e);return t==="localhost"||t.endsWith(".localhost")||ve(t)||Hr(t)}var T={};tt(T,{BIGINT_FORMAT_RANGES:()=>ln,CONSTANT_CATCH:()=>$t,Class:()=>we,NUMBER_FORMAT_RANGES:()=>an,aborted:()=>O,allowsEval:()=>at,assert:()=>Jr,assertEqual:()=>Br,assertIs:()=>Gr,assertNever:()=>Wr,assertNotEqual:()=>Kr,assignProp:()=>ee,attachSchema:()=>ne,base64ToUint8Array:()=>bt,base64urlToUint8Array:()=>gn,cached:()=>ae,captureStackTrace:()=>le,cleanEnum:()=>_n,cleanRegex:()=>Pe,clone:()=>P,cloneDef:()=>tn,codePointLength:()=>dn,constantCatch:()=>zt,createTransparentProxy:()=>un,defineLazy:()=>ot,defineLazyInternal:()=>S,derived:()=>vn,esc:()=>ct,escapeRegex:()=>re,explicitlyAborted:()=>Ee,extend:()=>mt,finalizeIssue:()=>N,floatSafeRemainder:()=>qr,getElementAtPath:()=>rn,getEnumValues:()=>ue,getLengthableOrigin:()=>mn,getParsedType:()=>cn,getSizableOrigin:()=>pn,hexToUint8Array:()=>yn,hide:()=>Ie,installLazyProp:()=>Oe,isObject:()=>Q,isPlainObject:()=>te,issue:()=>he,joinValues:()=>Xr,jsonStringifyReplacer:()=>ke,members:()=>Ce,merge:()=>gt,mergeDefs:()=>C,normalizeParams:()=>Z,nullish:()=>Yr,numKeys:()=>sn,objectClone:()=>Qr,omit:()=>dt,optionalKeys:()=>Ae,own:()=>E,parsedType:()=>hn,partial:()=>xt,pick:()=>ft,prefixIssues:()=>de,primitiveTypes:()=>lt,promiseAllObject:()=>nn,propertyKeyTypes:()=>Se,randomString:()=>on,rawShape:()=>Ze,required:()=>yt,safeExtend:()=>_t,shallowClone:()=>pe,sizeCaps:()=>me,slugify:()=>ut,stringifyPrimitive:()=>pt,toZod:()=>Vr,uint8ArrayToBase64:()=>vt,uint8ArrayToBase64url:()=>xn,uint8ArrayToHex:()=>bn,unwrapMessage:()=>V});function Br(e){return e}function Kr(e){return e}function Vr(){return e=>e}function Gr(e){}function Wr(e){throw new Error("Unexpected value in exhaustive check")}function Jr(e){}function ue(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Xr(e,t="|"){return e.map(r=>pt(r)).join(t)}function ke(e,t){return typeof t=="bigint"?t.toString():t}var ze=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function ae(e){return new ze(e)}function Yr(e){return e==null}function Pe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qr(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var nt=Symbol("evaluating");function ot(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==nt)return n===void 0&&(n=nt,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Qr(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ee(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ze(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function I(e){return Ze(e._zod.def)??e._zod.def.shape}function it(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return ee(this,t,n),n},enumerable:!0,configurable:!0})}function st(e,t,r){t in e?ee(e,t,r):e[t]=r}function j(e,t,r,n){let o=I(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?it(e,i,()=>{let s=t._zod.def.shape[i];return n?n(s,i):s}):st(e,i,n?n(c.value,i):c.value))}}function en(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?it(e,r,()=>t[r]):st(e,r,n.value))}}function C(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function tn(e){return C(e._zod.def)}function rn(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function nn(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function on(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function ct(e){return JSON.stringify(e)}function ut(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var le="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Q(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var at=ae(()=>{if(F.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function te(e){if(Q(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Q(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function pe(e){return te(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function sn(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var cn=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Se=new Set(["string","number","symbol"]),lt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function un(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function pt(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ae(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var an={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ln={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ft(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return j(i,e,fe(e,t)),P(e,C(r,{shape:i,checks:[]}))}function fe(e,t){let r=I(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function dt(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(fe(e,t)),c={};return j(c,e,Reflect.ownKeys(I(e)).filter(s=>!i.has(s))),P(e,C(r,{shape:c,checks:[]}))}function mt(e,t){if(!te(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=I(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return P(e,C(e._zod.def,{shape:ht(e,t)}))}function ht(e,t){let r={};return j(r,e,Reflect.ownKeys(I(e))),en(r,t),r}function _t(e,t){if(!te(t))throw new Error("Invalid input to safeExtend: expected a plain object");return P(e,C(e._zod.def,{shape:ht(e,t)}))}function gt(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};j(r,e,Reflect.ownKeys(I(e))),j(r,t,Reflect.ownKeys(I(t)));let n=C(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return P(e,n)}function xt(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let s=r?new Set(fe(t,r)):void 0,u={};return j(u,t,Reflect.ownKeys(I(t)),e&&((a,l)=>s&&!s.has(l)?a:new e({type:"optional",innerType:a}))),P(t,C(t._zod.def,{shape:u,checks:[]}))}function yt(e,t,r){let n=r?new Set(fe(t,r)):void 0,o={};return j(o,t,Reflect.ownKeys(I(t)),(i,c)=>n&&!n.has(c)?i:new e({type:"nonoptional",innerType:i})),P(t,C(t._zod.def,{shape:o}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ee(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function de(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function V(e){return typeof e=="string"?e:e?.message}function me(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function ne(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function N(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:V(e.inst?._zod.def?.error?.(e))??V(i?.(e))??V(t?.error?.(e))??V(r.customError?.(e))??V(r.localeError?.(e))??"Invalid input",s={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(s[u]=e[u]);return s.path??(s.path=[]),s.message=c,t?.reportInput&&(s.input=e.input),s}function pn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var fn=/[\uD800-\uDBFF]/;function dn(e){let t=e.length;if(!fn.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function mn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function hn(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function he(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function _n(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function bt(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function vt(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function gn(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return bt(t+r)}function xn(e){return vt(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function yn(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function bn(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var we=class{constructor(...t){}};function Ce(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):$n(e,r,n.value)}}function E(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Ie(e,t,r){return E(e,t,r,!1)}function vn(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return E(this,r,n(this))},set(o){E(this,r,o)}})}return t}function $n(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:E(this,t,r.bind(this))},set(n){E(this,t,n)}})}function zn(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var $e,M=!1,wn={configurable:!0,get(){M=!0}};function S(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&$e!==e._zod){$e=void 0;return}$e=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,wn);let o=M;M=!1;try{let i=r(this);return M?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),M=M||o,i}catch(i){throw delete this[t],M=M||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Oe(e,t,r,n){let o=zn(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var $t="~constantCatch";function zt(e){let t=()=>e;return t[$t]=!0,t}var wt;var Te={value:void 0,enumerable:!1},kt="captureStackTrace"in Error?Error:null;function kn(e){let t=kt;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return kt=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function d(e,t,r,n){let o={};function i(p){this.def=p,this.constr=f,this.traits=new Set}i.prototype=o;let c=r,s=c&&new WeakSet;function u(p,_){if(p._zod){if(p._zod.traits.has(e))return}else{Te.value=new i(_);try{Object.defineProperty(p,"_zod",Te)}finally{Te.value=void 0}}if(p._zod.traits.add(e),t(p,_),s){let x=Object.getPrototypeOf(p),z=p._zod.constr.prototype,g=x;for(;g&&g!==z;)g=Object.getPrototypeOf(g);let y=g??x;s.has(y)||(s.add(y),Ce(y,c))}let h=f.prototype;for(let x in h)Object.prototype.hasOwnProperty.call(h,x)&&(x in p||(p[x]=h[x].bind(p)))}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(p){let _=n?.Parent?kn(l):this;u(_,p);let h=_._zod.deferred;if(h){for(let z of h)z();_._zod.deferred=void 0}let x=globalThis.__zod_globalConfig?.postProcessor;return x&&x(_),_}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var R=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(wt=globalThis).__zod_globalConfig??(wt.__zod_globalConfig={});var F=globalThis.__zod_globalConfig;function H(e){return e&&Object.assign(F,e),F}function Pn(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ke,2)),e.message}function Zn(e){this._zod.message=e}var Sn={get:Pn,set:Zn,enumerable:!0,configurable:!0},Me={value:void 0,enumerable:!1},Pt=new WeakSet([Object.prototype,Error.prototype]),Zt=(e,t)=>{e.name="$ZodError",Me.value=t,Object.defineProperty(e,"issues",Me),Me.value=void 0,Object.defineProperty(e,"message",Sn);let r=Object.getPrototypeOf(e);Pt.has(r)||(Pt.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},No=d("$ZodError",Zt),oe=d("$ZodError",Zt,void 0,{Parent:Error});var En=e=>{let t=(r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)throw new R;if(s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>N(a,c,H())));throw le(u,i?.callee??t),u}return s.value};return t},Ne=En(oe),Cn=e=>{let t=async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>N(a,c,H())));throw le(u,i?.callee??t),u}return s.value};return t},De=Cn(oe),In=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new R;return i.issues.length?St(e,i.issues,o):{success:!0,data:i.value}},Le=In(oe);function St(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>N(o,r,H()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var On=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?St(e,i.issues,o):{success:!0,data:i.value}},je=On(oe);var At=/^[\s\S]{0,}$/;var Et=/^-?\d+(?:\.\d+)?$/,Ct=/^(?:true|false)$/i;var ie=d("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var It=d("$ZodCheckStringFormat",(e,t)=>{var r,n;ie.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ot=d("$ZodCheckRegex",(e,t)=>{It.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Rt={major:4,minor:6,patch:6};var w=d("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rt;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,u,a)=>{if(s.memo)return s;let l=O(s),f;for(let p of u){if(p._zod.def.when){if(Ee(s)||!p._zod.def.when(s))continue}else if(l)continue;let _=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&a?.async===!1)throw new R;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==_&&(ne(s.issues,_,e),l||(l=O(s,_)))});else{if(s.issues.length===_)continue;ne(s.issues,_,e),l||(l=O(s,_))}}return f?f.then(()=>s):s},c=(s,u,a)=>{if(O(s))return s.aborted=!0,s;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new R;return l.then(f=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(f=>c(f,s,u)):c(l,s,u)}let a=e._zod.parse(s,u);if(a instanceof Promise){if(u.async===!1)throw new R;return a.then(l=>i(l,o,u))}return i(a,o,u)}}},{get"~standard"(){return Ie(this,"~standard",Rn(this))},set"~standard"(e){E(this,"~standard",e)}}),Ft=(e,t)=>e.issues.length?{issues:e.issues.map(r=>N(r,t,H()))}:{value:e.value};async function Tn(e,t){let r={async:!0};return Ft(await e._zod.run({value:t,issues:[]},r),r)}function Rn(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Ft(n,r)}catch{}return Tn(e,t)},vendor:"zod",version:1}}var Ht=d("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??At,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}});var Ut=d("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=Et,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}});var Bt=d("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=Ct,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});function Mn(e,t){let r=me(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,c)=>{let s=t(i.value);if(s>n&&!c?.skipChecks&&c?.direction!=="backward"){for(let[u,a]of me(e._zod.def.checks))if(s>u&&a._zod.def.when(i)){let l=i.issues.length;return a._zod.check(i),i.issues[l].continue=!1,ne(i.issues,l,e),i}}return o(i,c)}}var Nn=e=>Array.isArray(e)?e.length:-1;function Mt(e,t,r){e.issues.length&&t.issues.push(...de(r,e.issues)),t.value[r]=e.value}var Kt=d("$ZodArray",(e,t)=>{w.init(e,t);let r=F.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],s=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)c.push(l.then(f=>Mt(f,n,u)));else if(Mt(l,n,u),s&&l.issues.length!==0&&O(l))break}return c.length?Promise.all(c).then(()=>n):n},Mn(e,Nn)});function _e(e,t,r,n,o,i){let c=r in n,s=i==="optional";if(!(!c&&s&&o==="optional")){if(e.issues.length){if(o!==void 0&&s&&!c)return;t.issues.push(...de(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}var Dn=[];function Ln(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Dn,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=Ae(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function jn(e,t,r,n,o,i,c){let s=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,f=a.optin,p=a.optout,_=0;for(let h in t){if(c&&r.issues.length!==_){if(O(r,_))break;_=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){l==="never"&&s.push(h);continue}if(l==="never"){s.push(h);continue}let x=a.run({value:t[h],issues:[]},n);x instanceof Promise?e.push(x.then(z=>_e(z,r,h,t,f,p))):_e(x,r,h,t,f,p)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Vt=d("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=ae(()=>Ln(t));S(e,"propValues",a=>{let l=a.def.shape,f={};for(let p in l){let _=l[p]._zod;if(_.values){Object.prototype.hasOwnProperty.call(f,p)||ee(f,p,new Set);for(let h of _.values)f[p].add(h);_.optin!==void 0&&f[p].add(void 0)}}return f});let i=Q,c=t.catchall,s,u=F.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{s??(s=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let p=[],_=s.shape,h=l?.abortEarly,x=a.issues.length;for(let z of s.allKeys){if(h&&a.issues.length!==x){if(O(a,x))break;x=a.issues.length}if(z==="__proto__")continue;let g=_[z],y=g._zod.optin,m=g._zod.optout,b=g._zod.run({value:f[z],issues:[]},l);b instanceof Promise?p.push(b.then(B=>_e(B,a,z,f,y,m))):_e(b,a,z,f,y,m)}return c?jn(p,f,a,l,o.value,e,h===!0):p.length?Promise.all(p).then(()=>a):a}});var Gt=d("$ZodEnum",(e,t)=>{w.init(e,t);let r=ue(t.entries),n=new Set(r);e._zod.values=n,S(e,"pattern",o=>{let i=ue(o.def.entries).filter(c=>Se.has(typeof c));return new RegExp(i.length?`^(${i.map(c=>re(c.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Wt=d("$ZodLiteral",(e,t)=>{w.init(e,t);let r=new Set(t.values);e._zod.values=r,S(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?re(i):i?re(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});function Nt(e,t){return e.value=t.issues.length?void 0:t.value,e}var Jt=d("$ZodOptional",(e,t)=>{w.init(e,t),S(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",S(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),S(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Pe(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Nt(r,i)):Nt(r,o)}return t.innerType._zod.run(r,n)}});var Xt=d("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",S(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Dt(i,t)):Dt(o,t)}});function Dt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Lt(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>N(o,n,H()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Yt=d("$ZodCatch",(e,t)=>{w.init(e,t),S(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),S(e,"optout",r=>r.def.innerType._zod.optout),S(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Lt(r,i,t,n)):Lt(r,o,t,n)}});var qt=d("$ZodCustom",(e,t)=>{ie.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>jt(i,r,n,e));jt(o,r,n,e)}});function jt(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(he(o))}}function Qt(e){return e.checks&&(e.checks=[...e.checks]),e}function er(e,t){return new e(Qt({type:"string",...Z(t)}))}function tr(e,t){return new e(Qt({type:"number",checks:[],...Z(t)}))}function rr(e,t){return new e({type:"boolean",...Z(t)})}function He(e,t){return new Ot({check:"string_format",format:"regex",...Z(t),pattern:e})}function nr(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}var A=d("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");w.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){E(this,"with",e)},parse(e,t){return Ne(this,e,t,{callee:this.parse})},parseAsync(e,t){return De(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Le(this,e,t)},safeParseAsync(e,t){return je(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return P(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Un=d("ZodMiniString",(e,t)=>{Ht.init(e,t),A.init(e,t)});function U(e){return er(Un,e)}var Bn=d("ZodMiniNumber",(e,t)=>{Ut.init(e,t),A.init(e,t)});function Ue(e){return tr(Bn,e)}var Kn=d("ZodMiniBoolean",(e,t)=>{Bt.init(e,t),A.init(e,t)});function D(e){return rr(Kn,e)}var Vn=d("ZodMiniArray",(e,t)=>{Kt.init(e,t),A.init(e,t)});function Be(e,t){return new Vn({type:"array",element:e,...Z(t)})}var Gn=d("ZodMiniObject",(e,t)=>{Vt.init(e,t),A.init(e,t),Oe(e,"shape",r=>r._zod.def.shape,!1)});function Ke(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Gn(r)}var Wn=d("ZodMiniEnum",(e,t)=>{Gt.init(e,t),A.init(e,t),e.options=[...e._zod.values]});function or(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Wn({type:"enum",entries:r,...Z(t)})}var Jn=d("ZodMiniLiteral",(e,t)=>{Wt.init(e,t),A.init(e,t)});function ir(e,t){return new Jn({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}var Xn=d("ZodMiniOptional",(e,t)=>{Jt.init(e,t),A.init(e,t)});function $(e){return new Xn({type:"optional",innerType:e})}var Yn=d("ZodMiniDefault",(e,t)=>{Xt.init(e,t),A.init(e,t)});function G(e,t){return new Yn({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():pe(t)}})}var qn=d("ZodMiniCatch",(e,t)=>{Yt.init(e,t),A.init(e,t)});function sr(e,t){return new qn({type:"catch",innerType:e,catchValue:typeof t=="function"?t:T.constantCatch(t)})}var Qn=d("ZodMiniCustom",(e,t)=>{qt.init(e,t),A.init(e,t)});function Ve(e,t){return nr(Qn,e??(()=>!0),t)}var Ge="https://in.dev.heycatch.ai",J="dev",X="0.8.4-dev.2343",cr="phc_CqKdgm7xbFBs3mSdtqzrHNTfzTRKrwRmCrEB9aftENY9";function ur(e=J){return e!=="dev"?null:`[HeyCatch] WARNING: this is an internal development build (v${X}). Events are being sent to the HeyCatch development environment and will NEVER appear in your dashboard. Reinstall the latest stable version - resolve it with \`npm view @heycatch/sdk version\` - or re-run the install guide: https://heycatch.ai/agents.md`}var W="unknown",no=["localStorage","cookie","memory","localStorage+cookie","sessionStorage"];var ar=Ke({projectKey:U({error:'config.projectKey is missing or malformed \u2014 expected a string starting with "hck_pk_". Copy it from your project page in the HeyCatch dashboard.'}).check(He(/^hck_pk_/,{error:'config.projectKey is missing or malformed \u2014 expected a string starting with "hck_pk_". Copy it from your project page in the HeyCatch dashboard.'})),tracingHosts:G(Be(U()),[]),install:G(Ke({framework:G(U(),W),frameworkVersion:G(U(),W),agent:G(U(),W)}),{framework:W,frameworkVersion:W,agent:W}),autocapture:$(D()),maskAllText:$(D()),maskAllElementAttributes:$(D()),propertyDenylist:$(Be(U())),sanitizeProperties:$(Ve(e=>typeof e=="function")),beforeSend:$(Ve(e=>typeof e=="function"||Array.isArray(e)&&e.every(t=>typeof t=="function"))),persistence:$(or(no)),disablePersistence:$(D()),cookieExpirationDays:$(Ue()),optOutCapturingByDefault:$(D()),respectDnt:$(D()),requestBatching:$(D()),flushIntervalMs:$(Ue()),site:sr($(ir("landing")),e=>{let t=typeof e.value=="string"?JSON.stringify(e.value):`a ${typeof e.value}`;console.error(`[HeyCatch] config.site must be 'landing' or omitted - got ${t}. Ignoring it; this project is reported as untagged.`)})});var lr="[redacted]",oo=/(^|[#&?])(access_token|refresh_token|token_hash|token)=[^\s#&"'<>]+/gi,io=/(^|[^\w-])eyJ[\w-]+\.[\w-]+\.[\w-]+/g;function pr(e){return e.replaceAll(oo,`$1$2=${lr}`).replaceAll(io,`$1${lr}`)}var so=new Set(["$anon_distinct_id","distinct_id"]),co=["$set","$set_once"];function We(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){return typeof e=="string"?pr(e):Array.isArray(e)?uo(e):We(e)?fr(e,()=>!0):e}function uo(e){let t=e.map(r=>Je(r));return t.some((r,n)=>r!==e[n])?t:e}function fr(e,t){let r=!1,n=[];for(let[o,i]of Object.entries(e)){let c=t(o)?Je(i):i;c!==i&&(r=!0),n.push([o,c])}return r?Object.fromEntries(n):e}function dr(e){if(!We(e))return e;try{let t=!1,r={...e},{properties:n}=e;if(We(n)){let o=fr(n,i=>!so.has(i));o!==n&&(t=!0,r.properties=o)}for(let o of co){let i=e[o],c=Je(i);c!==i&&(t=!0,r[o]=c)}return t?r:e}catch{return e}}function mr(e){return t=>{if(t?.event!=="$autocapture")return t;let r=e();if(r===null)return t;let n=t.properties??{};return"$process_person_profile"in n?t:{...t,properties:{...n,$process_person_profile:r._hasPersonProcessing()}}}}var ao=5e3,lo=60,po=1e3,fo=60,mo=new Set(["$set"]),Xe="heycatch_volume_cap_reached",hr=3,ho=6e4;function ge({bucket:e,perMinute:t,now:r}){if(e===void 0)return t;let n=Math.max(0,r-e.at);return Math.min(t,e.tokens+n*t/ho)}function _o(e){return e===void 0||e.length===0?!1:rt(go(e))}function go(e){if(e.startsWith("[")){let r=e.indexOf("]");return r===-1?e:e.slice(0,r+1)}let t=e.indexOf(":");return t!==-1&&t===e.lastIndexOf(":")?e.slice(0,t):e}function _r(e){let{$session_id:t,$host:r}=e.properties;return{sessionId:typeof t=="string"?t:"",host:typeof r=="string"?r:void 0}}var xr=4;function gr(e){if(e!==void 0)return typeof e=="object"&&e!==null&&"tokens"in e&&typeof e.tokens=="number"&&Number.isFinite(e.tokens)&&e.tokens>=0&&"at"in e&&typeof e.at=="number"&&Number.isFinite(e.at)?{tokens:e.tokens,at:e.at}:!1}function xo(e){if(typeof e=="object"&&e!==null&&"sessionId"in e&&typeof e.sessionId=="string"&&"count"in e&&typeof e.count=="number"&&Number.isInteger(e.count)&&e.count>=0&&"markerAttempts"in e&&typeof e.markerAttempts=="number"&&Number.isInteger(e.markerAttempts)&&e.markerAttempts>=0){let t=gr("person"in e?e.person:void 0),r=gr("localhost"in e?e.localhost:void 0);if(t!==!1&&r!==!1)return{sessionId:e.sessionId,count:e.count,markerAttempts:e.markerAttempts,person:t,localhost:r}}return null}function yo(e){if(e===null)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t.flatMap(r=>{let n=xo(r);return n===null?[]:[n]}).slice(0,xr)}catch{}return[]}function yr({store:e,warn:t,emitMarker:r,cap:n=ao,personUpdateBudget:o=lo,localhostFreeEvents:i=po,localhostRatePerMinute:c=fo,now:s=Date.now}){let u=[],a=!1,l=!1,f=!1,p=!1;function _(){if(e===void 0||a)return u;try{return yo(e.read())}catch{return u}}function h(g){let y=_().filter(m=>m.sessionId!==g.sessionId);u=[g,...y].slice(0,xr);try{e?.write(JSON.stringify(u))}catch{a=!0}}function x(g){let y=_().find(v=>v.sessionId===g),m=u.find(v=>v.sessionId===g),b=[y,m].filter(v=>v!==void 0),B=s();function Y(v,q){let L;for(let{[v]:K}of b)K!==void 0&&ge({bucket:K,perMinute:q,now:B})<ge({bucket:L,perMinute:q,now:B})&&(L=K);return L}return{sessionId:g,count:Math.max(0,...b.map(v=>v.count)),markerAttempts:Math.max(0,...b.map(v=>v.markerAttempts)),person:Y("person",o),localhost:Y("localhost",c)}}function z(g,y){let m=y,b=s(),{sessionId:B,host:Y}=_r(g);m.person!==void 0&&m.person.at>b&&(m={...m,person:{...m.person,at:b}},h(m)),m.localhost!==void 0&&m.localhost.at>b&&(m={...m,localhost:{...m.localhost,at:b}},h(m));let v=mo.has(g.event),q=v?ge({bucket:m.person,perMinute:o,now:b}):0;if(v&&q<1)return f||(f=!0,t(`[HeyCatch] setPersonProperties is being called more than ${o} times a minute - call it when a property changes, not on every render. Dropping the extra updates for now; other events are unaffected.`)),null;let L=m.count>=i&&_o(Y),K=L?ge({bucket:m.localhost,perMinute:c,now:b}):0;return L&&K<1?(p||(p=!0,t(`[HeyCatch] this local dev session (${Y??"unknown host"}, session ${B||"unknown"}) sent ${i} events - throttling it to ${c} a minute so a dev loop cannot flood your analytics. Production traffic is unaffected.`)),null):(h({...m,count:m.count+1,...v?{person:{tokens:q-1,at:b}}:{},...L?{localhost:{tokens:K-1,at:b}}:{}}),g)}return g=>{if(g===null||g.event===Xe)return g;let{sessionId:y}=_r(g),m=x(y);return m.count<n?z(g,m):(l||(l=!0,t(`[HeyCatch] this session sent ${n} events, the per-session cap - dropping the rest until a new session starts (session ${y||"unknown"}). A tracking call inside a render loop or an effect is the usual cause.`)),m.markerAttempts<hr&&(h({...m,markerAttempts:hr}),r({cap:n,sessionId:y})||h({...m,markerAttempts:m.markerAttempts+1})),null)}}function br(e){let t=yr({warn:r=>{console.warn(r)},emitMarker:({cap:r})=>{let n=e();return n?.capture(Xe,{heycatch_session_event_cap:r}),n!==null}});return r=>r===null||t({event:r.event,properties:r.properties??{}})===null?null:r}var se=null;function k(){return se}var Ye=null;function $r(){Ye?.()}function zr(e){if(se!==null)return;let t=ar.safeParse(e);if(!t.success){let c=t.error.issues[0]?.message??"init() requires a config object with { projectKey }.";console.error(`[HeyCatch] ${c}`);return}let r=new vr.PostHog(cr,{host:Ge,preloadFeatureFlags:!1,disableRemoteFeatureFlags:!0,sendFeatureFlagEvent:!1,disableSurveys:!0,...t.data.optOutCapturingByDefault===void 0?{}:{defaultOptIn:!t.data.optOutCapturingByDefault},before_send:[mr(()=>se),br(()=>se),dr]}),{install:n}=t.data,o={heycatch_framework:n.framework,heycatch_framework_version:n.frameworkVersion,heycatch_agent:n.agent};Ye=()=>{r.register({heycatch_sdk_version:X,heycatch_sdk_stage:J,heycatch_project_key:t.data.projectKey,...o})},Ye(),se=r,console.info(`[HeyCatch] SDK v${X} (${J}) initialized \u2192 ${Ge}`);let i=ur();i!==null&&console.warn(i)}function wr(e){return t=>{console.error(`[HeyCatch] consent ${e} could not be saved - capture state may reset on the next app launch:`,t)}}function kr(){k()?.optIn().catch(wr("opt-in"))}function Pr(){k()?.optOut().catch(wr("opt-out"))}var Zr=require("posthog-react-native");function Sr(e,t,r){let n=k();if(n!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] setIdentity() requires a non-empty string user id. Pass a stable internal user id from your auth provider \u2014 not an email or session token.");return}n.getPersistedProperty(Zr.PostHogPersistedProperty.PersonMode)==="identified"&&n.getDistinctId()!==e&&qe(),n.identify(e,{...t?{$set:t}:{},...r?{$set_once:r}:{}})}}function qe(){let e=k();e!==null&&(e.reset(),$r())}function xe(e,t){let r=k();if(r!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] trackScreen() requires a non-empty screen name.");return}r.screen(e,t?t:void 0)}}function Ar(e,t,r){let n=k();if(n!==null){if(typeof e!="string"||e.length===0){console.error("[HeyCatch] trackEvent() requires a non-empty event name.");return}if(e.startsWith("$")){console.error(`[HeyCatch] trackEvent() event names cannot start with "$" (got "${e}") - that prefix is reserved for built-in events.`);return}n.capture(e,{...t,...r?.set?{$set:r.set}:{},...r?.setOnce?{$set_once:r.setOnce}:{},heycatch_custom_user_event:!0})}}function Er(e,t){let r=k();r!==null&&(!e&&!t||r.capture("$set",{...e?{$set:e}:{},...t?{$set_once:t}:{}}))}var Ir=require("posthog-react-native"),ye=require("react");function bo(e){return typeof e=="object"&&e!==null&&"usePathname"in e&&typeof e.usePathname=="function"&&"useGlobalSearchParams"in e&&typeof e.useGlobalSearchParams=="function"}function vo(){try{if(typeof require!="function")return null;let e=require("expo-router");return bo(e)?e:null}catch{return null}}var Qe=vo();var $o=new Set(["code","jwt","otp","pin","pwd","sid","sig"]),zo=["credential","email","passcode","passwd","password","secret","session","signature","token"],wo="#",ko=/[^\s@,]+@[^\s@,]+\.[^\s@,]+/;function Po(e){return e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[\s_-]+/).filter(t=>t.length>0)}function Zo(e,t){if(e===wo)return!0;let r=e.toLowerCase().replaceAll(/[_-]/g,"");return r.startsWith("auth")||r.includes("key")||zo.some(n=>r.includes(n))||Po(e).some(n=>$o.has(n))?!0:typeof t=="string"&&ko.test(t)}function Cr(e){let t=JSON.parse(e);if(typeof t!="object"||t===null)return{};let r={};for(let[n,o]of Object.entries(t)){let i;if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")i=o;else if(Array.isArray(o))i=o.filter(c=>typeof c=="string").join(",");else continue;Zo(n,i)||(r[n]=i)}return r}var ce=require("react/jsx-runtime");function So({router:e}){let{useGlobalSearchParams:t,usePathname:r}=e,n=r(),o=JSON.stringify(t());return(0,ye.useEffect)(()=>{xe(n,Cr(o))},[n,o]),null}var et=class extends ye.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(t){console.error("[HeyCatch] Automatic screen views are off: an Expo Router hook threw. Call analytics.trackScreen(name) from your navigation instead.",t)}render(){return this.state.failed?null:this.props.children}};function Or({children:e,trackScreens:t=!0}){let r=k();return r===null?(console.error("[HeyCatch] HeyCatchProvider mounted before init() - call analytics.init({ projectKey }) at module scope of the root layout."),e):(0,ce.jsxs)(Ir.PostHogProvider,{autocapture:{captureScreens:!1,captureTouches:!0},client:r,children:[!t||Qe===null?null:(0,ce.jsx)(et,{children:(0,ce.jsx)(So,{router:Qe})}),e]})}var Ao={init:zr,optInCapturing:kr,optOutCapturing:Pr,resetIdentity:qe,setIdentity:Sr,setPersonProperties:Er,trackEvent:Ar,trackScreen:xe};0&&(module.exports={HeyCatchProvider,SDK_VERSION,STAGE,analytics});
2
2
  //# sourceMappingURL=react-native.cjs.map