@aranova/tracking-browser 0.14.1 → 0.14.2
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 AranovaTracking=(()=>{var vt=Object.defineProperty;var Or=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Nr=Object.prototype.hasOwnProperty;var mn=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},Vr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mr(e))!Nr.call(t,i)&&i!==n&&vt(t,i,{get:()=>e[i],enumerable:!(r=Or(e,i))||r.enumerable});return t};var jr=t=>Vr(vt({},"__esModule",{value:!0}),t);var Fa={};mn(Fa,{default:()=>Da,init:()=>Pr});var gn="0.14.1";var xt="consent_state",hn="consent_timestamp",St=new Set;function yn(t){return St.add(t),()=>{St.delete(t)}}function bt(t){return{ad_storage:t,ad_user_data:t,ad_personalization:t,analytics_storage:t}}function O(){if(typeof window>"u")return"pending";try{let t=window.localStorage.getItem(xt);if(t==="granted"||t==="denied")return t}catch{}return"pending"}function ye(t){if(!(typeof window>"u")){try{window.localStorage.setItem(xt,t),window.localStorage.setItem(hn,new Date().toISOString())}catch{}if(typeof window.gtag=="function"&&window.gtag("consent","update",bt(t)),typeof window.fbq=="function"&&window.fbq("consent",t==="granted"?"grant":"revoke"),t==="granted")for(let e of St)try{e()}catch{}}}function Be(){let t=O();return(t==="granted"||t==="denied")&&ye(t),t}var Ye=["gclid","fbclid","utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function _e(){return{gclid:null,fbclid:null,utm_source:null,utm_medium:null,utm_campaign:null,utm_term:null,utm_content:null}}function We(t){return typeof t=="string"&&t.length>0?t:null}function ve(t){return Ye.reduce((e,n)=>(e[n]=We(t(n)),e),_e())}function _n(t){return Ye.reduce((e,n)=>{let r=t.get(n);return typeof r=="string"&&r.trim().length>0&&(e[n]=r),e},{})}var Fr="_aranova_track_";function vn(t){return`${Fr}${t}`}function Je(t,e,n=7776e3){let r=encodeURIComponent(e);if(typeof document<"u")try{document.cookie=`${t}=${r}; Max-Age=${n}; Path=/; SameSite=Lax`}catch{}if(typeof window<"u")try{window.localStorage.setItem(vn(t),r)}catch{}}function Se(t){if(typeof document<"u"){let n=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(`${t}=`));if(n){let[,r=""]=n.split("=");return We(decodeURIComponent(r))}}if(typeof window<"u")try{let e=window.localStorage.getItem(vn(t));if(e)return We(decodeURIComponent(e))}catch{}return null}function xe(t){return Se(t)}function Sn(t,e,n=7776e3){Je(t,e,n)}function Ct(t,e){return Ye.reduce((n,r)=>(n[r]=t[r]??e[r],n),_e())}function xn(t,e=7776e3){let n=_n(t);return Object.entries(n).forEach(([r,i])=>{Sn(r,i,e)}),n}function Q(t=typeof window>"u"?"":window.location.href,e=7776e3){let n=typeof window>"u"?new URL(t||"https://example.invalid"):new URL(t,window.location.origin);return xn(n.searchParams,e),ve(xe)}var bn="https://www.googletagmanager.com/gtag/js",be="data-aranova-tracking";function $r(t){return`aranova-${t}`}var Lr=/^[A-Z]{1,3}-[A-Za-z0-9_-]+$/;function kt(t){return Lr.test(t)}function Xe(){if(window.dataLayer=window.dataLayer||[],typeof window.gtag=="function")return window.gtag;function t(){window.dataLayer?.push(arguments)}return window.gtag=t,window.gtag}var Gr=/^AW-[A-Za-z0-9]+\/[A-Za-z0-9_-]+$/;function Cn(t){return Gr.test(t)}function wt(t){if(typeof window>"u"||typeof window.gtag!="function"||!Cn(t.sendTo))return!1;let e={send_to:t.sendTo};t.value!=null&&(e.value=t.value),t.currency&&(e.currency=t.currency),t.transactionId&&(e.transaction_id=t.transactionId);try{return window.gtag("event","conversion",e),!0}catch{return!1}}function Tt(){Xe()("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",wait_for_update:500})}function Et(t){if(typeof document>"u")return;let e=$r("gtag-loader");if(document.querySelector(`script[${be}="${e}"]`))return;let r=document.createElement("script");r.async=!0,r.src=`${bn}?id=${encodeURIComponent(t)}`,r.setAttribute(be,e),document.head.append(r)}function kn(t){let e=Xe();e("js",new Date),e("config",t)}function It(t){typeof window>"u"||typeof document>"u"||kt(t)&&(Tt(),Et(t),kn(t),Be())}function Rt(t){if(typeof window>"u"||typeof document>"u")return;let e=Object.values(t).filter(r=>typeof r=="string"&&kt(r));if(e.length===0)return;Tt(),Et(e[0]);let n=Xe();n("js",new Date);for(let r of e)n("config",r);Be()}var wn="https://connect.facebook.net/en_US/fbevents.js",Pt="_fbc",Tn="_fbp",zr=/^\d{15,16}$/;function At(t){return zr.test(t)}function En(t){let e=t.split(".").filter(Boolean);return Math.max(0,e.length-1)}function In(t,e,n){let r=n??(typeof window>"u"?"":window.location.hostname);return`fb.${En(r)}.${e}.${t}`}function De(){return Se(Pt)}function et(){return Se(Tn)}function Ur(){if(typeof window>"u")return null;try{let t=new URL(window.location.href).searchParams.get("fbclid");return t&&t.trim().length>0?t:null}catch{return null}}function Fe(t=typeof Date>"u"?0:Date.now()){if(typeof window>"u"||De())return;let e=Ur()??Se("fbclid");e&&Je(Pt,In(e,t),7776e3)}function Kr(t){return`aranova-${t}`}function tt(){let t=window;if(typeof t.fbq=="function")return t.fbq;let e=function(...n){e.callMethod?e.callMethod.apply(e,n):e.queue.push(n)};return e.push=e,e.loaded=!0,e.version="2.0",e.queue=[],t.fbq=e,t._fbq||(t._fbq=e),e}function Ot(){tt()("consent","revoke")}function Mt(){if(typeof document>"u")return;let t=Kr("fbq-loader");if(document.querySelector(`script[${be}="${t}"]`))return;let n=document.createElement("script");n.async=!0,n.src=wn,n.setAttribute(be,t),document.head.append(n)}function Rn(t){let e=tt();e("init",t),e("track","PageView")}function Nt(){if(typeof window>"u")return;let t=O();t==="granted"?window.fbq?.("consent","grant"):t==="denied"&&window.fbq?.("consent","revoke")}function Vt(t){typeof window>"u"||typeof document>"u"||At(t)&&(Ot(),Mt(),Rn(t),Nt(),Fe())}function jt(t){if(typeof window>"u"||typeof document>"u")return;let e=Object.values(t).filter(r=>typeof r=="string"&&At(r));if(e.length===0)return;Ot(),Mt();let n=tt();for(let r of e)n("init",r);n("track","PageView"),Nt(),Fe()}var Hr="_aranova_conv_",qr=100,$e=[];function Pn(t){return`${Hr}${t.transactionId??""}:${t.sendTo}`}function Zr(t){if(!t.transactionId||typeof window>"u")return!1;try{return window.sessionStorage.getItem(Pn(t))!==null}catch{return!1}}function Br(t){if(!(!t.transactionId||typeof window>"u"))try{window.sessionStorage.setItem(Pn(t),"1")}catch{}}function An(t){Zr(t)||wt(t)&&Br(t)}function Ce(t){let e=O();if(e!=="denied"){if(e==="pending"){$e.length>=qr&&$e.shift(),$e.push(t);return}An(t)}}function On(){if(O()==="granted")for(;$e.length>0;){let t=$e.shift();t&&An(t)}}typeof window<"u"&&yn(On);function Mn(t){return typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string")}function Nn(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.send_to!="string"?null:{send_to:e.send_to,value_cents:typeof e.value_cents=="number"?e.value_cents:null,currency:typeof e.currency=="string"?e.currency:null}}function Wr(t){if(!t||typeof t!="object")return null;let e=t;if(typeof e.event_type!="string")return null;let n={event_type:e.event_type};return typeof e.threshold_percent=="number"&&(n.threshold_percent=e.threshold_percent),typeof e.threshold_seconds=="number"&&(n.threshold_seconds=e.threshold_seconds),typeof e.page_threshold=="number"&&(n.page_threshold=e.page_threshold),typeof e.page_name=="string"&&(n.page_name=e.page_name),n}function Dt(t){if(!t||typeof t!="object")return null;let e=t,r=(Array.isArray(e.services)?e.services:[]).flatMap(s=>{if(!s||typeof s!="object")return[];let o=s;return typeof o.key!="string"?[]:[{key:o.key,label:typeof o.label=="string"?o.label:void 0,firing:Nn(o.firing)}]}),i=Array.isArray(e.goals)?e.goals:null,a=i?i.flatMap(s=>{if(!s||typeof s!="object")return[];let o=s;return typeof o.key!="string"?[]:[{key:o.key,label:typeof o.label=="string"?o.label:void 0,kind:o.kind==="event"?"event":"sale",trigger:Wr(o.trigger),firing:Nn(o.firing)}]}):r.map(s=>({key:s.key,label:s.label,kind:"sale",trigger:null,firing:s.firing}));return{schema_version:typeof e.schema_version=="number"?e.schema_version:1,config_version:typeof e.config_version=="number"?e.config_version:0,business_id:typeof e.business_id=="string"?e.business_id:void 0,customer_id:typeof e.customer_id=="string"?e.customer_id:null,environment:typeof e.environment=="string"?e.environment:void 0,gtag_ids:Mn(e.gtag_ids)?e.gtag_ids:{},meta_pixel_ids:Mn(e.meta_pixel_ids)?e.meta_pixel_ids:{},services:r,goals:a}}var Yr="_aranova_cfg_";function Vn(t){return`${Yr}${t}`}function Jr(t){if(typeof window>"u")return null;try{let e=window.sessionStorage.getItem(Vn(t));if(!e)return null;let n=JSON.parse(e),r=Dt(n.config);return r?{etag:typeof n.etag=="string"?n.etag:null,config:r}:null}catch{return null}}function Xr(t,e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Vn(t),JSON.stringify(e))}catch{}}function Ft(t){let e=Jr(t.cdnUrl),n=e?.config??t.baked??null,r=e?.etag??null,i=new Map,a=new Set;function s(){i.clear();for(let f of n?.goals??[])i.set(f.key,f)}function o(){let f=[...a];a.clear();for(let h of f)try{h()}catch{}}function l(f,h){if(!f||n&&f.config_version<=n.config_version)return;let b=n===null;n=f,r=h,s(),Xr(t.cdnUrl,{etag:r,config:f}),b&&o()}async function u(){if(!(typeof window>"u"))try{let f=t.fetchImpl??globalThis.fetch;if(!f)return;let h={};r&&(h["If-None-Match"]=r);let b=await f(t.cdnUrl,{method:"GET",headers:h});if(b.status===304||!b.ok)return;l(Dt(await b.json()),b.headers.get("ETag"))}catch{}}return s(),u(),{getFiring:f=>i.get(f)?.firing??null,getGoal:f=>i.get(f)??null,listGoals:()=>[...i.values()],current:()=>n,isReady:()=>n!==null,onResolve:f=>n!==null?(f(),()=>{}):(a.add(f),()=>a.delete(f)),revalidate:u}}var Qr={USD:2,CAD:2};function ei(t){return Qr[t]??2}function Le(t,e){return t/10**ei(e)}function ti(t,e,n){let r=t.trigger;if(!r||r.event_type!==e)return!1;switch(e){case"scroll_depth":return typeof n.depth_percent=="number"&&r.threshold_percent!=null&&n.depth_percent>=r.threshold_percent;case"time_on_site":return typeof n.duration_ms=="number"&&r.threshold_seconds!=null&&n.duration_ms>=r.threshold_seconds*1e3;case"multi_page_session":return typeof n.page_count=="number"&&r.page_threshold!=null&&n.page_count>=r.page_threshold;case"specific_page_visit":return typeof n.page_name=="string"&&n.page_name===r.page_name;case"page_view":case"form_start":return!0;default:return!1}}function ni(){return typeof window>"u"?"":window.location.pathname}var ri=50;function $t(t){let e=[],n=!1;function r(i,a){for(let s of t.listGoals()){if(s.kind!=="event"||!s.firing||!ti(s,i,a))continue;let o=s.firing,l=o.value_cents??null,u=o.currency??null;Ce({sendTo:o.send_to,value:l!=null&&u?Le(l,u):null,currency:u,transactionId:`auto:${s.key}:${ni()}`})}}return{onAutomaticEvent(i,a){if(t.isReady()){r(i,a);return}e.length<ri&&e.push({eventType:i,metadata:a}),n||(n=!0,t.onResolve(()=>{let s=e.splice(0);for(let o of s)r(o.eventType,o.metadata)}))}}}function Lt(t,e){return{...t,trackEvent:n=>{t.trackEvent(n);try{e.onAutomaticEvent(n.eventType,n.metadata??{})}catch{}}}}var Gt="aranova_tracking_visitor",nt="aranova_tracking_session";function rt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}-${Math.random().toString(16).slice(2)}`}function jn(t){try{return window.localStorage.getItem(t)}catch{return null}}function zt(t,e){try{window.localStorage.setItem(t,e)}catch{}}function Ut(){if(typeof window>"u")return rt();let t=jn(Gt);if(t&&t.length>0)return t;let e=rt();return zt(Gt,e),e}function ke(t=Date.now()){if(typeof window>"u")return{id:rt(),isNew:!0};let e=jn(nt);if(e)try{let r=JSON.parse(e);if(typeof r.id=="string"&&typeof r.last_event_at=="number"&&t-r.last_event_at<=18e5){let i={id:r.id,last_event_at:t};return zt(nt,JSON.stringify(i)),{id:r.id,isNew:!1}}}catch{}let n={id:rt(),last_event_at:t};return zt(nt,JSON.stringify(n)),{id:n.id,isNew:!0}}var c={};mn(c,{BRAND:()=>Ri,DIRTY:()=>ee,EMPTY_PATH:()=>oi,INVALID:()=>y,NEVER:()=>pa,OK:()=>I,ParseStatus:()=>E,Schema:()=>x,ZodAny:()=>J,ZodArray:()=>Z,ZodBigInt:()=>ne,ZodBoolean:()=>re,ZodBranded:()=>ze,ZodCatch:()=>me,ZodDate:()=>ie,ZodDefault:()=>pe,ZodDiscriminatedUnion:()=>st,ZodEffects:()=>j,ZodEnum:()=>de,ZodError:()=>R,ZodFirstPartyTypeKind:()=>_,ZodFunction:()=>ct,ZodIntersection:()=>ce,ZodIssueCode:()=>d,ZodLazy:()=>ue,ZodLiteral:()=>le,ZodMap:()=>Pe,ZodNaN:()=>Oe,ZodNativeEnum:()=>fe,ZodNever:()=>F,ZodNull:()=>se,ZodNullable:()=>z,ZodNumber:()=>te,ZodObject:()=>P,ZodOptional:()=>N,ZodParsedType:()=>m,ZodPipeline:()=>Ue,ZodPromise:()=>X,ZodReadonly:()=>ge,ZodRecord:()=>ot,ZodSchema:()=>x,ZodSet:()=>Ae,ZodString:()=>Y,ZodSymbol:()=>Ie,ZodTransformer:()=>j,ZodTuple:()=>G,ZodType:()=>x,ZodUndefined:()=>ae,ZodUnion:()=>oe,ZodUnknown:()=>q,ZodVoid:()=>Re,addIssueToContext:()=>p,any:()=>Fi,array:()=>zi,bigint:()=>Mi,boolean:()=>Zn,coerce:()=>fa,custom:()=>Kn,date:()=>Ni,datetimeRegex:()=>zn,defaultErrorMap:()=>K,discriminatedUnion:()=>qi,effect:()=>ia,enum:()=>ta,function:()=>Xi,getErrorMap:()=>we,getParsedType:()=>L,instanceof:()=>Ai,intersection:()=>Zi,isAborted:()=>it,isAsync:()=>Te,isDirty:()=>at,isValid:()=>W,late:()=>Pi,lazy:()=>Qi,literal:()=>ea,makeIssue:()=>Ge,map:()=>Yi,nan:()=>Oi,nativeEnum:()=>na,never:()=>Li,null:()=>Di,nullable:()=>sa,number:()=>qn,object:()=>Ui,objectUtil:()=>Kt,oboolean:()=>da,onumber:()=>la,optional:()=>aa,ostring:()=>ua,pipeline:()=>ca,preprocess:()=>oa,promise:()=>ra,quotelessJson:()=>ii,record:()=>Wi,set:()=>Ji,setErrorMap:()=>si,strictObject:()=>Ki,string:()=>Hn,symbol:()=>Vi,transformer:()=>ia,tuple:()=>Bi,undefined:()=>ji,union:()=>Hi,unknown:()=>$i,util:()=>C,void:()=>Gi});var C;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(let s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(C||(C={}));var Kt;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Kt||(Kt={}));var m=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),L=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}};var d=C.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"]),ii=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),R=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};R.create=t=>new R(t);var ai=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===m.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,C.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${C.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${C.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${C.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:C.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,C.assertNever(t)}return{message:n}},K=ai;var Dn=K;function si(t){Dn=t}function we(){return Dn}var Ge=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)o=u(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}},oi=[];function p(t,e){let n=we(),r=Ge({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===K?void 0:K].filter(i=>!!i)});t.common.issues.push(r)}var E=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return y;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let a=await i.key,s=await i.value;r.push({key:a,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return y;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},y=Object.freeze({status:"aborted"}),ee=t=>({status:"dirty",value:t}),I=t=>({status:"valid",value:t}),it=t=>t.status==="aborted",at=t=>t.status==="dirty",W=t=>t.status==="valid",Te=t=>typeof Promise<"u"&&t instanceof Promise;var g;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(g||(g={}));var V=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,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}},Fn=(t,e)=>{if(W(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new R(t.common.issues);return this._error=n,this._error}}};function S(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}var x=class{get description(){return this._def.description}_getType(e){return L(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:L(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E,ctx:{common:e.parent.common,data:e.data,parsedType:L(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Te(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fn(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return W(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>W(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(Te(i)?i:Promise.resolve(i));return Fn(r,a)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{let s=e(i),o=()=>a.addIssue({code:d.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new j({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return N.create(this,this._def)}nullable(){return z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this)}promise(){return X.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return ce.create(this,e,this._def)}transform(e){return new j({...S(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new pe({...S(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...S(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new me({...S(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ci=/^c[^\s-]{8,}$/i,ui=/^[0-9a-z]+$/,li=/^[0-9A-HJKMNP-TV-Z]{26}$/i,di=/^[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,fi=/^[a-z0-9_-]{21}$/i,pi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mi=/^[-+]?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)?)??$/,gi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ht,yi=/^(?:(?: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])$/,_i=/^(?:(?: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])$/,vi=/^(([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]))$/,Si=/^(([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])$/,xi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bi=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ln="((\\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])))",Ci=new RegExp(`^${Ln}$`);function Gn(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function ki(t){return new RegExp(`^${Gn(t)}$`)}function zn(t){let e=`${Ln}T${Gn(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function wi(t,e){return!!((e==="v4"||!e)&&yi.test(t)||(e==="v6"||!e)&&vi.test(t))}function Ti(t,e){if(!pi.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Ei(t,e){return!!((e==="v4"||!e)&&_i.test(t)||(e==="v6"||!e)&&Si.test(t))}var Y=class t extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.string,received:a.parsedType}),y}let r=new E,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?p(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&p(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")gi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ht||(Ht=new RegExp(hi,"u")),Ht.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")di.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")fi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")ci.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")ui.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")li.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),p(i,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?zn(a).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Ci.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?ki(a).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?mi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?wi(e.data,a.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Ti(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?Ei(e.data,a.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?xi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?bi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()):C.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:d.invalid_string,...g.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...g.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...g.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...g.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...g.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...g.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...g.errToObj(n)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Y.create=t=>new Y({checks:[],typeName:_.ZodString,coerce:t?.coerce??!1,...S(t)});function Ii(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}var te=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==m.number){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.number,received:a.parsedType}),y}let r,i=new E;for(let a of this._def.checks)a.kind==="int"?C.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Ii(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_finite,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,g.toString(n))}gt(e,n){return this.setLimit("min",e,!1,g.toString(n))}lte(e,n){return this.setLimit("max",e,!0,g.toString(n))}lt(e,n){return this.setLimit("max",e,!1,g.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};te.create=t=>new te({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...S(t)});var ne=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==m.bigint)return this._getInvalidInput(e);let r,i=new E;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):C.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.bigint,received:n.parsedType}),y}gte(e,n){return this.setLimit("min",e,!0,g.toString(n))}gt(e,n){return this.setLimit("min",e,!1,g.toString(n))}lte(e,n){return this.setLimit("max",e,!0,g.toString(n))}lt(e,n){return this.setLimit("max",e,!1,g.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:g.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:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ne.create=t=>new ne({checks:[],typeName:_.ZodBigInt,coerce:t?.coerce??!1,...S(t)});var re=class extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.boolean,received:r.parsedType}),y}return I(e.data)}};re.create=t=>new re({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...S(t)});var ie=class t extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.date,received:a.parsedType}),y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_date}),y}let r=new E,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):C.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ie.create=t=>new ie({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...S(t)});var Ie=class extends x{_parse(e){if(this._getType(e)!==m.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.symbol,received:r.parsedType}),y}return I(e.data)}};Ie.create=t=>new Ie({typeName:_.ZodSymbol,...S(t)});var ae=class extends x{_parse(e){if(this._getType(e)!==m.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.undefined,received:r.parsedType}),y}return I(e.data)}};ae.create=t=>new ae({typeName:_.ZodUndefined,...S(t)});var se=class extends x{_parse(e){if(this._getType(e)!==m.null){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.null,received:r.parsedType}),y}return I(e.data)}};se.create=t=>new se({typeName:_.ZodNull,...S(t)});var J=class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return I(e.data)}};J.create=t=>new J({typeName:_.ZodAny,...S(t)});var q=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return I(e.data)}};q.create=t=>new q({typeName:_.ZodUnknown,...S(t)});var F=class extends x{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.never,received:n.parsedType}),y}};F.create=t=>new F({typeName:_.ZodNever,...S(t)});var Re=class extends x{_parse(e){if(this._getType(e)!==m.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.void,received:r.parsedType}),y}return I(e.data)}};Re.create=t=>new Re({typeName:_.ZodVoid,...S(t)});var Z=class t extends x{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==m.array)return p(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),y;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(p(n,{code:s?d.too_big:d.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(p(n,{code:d.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(p(n,{code:d.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new V(n,s,n.path,o)))).then(s=>E.mergeArray(r,s));let a=[...n.data].map((s,o)=>i.type._parseSync(new V(n,s,n.path,o)));return E.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:g.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:g.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:g.toString(n)}})}nonempty(e){return this.min(1,e)}};Z.create=(t,e)=>new Z({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...S(e)});function Ee(t){if(t instanceof P){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=N.create(Ee(r))}return new P({...t._def,shape:()=>e})}else return t instanceof Z?new Z({...t._def,type:Ee(t.element)}):t instanceof N?N.create(Ee(t.unwrap())):t instanceof z?z.create(Ee(t.unwrap())):t instanceof G?G.create(t.items.map(e=>Ee(e))):t}var P=class t extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=C.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return p(u,{code:d.invalid_type,expected:m.object,received:u.parsedType}),y}let{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof F&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||o.push(u);let l=[];for(let u of s){let f=a[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new V(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof F){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of o)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")o.length>0&&(p(i,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of o){let h=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new V(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of l){let h=await f.key,b=await f.value;u.push({key:h,value:b,alwaysSet:f.alwaysSet})}return u}).then(u=>E.mergeObjectSync(r,u)):E.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:g.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of C.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of C.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Ee(this)}partial(e){let n={};for(let r of C.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of C.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof N;)a=a._def.innerType;n[r]=a}return new t({...this._def,shape:()=>n})}keyof(){return Un(C.objectKeys(this.shape))}};P.create=(t,e)=>new P({shape:()=>t,unknownKeys:"strip",catchall:F.create(),typeName:_.ZodObject,...S(e)});P.strictCreate=(t,e)=>new P({shape:()=>t,unknownKeys:"strict",catchall:F.create(),typeName:_.ZodObject,...S(e)});P.lazycreate=(t,e)=>new P({shape:t,unknownKeys:"strip",catchall:F.create(),typeName:_.ZodObject,...S(e)});var oe=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new R(o.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:s}),y}if(n.common.async)return Promise.all(r.map(async a=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let l of r){let u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(l=>new R(l));return p(n,{code:d.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}};oe.create=(t,e)=>new oe({options:t,typeName:_.ZodUnion,...S(e)});var H=t=>t instanceof ue?H(t.schema):t instanceof j?H(t.innerType()):t instanceof le?[t.value]:t instanceof de?t.options:t instanceof fe?C.objectValues(t.enum):t instanceof pe?H(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof N?[void 0,...H(t.unwrap())]:t instanceof z?[null,...H(t.unwrap())]:t instanceof ze||t instanceof ge?H(t.unwrap()):t instanceof me?H(t._def.innerType):[],st=class t extends x{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return p(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),y;let r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let a of n){let s=H(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...S(r)})}};function qt(t,e){let n=L(t),r=L(e);if(t===e)return{valid:!0,data:t};if(n===m.object&&r===m.object){let i=C.objectKeys(e),a=C.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(let o of a){let l=qt(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===m.array&&r===m.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let s=t[a],o=e[a],l=qt(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===m.date&&r===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ce=class extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(it(a)||it(s))return y;let o=qt(a.value,s.value);return o.valid?((at(a)||at(s))&&n.dirty(),{status:n.value,value:o.data}):(p(r,{code:d.invalid_intersection_types}),y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ce.create=(t,e,n)=>new ce({left:t,right:e,typeName:_.ZodIntersection,...S(n)});var G=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.array)return p(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),y;if(r.data.length<this._def.items.length)return p(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((s,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new V(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>E.mergeArray(n,s)):E.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};G.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new G({items:t,typeName:_.ZodTuple,rest:null,...S(e)})};var ot=class t extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.object)return p(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),y;let i=[],a=this._def.keyType,s=this._def.valueType;for(let o in r.data)i.push({key:a._parse(new V(r,o,r.path,o)),value:s._parse(new V(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?E.mergeObjectAsync(n,i):E.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof x?new t({keyType:e,valueType:n,typeName:_.ZodRecord,...S(r)}):new t({keyType:Y.create(),valueType:e,typeName:_.ZodRecord,...S(n)})}},Pe=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.map)return p(r,{code:d.invalid_type,expected:m.map,received:r.parsedType}),y;let i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new V(r,o,r.path,[u,"key"])),value:a._parse(new V(r,l,r.path,[u,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return y;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let l of s){let u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return y;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}}}};Pe.create=(t,e,n)=>new Pe({valueType:e,keyType:t,typeName:_.ZodMap,...S(n)});var Ae=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.set)return p(r,{code:d.invalid_type,expected:m.set,received:r.parsedType}),y;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(p(r,{code:d.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(p(r,{code:d.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let a=this._def.valueType;function s(l){let u=new Set;for(let f of l){if(f.status==="aborted")return y;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}let o=[...r.data.values()].map((l,u)=>a._parse(new V(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new t({...this._def,minSize:{value:e,message:g.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:g.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ae.create=(t,e)=>new Ae({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...S(e)});var ct=class t extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.function)return p(n,{code:d.invalid_type,expected:m.function,received:n.parsedType}),y;function r(o,l){return Ge({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,we(),K].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:l}})}function i(o,l){return Ge({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,we(),K].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:l}})}let a={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof X){let o=this;return I(async function(...l){let u=new R([]),f=await o._def.args.parseAsync(l,a).catch(w=>{throw u.addIssue(r(l,w)),u}),h=await Reflect.apply(s,this,f);return await o._def.returns._def.type.parseAsync(h,a).catch(w=>{throw u.addIssue(i(h,w)),u})})}else{let o=this;return I(function(...l){let u=o._def.args.safeParse(l,a);if(!u.success)throw new R([r(l,u.error)]);let f=Reflect.apply(s,this,u.data),h=o._def.returns.safeParse(f,a);if(!h.success)throw new R([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:G.create(e).rest(q.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||G.create([]).rest(q.create()),returns:n||q.create(),typeName:_.ZodFunction,...S(r)})}},ue=class extends x{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ue.create=(t,e)=>new ue({getter:t,typeName:_.ZodLazy,...S(e)});var le=class extends x{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}};le.create=(t,e)=>new le({value:t,typeName:_.ZodLiteral,...S(e)});function Un(t,e){return new de({values:t,typeName:_.ZodEnum,...S(e)})}var de=class t extends x{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:C.joinValues(r),received:n.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:r}),y}return I(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};de.create=Un;var fe=class extends x{_parse(e){let n=C.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==m.string&&r.parsedType!==m.number){let i=C.objectValues(n);return p(r,{expected:C.joinValues(i),received:r.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=C.objectValues(n);return p(r,{received:r.data,code:d.invalid_enum_value,options:i}),y}return I(e.data)}get enum(){return this._def.values}};fe.create=(t,e)=>new fe({values:t,typeName:_.ZodNativeEnum,...S(e)});var X=class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.promise&&n.common.async===!1)return p(n,{code:d.invalid_type,expected:m.promise,received:n.parsedType}),y;let r=n.parsedType===m.promise?n.data:Promise.resolve(n.data);return I(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};X.create=(t,e)=>new X({type:t,typeName:_.ZodPromise,...S(e)});var j=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{p(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return y;let l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?y:l.status==="dirty"?ee(l.value):n.value==="dirty"?ee(l.value):l});{if(n.value==="aborted")return y;let o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?y:o.status==="dirty"?ee(o.value):n.value==="dirty"?ee(o.value):o}}if(i.type==="refinement"){let s=o=>{let l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?y:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!W(s))return y;let o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>W(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):y);C.assertNever(i)}};j.create=(t,e,n)=>new j({schema:t,typeName:_.ZodEffects,effect:e,...S(n)});j.createWithPreprocess=(t,e,n)=>new j({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...S(n)});var N=class extends x{_parse(e){return this._getType(e)===m.undefined?I(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(t,e)=>new N({innerType:t,typeName:_.ZodOptional,...S(e)});var z=class extends x{_parse(e){return this._getType(e)===m.null?I(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};z.create=(t,e)=>new z({innerType:t,typeName:_.ZodNullable,...S(e)});var pe=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===m.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});var me=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Te(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new R(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new R(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};me.create=(t,e)=>new me({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});var Oe=class extends x{_parse(e){if(this._getType(e)!==m.nan){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.nan,received:r.parsedType}),y}return{status:"valid",value:e.data}}};Oe.create=t=>new Oe({typeName:_.ZodNaN,...S(t)});var Ri=Symbol("zod_brand"),ze=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Ue=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?y:a.status==="dirty"?(n.dirty(),ee(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:_.ZodPipeline})}},ge=class extends x{_parse(e){let n=this._def.innerType._parse(e),r=i=>(W(i)&&(i.value=Object.freeze(i.value)),i);return Te(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};ge.create=(t,e)=>new ge({innerType:t,typeName:_.ZodReadonly,...S(e)});function $n(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Kn(t,e={},n){return t?J.create().superRefine((r,i)=>{let a=t(r);if(a instanceof Promise)return a.then(s=>{if(!s){let o=$n(e,r),l=o.fatal??n??!0;i.addIssue({code:"custom",...o,fatal:l})}});if(!a){let s=$n(e,r),o=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:o})}}):J.create()}var Pi={object:P.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var Ai=(t,e={message:`Input not instance of ${t.name}`})=>Kn(n=>n instanceof t,e),Hn=Y.create,qn=te.create,Oi=Oe.create,Mi=ne.create,Zn=re.create,Ni=ie.create,Vi=Ie.create,ji=ae.create,Di=se.create,Fi=J.create,$i=q.create,Li=F.create,Gi=Re.create,zi=Z.create,Ui=P.create,Ki=P.strictCreate,Hi=oe.create,qi=st.create,Zi=ce.create,Bi=G.create,Wi=ot.create,Yi=Pe.create,Ji=Ae.create,Xi=ct.create,Qi=ue.create,ea=le.create,ta=de.create,na=fe.create,ra=X.create,ia=j.create,aa=N.create,sa=z.create,oa=j.createWithPreprocess,ca=Ue.create,ua=()=>Hn().optional(),la=()=>qn().optional(),da=()=>Zn().optional(),fa={string:(t=>Y.create({...t,coerce:!0})),number:(t=>te.create({...t,coerce:!0})),boolean:(t=>re.create({...t,coerce:!0})),bigint:(t=>ne.create({...t,coerce:!0})),date:(t=>ie.create({...t,coerce:!0}))};var pa=y;var ut=c.object({page:c.object({title:c.string().nullable(),path:c.string(),search:c.string(),hash:c.string()}).strict(),referrer:c.string().nullable(),viewport:c.object({w:c.number(),h:c.number()}).strict().nullable().optional()}).strict(),Bn=c.object({}).strict();var Wt="aranova_tracking_last_fired_url",Zt=null,Bt=!1;function ma(t){try{return typeof window>"u"?null:window.sessionStorage.getItem(t)}catch{return null}}function ga(t,e){try{if(typeof window>"u")return;window.sessionStorage.setItem(t,e)}catch{}}function ha(){if(!Bt){Bt=!0;let t=ma(Wt);t!==null&&(Zt=t)}return Zt}function ya(t){Zt=t,Bt=!0,ga(Wt,t)}function Wn(t){return typeof window>"u"||typeof document>"u"?null:ut.parse({page:{title:document.title||null,path:window.location.pathname,search:window.location.search,hash:window.location.hash},referrer:t!==void 0?t:document.referrer||null,viewport:{w:window.innerWidth,h:window.innerHeight}})}function Ke(t){if(typeof window>"u")return;let e=window.location.href,n=ha(),r=n!==null&&n!==e?n:null,i=typeof document<"u"&&document.referrer||null,s=Wn(r??i);t.trackEvent({eventType:"page_view",pageUrl:e,metadata:s}),e!==n&&ya(e)}function Yt(t){if(typeof window>"u")return()=>{};function e(n){n.persisted&&Ke(t)}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}}function Jt(t,e={}){if(typeof window>"u"||typeof history>"u")return()=>{};let n=window.location.pathname+window.location.search;function r(){let u=window.location.pathname+window.location.search;u!==n&&(n=u,Ke(t))}let i=history.pushState.bind(history),a=history.replaceState.bind(history);function s(...u){i(...u),setTimeout(r,0)}function o(...u){a(...u),setTimeout(r,0)}function l(u){u.persisted&&Ke(t)}return history.pushState=s,history.replaceState=o,window.addEventListener("popstate",r),window.addEventListener("pageshow",l),e.skipInitial||Ke(t),()=>{history.pushState=i,history.replaceState=a,window.removeEventListener("popstate",r),window.removeEventListener("pageshow",l)}}function lt(t){if(t instanceof RegExp)return t.source;if(Array.isArray(t))return t.map(lt);if(t!==null&&typeof t=="object"){let e={};for(let[n,r]of Object.entries(t))e[n]=lt(r);return e}return t}function Xt(t,e,n,r,i=null){let a=r?Object.keys(r.automatic):[],s=r?.manual?Object.keys(r.manual):[],o=null;if(r){let l={};for(let[u,f]of Object.entries(r.automatic)){let h=lt(f);Object.keys(h).length>0&&(l[u]=h)}if(r.manual)for(let[u,f]of Object.entries(r.manual)){if(f===void 0)continue;let h=lt(f);Object.keys(h).length>0&&(l[u]=h)}Object.keys(l).length>0&&(o=l)}return{sdk_version:e??"unknown",package_name:n,surface:t,triggers:{automatic:a,manual:s},trigger_config:o,configured_gtag_ids:i}}var Jn=2e3,Xn=10,dt=50,ft="X-Aranova-Api-Key",pt="X-Aranova-Sdk-Version",mt="X-Aranova-Sdk-Package",gt="X-Aranova-Sdk-Surface",ht="X-Aranova-Sdk-Environment";function va(t,e,n,r,i){return{surface:t,sdk_version:e,package_name:n,site_origin:typeof window>"u"?null:window.location.origin,page_title:typeof document>"u"?null:document.title||null,referrer:typeof document>"u"?null:document.referrer||null,environment:r,active_gtag_ids:i}}function Sa(){if(typeof window>"u")return _e();try{Q()}catch{}return ve(xe)}function xa(){try{return{state:O()}}catch{return null}}async function Yn(t,e,n,r,i){if(typeof fetch=="function")try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",[ft]:n,[pt]:r.sdkVersion,[mt]:r.packageName,[gt]:r.surface,[ht]:r.environment},body:e,keepalive:i,credentials:"omit",mode:"cors"})}catch{}}function Qt(t){let e=t.flushIntervalMs??Jn,n=Math.min(t.maxQueueSize??Xn,dt),r=t.sdkVersion??null,i=t.packageName??null,a=t.environment??"production",s=t.activeGtagIds??null,l=`${t.endpoint.replace(/\/$/,"")}/events`,u={sdkVersion:r??"",packageName:i??"",surface:t.surface,environment:a},f=[],h=null,b=null,w=_e(),v=!1,T=Ut(),B=ke(),$=B.id;if(typeof window<"u"){b=window.location.href;try{w=Q()}catch{}try{Fe()}catch{}}function Me(){let k=Xt(t.surface,r,i,t.triggers??null,s);f.push({event_type:"sdk_heartbeat",page_url:typeof window>"u"?null:window.location.href,metadata:k,occurred_at:new Date().toISOString()})}B.isNew&&Me();function Ne(){let k=ke();k.isNew&&k.id!==$&&Me(),$=k.id;let A=Ct(Sa(),w),je=va(t.surface,r,i,a,s);return{session_id:$,visitor_id:T,gclid:A.gclid,fbclid:A.fbclid,fbc:De(),fbp:et(),utm_source:A.utm_source,utm_medium:A.utm_medium,utm_campaign:A.utm_campaign,utm_term:A.utm_term,utm_content:A.utm_content,first_page:b,consent_state:xa(),context:je}}function qe(){h!==null||v||(h=setTimeout(()=>{h=null,Ve()},e))}function he(){h!==null&&(clearTimeout(h),h=null)}async function Ve(){if(f.length===0)return;let k=f.slice(0,dt);f=f.slice(k.length),he();let A={session:Ne(),events:k},je=JSON.stringify(A);await Yn(l,je,t.apiKey,u,!1)}function Ar(k){if(v||!k||typeof k.eventType!="string"||k.eventType.length===0)return;let A=k.occurredAt instanceof Date?k.occurredAt.toISOString():typeof k.occurredAt=="string"?k.occurredAt:new Date().toISOString();f.push({event_type:k.eventType,page_url:k.pageUrl??(typeof window>"u"?null:window.location.href),metadata:k.metadata??null,occurred_at:A}),f.length>=n?Ve():qe()}function Ze(){if(f.length===0)return;let k=f.slice(0,dt);f=f.slice(k.length),he();let A={session:Ne(),events:k},je=JSON.stringify(A);Yn(l,je,t.apiKey,u,!0)}return typeof window<"u"&&(window.addEventListener("pagehide",Ze),window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ze()})),{trackEvent:Ar,flush:Ve,getSessionId:()=>$,getVisitorId:()=>T,destroy:()=>{v=!0,f.length>0&&Ze(),he(),f=[],typeof window<"u"&&window.removeEventListener("pagehide",Ze)}}}var Qn=c.object({cta_name:c.string(),page:c.object({path:c.string()}).strict(),section:c.string().nullable().optional(),destination_url:c.string().nullable().optional()}).strict(),er=c.object({}).strict();var ba=c.object({automatic:c.array(c.string()),manual:c.array(c.string())}).strict(),tr=c.object({sdk_version:c.string(),package_name:c.string().nullable(),surface:c.enum(["next","react","script"]),triggers:ba,trigger_config:c.record(c.string(),c.record(c.string(),c.unknown())).nullable().optional(),configured_gtag_ids:c.record(c.string(),c.string()).nullable().optional()}).strict(),nr=c.object({}).strict();var rr=c.object({form:c.object({id:c.string(),action:c.string().nullable()}).strict(),page:c.object({path:c.string()}).strict()}).strict(),ir=c.object({selector:c.string().optional()}).strict();var en=c.lazy(()=>c.union([c.string(),c.number().finite(),c.boolean(),c.null(),c.array(en),c.record(en)])),ar=c.object({form:c.object({id:c.string(),action:c.string().nullable(),fields:c.array(c.object({name:c.string(),type:c.string(),label:c.string().nullable(),value:en}).strict()).optional()}).strict(),page:c.object({path:c.string()}).strict()}).strict(),sr=c.object({}).strict();var or=c.object({page_count:c.number().int().min(2),page:c.object({path:c.string()}).strict()}).strict(),cr=c.object({pageThreshold:c.number().int().min(2)}).strict();var ur=c.object({phone_number:c.string(),page:c.object({path:c.string()}).strict(),section:c.string().nullable().optional()}).strict(),lr=c.object({}).strict();var dr=c.object({depth_percent:c.number().int().min(1).max(100),page:c.object({path:c.string()}).strict()}).strict(),fr=c.object({thresholds:c.array(c.number().int().min(1).max(100)).min(1)}).strict();var Ca=["contact_page","about_page","services_page","booking_page","location_page","pricing_page","faq_page","testimonials_page"],pr=c.enum(Ca),mr=c.object({page_name:pr,page:c.object({path:c.string()}).strict()}).strict(),gr=c.object({pages:c.array(c.object({name:pr,pathPattern:c.custom(t=>t instanceof RegExp,{message:"pathPattern must be a RegExp"})}).strict()).min(1)}).strict();var hr=c.object({duration_ms:c.number().int().nonnegative(),page:c.object({path:c.string()}).strict()}).strict(),yr=c.object({thresholdSeconds:c.number().int().positive()}).strict();var tn={page_view:{kind:"automatic",metadataSchema:ut,configSchema:Bn},time_on_site:{kind:"automatic",metadataSchema:hr,configSchema:yr},specific_page_visit:{kind:"automatic",metadataSchema:mr,configSchema:gr},scroll_depth:{kind:"automatic",metadataSchema:dr,configSchema:fr},multi_page_session:{kind:"automatic",metadataSchema:or,configSchema:cr},form_start:{kind:"automatic",metadataSchema:rr,configSchema:ir},sdk_heartbeat:{kind:"automatic",metadataSchema:tr,configSchema:nr},form_submit:{kind:"manual",metadataSchema:ar,configSchema:sr},phone_click:{kind:"manual",metadataSchema:ur,configSchema:lr},cta_click:{kind:"manual",metadataSchema:Qn,configSchema:er}},vo=Object.entries(tn).filter(([,t])=>t.kind==="automatic").map(([t])=>t),So=Object.entries(tn).filter(([,t])=>t.kind==="manual").map(([t])=>t);function nn(t){return tn[t]}function rn(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=e.thresholdSeconds*1e3,r=0,i=document.visibilityState==="visible"?Date.now():null,a=null,s=!1;function o(){s||(s=!0,t.trackEvent({eventType:"time_on_site",metadata:{duration_ms:n,page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}function l(){if(s||i===null)return;let h=n-r;if(h<=0){o();return}a=setTimeout(o,h)}function u(){a!==null&&(clearTimeout(a),a=null)}function f(){s||(document.visibilityState==="hidden"?(i!==null&&(r+=Date.now()-i,i=null),u()):(i=Date.now(),l()))}return document.addEventListener("visibilitychange",f),l(),()=>{u(),document.removeEventListener("visibilitychange",f)}}function an(t,e){if(typeof window>"u"||typeof history>"u")return()=>{};let{pages:n}=e,r=new Set;function i(){let u=window.location.pathname;for(let{name:f,pathPattern:h}of n){if(h.lastIndex=0,!h.test(u))continue;let b=`${f}:${u}`;r.has(b)||(r.add(b),t.trackEvent({eventType:"specific_page_visit",metadata:{page_name:f,page:{path:u}},pageUrl:window.location.href,occurredAt:null}))}}let a=history.pushState.bind(history),s=history.replaceState.bind(history);function o(...u){a(...u),setTimeout(i,0)}function l(...u){s(...u),setTimeout(i,0)}return history.pushState=o,history.replaceState=l,window.addEventListener("popstate",i),i(),()=>{history.pushState=a,history.replaceState=s,window.removeEventListener("popstate",i)}}function sn(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=new Set(e.thresholds),r=new Set,i=window.location.pathname,a=null;function s(){let v=document.documentElement,T=window.scrollY||v.scrollTop,B=v.scrollHeight,$=v.clientHeight;return B<=$?100:Math.round((T+$)/B*100)}function o(){let v=s();for(let T of n)v>=T&&!r.has(T)&&(r.add(T),t.trackEvent({eventType:"scroll_depth",metadata:{depth_percent:T,page:{path:i}},pageUrl:window.location.href,occurredAt:null}))}function l(){a===null&&(a=requestAnimationFrame(()=>{a=null,o()}))}function u(){let v=window.location.pathname;v!==i&&(i=v,r=new Set,setTimeout(o,0))}let f=history.pushState.bind(history),h=history.replaceState.bind(history);function b(...v){f(...v),setTimeout(u,0)}function w(...v){h(...v),setTimeout(u,0)}return history.pushState=b,history.replaceState=w,window.addEventListener("popstate",u),window.addEventListener("scroll",l,{passive:!0}),setTimeout(o,0),()=>{a!==null&&cancelAnimationFrame(a),history.pushState=f,history.replaceState=h,window.removeEventListener("popstate",u),window.removeEventListener("scroll",l)}}var on="aranova_tracking_mps_paths",_r="aranova_tracking_mps_session",cn="aranova_tracking_mps_fired";function ka(){try{return typeof window<"u"?window.sessionStorage:null}catch{return null}}function un(t,e){if(typeof window>"u"||typeof history>"u")return()=>{};let n=ka();if(!n)return()=>{};let{pageThreshold:r}=e,i="";function a(){try{let v=n.getItem(on);return v?new Set(JSON.parse(v)):new Set}catch{return new Set}}function s(v){try{n.setItem(on,JSON.stringify([...v]))}catch{}}function o(){let v=ke().id;n.getItem(_r)!==v&&(n.setItem(_r,v),n.removeItem(on),n.removeItem(cn))}function l(){return n.getItem(cn)==="1"}function u(){let v=window.location.pathname;if(v===i||(i=v,o(),l()))return;let T=a();T.add(v),s(T),T.size>=r&&(n.setItem(cn,"1"),t.trackEvent({eventType:"multi_page_session",metadata:{page_count:T.size,page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}let f=history.pushState.bind(history),h=history.replaceState.bind(history);function b(...v){f(...v),setTimeout(u,0)}function w(...v){h(...v),setTimeout(u,0)}return history.pushState=b,history.replaceState=w,window.addEventListener("popstate",u),u(),()=>{history.pushState=f,history.replaceState=h,window.removeEventListener("popstate",u)}}function ln(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=e.selector??"form",r=new Set,i=window.location.pathname;function a(b){if(b.id)return`id:${b.id}`;let w=b.getAttribute("action");return w?`action:${w}`:`index:${Array.from(document.querySelectorAll(n)).indexOf(b)}`}function s(b){let w=b.target;if(!(w instanceof HTMLElement))return;let v=w.closest(n);if(!v||v.tagName!=="FORM")return;let T=a(v);r.has(T)||(r.add(T),t.trackEvent({eventType:"form_start",metadata:{form:{id:v.id||"",action:v.getAttribute("action")??null},page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}function o(){let b=window.location.pathname;b!==i&&(i=b,r=new Set)}let l=history.pushState.bind(history),u=history.replaceState.bind(history);function f(...b){l(...b),setTimeout(o,0)}function h(...b){u(...b),setTimeout(o,0)}return history.pushState=f,history.replaceState=h,window.addEventListener("popstate",o),document.addEventListener("focusin",s),()=>{history.pushState=l,history.replaceState=u,window.removeEventListener("popstate",o),document.removeEventListener("focusin",s)}}var yt=class extends Error{constructor(e,n){super(e),this.name="AranovaApiError",this.status=n.status,this.code=n.code,this.requestId=n.requestId}};function wa(t){let e={[ft]:t.apiKey};return t.sdkVersion&&(e[pt]=t.sdkVersion),t.packageName&&(e[mt]=t.packageName),t.surface&&(e[gt]=t.surface),t.environment&&(e[ht]=t.environment),e}function Ta(t,e){return`${t.replace(/\/$/,"")}${e}`}async function D(t,e,n,r){let i=wa(t);r!==void 0&&(i["Content-Type"]="application/json");let a=await fetch(Ta(t.endpoint,n),{method:e,headers:i,body:r===void 0?void 0:JSON.stringify(r)});if(!a.ok){let s,o;try{let l=await a.json();if(l&&typeof l=="object"){let u=l;typeof u.detail=="string"&&(s=u.detail),typeof u.code=="string"&&(o=u.code)}}catch{}throw new yt(s??a.statusText??"Request failed",{status:a.status,code:o,requestId:a.headers.get("x-request-id")??void 0})}if(a.status!==204)return await a.json()}function Ea(t,e,n,r,i){if(!t)return;let a=e.external_id??r.id;for(let s of n){if(!s.service)continue;let o=t.getFiring(s.service);if(!o)continue;let l=s.amount_cents??o.value_cents??null;Ce({sendTo:o.send_to,value:l!=null?Le(l,i):null,currency:o.currency??i,transactionId:`${a}:${s.service}`})}}function vr(t){async function e(n){let r=n.currency??t.defaultCurrency;if(!r)throw new Error("record: `currency` is required (pass it on the sale or set config.defaultCurrency)");let i={...n,currency:r,occurred_at:n.occurred_at??new Date().toISOString()},a=await D(t,"POST","/sales",i),s=n.services?.length?n.services.map(o=>({service:o.service,amount_cents:o.amount_cents})):[{service:n.service,amount_cents:n.amount_total_cents??null}];return Ea(t.firing,n,s,a,r),a}return{record:e,recordSale:e,trackConversion(n,r){let i=t.firing?.getFiring(n);if(!i)return;let a=i.currency??r?.currency??t.defaultCurrency??null,s=i.value_cents??null,o=r?.value??(s!=null&&a?Le(s,a):null);Ce({sendTo:i.send_to,value:o,currency:a,transactionId:r?.transactionId??null})},async list(n){let{cursor:r,limit:i,sort:a,order:s,want_total:o,...l}=n??{};return D(t,"POST","/sales/query",{filters:l,...i!==void 0?{limit:i}:{},...r!==void 0?{cursor:r}:{},...a!==void 0?{sort:a}:{},...s!==void 0?{order:s}:{},...o!==void 0?{want_total:o}:{}})},async summary(n){let{range:r,include_categories:i,include_deleted_services:a,top_n:s,since:o,until:l,timezone:u,granularity:f,compare_to:h,...b}=n;return D(t,"POST","/sales/summary",{filters:b,...r!==void 0?{range:r}:{},...i!==void 0?{include_categories:i}:{},...a!==void 0?{include_deleted_services:a}:{},...s!==void 0?{top_n:s}:{},...o!==void 0?{since:o}:{},...l!==void 0?{until:l}:{},...u!==void 0?{timezone:u}:{},...f!==void 0?{granularity:f}:{},...h!==void 0?{compare_to:h}:{}})},async get(n){return D(t,"GET",`/sales/${n}`)},async update(n,r){return D(t,"PATCH",`/sales/${n}`,r)},async delete(n){await D(t,"DELETE",`/sales/${n}`)},customers:{async list(n){let{segment:r,sort:i,order:a,cursor:s,limit:o,want_total:l,...u}=n??{};return D(t,"POST","/customers/query",{filters:u,...r!==void 0?{segment:r}:{},...i!==void 0?{sort:i}:{},...a!==void 0?{order:a}:{},...s!==void 0?{cursor:s}:{},...o!==void 0?{limit:o}:{},...l!==void 0?{want_total:l}:{}})},async get(n,r){let i=new URLSearchParams;r?.include_sales!==void 0&&i.set("include_sales",String(r.include_sales)),r?.limit!==void 0&&i.set("limit",String(r.limit)),r?.cursor!=null&&i.set("cursor",r.cursor);let a=i.toString();return D(t,"GET",`/customers/${encodeURIComponent(n)}${a?`?${a}`:""}`)},async summary(n){let{range:r,since:i,until:a,timezone:s,compare_to:o,...l}=n??{};return D(t,"POST","/customers/summary",{filters:l,...r!==void 0?{range:r}:{},...i!==void 0?{since:i}:{},...a!==void 0?{until:a}:{},...s!==void 0?{timezone:s}:{},...o!==void 0?{compare_to:o}:{}})}},business:{async config(){return D(t,"GET","/business/config")}}}}var Ia=["USD","CAD"],Ra=["production","development"],Sr=c.enum(Ia),He=c.number().int().nonnegative(),Pa=c.string().regex(/^\d+(\.\d{1,3})?$/),xr=c.record(c.unknown()),br=c.object({external_item_id:c.string().nullable().optional(),name:c.string().nullable().optional(),category:c.string().nullable().optional(),quantity:Pa,unit_price_cents:He,unit_cost_cents:He.nullable().optional()}).strict(),Cr=c.object({service:c.string(),amount_cents:He}).strict(),kr=c.string().max(200),wr=c.string().max(64),Tr=c.string().max(320).email();function Er(t,e,{requireAmount:n}){if(t.services!=null){t.service!=null&&e.addIssue({code:c.ZodIssueCode.custom,message:"pass either `service` or `services`, not both",path:["services"]}),t.services.length===0&&e.addIssue({code:c.ZodIssueCode.custom,message:"`services` must not be empty",path:["services"]});let r=t.services.map(i=>i.service);if(new Set(r).size!==r.length&&e.addIssue({code:c.ZodIssueCode.custom,message:"`services` must not list the same service more than once",path:["services"]}),t.amount_total_cents!=null){let i=t.services.reduce((a,s)=>a+s.amount_cents,0);t.amount_total_cents!==i&&e.addIssue({code:c.ZodIssueCode.custom,message:"amount_total_cents must equal the sum of the services amounts (omit it to derive it automatically)",path:["amount_total_cents"]})}}else n&&t.amount_total_cents==null&&e.addIssue({code:c.ZodIssueCode.custom,message:"amount_total_cents is required unless `services` is provided",path:["amount_total_cents"]})}var $o=c.object({external_id:c.string().nullable().optional(),description:c.string().nullable().optional(),service:c.string().nullable().optional(),services:c.array(Cr).nullable().optional(),currency:Sr,amount_total_cents:He.nullable().optional(),occurred_at:c.string().datetime(),environment:c.enum(Ra).default("production"),items:c.array(br).default([]),metadata:xr.nullable().optional(),customer_name:kr.nullable().optional(),customer_phone:wr.nullable().optional(),customer_email:Tr.nullable().optional()}).strict().superRefine((t,e)=>Er(t,e,{requireAmount:!0})),Lo=c.object({description:c.string().nullable().optional(),service:c.string().nullable().optional(),services:c.array(Cr).nullable().optional(),currency:Sr.optional(),amount_total_cents:He.optional(),occurred_at:c.string().datetime().optional(),items:c.array(br).optional(),metadata:xr.nullable().optional(),customer_name:kr.nullable().optional(),customer_phone:wr.nullable().optional(),customer_email:Tr.nullable().optional()}).strict().superRefine((t,e)=>Er(t,e,{requireAmount:!1}));var dn="aranova-tracking-consent-banner";function Oa(){return ve(xe)}function Ir(){document.querySelector(`#${dn}`)?.remove()}function Rr(t,e,n){let r=document.createElement("button");return r.type="button",r.textContent=t,Object.assign(r.style,{borderRadius:"6px",padding:"10px 16px",fontSize:"14px",fontWeight:"600",cursor:"pointer",border:"1px solid #d1d5db",background:"#ffffff",color:"#374151"},n),r.addEventListener("click",e),r}function Ma(){if(typeof document>"u"||O()!=="pending"||document.querySelector(`#${dn}`))return;let t=document.createElement("div");t.id=dn,Object.assign(t.style,{position:"fixed",left:"0",right:"0",bottom:"0",zIndex:"2147483647",background:"#ffffff",borderTop:"1px solid #e5e7eb",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.12)",padding:"16px",fontFamily:"Inter, system-ui, sans-serif"});let e=document.createElement("div");Object.assign(e.style,{maxWidth:"960px",margin:"0 auto",display:"flex",flexDirection:"column",gap:"12px"});let n=document.createElement("p");n.textContent="We use cookies to understand ad performance and improve how our marketing works across visits. You can accept or decline this tracking.",Object.assign(n.style,{margin:"0",color:"#374151",fontSize:"14px",lineHeight:"1.5"});let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"8px",flexWrap:"wrap"});let i=Rr("Decline",()=>{ye("denied"),Ir()},{}),a=Rr("Accept",()=>{ye("granted"),Ir()},{background:"#111827",color:"#ffffff",border:"1px solid #111827"});r.append(i),r.append(a),e.append(n),e.append(r),t.append(e),document.body.append(t)}var M=null,fn=null,U=[],_t=null;function Na(){for(let t=U.length-1;t>=0;t--)U[t]();U=[],M!==null&&(M.destroy(),M=null),fn=null,_t=null}function Pr(t={}){if(typeof window>"u")return;window.AranovaTracking=pn;let{apiKey:e,endpoint:n,autoCaptureTrackingParams:r=!0,cookieMaxAgeSeconds:i=7776e3,gtagId:a,gtagIds:s,metaPixelId:o,metaPixelIds:l,environment:u,renderConsentBanner:f=!0,triggers:h,conversionConfig:b}=t;if(r&&Q(window.location.href,i),s&&Object.keys(s).length>0?Rt(s):a&&It(a),l&&Object.keys(l).length>0?jt(l):o&&Vt(o),f&&Ma(),Na(),!e||!n){(e||n)&&console.warn("[AranovaTracking] init() requires both `apiKey` and `endpoint` to enable first-party event ingest. Page-view events will not be sent.");return}let w=b?Ft({cdnUrl:b.cdnUrl,baked:b.baked}):null;_t=vr({apiKey:e,endpoint:n,firing:w??void 0});let v=h??{automatic:{page_view:{}},manual:{}};fn=v;let T=s?Object.fromEntries(Object.entries(s).filter(Ve=>Ve[1]!=null)):a?{default:a}:void 0,B=Qt({apiKey:e,endpoint:n,surface:"script",packageName:"@aranova/tracking-browser",sdkVersion:gn,triggers:v,environment:u,activeGtagIds:T});M=w?Lt(B,$t(w)):B,U.push(Jt(M)),U.push(Yt(M));let $=v.automatic.time_on_site;$&&U.push(rn(M,$));let Me=v.automatic.specific_page_visit;Me&&U.push(an(M,Me));let Ne=v.automatic.scroll_depth;Ne&&U.push(sn(M,Ne));let qe=v.automatic.multi_page_session;qe&&U.push(un(M,qe));let he=v.automatic.form_start;he&&U.push(ln(M,he))}function Va(t,e){if(M===null){console.warn("[AranovaTracking] trackEvent called before init({ apiKey, endpoint })");return}let n=fn;if(n===null){console.warn("[AranovaTracking] trackEvent called but no trigger registry was passed to init()");return}let r=n.manual??{};if(!(t in r)){console.warn(`[AranovaTracking] trackEvent: event "${t}" is not registered as a manual trigger. Register it under \`triggers.manual\` in init().`);return}try{nn(t).metadataSchema.parse(e)}catch(i){console.warn(`[AranovaTracking] trackEvent: metadata for "${t}" failed schema validation`,i);return}M.trackEvent({eventType:t,metadata:e,pageUrl:null,occurredAt:null})}function ja(){if(_t===null)throw new Error("[AranovaTracking] sales() called before init({ apiKey, endpoint })");return _t}var pn={init:Pr,captureTrackingParams:()=>Q(),getTrackingParams:Oa,getConsentState:O,setConsentState:ye,trackEvent:Va,sales:ja};typeof window<"u"&&(window.AranovaTracking=pn);var Da=pn;return jr(Fa);})();
|
|
1
|
+
"use strict";var AranovaTracking=(()=>{var vt=Object.defineProperty;var Or=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Mr=Object.prototype.hasOwnProperty;var mn=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},Vr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nr(e))!Mr.call(t,i)&&i!==n&&vt(t,i,{get:()=>e[i],enumerable:!(r=Or(e,i))||r.enumerable});return t};var jr=t=>Vr(vt({},"__esModule",{value:!0}),t);var Fa={};mn(Fa,{default:()=>Da,init:()=>Pr});var gn="0.14.2";var xt="consent_state",hn="consent_timestamp",St=new Set;function yn(t){return St.add(t),()=>{St.delete(t)}}function Ct(t){return{ad_storage:t,ad_user_data:t,ad_personalization:t,analytics_storage:t}}function O(){if(typeof window>"u")return"pending";try{let t=window.localStorage.getItem(xt);if(t==="granted"||t==="denied")return t}catch{}return"pending"}function ye(t){if(!(typeof window>"u")){try{window.localStorage.setItem(xt,t),window.localStorage.setItem(hn,new Date().toISOString())}catch{}if(typeof window.gtag=="function"&&window.gtag("consent","update",Ct(t)),typeof window.fbq=="function"&&window.fbq("consent",t==="granted"?"grant":"revoke"),t==="granted")for(let e of St)try{e()}catch{}}}function Be(){let t=O();return(t==="granted"||t==="denied")&&ye(t),t}var Ye=["gclid","fbclid","utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function _e(){return{gclid:null,fbclid:null,utm_source:null,utm_medium:null,utm_campaign:null,utm_term:null,utm_content:null}}function We(t){return typeof t=="string"&&t.length>0?t:null}function ve(t){return Ye.reduce((e,n)=>(e[n]=We(t(n)),e),_e())}function _n(t){return Ye.reduce((e,n)=>{let r=t.get(n);return typeof r=="string"&&r.trim().length>0&&(e[n]=r),e},{})}var Fr="_aranova_track_";function vn(t){return`${Fr}${t}`}function Qe(t,e,n=7776e3){let r=encodeURIComponent(e);if(typeof document<"u")try{document.cookie=`${t}=${r}; Max-Age=${n}; Path=/; SameSite=Lax`}catch{}if(typeof window<"u")try{window.localStorage.setItem(vn(t),r)}catch{}}function Se(t){if(typeof document<"u"){let n=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(`${t}=`));if(n){let[,r=""]=n.split("=");return We(decodeURIComponent(r))}}if(typeof window<"u")try{let e=window.localStorage.getItem(vn(t));if(e)return We(decodeURIComponent(e))}catch{}return null}function xe(t){return Se(t)}function Sn(t,e,n=7776e3){Qe(t,e,n)}function bt(t,e){return Ye.reduce((n,r)=>(n[r]=t[r]??e[r],n),_e())}function xn(t,e=7776e3){let n=_n(t);return Object.entries(n).forEach(([r,i])=>{Sn(r,i,e)}),n}function J(t=typeof window>"u"?"":window.location.href,e=7776e3){let n=typeof window>"u"?new URL(t||"https://example.invalid"):new URL(t,window.location.origin);return xn(n.searchParams,e),ve(xe)}var Cn="https://www.googletagmanager.com/gtag/js",Ce="data-aranova-tracking";function Gr(t){return`aranova-${t}`}var Lr=/^[A-Z]{1,3}-[A-Za-z0-9_-]+$/;function kt(t){return Lr.test(t)}function Xe(){if(window.dataLayer=window.dataLayer||[],typeof window.gtag=="function")return window.gtag;function t(){window.dataLayer?.push(arguments)}return window.gtag=t,window.gtag}var $r=/^AW-[A-Za-z0-9]+\/[A-Za-z0-9_-]+$/;function bn(t){return $r.test(t)}function wt(t){if(typeof window>"u"||typeof window.gtag!="function"||!bn(t.sendTo))return!1;let e={send_to:t.sendTo};t.value!=null&&(e.value=t.value),t.currency&&(e.currency=t.currency),t.transactionId&&(e.transaction_id=t.transactionId);try{return window.gtag("event","conversion",e),!0}catch{return!1}}function Tt(){Xe()("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",wait_for_update:500})}function Et(t){if(typeof document>"u")return;let e=Gr("gtag-loader");if(document.querySelector(`script[${Ce}="${e}"]`))return;let r=document.createElement("script");r.async=!0,r.src=`${Cn}?id=${encodeURIComponent(t)}`,r.setAttribute(Ce,e),document.head.append(r)}function kn(t){let e=Xe();e("js",new Date),e("config",t)}function It(t){typeof window>"u"||typeof document>"u"||kt(t)&&(Tt(),Et(t),kn(t),Be())}function Rt(t){if(typeof window>"u"||typeof document>"u")return;let e=Object.values(t).filter(r=>typeof r=="string"&&kt(r));if(e.length===0)return;Tt(),Et(e[0]);let n=Xe();n("js",new Date);for(let r of e)n("config",r);Be()}var wn="https://connect.facebook.net/en_US/fbevents.js",Pt="_fbc",Tn="_fbp",zr=/^\d{15,16}$/;function At(t){return zr.test(t)}function En(t){let e=t.split(".").filter(Boolean);return Math.max(0,e.length-1)}function In(t,e,n){let r=n??(typeof window>"u"?"":window.location.hostname);return`fb.${En(r)}.${e}.${t}`}function De(){return Se(Pt)}function et(){return Se(Tn)}function Kr(){if(typeof window>"u")return null;try{let t=new URL(window.location.href).searchParams.get("fbclid");return t&&t.trim().length>0?t:null}catch{return null}}function Fe(t=typeof Date>"u"?0:Date.now()){if(typeof window>"u"||De())return;let e=Kr()??Se("fbclid");e&&Qe(Pt,In(e,t),7776e3)}function Ur(t){return`aranova-${t}`}function tt(){let t=window;if(typeof t.fbq=="function")return t.fbq;let e=function(...n){e.callMethod?e.callMethod.apply(e,n):e.queue.push(n)};return e.push=e,e.loaded=!0,e.version="2.0",e.queue=[],t.fbq=e,t._fbq||(t._fbq=e),e}function Ot(){tt()("consent","revoke")}function Nt(){if(typeof document>"u")return;let t=Ur("fbq-loader");if(document.querySelector(`script[${Ce}="${t}"]`))return;let n=document.createElement("script");n.async=!0,n.src=wn,n.setAttribute(Ce,t),document.head.append(n)}function Rn(t){let e=tt();e("init",t),e("track","PageView")}function Mt(){if(typeof window>"u")return;let t=O();t==="granted"?window.fbq?.("consent","grant"):t==="denied"&&window.fbq?.("consent","revoke")}function Vt(t){typeof window>"u"||typeof document>"u"||At(t)&&(Ot(),Nt(),Rn(t),Mt(),Fe())}function jt(t){if(typeof window>"u"||typeof document>"u")return;let e=Object.values(t).filter(r=>typeof r=="string"&&At(r));if(e.length===0)return;Ot(),Nt();let n=tt();for(let r of e)n("init",r);n("track","PageView"),Mt(),Fe()}var Hr="_aranova_conv_",qr=100,Ge=[];function Pn(t){return`${Hr}${t.transactionId??""}:${t.sendTo}`}function Zr(t){if(!t.transactionId||typeof window>"u")return!1;try{return window.sessionStorage.getItem(Pn(t))!==null}catch{return!1}}function Br(t){if(!(!t.transactionId||typeof window>"u"))try{window.sessionStorage.setItem(Pn(t),"1")}catch{}}function An(t){Zr(t)||wt(t)&&Br(t)}function be(t){let e=O();if(e!=="denied"){if(e==="pending"){Ge.length>=qr&&Ge.shift(),Ge.push(t);return}An(t)}}function On(){if(O()==="granted")for(;Ge.length>0;){let t=Ge.shift();t&&An(t)}}typeof window<"u"&&yn(On);function Nn(t){return typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string")}function Mn(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.send_to!="string"?null:{send_to:e.send_to,value_cents:typeof e.value_cents=="number"?e.value_cents:null,currency:typeof e.currency=="string"?e.currency:null}}function Wr(t){if(!t||typeof t!="object")return null;let e=t;if(typeof e.event_type!="string")return null;let n={event_type:e.event_type};return typeof e.threshold_percent=="number"&&(n.threshold_percent=e.threshold_percent),typeof e.threshold_seconds=="number"&&(n.threshold_seconds=e.threshold_seconds),typeof e.page_threshold=="number"&&(n.page_threshold=e.page_threshold),typeof e.page_name=="string"&&(n.page_name=e.page_name),n}function Dt(t){if(!t||typeof t!="object")return null;let e=t,r=(Array.isArray(e.services)?e.services:[]).flatMap(s=>{if(!s||typeof s!="object")return[];let o=s;return typeof o.key!="string"?[]:[{key:o.key,label:typeof o.label=="string"?o.label:void 0,firing:Mn(o.firing)}]}),i=Array.isArray(e.goals)?e.goals:null,a=i?i.flatMap(s=>{if(!s||typeof s!="object")return[];let o=s;return typeof o.key!="string"?[]:[{key:o.key,label:typeof o.label=="string"?o.label:void 0,kind:o.kind==="event"?"event":"sale",trigger:Wr(o.trigger),firing:Mn(o.firing)}]}):r.map(s=>({key:s.key,label:s.label,kind:"sale",trigger:null,firing:s.firing}));return{schema_version:typeof e.schema_version=="number"?e.schema_version:1,config_version:typeof e.config_version=="number"?e.config_version:0,business_id:typeof e.business_id=="string"?e.business_id:void 0,customer_id:typeof e.customer_id=="string"?e.customer_id:null,environment:typeof e.environment=="string"?e.environment:void 0,gtag_ids:Nn(e.gtag_ids)?e.gtag_ids:{},meta_pixel_ids:Nn(e.meta_pixel_ids)?e.meta_pixel_ids:{},services:r,goals:a}}var Yr="_aranova_cfg_";function Vn(t){return`${Yr}${t}`}function Qr(t){if(typeof window>"u")return null;try{let e=window.sessionStorage.getItem(Vn(t));if(!e)return null;let n=JSON.parse(e),r=Dt(n.config);return r?{etag:typeof n.etag=="string"?n.etag:null,config:r}:null}catch{return null}}function Xr(t,e){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Vn(t),JSON.stringify(e))}catch{}}function Ft(t){let e=Qr(t.cdnUrl),n=e?.config??t.baked??null,r=e?.etag??null,i=new Map,a=new Set;function s(){i.clear();for(let f of n?.goals??[])i.set(f.key,f)}function o(){let f=[...a];a.clear();for(let h of f)try{h()}catch{}}function l(f,h){if(!f||n&&f.config_version<=n.config_version)return;let C=n===null;n=f,r=h,s(),Xr(t.cdnUrl,{etag:r,config:f}),C&&o()}async function u(){if(!(typeof window>"u"))try{let f=t.fetchImpl??globalThis.fetch;if(!f)return;let h={};r&&(h["If-None-Match"]=r);let C=await f(t.cdnUrl,{method:"GET",headers:h});if(C.status===304||!C.ok)return;l(Dt(await C.json()),C.headers.get("ETag"))}catch{}}return s(),u(),{getFiring:f=>i.get(f)?.firing??null,getGoal:f=>i.get(f)??null,listGoals:()=>[...i.values()],current:()=>n,isReady:()=>n!==null,onResolve:f=>n!==null?(f(),()=>{}):(a.add(f),()=>a.delete(f)),revalidate:u}}var Jr={USD:2,CAD:2};function ei(t){return Jr[t]??2}function Le(t,e){return t/10**ei(e)}function ti(t,e,n){let r=t.trigger;if(!r||r.event_type!==e)return!1;switch(e){case"scroll_depth":return typeof n.depth_percent=="number"&&r.threshold_percent!=null&&n.depth_percent>=r.threshold_percent;case"time_on_site":return typeof n.duration_ms=="number"&&r.threshold_seconds!=null&&n.duration_ms>=r.threshold_seconds*1e3;case"multi_page_session":return typeof n.page_count=="number"&&r.page_threshold!=null&&n.page_count>=r.page_threshold;case"specific_page_visit":return typeof n.page_name=="string"&&n.page_name===r.page_name;case"page_view":case"form_start":return!0;default:return!1}}function ni(){return typeof window>"u"?"":window.location.pathname}var ri=50;function Gt(t){let e=[],n=!1;function r(i,a){for(let s of t.listGoals()){if(s.kind!=="event"||!s.firing||!ti(s,i,a))continue;let o=s.firing,l=o.value_cents??null,u=o.currency??null;be({sendTo:o.send_to,value:l!=null&&u?Le(l,u):null,currency:u,transactionId:`auto:${s.key}:${ni()}`})}}return{onAutomaticEvent(i,a){if(t.isReady()){r(i,a);return}e.length<ri&&e.push({eventType:i,metadata:a}),n||(n=!0,t.onResolve(()=>{let s=e.splice(0);for(let o of s)r(o.eventType,o.metadata)}))}}}function Lt(t,e){return{...t,trackEvent:n=>{t.trackEvent(n);try{e.onAutomaticEvent(n.eventType,n.metadata??{})}catch{}}}}var $t="aranova_tracking_visitor",nt="aranova_tracking_session";function rt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}-${Math.random().toString(16).slice(2)}`}function jn(t){try{return window.localStorage.getItem(t)}catch{return null}}function zt(t,e){try{window.localStorage.setItem(t,e)}catch{}}function Kt(){if(typeof window>"u")return rt();let t=jn($t);if(t&&t.length>0)return t;let e=rt();return zt($t,e),e}function ke(t=Date.now()){if(typeof window>"u")return{id:rt(),isNew:!0};let e=jn(nt);if(e)try{let r=JSON.parse(e);if(typeof r.id=="string"&&typeof r.last_event_at=="number"&&t-r.last_event_at<=18e5){let i={id:r.id,last_event_at:t};return zt(nt,JSON.stringify(i)),{id:r.id,isNew:!1}}}catch{}let n={id:rt(),last_event_at:t};return zt(nt,JSON.stringify(n)),{id:n.id,isNew:!0}}var c={};mn(c,{BRAND:()=>Ri,DIRTY:()=>ee,EMPTY_PATH:()=>oi,INVALID:()=>y,NEVER:()=>pa,OK:()=>I,ParseStatus:()=>E,Schema:()=>x,ZodAny:()=>Q,ZodArray:()=>Z,ZodBigInt:()=>ne,ZodBoolean:()=>re,ZodBranded:()=>ze,ZodCatch:()=>me,ZodDate:()=>ie,ZodDefault:()=>pe,ZodDiscriminatedUnion:()=>st,ZodEffects:()=>j,ZodEnum:()=>de,ZodError:()=>R,ZodFirstPartyTypeKind:()=>_,ZodFunction:()=>ct,ZodIntersection:()=>ce,ZodIssueCode:()=>d,ZodLazy:()=>ue,ZodLiteral:()=>le,ZodMap:()=>Pe,ZodNaN:()=>Oe,ZodNativeEnum:()=>fe,ZodNever:()=>F,ZodNull:()=>se,ZodNullable:()=>z,ZodNumber:()=>te,ZodObject:()=>P,ZodOptional:()=>M,ZodParsedType:()=>m,ZodPipeline:()=>Ke,ZodPromise:()=>X,ZodReadonly:()=>ge,ZodRecord:()=>ot,ZodSchema:()=>x,ZodSet:()=>Ae,ZodString:()=>Y,ZodSymbol:()=>Ie,ZodTransformer:()=>j,ZodTuple:()=>$,ZodType:()=>x,ZodUndefined:()=>ae,ZodUnion:()=>oe,ZodUnknown:()=>q,ZodVoid:()=>Re,addIssueToContext:()=>p,any:()=>Fi,array:()=>zi,bigint:()=>Ni,boolean:()=>Zn,coerce:()=>fa,custom:()=>Un,date:()=>Mi,datetimeRegex:()=>zn,defaultErrorMap:()=>U,discriminatedUnion:()=>qi,effect:()=>ia,enum:()=>ta,function:()=>Xi,getErrorMap:()=>we,getParsedType:()=>L,instanceof:()=>Ai,intersection:()=>Zi,isAborted:()=>it,isAsync:()=>Te,isDirty:()=>at,isValid:()=>W,late:()=>Pi,lazy:()=>Ji,literal:()=>ea,makeIssue:()=>$e,map:()=>Yi,nan:()=>Oi,nativeEnum:()=>na,never:()=>Li,null:()=>Di,nullable:()=>sa,number:()=>qn,object:()=>Ki,objectUtil:()=>Ut,oboolean:()=>da,onumber:()=>la,optional:()=>aa,ostring:()=>ua,pipeline:()=>ca,preprocess:()=>oa,promise:()=>ra,quotelessJson:()=>ii,record:()=>Wi,set:()=>Qi,setErrorMap:()=>si,strictObject:()=>Ui,string:()=>Hn,symbol:()=>Vi,transformer:()=>ia,tuple:()=>Bi,undefined:()=>ji,union:()=>Hi,unknown:()=>Gi,util:()=>b,void:()=>$i});var b;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(let s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(b||(b={}));var Ut;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ut||(Ut={}));var m=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),L=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}};var d=b.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"]),ii=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),R=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};R.create=t=>new R(t);var ai=(t,e)=>{let n;switch(t.code){case d.invalid_type:t.received===m.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:n=`Unrecognized key(s) in object: ${b.joinValues(t.keys,", ")}`;break;case d.invalid_union:n="Invalid input";break;case d.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${b.joinValues(t.options)}`;break;case d.invalid_enum_value:n=`Invalid enum value. Expected ${b.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:n="Invalid function arguments";break;case d.invalid_return_type:n="Invalid function return type";break;case d.invalid_date:n="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:b.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case d.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case d.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case d.custom:n="Invalid input";break;case d.invalid_intersection_types:n="Intersection results could not be merged";break;case d.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:n="Number must be finite";break;default:n=e.defaultError,b.assertNever(t)}return{message:n}},U=ai;var Dn=U;function si(t){Dn=t}function we(){return Dn}var $e=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",l=r.filter(u=>!!u).slice().reverse();for(let u of l)o=u(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}},oi=[];function p(t,e){let n=we(),r=$e({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===U?void 0:U].filter(i=>!!i)});t.common.issues.push(r)}var E=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return y;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let a=await i.key,s=await i.value;r.push({key:a,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return y;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},y=Object.freeze({status:"aborted"}),ee=t=>({status:"dirty",value:t}),I=t=>({status:"valid",value:t}),it=t=>t.status==="aborted",at=t=>t.status==="dirty",W=t=>t.status==="valid",Te=t=>typeof Promise<"u"&&t instanceof Promise;var g;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(g||(g={}));var V=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,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}},Fn=(t,e)=>{if(W(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new R(t.common.issues);return this._error=n,this._error}}};function S(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}var x=class{get description(){return this._def.description}_getType(e){return L(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:L(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E,ctx:{common:e.parent.common,data:e.data,parsedType:L(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Te(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Fn(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return W(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>W(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:L(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(Te(i)?i:Promise.resolve(i));return Fn(r,a)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{let s=e(i),o=()=>a.addIssue({code:d.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new j({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return M.create(this,this._def)}nullable(){return z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this)}promise(){return X.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return ce.create(this,e,this._def)}transform(e){return new j({...S(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new pe({...S(this._def),innerType:this,defaultValue:n,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...S(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new me({...S(this._def),innerType:this,catchValue:n,typeName:_.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ke.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ci=/^c[^\s-]{8,}$/i,ui=/^[0-9a-z]+$/,li=/^[0-9A-HJKMNP-TV-Z]{26}$/i,di=/^[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,fi=/^[a-z0-9_-]{21}$/i,pi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mi=/^[-+]?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)?)??$/,gi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ht,yi=/^(?:(?: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])$/,_i=/^(?:(?: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])$/,vi=/^(([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]))$/,Si=/^(([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])$/,xi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ci=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ln="((\\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])))",bi=new RegExp(`^${Ln}$`);function $n(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function ki(t){return new RegExp(`^${$n(t)}$`)}function zn(t){let e=`${Ln}T${$n(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function wi(t,e){return!!((e==="v4"||!e)&&yi.test(t)||(e==="v6"||!e)&&vi.test(t))}function Ti(t,e){if(!pi.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Ei(t,e){return!!((e==="v4"||!e)&&_i.test(t)||(e==="v6"||!e)&&Si.test(t))}var Y=class t extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.string,received:a.parsedType}),y}let r=new E,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?p(i,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&p(i,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")gi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ht||(Ht=new RegExp(hi,"u")),Ht.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")di.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")fi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")ci.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")ui.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")li.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),p(i,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?zn(a).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?bi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?ki(a).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?mi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?wi(e.data,a.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Ti(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?Ei(e.data,a.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?xi.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Ci.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()):b.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:d.invalid_string,...g.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...g.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...g.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...g.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...g.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...g.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...g.errToObj(n)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Y.create=t=>new Y({checks:[],typeName:_.ZodString,coerce:t?.coerce??!1,...S(t)});function Ii(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}var te=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==m.number){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.number,received:a.parsedType}),y}let r,i=new E;for(let a of this._def.checks)a.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Ii(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_finite,message:a.message}),i.dirty()):b.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,g.toString(n))}gt(e,n){return this.setLimit("min",e,!1,g.toString(n))}lte(e,n){return this.setLimit("max",e,!0,g.toString(n))}lt(e,n){return this.setLimit("max",e,!1,g.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};te.create=t=>new te({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...S(t)});var ne=class t extends x{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==m.bigint)return this._getInvalidInput(e);let r,i=new E;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):b.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.bigint,received:n.parsedType}),y}gte(e,n){return this.setLimit("min",e,!0,g.toString(n))}gt(e,n){return this.setLimit("min",e,!1,g.toString(n))}lte(e,n){return this.setLimit("max",e,!0,g.toString(n))}lt(e,n){return this.setLimit("max",e,!1,g.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:g.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:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ne.create=t=>new ne({checks:[],typeName:_.ZodBigInt,coerce:t?.coerce??!1,...S(t)});var re=class extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.boolean,received:r.parsedType}),y}return I(e.data)}};re.create=t=>new re({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...S(t)});var ie=class t extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_type,expected:m.date,received:a.parsedType}),y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return p(a,{code:d.invalid_date}),y}let r=new E,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):b.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ie.create=t=>new ie({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...S(t)});var Ie=class extends x{_parse(e){if(this._getType(e)!==m.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.symbol,received:r.parsedType}),y}return I(e.data)}};Ie.create=t=>new Ie({typeName:_.ZodSymbol,...S(t)});var ae=class extends x{_parse(e){if(this._getType(e)!==m.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.undefined,received:r.parsedType}),y}return I(e.data)}};ae.create=t=>new ae({typeName:_.ZodUndefined,...S(t)});var se=class extends x{_parse(e){if(this._getType(e)!==m.null){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.null,received:r.parsedType}),y}return I(e.data)}};se.create=t=>new se({typeName:_.ZodNull,...S(t)});var Q=class extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return I(e.data)}};Q.create=t=>new Q({typeName:_.ZodAny,...S(t)});var q=class extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return I(e.data)}};q.create=t=>new q({typeName:_.ZodUnknown,...S(t)});var F=class extends x{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:d.invalid_type,expected:m.never,received:n.parsedType}),y}};F.create=t=>new F({typeName:_.ZodNever,...S(t)});var Re=class extends x{_parse(e){if(this._getType(e)!==m.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.void,received:r.parsedType}),y}return I(e.data)}};Re.create=t=>new Re({typeName:_.ZodVoid,...S(t)});var Z=class t extends x{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==m.array)return p(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),y;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(p(n,{code:s?d.too_big:d.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(p(n,{code:d.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(p(n,{code:d.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new V(n,s,n.path,o)))).then(s=>E.mergeArray(r,s));let a=[...n.data].map((s,o)=>i.type._parseSync(new V(n,s,n.path,o)));return E.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:g.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:g.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:g.toString(n)}})}nonempty(e){return this.min(1,e)}};Z.create=(t,e)=>new Z({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...S(e)});function Ee(t){if(t instanceof P){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=M.create(Ee(r))}return new P({...t._def,shape:()=>e})}else return t instanceof Z?new Z({...t._def,type:Ee(t.element)}):t instanceof M?M.create(Ee(t.unwrap())):t instanceof z?z.create(Ee(t.unwrap())):t instanceof $?$.create(t.items.map(e=>Ee(e))):t}var P=class t extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=b.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return p(u,{code:d.invalid_type,expected:m.object,received:u.parsedType}),y}let{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof F&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||o.push(u);let l=[];for(let u of s){let f=a[u],h=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new V(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof F){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of o)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")o.length>0&&(p(i,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of o){let h=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new V(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of l){let h=await f.key,C=await f.value;u.push({key:h,value:C,alwaysSet:f.alwaysSet})}return u}).then(u=>E.mergeObjectSync(r,u)):E.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:g.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of b.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of b.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Ee(this)}partial(e){let n={};for(let r of b.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of b.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof M;)a=a._def.innerType;n[r]=a}return new t({...this._def,shape:()=>n})}keyof(){return Kn(b.objectKeys(this.shape))}};P.create=(t,e)=>new P({shape:()=>t,unknownKeys:"strip",catchall:F.create(),typeName:_.ZodObject,...S(e)});P.strictCreate=(t,e)=>new P({shape:()=>t,unknownKeys:"strict",catchall:F.create(),typeName:_.ZodObject,...S(e)});P.lazycreate=(t,e)=>new P({shape:t,unknownKeys:"strip",catchall:F.create(),typeName:_.ZodObject,...S(e)});var oe=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new R(o.ctx.common.issues));return p(n,{code:d.invalid_union,unionErrors:s}),y}if(n.common.async)return Promise.all(r.map(async a=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let l of r){let u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(l=>new R(l));return p(n,{code:d.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}};oe.create=(t,e)=>new oe({options:t,typeName:_.ZodUnion,...S(e)});var H=t=>t instanceof ue?H(t.schema):t instanceof j?H(t.innerType()):t instanceof le?[t.value]:t instanceof de?t.options:t instanceof fe?b.objectValues(t.enum):t instanceof pe?H(t._def.innerType):t instanceof ae?[void 0]:t instanceof se?[null]:t instanceof M?[void 0,...H(t.unwrap())]:t instanceof z?[null,...H(t.unwrap())]:t instanceof ze||t instanceof ge?H(t.unwrap()):t instanceof me?H(t._def.innerType):[],st=class t extends x{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return p(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),y;let r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let a of n){let s=H(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...S(r)})}};function qt(t,e){let n=L(t),r=L(e);if(t===e)return{valid:!0,data:t};if(n===m.object&&r===m.object){let i=b.objectKeys(e),a=b.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(let o of a){let l=qt(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===m.array&&r===m.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let s=t[a],o=e[a],l=qt(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===m.date&&r===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ce=class extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(it(a)||it(s))return y;let o=qt(a.value,s.value);return o.valid?((at(a)||at(s))&&n.dirty(),{status:n.value,value:o.data}):(p(r,{code:d.invalid_intersection_types}),y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ce.create=(t,e,n)=>new ce({left:t,right:e,typeName:_.ZodIntersection,...S(n)});var $=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.array)return p(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),y;if(r.data.length<this._def.items.length)return p(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((s,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new V(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>E.mergeArray(n,s)):E.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};$.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:t,typeName:_.ZodTuple,rest:null,...S(e)})};var ot=class t extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.object)return p(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),y;let i=[],a=this._def.keyType,s=this._def.valueType;for(let o in r.data)i.push({key:a._parse(new V(r,o,r.path,o)),value:s._parse(new V(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?E.mergeObjectAsync(n,i):E.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof x?new t({keyType:e,valueType:n,typeName:_.ZodRecord,...S(r)}):new t({keyType:Y.create(),valueType:e,typeName:_.ZodRecord,...S(n)})}},Pe=class extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.map)return p(r,{code:d.invalid_type,expected:m.map,received:r.parsedType}),y;let i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new V(r,o,r.path,[u,"key"])),value:a._parse(new V(r,l,r.path,[u,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return y;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let l of s){let u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return y;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),o.set(u.value,f.value)}return{status:n.value,value:o}}}};Pe.create=(t,e,n)=>new Pe({valueType:e,keyType:t,typeName:_.ZodMap,...S(n)});var Ae=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==m.set)return p(r,{code:d.invalid_type,expected:m.set,received:r.parsedType}),y;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(p(r,{code:d.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(p(r,{code:d.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let a=this._def.valueType;function s(l){let u=new Set;for(let f of l){if(f.status==="aborted")return y;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}let o=[...r.data.values()].map((l,u)=>a._parse(new V(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new t({...this._def,minSize:{value:e,message:g.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:g.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ae.create=(t,e)=>new Ae({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...S(e)});var ct=class t extends x{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.function)return p(n,{code:d.invalid_type,expected:m.function,received:n.parsedType}),y;function r(o,l){return $e({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,we(),U].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:l}})}function i(o,l){return $e({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,we(),U].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:l}})}let a={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof X){let o=this;return I(async function(...l){let u=new R([]),f=await o._def.args.parseAsync(l,a).catch(w=>{throw u.addIssue(r(l,w)),u}),h=await Reflect.apply(s,this,f);return await o._def.returns._def.type.parseAsync(h,a).catch(w=>{throw u.addIssue(i(h,w)),u})})}else{let o=this;return I(function(...l){let u=o._def.args.safeParse(l,a);if(!u.success)throw new R([r(l,u.error)]);let f=Reflect.apply(s,this,u.data),h=o._def.returns.safeParse(f,a);if(!h.success)throw new R([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:$.create(e).rest(q.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||$.create([]).rest(q.create()),returns:n||q.create(),typeName:_.ZodFunction,...S(r)})}},ue=class extends x{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ue.create=(t,e)=>new ue({getter:t,typeName:_.ZodLazy,...S(e)});var le=class extends x{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}};le.create=(t,e)=>new le({value:t,typeName:_.ZodLiteral,...S(e)});function Kn(t,e){return new de({values:t,typeName:_.ZodEnum,...S(e)})}var de=class t extends x{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:b.joinValues(r),received:n.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:d.invalid_enum_value,options:r}),y}return I(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};de.create=Kn;var fe=class extends x{_parse(e){let n=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==m.string&&r.parsedType!==m.number){let i=b.objectValues(n);return p(r,{expected:b.joinValues(i),received:r.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=b.objectValues(n);return p(r,{received:r.data,code:d.invalid_enum_value,options:i}),y}return I(e.data)}get enum(){return this._def.values}};fe.create=(t,e)=>new fe({values:t,typeName:_.ZodNativeEnum,...S(e)});var X=class extends x{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==m.promise&&n.common.async===!1)return p(n,{code:d.invalid_type,expected:m.promise,received:n.parsedType}),y;let r=n.parsedType===m.promise?n.data:Promise.resolve(n.data);return I(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};X.create=(t,e)=>new X({type:t,typeName:_.ZodPromise,...S(e)});var j=class extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{p(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return y;let l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?y:l.status==="dirty"?ee(l.value):n.value==="dirty"?ee(l.value):l});{if(n.value==="aborted")return y;let o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?y:o.status==="dirty"?ee(o.value):n.value==="dirty"?ee(o.value):o}}if(i.type==="refinement"){let s=o=>{let l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?y:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!W(s))return y;let o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>W(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):y);b.assertNever(i)}};j.create=(t,e,n)=>new j({schema:t,typeName:_.ZodEffects,effect:e,...S(n)});j.createWithPreprocess=(t,e,n)=>new j({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...S(n)});var M=class extends x{_parse(e){return this._getType(e)===m.undefined?I(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M.create=(t,e)=>new M({innerType:t,typeName:_.ZodOptional,...S(e)});var z=class extends x{_parse(e){return this._getType(e)===m.null?I(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};z.create=(t,e)=>new z({innerType:t,typeName:_.ZodNullable,...S(e)});var pe=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===m.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};pe.create=(t,e)=>new pe({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});var me=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Te(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new R(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new R(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};me.create=(t,e)=>new me({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});var Oe=class extends x{_parse(e){if(this._getType(e)!==m.nan){let r=this._getOrReturnCtx(e);return p(r,{code:d.invalid_type,expected:m.nan,received:r.parsedType}),y}return{status:"valid",value:e.data}}};Oe.create=t=>new Oe({typeName:_.ZodNaN,...S(t)});var Ri=Symbol("zod_brand"),ze=class extends x{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Ke=class t extends x{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?y:a.status==="dirty"?(n.dirty(),ee(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?y:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:_.ZodPipeline})}},ge=class extends x{_parse(e){let n=this._def.innerType._parse(e),r=i=>(W(i)&&(i.value=Object.freeze(i.value)),i);return Te(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};ge.create=(t,e)=>new ge({innerType:t,typeName:_.ZodReadonly,...S(e)});function Gn(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Un(t,e={},n){return t?Q.create().superRefine((r,i)=>{let a=t(r);if(a instanceof Promise)return a.then(s=>{if(!s){let o=Gn(e,r),l=o.fatal??n??!0;i.addIssue({code:"custom",...o,fatal:l})}});if(!a){let s=Gn(e,r),o=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:o})}}):Q.create()}var Pi={object:P.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var Ai=(t,e={message:`Input not instance of ${t.name}`})=>Un(n=>n instanceof t,e),Hn=Y.create,qn=te.create,Oi=Oe.create,Ni=ne.create,Zn=re.create,Mi=ie.create,Vi=Ie.create,ji=ae.create,Di=se.create,Fi=Q.create,Gi=q.create,Li=F.create,$i=Re.create,zi=Z.create,Ki=P.create,Ui=P.strictCreate,Hi=oe.create,qi=st.create,Zi=ce.create,Bi=$.create,Wi=ot.create,Yi=Pe.create,Qi=Ae.create,Xi=ct.create,Ji=ue.create,ea=le.create,ta=de.create,na=fe.create,ra=X.create,ia=j.create,aa=M.create,sa=z.create,oa=j.createWithPreprocess,ca=Ke.create,ua=()=>Hn().optional(),la=()=>qn().optional(),da=()=>Zn().optional(),fa={string:(t=>Y.create({...t,coerce:!0})),number:(t=>te.create({...t,coerce:!0})),boolean:(t=>re.create({...t,coerce:!0})),bigint:(t=>ne.create({...t,coerce:!0})),date:(t=>ie.create({...t,coerce:!0}))};var pa=y;var ut=c.object({page:c.object({title:c.string().nullable(),path:c.string(),search:c.string(),hash:c.string()}).strict(),referrer:c.string().nullable(),viewport:c.object({w:c.number(),h:c.number()}).strict().nullable().optional()}).strict(),Bn=c.object({}).strict();var Wt="aranova_tracking_last_fired_url",Zt=null,Bt=!1;function ma(t){try{return typeof window>"u"?null:window.sessionStorage.getItem(t)}catch{return null}}function ga(t,e){try{if(typeof window>"u")return;window.sessionStorage.setItem(t,e)}catch{}}function ha(){if(!Bt){Bt=!0;let t=ma(Wt);t!==null&&(Zt=t)}return Zt}function ya(t){Zt=t,Bt=!0,ga(Wt,t)}function Wn(t){return typeof window>"u"||typeof document>"u"?null:ut.parse({page:{title:document.title||null,path:window.location.pathname,search:window.location.search,hash:window.location.hash},referrer:t!==void 0?t:document.referrer||null,viewport:{w:window.innerWidth,h:window.innerHeight}})}function Ue(t){if(typeof window>"u")return;let e=window.location.href,n=ha(),r=n!==null&&n!==e?n:null,i=typeof document<"u"&&document.referrer||null,s=Wn(r??i);t.trackEvent({eventType:"page_view",pageUrl:e,metadata:s}),e!==n&&ya(e)}function Yt(t){if(typeof window>"u")return()=>{};function e(n){n.persisted&&Ue(t)}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}}function Qt(t,e={}){if(typeof window>"u"||typeof history>"u")return()=>{};let n=window.location.pathname+window.location.search;function r(){let u=window.location.pathname+window.location.search;u!==n&&(n=u,Ue(t))}let i=history.pushState.bind(history),a=history.replaceState.bind(history);function s(...u){i(...u),setTimeout(r,0)}function o(...u){a(...u),setTimeout(r,0)}function l(u){u.persisted&&Ue(t)}return history.pushState=s,history.replaceState=o,window.addEventListener("popstate",r),window.addEventListener("pageshow",l),e.skipInitial||Ue(t),()=>{history.pushState=i,history.replaceState=a,window.removeEventListener("popstate",r),window.removeEventListener("pageshow",l)}}function lt(t){if(t instanceof RegExp)return t.source;if(Array.isArray(t))return t.map(lt);if(t!==null&&typeof t=="object"){let e={};for(let[n,r]of Object.entries(t))e[n]=lt(r);return e}return t}function Xt(t,e,n,r,i=null){let a=r?Object.keys(r.automatic):[],s=r?.manual?Object.keys(r.manual):[],o=null;if(r){let l={};for(let[u,f]of Object.entries(r.automatic)){let h=lt(f);Object.keys(h).length>0&&(l[u]=h)}if(r.manual)for(let[u,f]of Object.entries(r.manual)){if(f===void 0)continue;let h=lt(f);Object.keys(h).length>0&&(l[u]=h)}Object.keys(l).length>0&&(o=l)}return{sdk_version:e??"unknown",package_name:n,surface:t,triggers:{automatic:a,manual:s},trigger_config:o,configured_gtag_ids:i}}var Qn=2e3,Xn=10,dt=50,ft="X-Aranova-Api-Key",pt="X-Aranova-Sdk-Version",mt="X-Aranova-Sdk-Package",gt="X-Aranova-Sdk-Surface",ht="X-Aranova-Sdk-Environment";function va(t,e,n,r,i){return{surface:t,sdk_version:e,package_name:n,site_origin:typeof window>"u"?null:window.location.origin,page_title:typeof document>"u"?null:document.title||null,referrer:typeof document>"u"?null:document.referrer||null,environment:r,active_gtag_ids:i}}function Sa(){if(typeof window>"u")return _e();try{J()}catch{}return ve(xe)}function xa(){try{return{state:O()}}catch{return null}}async function Yn(t,e,n,r,i){if(typeof fetch=="function")try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",[ft]:n,[pt]:r.sdkVersion,[mt]:r.packageName,[gt]:r.surface,[ht]:r.environment},body:e,keepalive:i,credentials:"omit",mode:"cors"})}catch{}}function Jt(t){let e=t.flushIntervalMs??Qn,n=Math.min(t.maxQueueSize??Xn,dt),r=t.sdkVersion??null,i=t.packageName??null,a=t.environment??"production",s=t.activeGtagIds??null,l=`${t.endpoint.replace(/\/$/,"")}/events`,u={sdkVersion:r??"",packageName:i??"",surface:t.surface,environment:a},f=[],h=null,C=null,w=_e(),v=!1,T=Kt(),B=ke(),G=B.id;if(typeof window<"u"){C=window.location.href;try{w=J()}catch{}try{Fe()}catch{}}function Ne(){let k=Xt(t.surface,r,i,t.triggers??null,s);f.push({event_type:"sdk_heartbeat",page_url:typeof window>"u"?null:window.location.href,metadata:k,occurred_at:new Date().toISOString()})}B.isNew&&Ne();function Me(){let k=ke();k.isNew&&k.id!==G&&Ne(),G=k.id;let A=bt(Sa(),w),je=va(t.surface,r,i,a,s);return{session_id:G,visitor_id:T,gclid:A.gclid,fbclid:A.fbclid,fbc:De(),fbp:et(),utm_source:A.utm_source,utm_medium:A.utm_medium,utm_campaign:A.utm_campaign,utm_term:A.utm_term,utm_content:A.utm_content,first_page:C,consent_state:xa(),context:je}}function qe(){h!==null||v||(h=setTimeout(()=>{h=null,Ve()},e))}function he(){h!==null&&(clearTimeout(h),h=null)}async function Ve(){if(f.length===0)return;let k=f.slice(0,dt);f=f.slice(k.length),he();let A={session:Me(),events:k},je=JSON.stringify(A);await Yn(l,je,t.apiKey,u,!1)}function Ar(k){if(v||!k||typeof k.eventType!="string"||k.eventType.length===0)return;let A=k.occurredAt instanceof Date?k.occurredAt.toISOString():typeof k.occurredAt=="string"?k.occurredAt:new Date().toISOString();f.push({event_type:k.eventType,page_url:k.pageUrl??(typeof window>"u"?null:window.location.href),metadata:k.metadata??null,occurred_at:A}),f.length>=n?Ve():qe()}function Ze(){if(f.length===0)return;let k=f.slice(0,dt);f=f.slice(k.length),he();let A={session:Me(),events:k},je=JSON.stringify(A);Yn(l,je,t.apiKey,u,!0)}return typeof window<"u"&&(window.addEventListener("pagehide",Ze),window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ze()})),{trackEvent:Ar,flush:Ve,getSessionId:()=>G,getVisitorId:()=>T,destroy:()=>{v=!0,f.length>0&&Ze(),he(),f=[],typeof window<"u"&&window.removeEventListener("pagehide",Ze)}}}var Jn=c.object({cta_name:c.string(),page:c.object({path:c.string()}).strict(),section:c.string().nullable().optional(),destination_url:c.string().nullable().optional()}).strict(),er=c.object({}).strict();var Ca=c.object({automatic:c.array(c.string()),manual:c.array(c.string())}).strict(),tr=c.object({sdk_version:c.string(),package_name:c.string().nullable(),surface:c.enum(["next","react","script"]),triggers:Ca,trigger_config:c.record(c.string(),c.record(c.string(),c.unknown())).nullable().optional(),configured_gtag_ids:c.record(c.string(),c.string()).nullable().optional()}).strict(),nr=c.object({}).strict();var rr=c.object({form:c.object({id:c.string(),action:c.string().nullable()}).strict(),page:c.object({path:c.string()}).strict()}).strict(),ir=c.object({selector:c.string().optional()}).strict();var en=c.lazy(()=>c.union([c.string(),c.number().finite(),c.boolean(),c.null(),c.array(en),c.record(en)])),ar=c.object({form:c.object({id:c.string(),action:c.string().nullable(),fields:c.array(c.object({name:c.string(),type:c.string(),label:c.string().nullable(),value:en}).strict()).optional()}).strict(),page:c.object({path:c.string()}).strict()}).strict(),sr=c.object({}).strict();var or=c.object({page_count:c.number().int().min(2),page:c.object({path:c.string()}).strict()}).strict(),cr=c.object({pageThreshold:c.number().int().min(2)}).strict();var ur=c.object({phone_number:c.string(),page:c.object({path:c.string()}).strict(),section:c.string().nullable().optional()}).strict(),lr=c.object({}).strict();var dr=c.object({depth_percent:c.number().int().min(1).max(100),page:c.object({path:c.string()}).strict()}).strict(),fr=c.object({thresholds:c.array(c.number().int().min(1).max(100)).min(1)}).strict();var ba=["contact_page","about_page","services_page","booking_page","location_page","pricing_page","faq_page","testimonials_page"],pr=c.enum(ba),mr=c.object({page_name:pr,page:c.object({path:c.string()}).strict()}).strict(),gr=c.object({pages:c.array(c.object({name:pr,pathPattern:c.custom(t=>t instanceof RegExp,{message:"pathPattern must be a RegExp"})}).strict()).min(1)}).strict();var hr=c.object({duration_ms:c.number().int().nonnegative(),page:c.object({path:c.string()}).strict()}).strict(),yr=c.object({thresholdSeconds:c.number().int().positive()}).strict();var tn={page_view:{kind:"automatic",metadataSchema:ut,configSchema:Bn},time_on_site:{kind:"automatic",metadataSchema:hr,configSchema:yr},specific_page_visit:{kind:"automatic",metadataSchema:mr,configSchema:gr},scroll_depth:{kind:"automatic",metadataSchema:dr,configSchema:fr},multi_page_session:{kind:"automatic",metadataSchema:or,configSchema:cr},form_start:{kind:"automatic",metadataSchema:rr,configSchema:ir},sdk_heartbeat:{kind:"automatic",metadataSchema:tr,configSchema:nr},form_submit:{kind:"manual",metadataSchema:ar,configSchema:sr},phone_click:{kind:"manual",metadataSchema:ur,configSchema:lr},cta_click:{kind:"manual",metadataSchema:Jn,configSchema:er}},vo=Object.entries(tn).filter(([,t])=>t.kind==="automatic").map(([t])=>t),So=Object.entries(tn).filter(([,t])=>t.kind==="manual").map(([t])=>t);function nn(t){return tn[t]}function rn(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=e.thresholdSeconds*1e3,r=0,i=document.visibilityState==="visible"?Date.now():null,a=null,s=!1;function o(){s||(s=!0,t.trackEvent({eventType:"time_on_site",metadata:{duration_ms:n,page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}function l(){if(s||i===null)return;let h=n-r;if(h<=0){o();return}a=setTimeout(o,h)}function u(){a!==null&&(clearTimeout(a),a=null)}function f(){s||(document.visibilityState==="hidden"?(i!==null&&(r+=Date.now()-i,i=null),u()):(i=Date.now(),l()))}return document.addEventListener("visibilitychange",f),l(),()=>{u(),document.removeEventListener("visibilitychange",f)}}function an(t,e){if(typeof window>"u"||typeof history>"u")return()=>{};let{pages:n}=e,r=new Set;function i(){let u=window.location.pathname;for(let{name:f,pathPattern:h}of n){if(h.lastIndex=0,!h.test(u))continue;let C=`${f}:${u}`;r.has(C)||(r.add(C),t.trackEvent({eventType:"specific_page_visit",metadata:{page_name:f,page:{path:u}},pageUrl:window.location.href,occurredAt:null}))}}let a=history.pushState.bind(history),s=history.replaceState.bind(history);function o(...u){a(...u),setTimeout(i,0)}function l(...u){s(...u),setTimeout(i,0)}return history.pushState=o,history.replaceState=l,window.addEventListener("popstate",i),i(),()=>{history.pushState=a,history.replaceState=s,window.removeEventListener("popstate",i)}}function sn(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=new Set(e.thresholds),r=new Set,i=window.location.pathname,a=null;function s(){let v=document.documentElement,T=window.scrollY||v.scrollTop,B=v.scrollHeight,G=v.clientHeight;return B<=G?100:Math.round((T+G)/B*100)}function o(){let v=s();for(let T of n)v>=T&&!r.has(T)&&(r.add(T),t.trackEvent({eventType:"scroll_depth",metadata:{depth_percent:T,page:{path:i}},pageUrl:window.location.href,occurredAt:null}))}function l(){a===null&&(a=requestAnimationFrame(()=>{a=null,o()}))}function u(){let v=window.location.pathname;v!==i&&(i=v,r=new Set,setTimeout(o,0))}let f=history.pushState.bind(history),h=history.replaceState.bind(history);function C(...v){f(...v),setTimeout(u,0)}function w(...v){h(...v),setTimeout(u,0)}return history.pushState=C,history.replaceState=w,window.addEventListener("popstate",u),window.addEventListener("scroll",l,{passive:!0}),setTimeout(o,0),()=>{a!==null&&cancelAnimationFrame(a),history.pushState=f,history.replaceState=h,window.removeEventListener("popstate",u),window.removeEventListener("scroll",l)}}var on="aranova_tracking_mps_paths",_r="aranova_tracking_mps_session",cn="aranova_tracking_mps_fired";function ka(){try{return typeof window<"u"?window.sessionStorage:null}catch{return null}}function un(t,e){if(typeof window>"u"||typeof history>"u")return()=>{};let n=ka();if(!n)return()=>{};let{pageThreshold:r}=e,i="";function a(){try{let v=n.getItem(on);return v?new Set(JSON.parse(v)):new Set}catch{return new Set}}function s(v){try{n.setItem(on,JSON.stringify([...v]))}catch{}}function o(){let v=ke().id;n.getItem(_r)!==v&&(n.setItem(_r,v),n.removeItem(on),n.removeItem(cn))}function l(){return n.getItem(cn)==="1"}function u(){let v=window.location.pathname;if(v===i||(i=v,o(),l()))return;let T=a();T.add(v),s(T),T.size>=r&&(n.setItem(cn,"1"),t.trackEvent({eventType:"multi_page_session",metadata:{page_count:T.size,page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}let f=history.pushState.bind(history),h=history.replaceState.bind(history);function C(...v){f(...v),setTimeout(u,0)}function w(...v){h(...v),setTimeout(u,0)}return history.pushState=C,history.replaceState=w,window.addEventListener("popstate",u),u(),()=>{history.pushState=f,history.replaceState=h,window.removeEventListener("popstate",u)}}function ln(t,e){if(typeof window>"u"||typeof document>"u")return()=>{};let n=e.selector??"form",r=new Set,i=window.location.pathname;function a(C){if(C.id)return`id:${C.id}`;let w=C.getAttribute("action");return w?`action:${w}`:`index:${Array.from(document.querySelectorAll(n)).indexOf(C)}`}function s(C){let w=C.target;if(!(w instanceof HTMLElement))return;let v=w.closest(n);if(!v||v.tagName!=="FORM")return;let T=a(v);r.has(T)||(r.add(T),t.trackEvent({eventType:"form_start",metadata:{form:{id:v.id||"",action:v.getAttribute("action")??null},page:{path:window.location.pathname}},pageUrl:window.location.href,occurredAt:null}))}function o(){let C=window.location.pathname;C!==i&&(i=C,r=new Set)}let l=history.pushState.bind(history),u=history.replaceState.bind(history);function f(...C){l(...C),setTimeout(o,0)}function h(...C){u(...C),setTimeout(o,0)}return history.pushState=f,history.replaceState=h,window.addEventListener("popstate",o),document.addEventListener("focusin",s),()=>{history.pushState=l,history.replaceState=u,window.removeEventListener("popstate",o),document.removeEventListener("focusin",s)}}var yt=class extends Error{constructor(e,n){super(e),this.name="AranovaApiError",this.status=n.status,this.code=n.code,this.requestId=n.requestId}};function wa(t){let e={[ft]:t.apiKey};return t.sdkVersion&&(e[pt]=t.sdkVersion),t.packageName&&(e[mt]=t.packageName),t.surface&&(e[gt]=t.surface),t.environment&&(e[ht]=t.environment),e}function Ta(t,e){return`${t.replace(/\/$/,"")}${e}`}async function D(t,e,n,r){let i=wa(t);r!==void 0&&(i["Content-Type"]="application/json");let a=await fetch(Ta(t.endpoint,n),{method:e,headers:i,body:r===void 0?void 0:JSON.stringify(r)});if(!a.ok){let s,o;try{let l=await a.json();if(l&&typeof l=="object"){let u=l;typeof u.detail=="string"&&(s=u.detail),typeof u.code=="string"&&(o=u.code)}}catch{}throw new yt(s??a.statusText??"Request failed",{status:a.status,code:o,requestId:a.headers.get("x-request-id")??void 0})}if(a.status!==204)return await a.json()}function Ea(t,e,n,r,i){if(!t)return;let a=e.external_id??r.id;for(let s of n){if(!s.service)continue;let o=t.getFiring(s.service);if(!o)continue;let l=s.amount_cents??o.value_cents??null;be({sendTo:o.send_to,value:l!=null?Le(l,i):null,currency:o.currency??i,transactionId:`${a}:${s.service}`})}}function vr(t){async function e(n){let r=n.currency??t.defaultCurrency;if(!r)throw new Error("record: `currency` is required (pass it on the sale or set config.defaultCurrency)");let i={...n,currency:r,occurred_at:n.occurred_at??new Date().toISOString()},a=await D(t,"POST","/sales",i),s=n.services?.length?n.services.map(o=>({service:o.service,amount_cents:o.amount_cents})):[{service:n.service,amount_cents:n.amount_total_cents??null}];return Ea(t.firing,n,s,a,r),a}return{record:e,recordSale:e,trackConversion(n,r){let i=t.firing?.getFiring(n);if(!i)return;let a=i.currency??r?.currency??t.defaultCurrency??null,s=i.value_cents??null,o=r?.value??(s!=null&&a?Le(s,a):null);be({sendTo:i.send_to,value:o,currency:a,transactionId:r?.transactionId??null})},async list(n){let{cursor:r,limit:i,sort:a,order:s,want_total:o,...l}=n??{};return D(t,"POST","/sales/query",{filters:l,...i!==void 0?{limit:i}:{},...r!==void 0?{cursor:r}:{},...a!==void 0?{sort:a}:{},...s!==void 0?{order:s}:{},...o!==void 0?{want_total:o}:{}})},async summary(n){let{range:r,include_categories:i,include_deleted_services:a,top_n:s,since:o,until:l,timezone:u,granularity:f,compare_to:h,...C}=n;return D(t,"POST","/sales/summary",{filters:C,...r!==void 0?{range:r}:{},...i!==void 0?{include_categories:i}:{},...a!==void 0?{include_deleted_services:a}:{},...s!==void 0?{top_n:s}:{},...o!==void 0?{since:o}:{},...l!==void 0?{until:l}:{},...u!==void 0?{timezone:u}:{},...f!==void 0?{granularity:f}:{},...h!==void 0?{compare_to:h}:{}})},async get(n){return D(t,"GET",`/sales/${n}`)},async update(n,r){return D(t,"PATCH",`/sales/${n}`,r)},async delete(n){await D(t,"DELETE",`/sales/${n}`)},customers:{async list(n){let{segment:r,sort:i,order:a,cursor:s,limit:o,want_total:l,...u}=n??{};return D(t,"POST","/customers/query",{filters:u,...r!==void 0?{segment:r}:{},...i!==void 0?{sort:i}:{},...a!==void 0?{order:a}:{},...s!==void 0?{cursor:s}:{},...o!==void 0?{limit:o}:{},...l!==void 0?{want_total:l}:{}})},async get(n,r){let i=new URLSearchParams;r?.include_sales!==void 0&&i.set("include_sales",String(r.include_sales)),r?.limit!==void 0&&i.set("limit",String(r.limit)),r?.cursor!=null&&i.set("cursor",r.cursor);let a=i.toString();return D(t,"GET",`/customers/${encodeURIComponent(n)}${a?`?${a}`:""}`)},async summary(n){let{range:r,since:i,until:a,timezone:s,compare_to:o,...l}=n??{};return D(t,"POST","/customers/summary",{filters:l,...r!==void 0?{range:r}:{},...i!==void 0?{since:i}:{},...a!==void 0?{until:a}:{},...s!==void 0?{timezone:s}:{},...o!==void 0?{compare_to:o}:{}})}},business:{async config(){return D(t,"GET","/business/config")}}}}var Ia=["USD","CAD"],Ra=["production","development"],Sr=c.enum(Ia),He=c.number().int().nonnegative(),Pa=c.string().regex(/^\d+(\.\d{1,3})?$/),xr=c.record(c.unknown()),Cr=c.object({external_item_id:c.string().nullable().optional(),name:c.string().nullable().optional(),category:c.string().nullable().optional(),quantity:Pa,unit_price_cents:He,unit_cost_cents:He.nullable().optional()}).strict(),br=c.object({service:c.string(),amount_cents:He}).strict(),kr=c.string().max(200),wr=c.string().max(64),Tr=c.string().max(320).email();function Er(t,e,{requireAmount:n}){if(t.services!=null){t.service!=null&&e.addIssue({code:c.ZodIssueCode.custom,message:"pass either `service` or `services`, not both",path:["services"]}),t.services.length===0&&e.addIssue({code:c.ZodIssueCode.custom,message:"`services` must not be empty",path:["services"]});let r=t.services.map(i=>i.service);if(new Set(r).size!==r.length&&e.addIssue({code:c.ZodIssueCode.custom,message:"`services` must not list the same service more than once",path:["services"]}),t.amount_total_cents!=null){let i=t.services.reduce((a,s)=>a+s.amount_cents,0);t.amount_total_cents!==i&&e.addIssue({code:c.ZodIssueCode.custom,message:"amount_total_cents must equal the sum of the services amounts (omit it to derive it automatically)",path:["amount_total_cents"]})}}else n&&t.amount_total_cents==null&&e.addIssue({code:c.ZodIssueCode.custom,message:"amount_total_cents is required unless `services` is provided",path:["amount_total_cents"]})}var Go=c.object({external_id:c.string().nullable().optional(),description:c.string().nullable().optional(),service:c.string().nullable().optional(),services:c.array(br).nullable().optional(),currency:Sr,amount_total_cents:He.nullable().optional(),occurred_at:c.string().datetime(),environment:c.enum(Ra).default("production"),items:c.array(Cr).default([]),metadata:xr.nullable().optional(),customer_name:kr.nullable().optional(),customer_phone:wr.nullable().optional(),customer_email:Tr.nullable().optional()}).strict().superRefine((t,e)=>Er(t,e,{requireAmount:!0})),Lo=c.object({description:c.string().nullable().optional(),service:c.string().nullable().optional(),services:c.array(br).nullable().optional(),currency:Sr.optional(),amount_total_cents:He.optional(),occurred_at:c.string().datetime().optional(),items:c.array(Cr).optional(),metadata:xr.nullable().optional(),customer_name:kr.nullable().optional(),customer_phone:wr.nullable().optional(),customer_email:Tr.nullable().optional()}).strict().superRefine((t,e)=>Er(t,e,{requireAmount:!1}));var dn="aranova-tracking-consent-banner";function Oa(){return ve(xe)}function Ir(){document.querySelector(`#${dn}`)?.remove()}function Rr(t,e,n){let r=document.createElement("button");return r.type="button",r.textContent=t,Object.assign(r.style,{borderRadius:"6px",padding:"10px 16px",fontSize:"14px",fontWeight:"600",cursor:"pointer",border:"1px solid #d1d5db",background:"#ffffff",color:"#374151"},n),r.addEventListener("click",e),r}function Na(){if(typeof document>"u"||O()!=="pending"||document.querySelector(`#${dn}`))return;let t=document.createElement("div");t.id=dn,Object.assign(t.style,{position:"fixed",left:"0",right:"0",bottom:"0",zIndex:"2147483647",background:"#ffffff",borderTop:"1px solid #e5e7eb",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.12)",padding:"16px",fontFamily:"Inter, system-ui, sans-serif"});let e=document.createElement("div");Object.assign(e.style,{maxWidth:"960px",margin:"0 auto",display:"flex",flexDirection:"column",gap:"12px"});let n=document.createElement("p");n.textContent="We use cookies to understand ad performance and improve how our marketing works across visits. You can accept or decline this tracking.",Object.assign(n.style,{margin:"0",color:"#374151",fontSize:"14px",lineHeight:"1.5"});let r=document.createElement("div");Object.assign(r.style,{display:"flex",gap:"8px",flexWrap:"wrap"});let i=Rr("Decline",()=>{ye("denied"),Ir()},{}),a=Rr("Accept",()=>{ye("granted"),Ir()},{background:"#111827",color:"#ffffff",border:"1px solid #111827"});r.append(i),r.append(a),e.append(n),e.append(r),t.append(e),document.body.append(t)}var N=null,fn=null,K=[],_t=null;function Ma(){for(let t=K.length-1;t>=0;t--)K[t]();K=[],N!==null&&(N.destroy(),N=null),fn=null,_t=null}function Pr(t={}){if(typeof window>"u")return;window.AranovaTracking=pn;let{apiKey:e,endpoint:n,autoCaptureTrackingParams:r=!0,cookieMaxAgeSeconds:i=7776e3,gtagId:a,gtagIds:s,metaPixelId:o,metaPixelIds:l,environment:u,renderConsentBanner:f=!0,triggers:h,conversionConfig:C}=t;if(r&&J(window.location.href,i),s&&Object.keys(s).length>0?Rt(s):a&&It(a),l&&Object.keys(l).length>0?jt(l):o&&Vt(o),f&&Na(),Ma(),!e||!n){(e||n)&&console.warn("[AranovaTracking] init() requires both `apiKey` and `endpoint` to enable first-party event ingest. Page-view events will not be sent.");return}let w=C?Ft({cdnUrl:C.cdnUrl,baked:C.baked}):null;_t=vr({apiKey:e,endpoint:n,firing:w??void 0});let v=h??{automatic:{page_view:{}},manual:{}};fn=v;let T=s?Object.fromEntries(Object.entries(s).filter(Ve=>Ve[1]!=null)):a?{default:a}:void 0,B=Jt({apiKey:e,endpoint:n,surface:"script",packageName:"@aranova/tracking-browser",sdkVersion:gn,triggers:v,environment:u,activeGtagIds:T});N=w?Lt(B,Gt(w)):B,K.push(Qt(N)),K.push(Yt(N));let G=v.automatic.time_on_site;G&&K.push(rn(N,G));let Ne=v.automatic.specific_page_visit;Ne&&K.push(an(N,Ne));let Me=v.automatic.scroll_depth;Me&&K.push(sn(N,Me));let qe=v.automatic.multi_page_session;qe&&K.push(un(N,qe));let he=v.automatic.form_start;he&&K.push(ln(N,he))}function Va(t,e){if(N===null){console.warn("[AranovaTracking] trackEvent called before init({ apiKey, endpoint })");return}let n=fn;if(n===null){console.warn("[AranovaTracking] trackEvent called but no trigger registry was passed to init()");return}let r=n.manual??{};if(!(t in r)){console.warn(`[AranovaTracking] trackEvent: event "${t}" is not registered as a manual trigger. Register it under \`triggers.manual\` in init().`);return}try{nn(t).metadataSchema.parse(e)}catch(i){console.warn(`[AranovaTracking] trackEvent: metadata for "${t}" failed schema validation`,i);return}N.trackEvent({eventType:t,metadata:e,pageUrl:null,occurredAt:null})}function ja(){if(_t===null)throw new Error("[AranovaTracking] sales() called before init({ apiKey, endpoint })");return _t}var pn={init:Pr,captureTrackingParams:()=>J(),getTrackingParams:Oa,getConsentState:O,setConsentState:ye,trackEvent:Va,sales:ja};typeof window<"u"&&(window.AranovaTracking=pn);var Da=pn;return jr(Fa);})();
|
|
2
2
|
//# sourceMappingURL=aranova-tracking.global.js.map
|