@prodantix/sdk 0.8.0-beta.547 → 0.8.0-beta.654
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chat.d.cts +3 -3
- package/dist/chat.d.ts +3 -3
- package/dist/chat.js +1 -1
- package/dist/{chunk-ODN4ZELX.js → chunk-5WTMO52O.js} +2 -2
- package/dist/chunk-ZQWZ4CKH.js +2 -0
- package/dist/{client-vogZuHfD.d.cts → client-C8r0UAth.d.cts} +1 -1
- package/dist/{client-Cz7M6XJC.d.ts → client-DnfOdWQo.d.ts} +1 -1
- package/dist/{config-Bhwwo-uC.d.ts → config-B4yq8a9P.d.ts} +1 -1
- package/dist/{config-C8WD1Pge.d.cts → config-BgUX3vOB.d.cts} +1 -1
- package/dist/consent.iife.js +45 -14
- package/dist/ctas.iife.js +3 -3
- package/dist/forms.iife.js +2 -2
- package/dist/{http-BCh716Vs.d.cts → http-CAOViYSh.d.cts} +1 -0
- package/dist/{http-BCh716Vs.d.ts → http-CAOViYSh.d.ts} +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/messenger.cjs +1 -1
- package/dist/messenger.d.cts +2 -2
- package/dist/messenger.d.ts +2 -2
- package/dist/messenger.js +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +1 -1
- package/dist/pages.iife.js +1 -1
- package/dist/prodantix-push-sw.js +1 -1
- package/dist/{transport-C9C4hqlF.d.cts → transport-BBYpAuVK.d.cts} +4 -2
- package/dist/{transport-C4mkCaix.d.ts → transport-BZDcmleq.d.ts} +4 -2
- package/dist/web.cjs +4 -4
- package/dist/web.d.cts +3 -3
- package/dist/web.d.ts +3 -3
- package/dist/web.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-YHIIKYUP.js +0 -2
package/dist/web.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var Cr=Object.defineProperty;var Ir=(t,e,n)=>e in t?Cr(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var d=(t,e,n)=>Ir(t,typeof e!="symbol"?e+"":e,n);var D=class extends Error{constructor(n,r,i){super(r,i);d(this,"code");this.code=n,this.name="ProdantixError";}},Z=class extends D{constructor(e){super("config",e),this.name="ConfigError";}},U=class extends D{constructor(n,r){super("validation",r);d(this,"field");this.field=n,this.name="ValidationError";}},f=class extends D{constructor(n,r,i){super("transport",n,i);d(this,"status");this.status=r,this.name="TransportError";}};function F(t){if(t)return t;let e=globalThis.fetch;if(typeof e=="function")return e.bind(globalThis)}function L(){let t=globalThis.AbortController;return t?new t:void 0}var Ft=t=>new Promise(e=>{setTimeout(e,t);});function C(t){return t.replace(/\/+$/,"")}var G=class{constructor(){d(this,"store",new Map);}getItem(e){return this.store.get(e)??null}removeItem(e){this.store.delete(e);}setItem(e,n){this.store.set(e,n);}},ee=class{constructor(e,n=()=>false){this.real=e;this.passes=n;d(this,"held",new G);d(this,"opened",false);}get isOpen(){return this.opened}open(){this.opened=true;}close(){this.opened=false;}target(e){return this.opened||this.passes(e)?this.real:this.held}getItem(e){return this.target(e).getItem(e)}removeItem(e){this.target(e).removeItem(e);}setItem(e,n){this.target(e).setItem(e,n);}};function Lt(){try{let t=globalThis.localStorage;if(t){let e="__pdx_probe__";return t.setItem(e,"1"),t.removeItem(e),t}}catch{return new G}return new G}var oe={now:()=>new Date};function ae(t){return t.toISOString()}function $t(){if(typeof window>"u"||typeof Intl>"u")return null;let t=Intl.DateTimeFormat().resolvedOptions().timeZone;return typeof t=="string"&&t!==""?t:null}function _r(){return globalThis.crypto}function Pr(t){t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e=[];for(let n=0;n<16;n+=1)e.push(t[n].toString(16).padStart(2,"0"));return `${e[0]}${e[1]}${e[2]}${e[3]}-${e[4]}${e[5]}-${e[6]}${e[7]}-${e[8]}${e[9]}-${e[10]}${e[11]}${e[12]}${e[13]}${e[14]}${e[15]}`}function Ve(){let t=_r();if(t?.randomUUID)return t.randomUUID();let e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<16;n+=1)e[n]=Math.floor(Math.random()*256);return Pr(e)}var Nt={uuid:Ve};var Ar=/^pdx_pub_(?:(?:live|test)_)?[a-z0-9]{32}$/;var Fr=/^(?:\$|[a-z])[a-z0-9_.]*$/;function de(t){let e=0;for(let n of t)e+=1;return e}function Rt(t){return Ar.test(t)}function Lr(t){return Fr.test(t)}function Ot(t){let e=de(t);if(e<1||e>200)throw new U("distinct_id","distinct_id must be between 1 and 200 characters")}function Mt(t){let e=de(t);if(e<1||e>200)throw new U("event_name","event_name must be between 1 and 200 characters");if(!Lr(t))throw new U("event_name","event_name must match /^(\\$|[a-z])[a-z0-9_.]*$/")}var Dt="prodantix-js",qt="0.8.0";var $r=t=>{};function Kt(t){if(!t.apiKey||!Rt(t.apiKey))throw new Z("apiKey must be a public project key of the form pdx_pub_<32 lowercase alphanumerics>");if(!t.host)throw new Z("host is required (the ingest base URL)");let e=C(t.host),n=t.defaultProperties,r=t.storage??new G;return {apiKey:t.apiKey,autocapture:t.autocapture??false,clock:t.clock??oe,consent:t.consent,consentMode:t.consentMode,defaultProperties:typeof n=="function"?n:()=>n??{},describeElement:t.describeElement,flagsHost:t.flagsHost?C(t.flagsHost):e,flushAt:t.flushAt??20,flushIntervalMs:t.flushIntervalMs??1e4,host:e,ids:t.ids??Nt,locale:t.locale,maxQueueSize:t.maxQueueSize??1e3,maxRetries:t.maxRetries??3,namespace:W(t.apiKey),onError:t.onError??$r,os:t.os,requestTimeoutMs:t.requestTimeoutMs??1e4,sdkName:t.sdkName??Dt,sdkVersion:t.sdkVersion??qt,sessionTracking:t.sessionTracking??false,sharedStorage:t.sharedStorage??r,socketFactory:t.socketFactory,storage:r,streamFlags:t.streamFlags??false,transport:t.transport}}function W(t){return t.slice(0,16)}var Bt="$cta_viewed",Ht="$cta_clicked",je="$cta_dismissed",Gt=(t,e)=>{let n={$cta_id:t.id,$cta_kind:t.kind,$cta_variant:t.variant.key,$cta_version:t.version},r=e===void 0?void 0:t.variant.content.buttons[e];return r&&e!==void 0&&(n.$cta_button=e,n.$cta_button_label=r.label,r.action.kind==="form"&&(n.$cta_form_id=r.action.value)),n},ce=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async ctas(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=new URLSearchParams({anonymous:String(e.anonymous),device:e.device,distinct_id:e.distinctId,language:e.language,url:e.url}),i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(`${this.host}/v1/ctas?${r.toString()}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(o.status<200||o.status>=300)throw new f(`ctas request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).ctas}finally{s!==void 0&&clearTimeout(s);}}};function Vt(t,e,n){Mt(t.eventName),Ot(t.distinctId);let r={distinct_id:t.distinctId,event_id:t.eventId??n.uuid(),event_name:t.eventName,properties:t.properties??{},schema_version:1,timestamp:ae(t.timestamp??e.now())};return t.context&&(r.context=t.context),t.sessionId&&(r.session_id=t.sessionId),r}var j=Symbol("absent");function Nr(t,e){if(t==="distinct_id")return e.distinctId;let n=e.properties??{};if(Object.prototype.hasOwnProperty.call(n,t))return n[t];let r=e.attributes??{};return Object.prototype.hasOwnProperty.call(r,t)?r[t]:j}function V(t){return t===j?"undefined":String(t)}function jt(t){return t===j?Number.NaN:Number(t)}function Ut(t){return t!==j&&t!==null&&t!==""}function Wt(t,e){if(!Array.isArray(e))return false;let n=V(t);return e.map(r=>String(r)).includes(n)}function zt(t,e){let n=Nr(t.attribute,e),r=t.value;switch(t.op){case "is_set":return Ut(n);case "is_not_set":return !Ut(n);case "eq":return V(n)===V(r===void 0?j:r);case "neq":return V(n)!==V(r===void 0?j:r);case "contains":return V(n).includes(V(r===void 0?j:r));case "in":return Wt(n,r);case "not_in":return Array.isArray(r)?!Wt(n,r):false;case "gt":return ue(n,r,(i,s)=>i>s);case "gte":return ue(n,r,(i,s)=>i>=s);case "lt":return ue(n,r,(i,s)=>i<s);case "lte":return ue(n,r,(i,s)=>i<=s);case "in_cohort":return typeof r=="string"&&r!==""&&(e.cohorts??[]).includes(r);case "not_in_cohort":return typeof r=="string"&&r!==""&&!(e.cohorts??[]).includes(r);default:return false}}function ue(t,e,n){let r=jt(t),i=e===void 0?Number.NaN:jt(e);return Number.isNaN(r)||Number.isNaN(i)?false:n(r,i)}function Jt(t,e){let n=`${t}:${e}`,r=2166136261;for(let i=0;i<n.length;i++)r^=n.charCodeAt(i),r=Math.imul(r,16777619);return (r>>>0)%100}function Ue(t,e){return t.targeting.length===0||t.targeting.every(n=>zt(n,e))}function Yt(t,e){let n=Jt(t.key,e.distinctId),r=t.variations??[];if(r.length===0)return t.rolloutPercentage>=100||n<t.rolloutPercentage?"true":"false";let i=0;for(let s=r.length-1;s>=0;s--)if(i+=r[s].weight,n<i)return r[s].key;return r[0].key}function We(t,e,n,r){for(let i of t.prerequisites??[]){if(r.includes(i.flagKey))return false;let s=e.find(a=>a.key===i.flagKey);if(!s||!s.enabled)return false;r.push(s.key);let o=We(s,e,n,r)&&Ue(s,n)&&Yt(s,n)===i.variationKey;if(r.pop(),!o)return false}return true}function le(t,e,n){return t.enabled?We(t,e,n,[t.key])?Ue(t,n)?t.rolloutPercentage>=100?{enabled:true,reason:"rollout_full"}:Jt(t.key,n.distinctId)<t.rolloutPercentage?{enabled:true,reason:"rollout"}:{enabled:false,reason:"rollout_excluded"}:{enabled:false,reason:"targeting"}:{enabled:false,reason:"prerequisite"}:{enabled:false,reason:"disabled"}}function Qt(t,e){let n={};for(let r of t)n[r.key]=le(r,t,e).enabled;return n}function ze(t,e,n){let r=t.variations??[],i=r[0];if(!i)return null;if(!t.enabled||!We(t,e,n,[t.key])||!Ue(t,n))return i;let s=Yt(t,n);return r.find(o=>o.key===s)??i}function Xt(t){return t.some(e=>e.targeting.some(n=>n.op==="in_cohort"||n.op==="not_in_cohort"))}function Zt(t){return `40${JSON.stringify(t)}`}function en(){return "3"}function tn(t){let e=t.charAt(0),n=t.slice(1);if(e==="2")return {kind:"ping"};if(e==="1")return {kind:"disconnect"};if(e==="0"){let o=Je(n);return {kind:"open",pingInterval:typeof o?.pingInterval=="number"?o.pingInterval:25e3,pingTimeout:typeof o?.pingTimeout=="number"?o.pingTimeout:2e4}}if(e!=="4")return {kind:"other"};let r=n.charAt(0),i=n.slice(1);if(r==="0")return {kind:"connected"};if(r==="1")return {kind:"disconnect"};if(r==="4"){let o=Je(i);return {kind:"connectError",message:typeof o?.message=="string"?o.message:"refused"}}if(r!=="2")return {kind:"other"};let s=Je(i);return !Array.isArray(s)||typeof s[0]!="string"?{kind:"other"}:{kind:"event",name:s[0],payload:s[1]}}function Je(t){try{return JSON.parse(t)}catch{return null}}var Rr="/socket.io/?EIO=4&transport=websocket",Or=250,pe=class{constructor(e){this.options=e;d(this,"socket",null);d(this,"heartbeat",null);d(this,"pending",null);d(this,"lastKey","");d(this,"ready",false);d(this,"closed",false);d(this,"heartbeatWindow",45e3);d(this,"factory");d(this,"setTimer");d(this,"clearTimer");this.factory=e.socketFactory??Mr,this.setTimer=e.setTimer??((n,r)=>setTimeout(n,r)),this.clearTimer=e.clearTimer??(n=>clearTimeout(n));}open(){if(this.socket||this.closed)return;let e=`${this.options.host.replace(/^http/,"ws").replace(/\/+$/,"")}${Rr}`,n;try{n=this.factory(e);}catch{this.options.onClosed(false);return}this.socket=n,n.onmessage=r=>this.receive(String(r.data)),n.onerror=()=>n.close(),n.onclose=()=>this.fell();}close(){this.closed=true,this.stopHeartbeat(),this.pending!==null&&this.clearTimer(this.pending),this.pending=null;let e=this.socket;this.socket=null,e?.close();}receive(e){let n=tn(e);if(n.kind==="open"){this.armHeartbeat(n.pingInterval+n.pingTimeout),this.socket?.send(Zt({projectKey:this.options.projectKey}));return}if(n.kind==="ping"){this.armHeartbeat(),this.socket?.send(en());return}if(n.kind==="connectError"||n.kind==="disconnect"){this.stopHeartbeat(),this.socket?.close();return}if(n.kind==="event"){if(n.name==="ready"){this.ready=true;return}if(n.name==="flagChange"){let r=n.payload?.key;this.lastKey=typeof r=="string"?r:"",this.pending===null&&(this.pending=this.setTimer(()=>{this.pending=null,this.options.onChange(this.lastKey);},Or));}}}fell(){this.stopHeartbeat();let e=this.ready;this.socket=null,this.ready=false,this.closed||this.options.onClosed(e);}armHeartbeat(e){e!==void 0&&(this.heartbeatWindow=e),this.stopHeartbeat(),this.heartbeat=this.setTimer(()=>this.socket?.close(),this.heartbeatWindow);}stopHeartbeat(){this.heartbeat!==null&&this.clearTimer(this.heartbeat),this.heartbeat=null;}};function Mr(t){let e=globalThis.WebSocket;if(!e)throw new f("no WebSocket");return new e(t)}var me=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async fetchAll(e){return (await this.fetchDecisions(e)).flags}async fetchDecisions(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags?distinct_id=${encodeURIComponent(e)}`,i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`flags request failed with status ${o.status}`,o.status);let a=JSON.parse(await o.text());return {flags:a.flags??{},variants:a.variants??{}}}finally{s!==void 0&&clearTimeout(s);}}async snapshot(){let e=this.fetch;if(!e)throw new f("no fetch implementation available in this runtime");let n=`${this.host}/v1/flags/snapshot`,r=L(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await e(n,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r?.signal});if(!s.ok)throw new f(`flag snapshot request failed with status ${s.status}`,s.status);let o=JSON.parse(await s.text()),a={flags:o.flags??[],generatedAt:o.generatedAt};return typeof o.socketUrl=="string"&&o.socketUrl!==""&&(a.socketUrl=o.socketUrl),a}finally{i!==void 0&&clearTimeout(i);}}async memberships(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags/memberships?distinct_id=${encodeURIComponent(e)}`,i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`memberships request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).cohorts??[]}finally{s!==void 0&&clearTimeout(s);}}};var nn="$form_viewed",rn="$form_started",te=class extends Error{constructor(n,r,i){super(i);d(this,"fields");d(this,"status");this.name="FormRefusedError",this.status=n,this.fields=r;}},fe=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async request(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o={authorization:`Bearer ${this.projectKey}`};n.body!==void 0&&(o["content-type"]="application/json");let a=await r(`${this.host}${e}`,{body:n.body,headers:o,method:n.method,signal:i?.signal});return {status:a.status,text:await a.text()}}finally{s!==void 0&&clearTimeout(s);}}async form(e,n){let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}?distinct_id=${encodeURIComponent(n)}`,{method:"GET"});if(r<200||r>=300)throw new f(`form request failed with status ${r}`,r);return JSON.parse(i)}async submit(e,n){let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}/submissions`,{body:JSON.stringify(n),method:"POST"});if(r>=200&&r<300)return JSON.parse(i).afterSubmit;let s=[],o=`form submission failed with status ${r}`;try{let a=JSON.parse(i);s=a.error?.fields??[],o=a.error?.message??o;}catch{s=[];}throw new te(r,s,o)}};var sn="$survey_shown",on="$survey_dismissed",an="$survey_sent",ge=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async surveys(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await r(`${this.host}/v1/surveys?distinct_id=${encodeURIComponent(e)}${n?`&lang=${encodeURIComponent(n)}`:""}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`surveys request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).surveys??[]}finally{s!==void 0&&clearTimeout(s);}}},Dr=864e5,he=t=>`${t.id}:${t.iteration}`;function Ye(t,e){return t.length===0?true:t.some(n=>{switch(n.matches){case "exact":return e===n.value;case "starts_with":return e.startsWith(n.value);default:return e.includes(n.value)}})}function dn(t,e,n,r,i){return t.kind!=="popover"||e.settled.includes(he(t))||t.showOnce&&e.settled.some(s=>s.startsWith(`${t.id}:`))||t.waitDays>0&&e.lastShownAt!==void 0&&r-e.lastShownAt<t.waitDays*Dr||t.event&&t.event!==i?false:Ye(t.urls,n)}function ye(t,e){let n={$survey_id:t.id,$survey_iteration:t.iteration,$survey_name:t.name};for(let[r,i]of Object.entries(e))n[`$survey_response_${r}`]=i;return n}var Qe="$guide_shown",cn="$guide_step_viewed",un="$guide_step_missed",Xe="$guide_completed",Ze="$guide_dismissed",ln="$checklist_task_done",ve=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async guides(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=L(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await n(`${this.host}/v1/guides?distinct_id=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r?.signal});if(!s.ok)throw new f(`guides request failed with status ${s.status}`,s.status);return JSON.parse(await s.text()).guides??[]}finally{i!==void 0&&clearTimeout(i);}}},qr=864e5,z=t=>`${t.id}:${t.iteration}`,be=(t,e)=>`${z(t)}:${e}`;function pn(t,e,n,r,i){return e.settled.includes(z(t))||t.showOnce&&e.settled.some(s=>s.startsWith(`${t.id}:`))||t.kind!=="checklist"&&t.waitDays>0&&e.lastShownAt!==void 0&&r-e.lastShownAt<t.waitDays*qr||t.event&&t.event!==i?false:Ye(t.urls,n)}var et=(t,e)=>t.steps.filter(n=>e.done.includes(be(t,n.id))).map(n=>n.id),mn=(t,e)=>t.kind==="checklist"?t.steps.find(n=>n.event===e):void 0;function fn(t,e){let n={$guide_id:t.id,$guide_iteration:t.iteration,$guide_name:t.name};return e!==void 0&&(n.$guide_step_id=e),n}function ne(t){if(typeof t!="string")return;let e=Array.from(t).length;return e>=1&&e<=200?t:void 0}function ke(t,e){return `pdx.${t}.${e}`}var nt="consent",Kr=["identityLink","analytics","marketing","functional"];function tt(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))return null;let n=e,r={};for(let i of Kr){let s=n[i];typeof s=="boolean"&&(r[i]=s);}return typeof n.version=="number"&&Number.isInteger(n.version)&&(r.version=n.version),Array.isArray(n.categories)&&n.categories.every(i=>typeof i=="string")&&(r.categories=n.categories),Object.keys(r).length===0?null:r}catch{return null}}var gn=t=>t.endsWith(`.${nt}`);function Se(t,e){return tt(t.getItem(ke(e,nt)))}function Br(t,e,n){let r=ke(e,nt),i=tt(JSON.stringify(n)),s=i===null?null:tt(JSON.stringify({...Se(t,e)??{},...i}));if(s===null){t.removeItem(r);return}t.setItem(r,JSON.stringify(s));}function hn(t,e,n,r){let i=ke(n,"anonymous_id"),s=ne(e.getItem(i))??ne(t.getItem(i));return e.setItem(i,r),t.setItem(i,r),s!==void 0&&s!==r?s:void 0}var xe=class{constructor(e,n,r,i){this.storage=e;this.shared=n;this.ids=r;this.namespace=i;d(this,"anonymousId");d(this,"distinctId");d(this,"identified");this.refresh();}refresh(){let e=ne(this.shared.getItem(this.key("anonymous_id"))),n=ne(this.storage.getItem(this.key("anonymous_id")));e?(this.anonymousId=e,n!==e&&this.storage.setItem(this.key("anonymous_id"),e)):n?(this.anonymousId=n,this.shared.setItem(this.key("anonymous_id"),n)):(this.anonymousId=this.ids.uuid(),this.shared.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.setItem(this.key("anonymous_id"),this.anonymousId));let r=ne(this.storage.getItem(this.key("distinct_id")));r?(this.distinctId=r,this.identified=true):(this.distinctId=this.anonymousId,this.identified=false);}getAnonymousId(){return this.anonymousId}getDistinctId(){return this.distinctId}isIdentified(){return this.identified}snapshot(){return {anonymousId:this.anonymousId,distinctId:this.distinctId,identified:this.identified}}consent(){return Se(this.shared,this.namespace)}setConsent(e){Br(this.shared,this.namespace,e);}assumeAnonymousId(e){this.anonymousId=e,this.shared.setItem(this.key("anonymous_id"),e),this.storage.setItem(this.key("anonymous_id"),e),this.identified||(this.distinctId=e);}identify(e){let n=!this.identified||this.distinctId!==e,r=this.storage.getItem(this.key("linked_anonymous_id")),i=n||r!==this.anonymousId;return this.distinctId=e,this.identified=true,n&&this.storage.setItem(this.key("distinct_id"),e),!i||this.consent()?.identityLink===false?{changed:n}:(this.storage.setItem(this.key("linked_anonymous_id"),this.anonymousId),{anonymousToLink:this.anonymousId,changed:n})}reset(){this.anonymousId=this.ids.uuid(),this.distinctId=this.anonymousId,this.identified=false,this.shared.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.removeItem(this.key("distinct_id")),this.storage.removeItem(this.key("linked_anonymous_id"));}key(e){return ke(this.namespace,e)}};var we=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async inbox(e){let n=this.requireFetch(),r=`${this.host}/v1/messages?distinct_id=${encodeURIComponent(e)}`,i=await this.request(n,r,{headers:this.authHeaders(),method:"GET"});if(!i.ok)throw new f(`inbox request failed with status ${i.status}`,i.status);return JSON.parse(await i.text()).messages??[]}async markRead(e,n){let r=this.requireFetch(),i=`${this.host}/v1/messages/read`,s=await this.request(r,i,{body:JSON.stringify({distinct_id:n,message_id:e}),headers:{...this.authHeaders(),"content-type":"application/json"},method:"POST"});if(!s.ok)throw new f(`mark-read request failed with status ${s.status}`,s.status)}requireFetch(){if(!this.fetch)throw new f("no fetch implementation available in this runtime");return this.fetch}authHeaders(){return {authorization:`Bearer ${this.projectKey}`}}async request(e,n,r){let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{return await e(n,{...r,signal:i?.signal})}finally{s!==void 0&&clearTimeout(s);}}};var Ee=class{constructor(e,n){this.maxSize=e;this.onOverflow=n;d(this,"events",[]);}get size(){return this.events.length}enqueue(e){this.events.push(e),this.enforceCap();}restore(e){this.events.push(...e),this.enforceCap();}requeue(e){this.events.unshift(...e),this.enforceCap();}drain(e){let n=e===void 0?this.events.length:Math.min(e,this.events.length);return this.events.splice(0,n)}snapshot(){return [...this.events]}enforceCap(){if(this.events.length<=this.maxSize)return;let e=this.events.splice(0,this.events.length-this.maxSize);this.onOverflow?.({dropped:e});}};var Hr={idleMs:18e5,maxMs:864e5,throttleMs:1e4};function yn(t){return `pdx.${t}.session`}function vn(t,e,n,r){let i={id:n.id,lastActivityAt:r,startedAt:n.startedAt};t.setItem(yn(e),JSON.stringify(i));}var Te=class{constructor(e,n,r,i,s=Hr){this.storage=e;this.ids=n;this.clock=r;this.namespace=i;this.options=s;}current(){return this.touch().id}startedAt(){return this.touch().startedAt}reset(){this.storage.removeItem(this.key());}touch(){let e=this.clock.now().getTime(),n=this.live(this.read(),e);if(n===void 0)return this.write({id:this.ids.uuid(),lastActivityAt:e,startedAt:e});if(e-n.lastActivityAt<=this.options.throttleMs)return n;let r=this.live(this.read(),e),i=r!==void 0&&r.id!==n.id?r:n;return this.write({...i,lastActivityAt:e})}live(e,n){if(e!==void 0&&!(n-e.lastActivityAt>this.options.idleMs||n-e.startedAt>this.options.maxMs))return e}write(e){return this.storage.setItem(this.key(),JSON.stringify(e)),e}read(){let e=this.storage.getItem(this.key());if(e)try{let n=JSON.parse(e);return typeof n.id=="string"&&typeof n.startedAt=="number"&&typeof n.lastActivityAt=="number"?{id:n.id,lastActivityAt:n.lastActivityAt,startedAt:n.startedAt}:void 0}catch{return}}key(){return yn(this.namespace)}};var w={autocapture:"$autocapture",createAlias:"$create_alias",featureFlagCalled:"$feature_flag_called",group:"$group",identify:"$identify",pageview:"$pageview",set:"$set",webVitals:"$web_vitals"};function bn(t){return t>=400&&t<500&&t!==429}var J=class{constructor(e={}){d(this,"fetch");d(this,"maxRetries");d(this,"requestTimeoutMs");d(this,"baseDelayMs");d(this,"maxDelayMs");d(this,"sleep");d(this,"random");this.fetch=F(e.fetch),this.maxRetries=e.maxRetries??3,this.requestTimeoutMs=e.requestTimeoutMs??1e4,this.baseDelayMs=e.baseDelayMs??500,this.maxDelayMs=e.maxDelayMs??3e4,this.sleep=e.sleep??Ft,this.random=e.random??Math.random;}async send(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=JSON.stringify(e.body),i;for(let s=0;s<=this.maxRetries;s+=1){try{let o=await this.attempt(n,e,r);if(o.ok)return;if(bn(o.status))throw new f(`ingest rejected batch with status ${o.status}`,o.status);i=new f(`ingest transient status ${o.status}`,o.status);}catch(o){if(o instanceof f&&o.status!==void 0&&bn(o.status))throw o;i=o;}s<this.maxRetries&&await this.sleep(this.backoff(s));}throw new f("ingest delivery failed after retries",void 0,{cause:i})}async attempt(e,n,r){let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{return await e(n.url,{body:r,headers:{authorization:`Bearer ${n.projectKey}`,"content-type":"application/json"},method:"POST",signal:i?.signal})}finally{s!==void 0&&clearTimeout(s);}}backoff(e){return Math.min(this.maxDelayMs,this.baseDelayMs*2**e)+this.random()*this.baseDelayMs}};var Gr="queue",Vr=1e3,xn=3e4,rt=t=>{let e={};return t.avatar!==void 0&&(e.$avatar=t.avatar),t.email!==void 0&&(e.$email=t.email),t.name!==void 0&&(e.$name=t.name),t.phone!==void 0&&(e.$phone=t.phone),e},Ce=class{constructor(e){d(this,"config");d(this,"identity");d(this,"session");d(this,"queue");d(this,"transport");d(this,"flagsClient");d(this,"messagesClient");d(this,"surveysClient");d(this,"guidesClient");d(this,"captureListeners",new Set);d(this,"formsClient");d(this,"ctasClient");d(this,"context");d(this,"flushTimer");d(this,"flushing",false);d(this,"cachedFlags");d(this,"cachedSnapshot");d(this,"membershipCache");d(this,"stream");d(this,"shutDown",false);d(this,"exposures",new Set);d(this,"gates");d(this,"cookielessId");d(this,"storageListeners",new Set);let n=Kt(e),r=Se(n.sharedStorage,n.namespace)??n.consent??null;if(this.gates=[new ee(n.storage),new ee(n.sharedStorage,gn)],n.consentMode!=="banner"||r?.analytics===true)for(let o of this.gates)o.open();let[i,s]=this.gates;this.config={...n,sharedStorage:s,storage:i},this.identity=new xe(this.config.storage,this.config.sharedStorage,this.config.ids,this.config.namespace),this.config.consent!==void 0&&this.identity.setConsent(this.config.consent),this.session=this.config.sessionTracking?new Te(this.config.sharedStorage,this.config.ids,this.config.clock,this.config.namespace):void 0,this.queue=new Ee(this.config.maxQueueSize,({dropped:o})=>{this.config.onError(new D("queue_overflow",`event queue overflow: dropped ${o.length} oldest event(s)`));}),this.transport=this.config.transport??new J({maxRetries:this.config.maxRetries,requestTimeoutMs:this.config.requestTimeoutMs}),this.flagsClient=new me({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.messagesClient=new we({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.surveysClient=new ge({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.guidesClient=new ve({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.formsClient=new fe({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.ctasClient=new ce({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.context={sdk:this.config.sdkName,sdk_version:this.config.sdkVersion},this.config.os&&(this.context.os=this.config.os),this.config.locale&&(this.context.locale=this.config.locale),this.restoreQueue(),this.startTimer();}get distinctId(){return this.identity.getDistinctId()}get anonymousId(){return this.identity.getAnonymousId()}get isIdentified(){return this.identity.isIdentified()}get sessionId(){return this.session?.current()}get sessionStartedAt(){return this.session?.startedAt()}capture(e,n={}){try{this.identity.refresh();let r={...this.config.defaultProperties(),...n.element===void 0?{}:this.config.describeElement?.(n.element)??{},...n.properties??{}},i=Vt({context:this.context,distinctId:n.distinctId??this.identity.getDistinctId(),eventName:e,properties:r,sessionId:n.sessionId??this.session?.current(),timestamp:n.timestamp},this.config.clock,this.config.ids);this.enqueue(i);}catch(r){this.config.onError(r);}for(let r of this.captureListeners)try{r(e);}catch(i){this.config.onError(i);}}onCapture(e){return this.captureListeners.add(e),()=>{this.captureListeners.delete(e);}}identify(e,n={}){if(this.isCookieless())return;this.identity.refresh();let r=this.identity.identify(e),i={};r.anonymousToLink!==void 0&&(i.$anon_distinct_id=r.anonymousToLink);let s=$t(),o={...s===null?{}:{$timezone:s},...rt(n.traits??{}),...n.set??{}};Object.keys(o).length>0&&(i.$set=o),this.capture(w.identify,{properties:i});}link(e,n,r){if(this.isCookieless())return;let i={$anon_distinct_id:n},s=rt(r??{});Object.keys(s).length>0&&(i.$set=s),this.capture(w.identify,{distinctId:e,properties:i});}setConsent(e){this.identity.setConsent(e),e.analytics===true&&this.allowStorage(),e.analytics===false&&this.config.consentMode==="banner"&&this.forbidStorage();}isCookieless(){return !this.gates[0].isOpen}takeCookielessId(e){this.cookielessId=e,this.isCookieless()&&this.identity.assumeAnonymousId(e);}allowStorage(){if(this.isCookieless()){for(let e of this.gates)e.open();this.identity.refresh();for(let e of [...this.storageListeners])e();}}onStorageAllowed(e){return this.storageListeners.add(e),()=>{this.storageListeners.delete(e);}}forbidStorage(){if(!this.isCookieless()){for(let e of ["anonymous_id","distinct_id","linked_anonymous_id","session"])this.config.storage.removeItem(`pdx.${this.config.namespace}.${e}`),this.config.sharedStorage.removeItem(`pdx.${this.config.namespace}.${e}`);for(let e of this.gates)e.close();this.identity.refresh(),this.cookielessId!==void 0&&this.identity.assumeAnonymousId(this.cookielessId);}}consent(){return this.identity.consent()}alias(e){this.capture(w.createAlias,{properties:{alias:e}});}group(e,n,r){let i={$group_key:n,$group_type:e};r&&(i.$set=r),this.capture(w.group,{properties:i});}setPersonProperties(e,n){if(this.isCookieless())return;let r={};e&&(r.$set=e),n&&(r.$set_once=n),this.capture(w.set,{properties:r});}setPersonTraits(e){if(this.isCookieless())return;let n=rt(e);Object.keys(n).length!==0&&this.capture(w.set,{properties:{$set:n}});}async getAllFlags(){let e=this.identity.getDistinctId(),n=await this.flagsClient.fetchDecisions(e);return this.cachedFlags={distinctId:e,flags:n.flags,variants:n.variants??{}},n.flags}async isFeatureEnabled(e){let r=(await this.getAllFlags())[e]??false;return this.recordExposure(e,this.cachedFlags?.variants[e]?.key??String(r)),r}async getVariant(e){let n=await this.getAllFlags(),r=this.cachedFlags?.variants[e]??null;return this.recordExposure(e,r?.key??String(n[e]??false)),r}async getVariantLocal(e,n={}){let r=await this.flagSnapshot(),i=r.flags.find(u=>u.key===e),s=await this.localContext(n,r.flags),o=i?ze(i,r.flags,s):null,a=i?le(i,r.flags,s).enabled:false;return this.recordExposure(e,o?.key??String(a)),o?{key:o.key,value:o.value}:null}recordExposure(e,n){let r=`${this.identity.getDistinctId()} ${e} ${n}`;this.exposures.has(r)||(this.exposures.add(r),this.capture(w.featureFlagCalled,{properties:{$feature_flag:e,$feature_flag_response:n}}));}getCachedFlag(e){if(!(!this.cachedFlags||this.cachedFlags.distinctId!==this.distinctId))return this.cachedFlags.flags[e]}async getLocalFlags(e={}){let n=await this.flagSnapshot();return Qt(n.flags,await this.localContext(e,n.flags))}async isFeatureEnabledLocal(e,n={}){let r=await this.flagSnapshot(),i=r.flags.find(a=>a.key===e),s=await this.localContext(n,r.flags),o=i?le(i,r.flags,s).enabled:false;return this.recordExposure(e,(i?ze(i,r.flags,s)?.key:void 0)??String(o)),o}async localContext(e,n){let r=this.identity.getDistinctId(),i=e.cohorts;if(i===void 0&&Xt(n)){let s=this.config.clock.now().getTime();this.membershipCache&&this.membershipCache.distinctId===r&&s-this.membershipCache.fetchedAt<xn?i=this.membershipCache.cohorts:(i=await this.flagsClient.memberships(r),this.membershipCache={cohorts:i,distinctId:r,fetchedAt:s});}return {attributes:e.attributes,cohorts:i,distinctId:r,properties:e.properties}}async flagSnapshot(){let e=this.config.clock.now().getTime();if(this.cachedSnapshot&&e-this.cachedSnapshot.fetchedAt<xn)return this.cachedSnapshot.snapshot;let n=await this.flagsClient.snapshot();return this.cachedSnapshot={fetchedAt:e,snapshot:n},this.maybeStream(n),n}maybeStream(e){if(!this.config.streamFlags||this.shutDown||this.stream||!e.socketUrl)return;let n=new pe({host:e.socketUrl,onChange:()=>{this.cachedSnapshot=void 0,this.flagSnapshot().catch(r=>this.config.onError(r));},onClosed:r=>{this.stream=void 0,r&&this.maybeStream(e);},projectKey:this.config.apiKey,socketFactory:this.config.socketFactory});this.stream=n,n.open();}async getInbox(){return this.messagesClient.inbox(this.identity.getDistinctId())}async markMessageRead(e){await this.messagesClient.markRead(e,this.identity.getDistinctId());}async getSurveys(e){return this.surveysClient.surveys(this.identity.getDistinctId(),e??this.config.locale)}captureSurveyShown(e){this.capture(sn,{properties:ye(e,{})});}captureSurveyDismissed(e){this.capture(on,{properties:ye(e,{})});}captureSurveySent(e,n){this.capture(an,{properties:ye(e,n)});}async getGuides(){return this.guidesClient.guides(this.identity.getDistinctId())}captureGuide(e,n,r){this.capture(e,{properties:fn(n,r)});}async getForm(e){return this.formsClient.form(e,this.identity.getDistinctId())}async submitForm(e,n,r,i){let{$page_id:s,$page_variant:o}=this.config.defaultProperties();return this.formsClient.submit(e,{answers:n,challenge:r,distinctId:this.identity.getDistinctId(),isAnonymous:!this.identity.isIdentified(),pageUrl:typeof window>"u"?"":window.location.href,solution:i,...typeof s=="string"&&typeof o=="string"?{pageId:s,pageVariant:o}:{}})}async getCtas(e){return this.ctasClient.ctas({...e,anonymous:!this.identity.isIdentified(),distinctId:this.identity.getDistinctId()})}captureCta(e,n,r){this.capture(e,{properties:Gt(n,r)});}async flush(){if(this.flushing||this.queue.size===0)return;this.flushing=true;let e=this.queue.drain(Vr);try{await this.transport.send({body:{events:e,sent_at:ae(this.config.clock.now())},projectKey:this.config.apiKey,url:`${this.config.host}/v1/events`}),this.persistQueue();}catch(n){this.queue.requeue(e),this.persistQueue(),this.config.onError(n);}finally{this.flushing=false;}}reset(){this.session?.reset(),this.identity.reset(),this.cachedFlags=void 0,this.cachedSnapshot=void 0,this.membershipCache=void 0;}async shutdown(){this.shutDown=true,this.stopTimer(),this.stream?.close(),this.stream=void 0,await this.flush();}enqueue(e){this.queue.enqueue(e),this.persistQueue(),this.queue.size>=this.config.flushAt&&this.flush();}persistQueue(){try{this.config.storage.setItem(this.persistKey(),JSON.stringify(this.queue.snapshot()));}catch(e){this.config.onError(e);}}restoreQueue(){try{let e=this.config.storage.getItem(this.persistKey());if(!e)return;let n=JSON.parse(e);Array.isArray(n)&&this.queue.restore(n);}catch(e){this.config.onError(e);}}startTimer(){if(this.config.flushIntervalMs<=0)return;let e=setInterval(()=>{this.flush();},this.config.flushIntervalMs),n=e;typeof n.unref=="function"&&n.unref(),this.flushTimer=e;}stopTimer(){this.flushTimer!==void 0&&(clearInterval(this.flushTimer),this.flushTimer=void 0);}persistKey(){return `pdx.${this.config.namespace}.${Gr}`}};var Sn="data-prodantix",wn="data-prodantix-action",En="data-prodantix-ignore",Y=300,it="data-pdx-no-capture",st="pdx-no-capture",jr=new Set(["a","button","input","label","option","select","summary","textarea"]),Ur=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]);function Wr(t){return jr.has(t.tagName.toLowerCase())||Ur.has((t.getAttribute("role")??"").trim().toLowerCase())}function ot(t){for(let e=t;e!==null;e=e.parentElement)if(Wr(e))return e;return t}function at(t){for(let e=t;e!==null;e=e.parentElement)if(e.getAttribute(En)!==null)return true;return false}function dt(t){for(let e=t;e!==null;e=e.parentElement)if(e.getAttribute(it)!==null||typeof e.className=="string"&&e.className.split(/\s+/).includes(st))return true;return false}function Ie(t){let e=new Set;return n=>{e.has(n.message)||(e.add(n.message),t(n));}}function kn(t,e,n){let r=t.getAttribute(e);if(r===null)return;let i=r.trim();if(i!==""){if(i.length>Y){n(new D("validation",`${e} on a <${t.tagName.toLowerCase()}> is ${i.length} characters, over the ${Y}-character limit, so it was ignored: "${i.slice(0,40)}\u2026"`));return}return i}}function ct(t,e){let n={},r=kn(t,Sn,e);r!==void 0&&(n.$el_description=r,n.$el_description_source="annotation");let i=kn(t,wn,e);return i!==void 0&&(n.$el_action=i),n}function Tn(t,e){return !zr(t)||at(t)||dt(t)?{}:ct(ot(t),e)}function zr(t){return typeof t=="object"&&t!==null&&typeof t.tagName=="string"&&typeof t.getAttribute=="function"}var Jr="$form_submitted",Yr=new Set(["button","file","hidden","image","password","reset","submit"]),Cn=/(card|cc-?num|cvc|cvv|iban|security.?code)/i,Qr=t=>(t.getAttribute("autocomplete")??"").startsWith("cc-")||Cn.test(t.name)||Cn.test(t.id),Xr=t=>{let e=t.name.toLowerCase();return t instanceof HTMLInputElement&&t.type==="email"||e==="email"||t.getAttribute("autocomplete")==="email"?"$email":e==="name"||e==="full_name"||e==="fullname"||t.getAttribute("autocomplete")==="name"?"$name":null},Zr=(t,e)=>{if(t.closest("[data-prodantix-ignore]")||t.hasAttribute("data-prodantix-form"))return null;let n={},r={};for(let i of Array.from(t.elements)){if(!(i instanceof HTMLInputElement||i instanceof HTMLSelectElement||i instanceof HTMLTextAreaElement)||!i.name||i.closest("[data-prodantix-ignore]")||Qr(i)||i instanceof HTMLInputElement&&(Yr.has(i.type)||(i.type==="checkbox"||i.type==="radio")&&!i.checked))continue;let s=i.value.trim();if(s==="")continue;n[i.name]=s;let o=Xr(i);o&&(r[o]=s);}return {$answers:n,$form_id:t.id||`${e}#${Array.from(t.ownerDocument.forms).indexOf(t)}`,$page_url:t.ownerDocument.location?.href??"",$set:r,collected:true}},In=(t,e=document)=>{let n=r=>{if(r.target instanceof HTMLFormElement){let i=Zr(r.target,e.location?.pathname??"");i&&t.capture(Jr,{properties:i});}};return e.addEventListener("submit",n,true),()=>e.removeEventListener("submit",n,true)};var ei=1e3,ti=5e3,ni=50,ut=class{constructor(){d(this,"fcp");d(this,"lcp");d(this,"cls");d(this,"window",{end:0,start:0,sum:0});d(this,"interactions",new Map);}add(e){if(e.entryType==="paint"&&e.name==="first-contentful-paint"&&(this.fcp=e.startTime),e.entryType==="largest-contentful-paint"&&(this.lcp=e.startTime),e.entryType==="layout-shift"&&!e.hadRecentInput&&e.value!==void 0){let n=this.window.sum>0&&e.startTime-this.window.end<ei&&e.startTime-this.window.start<ti;this.window=n?{end:e.startTime,start:this.window.start,sum:this.window.sum+e.value}:{end:e.startTime,start:e.startTime,sum:e.value},this.cls=Math.max(this.cls??0,this.window.sum);}e.entryType==="event"&&e.interactionId!==void 0&&e.interactionId>0&&this.interactions.set(e.interactionId,Math.max(this.interactions.get(e.interactionId)??0,e.duration));}properties(e){let n={};if(this.lcp!==void 0&&(n.$lcp_ms=Math.round(this.lcp)),this.fcp!==void 0&&(n.$fcp_ms=Math.round(this.fcp)),this.cls!==void 0&&(n.$cls=Math.round(this.cls*1e4)/1e4),this.interactions.size>0){let r=[...this.interactions.values()].sort((i,s)=>s-i);n.$inp_ms=Math.round(r[Math.min(r.length-1,Math.floor(r.length/ni))]??0);}return e!==void 0&&(n.$ttfb_ms=Math.round(e)),n}},ri=[{type:"paint"},{type:"largest-contentful-paint"},{type:"layout-shift"},{durationThreshold:40,type:"event"}];function _n(t,e){let n=new ut,r=[];for(let o of ri){let a=e.observer(u=>{for(let c of u)n.add(c);});if(a!==void 0)try{a.observe({...o,buffered:!0}),r.push(a);}catch{a.disconnect();}}let i=false,s=()=>{if(i)return;let o=n.properties(e.firstByte());if(Object.keys(o).length===0)return;i=true;let a=e.path();t.capture(w.webVitals,{properties:a===void 0?o:{...o,$pathname:a}});};return e.addEventListener("visibilitychange",()=>{e.isHidden()&&s();}),e.addEventListener("pagehide",s),()=>{for(let o of r)o.disconnect();}}function Pn(){if(!(typeof window>"u"||typeof document>"u"||typeof PerformanceObserver>"u"))return {addEventListener:(t,e)=>(t==="pagehide"?window:document).addEventListener(t,e),firstByte:()=>{let t=performance.getEntriesByType("navigation")[0];return t instanceof PerformanceNavigationTiming&&t.responseStart>0?t.responseStart:void 0},isHidden:()=>document.visibilityState==="hidden",observer:t=>{try{return new PerformanceObserver(e=>t(e.getEntries()))}catch{return}},path:()=>window.location?.pathname}}var ii=new Set(["input","select","textarea"]),si=new Set(["email","password","tel"]);function Pe(){return globalThis.location}function An(){return globalThis.document}function oi(){return globalThis.window??globalThis}function ai(t){return typeof t=="object"&&t!==null&&typeof t.tagName=="string"}function _e(t,e){let n;try{n=new URL(t,e);}catch{return}return n.protocol==="http:"||n.protocol==="https:"?`${n.origin}${n.pathname}`:n.protocol}function Fn(){let t=Pe(),e=An(),n={};if(t){let r=_e(t.href);r&&(n.$current_url=r),n.$pathname=t.pathname,n.$host=t.host;}if(e){e.title&&(n.$title=e.title);let r=e.referrer?_e(e.referrer):void 0;r&&(n.$referrer=r);}return n}function di(t){return typeof t.className=="string"?t.className:""}function ci(t){return ii.has(t.tagName.toLowerCase())||si.has((t.getAttribute("type")??"").toLowerCase())}function ui(t,e,n){let r={$el_tag:t.tagName.toLowerCase(),$event_type:"click"};if(e)return r;let i=n?t.textContent?.trim():void 0;i&&(r.$el_text=i.slice(0,255)),t.id&&(r.$el_id=t.id);let s=di(t);s&&(r.$el_classes=s);let o=t.getAttribute("href"),a=o?_e(o,Pe()?.href):void 0;return a&&(r.$el_href=a),r}function lt(t){return (t??"").replace(/\s+/g," ").trim()}function re(t,e){return {$el_description:t,$el_description_source:e}}function li(t,e,n){if(!e&&n){let o=lt(t.getAttribute("aria-label"));if(o!==""&&o.length<=Y)return re(o,"aria_label");let a=lt(t.textContent);if(a!==""&&a.length<=Y)return re(a,"text")}let r=e?null:t.getAttribute("href"),i=r?_e(r,Pe()?.href):void 0;if(i)return re(i,"href");let s=lt(t.getAttribute("role")).toLowerCase();return s===""?re(t.tagName.toLowerCase(),"tag"):re(s,"role")}function pi(t,e){let n=new Set,r=(c,l)=>{if(n.has(c))return false;try{return l()}catch(p){return n.add(c),e(new D("config",`autocapture maskSelectors entry "${c}" is not a valid selector`,{cause:p})),false}},i=(c,l)=>c.matches?r(l,()=>c.matches?.(l)===!0):false,s=c=>{let l=c.querySelector?.bind(c);return l?l(`[${it}], .${st}`)!==null||t.some(p=>r(p,()=>l(p)!==null)):false},o=c=>{for(let l=c;l;l=l.parentElement){let p=l;if(t.some(x=>i(p,x)))return true}return false},a=c=>{for(let l=c;l;l=l.parentElement)if(ci(l))return true;return false},u=c=>dt(c)||o(c);return {holdsMasked:s,isMasked:c=>u(c)||a(c),isOptedOut:u}}function mi(t){let e=globalThis.history,n=oi(),r="",i=()=>{let a=Pe(),u=a?`${a.pathname}${a.search}`:"";u!==r&&(r=u,t.capture(w.pageview,{properties:Fn()}));};if(i(),!e||!n)return ()=>{};let s=e.pushState.bind(e),o=e.replaceState.bind(e);return e.pushState=(...a)=>{s(...a),i();},e.replaceState=(...a)=>{o(...a),i();},n.addEventListener("popstate",i),()=>{e.pushState=s,e.replaceState=o,n.removeEventListener("popstate",i);}}function fi(t,e){let n=An();if(!n)return ()=>{};let r=e.onError??(()=>{}),i=pi(e.maskSelectors??[],r),s=Ie(r),o=e.captureElementText??false,a=u=>{let c=u.target;if(!ai(c)||at(c))return;let l=ot(c),p=i.isMasked(c)||i.holdsMasked(l),x=i.isOptedOut(c)?{}:ct(l,s),$=x.$el_description===void 0?li(l,p,o):{};t.capture(w.autocapture,{properties:{...Fn(),...ui(l,p,o),...$,...x}});};return n.addEventListener("click",a,true),()=>n.removeEventListener("click",a,true)}function Ln(t,e={}){let n=[];(e.pageviews??true)&&n.push(mi(t)),(e.clicks??true)&&n.push(fi(t,e)),e.collectForms===true&&typeof document<"u"&&n.push(In(t));let r=e.webVitals===false?void 0:Pn();return r!==void 0&&n.push(_n(t,r)),()=>{for(let i of n)i();}}function gi(){return globalThis.document?.visibilityState==="hidden"}function hi(t){let e=globalThis.navigator,n=globalThis.Blob;if(!e?.sendBeacon||!n)return false;let r=JSON.stringify({...t.body,api_key:t.projectKey});try{let i=new n([r],{type:"application/json"});return e.sendBeacon(t.url,i)}catch{return false}}var Ae=class{constructor(e={}){d(this,"fetchTransport");this.fetchTransport=new J(e);}async send(e){gi()&&hi(e)||await this.fetchTransport.send(e);}};var pt="prodantix:consent-ready",mt="prodantix:consent",$n="__prodantixConsent";var Nn=(t,e)=>{t.takeCookielessId(e.anonymousId),e.consent!==null?t.setConsent(e.consent):e.rule==="notice"&&t.allowStorage();},Rn=(t,e)=>{let n=e[$n];n&&Nn(t,n);let r=s=>{let o=s.detail;o&&Nn(t,o);},i=s=>{let o=s.detail;o&&t.setConsent(o);};return e.addEventListener(pt,r),e.addEventListener(mt,i),()=>{e.removeEventListener(pt,r),e.removeEventListener(mt,i);}};var yi=/^\d{1,3}(\.\d{1,3}){3}$/,vi=/^[a-z0-9.-]+$/i;function On(){return Math.random().toString(36).slice(2,12)}function Fe(t,e){let n=`${e}=`,r=[];for(let i of t.cookie.split(";")){let s=i.trim();s.startsWith(n)&&r.push(s.slice(n.length));}return r}function ie(t,e,n){let r=["Path=/",`Max-Age=${e}`,"SameSite=Lax"];return t&&r.push(`Domain=${t}`),n&&r.push("Secure"),r.join("; ")}function Mn(t,e,n,r){try{let i=`pdx_probe_${r()}`,s=r();t.cookie=`${i}=${s}; ${ie(e,60,n)}`;let o=Fe(t,i).includes(s);t.cookie=`${i}=; ${ie(e,0,n)}`;let a=Fe(t,i).includes(s);return o&&!a}catch{return false}}function gt(t){let e=t.replace(/^\[|\]$/g,"").toLowerCase();if(e.includes(":")||yi.test(e)||!e.includes("."))return [];let n=e.split("."),r=[];for(let i=n.length-2;i>=0;i-=1)r.push(n.slice(i).join("."));return r}function Dn(t,e,n,r=On){for(let i of gt(t))if(Mn(e,i,n,r))return i}function bi(t){let e=new Map,n=JSON.parse(decodeURIComponent(t));if(n===null||typeof n!="object"||Array.isArray(n))return e;for(let[r,i]of Object.entries(n))typeof i=="string"&&e.set(r,i);return e}var ft=class{constructor(e,n,r,i){this.jar=e;this.name=n;this.domain=r;this.secure=i;}getItem(e){return this.read().get(e)??null}setItem(e,n){let r=this.read();r.set(e,n),this.write(r);}removeItem(e){let n=this.read();n.delete(e)&&this.write(n);}read(){try{let e=Fe(this.jar,this.name);e.length>1&&this.domain&&(this.jar.cookie=`${this.name}=; ${ie(void 0,0,this.secure)}`,e=Fe(this.jar,this.name));let n=e[0];return n?bi(n):new Map}catch{return new Map}}write(e){try{if(e.size===0){this.jar.cookie=`${this.name}=; ${ie(this.domain,0,this.secure)}`;return}let n=encodeURIComponent(JSON.stringify(Object.fromEntries(e)));this.jar.cookie=`${this.name}=${n}; ${ie(this.domain,31536e3,this.secure)}`;}catch{return}}};function xi(){return globalThis.document}function ki(){return globalThis.location?.hostname??""}function Si(){return globalThis.location?.protocol==="https:"}function wi(t){if(t===void 0)return;let e=t.startsWith(".")?t.slice(1):t;return vi.test(e)?e.toLowerCase():void 0}function ht(t){let e="jar"in t?t.jar:xi();if(!e||globalThis.navigator?.cookieEnabled===false)return null;let r=t.random??On,i=t.secure??Si(),s=t.hostname??ki();try{let o=wi(t.domain)??Dn(s,e,i,r);return Mn(e,o,i,r)?new ft(e,t.name,o,i):null}catch{return null}}var Ei=["am","ar","bn","de","en","es","et","fil","fr","hi","id","ja","ko","pt","ru","sw","vi","zh"],qn=t=>{let e=(t??"").toLowerCase().split("-")[0]??"";return Ei.find(n=>n===e)??"en"};var Ti=/^\$(survey|guide|checklist)_/,Kn=()=>({guides:{done:[],settled:[]},surveys:{settled:[]}});function Ci(t,e){try{let n=t.getItem(e);if(n===null)return Kn();let r=JSON.parse(n);return {guides:{done:r.guides?.done??[],lastShownAt:r.guides?.lastShownAt,settled:r.guides?.settled??[]},surveys:{lastShownAt:r.surveys?.lastShownAt,settled:r.surveys?.settled??[]}}}catch{return Kn()}}function Bn(t,e,n){let r=n();return r?Promise.resolve(r):new Promise(i=>{let s=t.document.createElement("script");s.src=e,s.async=true,s.onload=()=>i(n()??null),s.onerror=()=>i(null),t.document.head.append(s);})}function Hn(t,e,n){let r=`pdx_engage_${n.namespace}`,i=Ci(n.storage,r),s=()=>{try{n.storage.setItem(r,JSON.stringify(i));}catch(y){n.onError(y);}},o=qn(e.document.documentElement.lang||e.navigator.language),a=[],u=[],c=false,l=false,p=new Map,x=()=>Bn(e,`${n.edgeHost}/surveys.js`,()=>e.prodantixSurveys),$=()=>Bn(e,`${n.edgeHost}/guides.js`,()=>e.prodantixGuides),_=async y=>{if(c)return;let g=a.find(A=>dn(A,i.surveys,e.location.href,Date.now(),y));if(!g)return;c=true;let T=await x();if(!T){c=false;return}let E=()=>{i.surveys.settled=[...i.surveys.settled.filter(A=>A!==he(g)),he(g)],s(),c=false;};T.showSurvey(e.document,g,o,{onDismissed:()=>{t.captureSurveyDismissed(g),E();},onSent:A=>{t.captureSurveySent(g,A),E();},onShown:()=>{i.surveys.lastShownAt=Date.now(),s(),t.captureSurveyShown(g);}});},R=y=>{i.guides.settled=[...i.guides.settled.filter(g=>g!==z(y)),z(y)],s();},B=async y=>{let g=u.filter(v=>!p.has(v.id)&&pn(v,i.guides,e.location.href,Date.now(),y)),T=g.filter(v=>v.kind==="checklist"),E=l?void 0:g.find(v=>v.kind!=="checklist");if(T.length===0&&!E)return;E&&(l=true);let A=await $();if(!A){l=false;return}for(let v of T)p.has(v.id)||p.set(v.id,A.showChecklist(e.document,v,o,et(v,i.guides),{onDismissed:()=>{t.captureGuide(Ze,v),R(v),p.delete(v.id);},onShown:()=>t.captureGuide(Qe,v)}));if(!E)return;(E.kind==="tooltip"?A.showTooltip:A.showTour)(e.document,E,o,{onCompleted:()=>{t.captureGuide(Xe,E),R(E),l=false;},onDismissed:()=>{t.captureGuide(Ze,E),R(E),l=false;},onMissed:v=>t.captureGuide(un,E,v),onShown:()=>{i.guides.lastShownAt=Date.now(),s(),t.captureGuide(Qe,E);},onStep:v=>t.captureGuide(cn,E,v)});},X=y=>{for(let g of u){let T=mn(g,y);!T||i.guides.done.includes(be(g,T.id))||i.guides.settled.includes(z(g))||(i.guides.done=[...i.guides.done,be(g,T.id)],t.captureGuide(ln,g,T.id),p.get(g.id)?.markDone(T.id),et(g,i.guides).length===g.steps.length&&(t.captureGuide(Xe,g),R(g),p.get(g.id)?.close(),p.delete(g.id)),s());}},O=y=>{n.surveys&&_(y).catch(n.onError),n.guides&&B(y).catch(n.onError);},M=t.onCapture(y=>{Ti.test(y)||(X(y),O(y));}),P=()=>O();e.addEventListener("popstate",P);let K=async()=>{let y=E=>(n.onError(E),[]),[g,T]=await Promise.all([n.surveys?t.getSurveys(e.document.documentElement.lang||e.navigator.language).catch(y):[],n.guides?t.getGuides().catch(y):[]]);a=g,u=T,O();};return e.document.readyState==="loading"?e.document.addEventListener("DOMContentLoaded",()=>void K(),{once:true}):K(),()=>{M(),e.removeEventListener("popstate",P);for(let y of p.values())y.close();p.clear();}}var jn="_pdx",Un="~",Ii=200,_i=/^\d+$/;function Wn(t,e,n,r){let i=Ai(t.href);if(i===void 0||vt(i.search).some(bt))return;let s=Gn(i.hostname,n);s===void 0||s===Gn(r,n)||(i.search=`${i.search}${i.search?"&":"?"}${jn}=${Pi(e)}`,t.href=i.href);}function Pi(t){return [t.anonymousId,t.sessionId,String(t.sessionStartedAt)].map(Li).join(Un)}function zn(t){let e=vt(t).find(bt);if(e===void 0)return;let n=Fi(e).split(Un);if(n.length!==3)return;let r=Le(n[0]),i=Le(n[1]),s=Le(n[2]);if(!(!Vn(r)||!Vn(i)||!$i(s)))return {anonymousId:r,sessionId:i,sessionStartedAt:Number(s)}}function Jn(t,e){let n=vt(e.search),r=n.filter(s=>!bt(s));if(r.length===n.length)return;let i=r.length>0?`?${r.join("&")}`:"";t.replaceState(t.state,"",`${e.pathname}${i}${e.hash}`);}function Yn(t){if(t.location===void 0||typeof t.location.search!="string")return;let e=zn(t.location.search);if(e===void 0)return;let n=hn(t.storage,t.shared,t.namespace,e.anonymousId);return vn(t.shared,t.namespace,{id:e.sessionId,startedAt:e.sessionStartedAt},t.now),t.history!==void 0&&Jn(t.history,t.location),n}function yt(t,e,n){if(n.length===0)return ()=>{};let r=i=>{let s=Oi(i.target);if(s===void 0)return;let o=Ni(e);o!==void 0&&Wn(s,o,n,t.location?.hostname??"");};return t.addEventListener("click",r,true),t.addEventListener("auxclick",r,true),()=>{t.removeEventListener("click",r,true),t.removeEventListener("auxclick",r,true);}}function Ai(t){try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"?e:void 0}catch{return}}function Gn(t,e){let n=e.map(r=>r.replace(/^\./,"").toLowerCase());return gt(t).find(r=>n.includes(r))}function vt(t){return t.replace(/^\?/,"").split("&").filter(e=>e!=="")}function bt(t){let e=t.indexOf("=");return Le(e===-1?t:t.slice(0,e))===jn}function Fi(t){let e=t.indexOf("=");return e===-1?"":t.slice(e+1)}function Li(t){return encodeURIComponent(t).replace(/~/g,"%7E")}function Le(t){try{return decodeURIComponent(t)}catch{return}}function Vn(t){if(t===void 0)return false;let e=de(t);return e>=1&&e<=Ii}function $i(t){return t!==void 0&&_i.test(t)&&Number.isSafeInteger(Number(t))}function Ni(t){if(t.consent?.()?.identityLink===false)return;let e=t.sessionId,n=t.sessionStartedAt;if(!(e===void 0||n===void 0))return {anonymousId:t.anonymousId,sessionId:e,sessionStartedAt:n}}function Ri(t){return typeof t.tagName=="string"&&t.tagName.toUpperCase()==="A"&&typeof t.href=="string"}function Oi(t){let e=typeof t=="object"?t:null;for(;e;){if(Ri(e))return e;e=e.parentElement??null;}}var Qn={maskAllInputs:true,maskAllText:false},Mi=new Set(["email","password","tel"]);function Xn(t){return t.replace(/\S/g,"*")}function $e(t,e,n){return Di(e)||n.maskAllInputs?Xn(t):t}function Ne(t,e){return e.maskAllText?Xn(t):t}function Di(t){return Mi.has((t??"").toLowerCase())}var qi=5e3,Re=class{constructor(e){this.options=e;d(this,"buffer",[]);d(this,"seq",0);d(this,"maxEvents");this.maxEvents=Math.min(Math.max(1,e.maxEvents),qi);}add(e){return this.buffer.push(e),this.buffer.length>=this.maxEvents?this.flush():null}flush(){if(this.buffer.length===0)return null;let e=this.buffer;this.buffer=[];let n={distinct_id:this.options.distinctId(),events:e,masked:this.options.masked,schema_version:1,seq:this.seq,session_id:this.options.sessionId,timestamp:new Date(this.options.now()).toISOString()};return this.seq+=1,n}};var xt=1,kt=3,Ki=9,Oe=class{constructor(){d(this,"next",1);}allocate(){let e=this.next;return this.next+=1,e}},Bi=new Set(["NOSCRIPT","SCRIPT"]);function Me(t,e,n,r){if(t.nodeType===kt){let i=e.allocate();return r?.(t,i),{id:i,textContent:Ne(t.textValue??"",n),type:"text"}}if(t.nodeType===Ki){let i=e.allocate();return r?.(t,i),{childNodes:Zn(t,e,n,r),id:i,type:"document"}}if(t.nodeType===xt){let i=t.tagName??"";if(Bi.has(i))return null;let s=e.allocate();return r?.(t,s),{attributes:Hi(t,n),childNodes:Zn(t,e,n,r),id:s,tagName:i,type:"element"}}return null}function Zn(t,e,n,r){let i=[];for(let s of t.childNodes??[]){let o=Me(s,e,n,r);o&&i.push(o);}return i}function Hi(t,e){let n={};for(let r of t.attributes??[])n[r.name]=r.value;return t.inputValue!==void 0&&(n.value=$e(t.inputValue,t.inputType,e)),n}async function er(t,e){let n=`${C(e.replayHost)}/v1/replay`;return (await e.fetch(n,{body:JSON.stringify(t),headers:{authorization:`Bearer ${e.apiKey}`,"content-type":"application/json"},method:"POST"})).ok}var tr=new Set(["INPUT","SELECT","TEXTAREA"]),De=class{constructor(e){this.options=e;d(this,"allocator",new Oe);d(this,"mirror",new Map);d(this,"chunker");d(this,"fetchImpl");d(this,"observer");d(this,"timer");d(this,"started",false);this.chunker=new Re({distinctId:e.distinctId,masked:e.mask.maskAllInputs,maxEvents:e.maxEvents,now:e.now,sessionId:e.sessionId}),this.fetchImpl=F(e.fetch);}start(){if(this.started)return;let e=Gi(),n=e?.documentElement;!e||!n||!this.fetchImpl||(this.started=true,this.captureFullSnapshot(n),this.observeMutations(n),this.observeInteractions(e),this.timer=setInterval(()=>this.upload(this.chunker.flush()),this.options.flushIntervalMs));}stop(){this.started&&(this.started=false,this.observer?.disconnect(),this.timer&&clearInterval(this.timer),this.upload(this.chunker.flush()));}captureFullSnapshot(e){let n=Me(this.adapt(e),this.allocator,this.options.mask,(r,i)=>{let s=r.ref;s&&this.mirror.set(s,i);});n&&this.push(2,{node:n});}observeMutations(e){let n=globalThis.MutationObserver;n&&(this.observer=new n(r=>{for(let i of r)this.handleMutation(i);}),this.observer.observe(e,{attributes:true,characterData:true,childList:true,subtree:true}));}handleMutation(e){if(e.type==="characterData"){let n=this.mirror.get(e.target);n!==void 0&&this.push(3,{texts:[{id:n,value:Ne(e.target.textContent??"",this.options.mask)}]});return}if(e.type==="attributes"&&e.attributeName){let n=this.mirror.get(e.target),r=e.target;n!==void 0&&this.push(3,{attributes:[{attributes:{[e.attributeName]:r.getAttribute(e.attributeName)??""},id:n}]});return}if(e.type==="childList"){let n=this.mirror.get(e.target);if(n===void 0)return;for(let r of Array.from(e.addedNodes)){let i=Me(this.adapt(r),this.allocator,this.options.mask,(s,o)=>{let a=s.ref;a&&this.mirror.set(a,o);});i&&this.push(3,{adds:[{node:i,parentId:n}]});}for(let r of Array.from(e.removedNodes)){let i=this.mirror.get(r);i!==void 0&&(this.push(3,{removes:[{id:i,parentId:n}]}),this.mirror.delete(r));}}}observeInteractions(e){e.addEventListener("input",n=>{let r=n.target;if(!r||!tr.has(r.tagName))return;let i=this.mirror.get(r);i!==void 0&&this.push(3,{input:{id:i,value:$e(r.value??"",r.type,this.options.mask)}});},true),e.addEventListener("scroll",n=>{let r=n.target,i=r?this.mirror.get(r):void 0;this.push(3,{scroll:{id:i??0,x:r?.scrollLeft??0,y:r?.scrollTop??0}});},true);}adapt(e){let n={childNodes:[],nodeType:e.nodeType,ref:e};if(e.nodeType===kt)return n.textValue=e.textContent??"",n;if(e.nodeType===xt){let r=e;if(n.tagName=r.tagName,n.attributes=Array.from(r.attributes).map(i=>({name:i.name,value:i.value})),tr.has(r.tagName)){let i=r;n.inputType=i.type,n.inputValue=i.value??"";}}return n.childNodes=Array.from(e.childNodes).map(r=>this.adapt(r)),n}push(e,n){let r=this.chunker.add({data:n,timestamp:this.options.now(),type:e});r&&this.upload(r);}upload(e){!e||!this.fetchImpl||er(e,{apiKey:this.options.apiKey,fetch:this.fetchImpl,replayHost:this.options.replayHost}).catch(n=>this.options.onError?.(n));}};function Gi(){return globalThis.document}function nr(t){let e=new De({apiKey:t.apiKey,distinctId:t.distinctId,flushIntervalMs:t.flushIntervalMs??5e3,mask:{...Qn,...t.mask},maxEvents:t.maxEvents??200,now:t.now??(()=>Date.now()),onError:t.onError,replayHost:t.replayHost,sessionId:t.sessionId??Ve()});return e.start(),e}var rr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],ir=["gclid","gbraid","wbraid","fbclid","msclkid","ttclid","li_fat_id","twclid"];var St=(t,e)=>{let n=new URLSearchParams(t),r={};for(let i of [...rr,...ir]){let s=n.get(i)?.trim();s&&(r[i]=s.slice(0,255));}return e&&(r.$session_referrer=e),r},Vi=t=>{let e={};for(let n of [...rr,...ir])t[n]!==void 0&&(e[`$initial_${n}`]=t[n]);return e.$initial_referrer=t.$session_referrer??"$direct",e},ji=(t,e)=>{let n=t.getItem(e);if(n)try{let r=JSON.parse(n);return typeof r.sessionId=="string"&&typeof r.properties=="object"&&r.properties!==null?{properties:r.properties,sessionId:r.sessionId}:void 0}catch{return}},sr=(t,e)=>{let n=`pdx_${e}_session_touch`,r=`pdx_${e}_first_touch`;return {forSession:(i,s,o)=>{if(i===void 0)return {};let a=ji(t,n);if(a!==void 0&&a.sessionId===i)return a.properties;let u=St(s,o);return t.setItem(n,JSON.stringify({properties:u,sessionId:i})),t.getItem(r)?u:(t.setItem(r,"1"),{...u,$set_once:Vi(u)})}}};var qe=t=>`prodantix-cta:${t}`,or=t=>{try{let e=window.localStorage.getItem(qe(t));return e===null?null:Number(e)}catch{return null}},ar=t=>{try{return window.sessionStorage.getItem(qe(t))!==null}catch{return false}},dr=(t,e)=>{try{window.localStorage.setItem(qe(t),String(e)),window.sessionStorage.setItem(qe(t),String(e));}catch{return}},cr=(t,e,n,r)=>e===null?true:t.kind==="once"?false:t.kind==="session"?!n:r-e>=t.value*864e5;var H={am:{back:"\u1270\u1218\u1208\u1235",close:"\u12DD\u130B",closed:"\u12ED\u1205 \u1245\u133D \u12A0\u1201\u1295 \u121D\u120B\u123E\u127D\u1295 \u12A0\u12ED\u1240\u1260\u120D\u121D\u1362",failed:"\u1218\u120B\u12AD \u12A0\u120D\u1270\u127B\u1208\u121D\u1362 \u12A5\u1295\u12F0\u1308\u1293 \u12ED\u121E\u12AD\u1229\u1362",invalid:"\u12ED\u1205 \u1218\u120D\u1235 \u12A0\u12ED\u1240\u1260\u120D\u121D\u1362",next:"\u1240\u1323\u12ED",poweredBy:"\u1260Prodantix \u12E8\u1270\u1230\u122B",required:"\u12ED\u1205 \u12EB\u1235\u1348\u120D\u130B\u120D\u1362",sending:"\u1260\u1218\u120B\u12AD \u120B\u12ED\u2026",step:"\u12F0\u1228\u1303 {step} \u12A8{total}",submit:"\u120B\u12AD",thanks:"\u12A5\u1293\u1218\u1230\u130D\u1293\u1208\u1295\u1362"},ar:{back:"\u0631\u062C\u0648\u0639",close:"\u0625\u063A\u0644\u0627\u0642",closed:"\u0644\u0627 \u064A\u0642\u0628\u0644 \u0647\u0630\u0627 \u0627\u0644\u0646\u0645\u0648\u0630\u062C \u0631\u062F\u0648\u062F\u064B\u0627 \u0627\u0644\u0622\u0646.",failed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",invalid:"\u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629.",next:"\u0627\u0644\u062A\u0627\u0644\u064A",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Prodantix",required:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628.",sending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",step:"\u0627\u0644\u062E\u0637\u0648\u0629 {step} \u0645\u0646 {total}",submit:"\u0625\u0631\u0633\u0627\u0644",thanks:"\u0634\u0643\u0631\u064B\u0627 \u0644\u0643."},bn:{back:"\u09AA\u09C7\u099B\u09A8\u09C7",close:"\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8",closed:"\u098F\u0987 \u09AB\u09B0\u09CD\u09AE\u099F\u09BF \u098F\u0996\u09A8 \u0989\u09A4\u09CD\u09A4\u09B0 \u09A8\u09BF\u099A\u09CD\u099B\u09C7 \u09A8\u09BE\u0964",failed:"\u09AA\u09BE\u09A0\u09BE\u09A8\u09CB \u09AF\u09BE\u09AF\u09BC\u09A8\u09BF\u0964 \u0986\u09AC\u09BE\u09B0 \u099A\u09C7\u09B7\u09CD\u099F\u09BE \u0995\u09B0\u09C1\u09A8\u0964",invalid:"\u098F\u0987 \u0989\u09A4\u09CD\u09A4\u09B0\u099F\u09BF \u0997\u09CD\u09B0\u09B9\u09A3\u09AF\u09CB\u0997\u09CD\u09AF \u09A8\u09AF\u09BC\u0964",next:"\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0",poweredBy:"Prodantix \u09A6\u09CD\u09AC\u09BE\u09B0\u09BE \u099A\u09BE\u09B2\u09BF\u09A4",required:"\u098F\u099F\u09BF \u0986\u09AC\u09B6\u09CD\u09AF\u0995\u0964",sending:"\u09AA\u09BE\u09A0\u09BE\u09A8\u09CB \u09B9\u099A\u09CD\u099B\u09C7\u2026",step:"\u09A7\u09BE\u09AA {step} / {total}",submit:"\u099C\u09AE\u09BE \u09A6\u09BF\u09A8",thanks:"\u09A7\u09A8\u09CD\u09AF\u09AC\u09BE\u09A6\u0964"},de:{back:"Zur\xFCck",close:"Schlie\xDFen",closed:"Dieses Formular nimmt gerade keine Antworten an.",failed:"Senden fehlgeschlagen. Bitte erneut versuchen.",invalid:"Diese Antwort wird nicht angenommen.",next:"Weiter",poweredBy:"Bereitgestellt von Prodantix",required:"Dieses Feld ist erforderlich.",sending:"Wird gesendet\u2026",step:"Schritt {step} von {total}",submit:"Absenden",thanks:"Vielen Dank."},en:{back:"Back",close:"Close",closed:"This form is not accepting responses right now.",failed:"This could not be sent. Try again.",invalid:"This answer is not accepted.",next:"Next",poweredBy:"Powered by Prodantix",required:"This is required.",sending:"Sending\u2026",step:"Step {step} of {total}",submit:"Submit",thanks:"Thank you."},es:{back:"Atr\xE1s",close:"Cerrar",closed:"Este formulario no acepta respuestas ahora.",failed:"No se pudo enviar. Int\xE9ntalo de nuevo.",invalid:"Esta respuesta no se acepta.",next:"Siguiente",poweredBy:"Con la tecnolog\xEDa de Prodantix",required:"Este campo es obligatorio.",sending:"Enviando\u2026",step:"Paso {step} de {total}",submit:"Enviar",thanks:"Gracias."},et:{back:"Tagasi",close:"Sulge",closed:"See vorm ei v\xF5ta praegu vastuseid vastu.",failed:"Saatmine eba\xF5nnestus. Proovi uuesti.",invalid:"Seda vastust ei v\xF5eta vastu.",next:"Edasi",poweredBy:"Toetab Prodantix",required:"See on kohustuslik.",sending:"Saatmine\u2026",step:"Samm {step}/{total}",submit:"Saada",thanks:"Ait\xE4h."},fil:{back:"Bumalik",close:"Isara",closed:"Hindi tumatanggap ng sagot ang form na ito ngayon.",failed:"Hindi naipadala. Subukan ulit.",invalid:"Hindi tinatanggap ang sagot na ito.",next:"Susunod",poweredBy:"Pinapagana ng Prodantix",required:"Kailangan ito.",sending:"Ipinapadala\u2026",step:"Hakbang {step} sa {total}",submit:"Ipadala",thanks:"Salamat."},fr:{back:"Retour",close:"Fermer",closed:"Ce formulaire n\u2019accepte plus de r\xE9ponses pour le moment.",failed:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez.",invalid:"Cette r\xE9ponse n\u2019est pas accept\xE9e.",next:"Suivant",poweredBy:"Propuls\xE9 par Prodantix",required:"Ce champ est obligatoire.",sending:"Envoi\u2026",step:"\xC9tape {step} sur {total}",submit:"Envoyer",thanks:"Merci."},hi:{back:"\u092A\u0940\u091B\u0947",close:"\u092C\u0902\u0926 \u0915\u0930\u0947\u0902",closed:"\u092F\u0939 \u092B\u093C\u0949\u0930\u094D\u092E \u0905\u092D\u0940 \u091C\u0935\u093E\u092C \u0928\u0939\u0940\u0902 \u0932\u0947 \u0930\u0939\u093E \u0939\u0948\u0964",failed:"\u092D\u0947\u091C\u093E \u0928\u0939\u0940\u0902 \u091C\u093E \u0938\u0915\u093E\u0964 \u092B\u093F\u0930 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0947\u0902\u0964",invalid:"\u092F\u0939 \u091C\u0935\u093E\u092C \u0938\u094D\u0935\u0940\u0915\u093E\u0930 \u0928\u0939\u0940\u0902 \u0939\u0948\u0964",next:"\u0906\u0917\u0947",poweredBy:"Prodantix \u0926\u094D\u0935\u093E\u0930\u093E \u0938\u0902\u091A\u093E\u0932\u093F\u0924",required:"\u092F\u0939 \u091C\u093C\u0930\u0942\u0930\u0940 \u0939\u0948\u0964",sending:"\u092D\u0947\u091C\u093E \u091C\u093E \u0930\u0939\u093E \u0939\u0948\u2026",step:"\u091A\u0930\u0923 {step} / {total}",submit:"\u092D\u0947\u091C\u0947\u0902",thanks:"\u0927\u0928\u094D\u092F\u0935\u093E\u0926\u0964"},id:{back:"Kembali",close:"Tutup",closed:"Formulir ini sedang tidak menerima tanggapan.",failed:"Gagal mengirim. Coba lagi.",invalid:"Jawaban ini tidak diterima.",next:"Berikutnya",poweredBy:"Didukung oleh Prodantix",required:"Wajib diisi.",sending:"Mengirim\u2026",step:"Langkah {step} dari {total}",submit:"Kirim",thanks:"Terima kasih."},ja:{back:"\u623B\u308B",close:"\u9589\u3058\u308B",closed:"\u3053\u306E\u30D5\u30A9\u30FC\u30E0\u306F\u73FE\u5728\u56DE\u7B54\u3092\u53D7\u3051\u4ED8\u3051\u3066\u3044\u307E\u305B\u3093\u3002",failed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",invalid:"\u3053\u306E\u56DE\u7B54\u306F\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3002",next:"\u6B21\u3078",poweredBy:"Powered by Prodantix",required:"\u5FC5\u9808\u9805\u76EE\u3067\u3059\u3002",sending:"\u9001\u4FE1\u4E2D\u2026",step:"\u30B9\u30C6\u30C3\u30D7 {step}/{total}",submit:"\u9001\u4FE1",thanks:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3057\u305F\u3002"},ko:{back:"\uC774\uC804",close:"\uB2EB\uAE30",closed:"\uC774 \uC591\uC2DD\uC740 \uC9C0\uAE08 \uC751\uB2F5\uC744 \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",failed:"\uBCF4\uB0B4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC138\uC694.",invalid:"\uC774 \uB2F5\uBCC0\uC740 \uBC1B\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",next:"\uB2E4\uC74C",poweredBy:"Prodantix \uC81C\uACF5",required:"\uD544\uC218 \uD56D\uBAA9\uC785\uB2C8\uB2E4.",sending:"\uBCF4\uB0B4\uB294 \uC911\u2026",step:"{total}\uB2E8\uACC4 \uC911 {step}\uB2E8\uACC4",submit:"\uC81C\uCD9C",thanks:"\uAC10\uC0AC\uD569\uB2C8\uB2E4."},pt:{back:"Voltar",close:"Fechar",closed:"Este formul\xE1rio n\xE3o est\xE1 a aceitar respostas neste momento.",failed:"N\xE3o foi poss\xEDvel enviar. Tente novamente.",invalid:"Esta resposta n\xE3o \xE9 aceite.",next:"Seguinte",poweredBy:"Com tecnologia Prodantix",required:"Este campo \xE9 obrigat\xF3rio.",sending:"A enviar\u2026",step:"Passo {step} de {total}",submit:"Enviar",thanks:"Obrigado."},ru:{back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",closed:"\u042D\u0442\u0430 \u0444\u043E\u0440\u043C\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u043E\u0442\u0432\u0435\u0442\u044B.",failed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.",invalid:"\u042D\u0442\u043E\u0442 \u043E\u0442\u0432\u0435\u0442 \u043D\u0435 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442\u0441\u044F.",next:"\u0414\u0430\u043B\u0435\u0435",poweredBy:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043D\u0430 Prodantix",required:"\u042D\u0442\u043E \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435.",sending:"\u041E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u2026",step:"\u0428\u0430\u0433 {step} \u0438\u0437 {total}",submit:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",thanks:"\u0421\u043F\u0430\u0441\u0438\u0431\u043E."},sw:{back:"Rudi",close:"Funga",closed:"Fomu hii haipokei majibu kwa sasa.",failed:"Imeshindwa kutuma. Jaribu tena.",invalid:"Jibu hili halikubaliki.",next:"Endelea",poweredBy:"Inaendeshwa na Prodantix",required:"Hii inahitajika.",sending:"Inatuma\u2026",step:"Hatua {step} kati ya {total}",submit:"Tuma",thanks:"Asante."},vi:{back:"Quay l\u1EA1i",close:"\u0110\xF3ng",closed:"Bi\u1EC3u m\u1EABu n\xE0y hi\u1EC7n kh\xF4ng nh\u1EADn c\xE2u tr\u1EA3 l\u1EDDi.",failed:"Kh\xF4ng g\u1EEDi \u0111\u01B0\u1EE3c. H\xE3y th\u1EED l\u1EA1i.",invalid:"C\xE2u tr\u1EA3 l\u1EDDi n\xE0y kh\xF4ng \u0111\u01B0\u1EE3c ch\u1EA5p nh\u1EADn.",next:"Ti\u1EBFp",poweredBy:"\u0110\u01B0\u1EE3c h\u1ED7 tr\u1EE3 b\u1EDFi Prodantix",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c.",sending:"\u0110ang g\u1EEDi\u2026",step:"B\u01B0\u1EDBc {step}/{total}",submit:"G\u1EEDi",thanks:"C\u1EA3m \u01A1n b\u1EA1n."},zh:{back:"\u4E0A\u4E00\u6B65",close:"\u5173\u95ED",closed:"\u6B64\u8868\u5355\u76EE\u524D\u4E0D\u63A5\u53D7\u56DE\u590D\u3002",failed:"\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",invalid:"\u6B64\u56DE\u7B54\u65E0\u6548\u3002",next:"\u4E0B\u4E00\u6B65",poweredBy:"\u7531 Prodantix \u63D0\u4F9B\u652F\u6301",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879\u3002",sending:"\u6B63\u5728\u53D1\u9001\u2026",step:"\u7B2C {step} \u6B65\uFF0C\u5171 {total} \u6B65",submit:"\u63D0\u4EA4",thanks:"\u8C22\u8C22\u3002"}},Ke=t=>{let e=(t??"").toLowerCase().split("-")[0]??"";return e in H?e:"en"};var b="prodantix-cta",ur="prodantix-cta-style",Ui=`.${b}{font-family:system-ui,sans-serif;color:var(--pdx-text);background:var(--pdx-background);border-radius:var(--pdx-radius);box-sizing:border-box;padding:16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
|
|
1
|
+
'use strict';var Ir=Object.defineProperty;var _r=(t,e,n)=>e in t?Ir(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var d=(t,e,n)=>_r(t,typeof e!="symbol"?e+"":e,n);var D=class extends Error{constructor(n,r,i){super(r,i);d(this,"code");this.code=n,this.name="ProdantixError";}},Z=class extends D{constructor(e){super("config",e),this.name="ConfigError";}},U=class extends D{constructor(n,r){super("validation",r);d(this,"field");this.field=n,this.name="ValidationError";}},f=class extends D{constructor(n,r,i){super("transport",n,i);d(this,"status");this.status=r,this.name="TransportError";}};function F(t){if(t)return t;let e=globalThis.fetch;if(typeof e=="function")return e.bind(globalThis)}function L(){let t=globalThis.AbortController;return t?new t:void 0}var Ft=t=>new Promise(e=>{setTimeout(e,t);});function C(t){return t.replace(/\/+$/,"")}var G=class{constructor(){d(this,"store",new Map);}getItem(e){return this.store.get(e)??null}removeItem(e){this.store.delete(e);}setItem(e,n){this.store.set(e,n);}},ee=class{constructor(e,n=()=>false){this.real=e;this.passes=n;d(this,"held",new G);d(this,"opened",false);}get isOpen(){return this.opened}open(){this.opened=true;}close(){this.opened=false;}target(e){return this.opened||this.passes(e)?this.real:this.held}getItem(e){return this.target(e).getItem(e)}removeItem(e){this.target(e).removeItem(e);}setItem(e,n){this.target(e).setItem(e,n);}};function Lt(){try{let t=globalThis.localStorage;if(t){let e="__pdx_probe__";return t.setItem(e,"1"),t.removeItem(e),t}}catch{return new G}return new G}var oe={now:()=>new Date};function ae(t){return t.toISOString()}function $t(){if(typeof window>"u"||typeof Intl>"u")return null;let t=Intl.DateTimeFormat().resolvedOptions().timeZone;return typeof t=="string"&&t!==""?t:null}function Pr(){return globalThis.crypto}function Ar(t){t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e=[];for(let n=0;n<16;n+=1)e.push(t[n].toString(16).padStart(2,"0"));return `${e[0]}${e[1]}${e[2]}${e[3]}-${e[4]}${e[5]}-${e[6]}${e[7]}-${e[8]}${e[9]}-${e[10]}${e[11]}${e[12]}${e[13]}${e[14]}${e[15]}`}function Ve(){let t=Pr();if(t?.randomUUID)return t.randomUUID();let e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<16;n+=1)e[n]=Math.floor(Math.random()*256);return Ar(e)}var Nt={uuid:Ve};var Fr=/^pdx_pub_(?:(?:live|test)_)?[a-z0-9]{32}$/;var Lr=/^(?:\$|[a-z])[a-z0-9_.]*$/;function de(t){let e=0;for(let n of t)e+=1;return e}function Rt(t){return Fr.test(t)}function $r(t){return Lr.test(t)}function Ot(t){let e=de(t);if(e<1||e>200)throw new U("distinct_id","distinct_id must be between 1 and 200 characters")}function Mt(t){let e=de(t);if(e<1||e>200)throw new U("event_name","event_name must be between 1 and 200 characters");if(!$r(t))throw new U("event_name","event_name must match /^(\\$|[a-z])[a-z0-9_.]*$/")}var Dt="prodantix-js",qt="0.8.0";var Nr=t=>{};function Kt(t){if(!t.apiKey||!Rt(t.apiKey))throw new Z("apiKey must be a public project key of the form pdx_pub_<32 lowercase alphanumerics>");if(!t.host)throw new Z("host is required (the ingest base URL)");let e=C(t.host),n=t.defaultProperties,r=t.storage??new G;return {apiKey:t.apiKey,autocapture:t.autocapture??false,clock:t.clock??oe,consent:t.consent,consentMode:t.consentMode,defaultProperties:typeof n=="function"?n:()=>n??{},describeElement:t.describeElement,flagsHost:t.flagsHost?C(t.flagsHost):e,flushAt:t.flushAt??20,flushIntervalMs:t.flushIntervalMs??1e4,host:e,ids:t.ids??Nt,locale:t.locale,maxQueueSize:t.maxQueueSize??1e3,maxRetries:t.maxRetries??3,namespace:W(t.apiKey),onError:t.onError??Nr,os:t.os,requestTimeoutMs:t.requestTimeoutMs??1e4,sdkName:t.sdkName??Dt,sdkVersion:t.sdkVersion??qt,sessionTracking:t.sessionTracking??false,sharedStorage:t.sharedStorage??r,socketFactory:t.socketFactory,storage:r,streamFlags:t.streamFlags??false,transport:t.transport}}function W(t){return t.slice(0,16)}var Ht="$cta_viewed",Bt="$cta_clicked",je="$cta_dismissed",Gt=(t,e)=>{let n={$cta_id:t.id,$cta_kind:t.kind,$cta_variant:t.variant.key,$cta_version:t.version},r=e===void 0?void 0:t.variant.content.buttons[e];return r&&e!==void 0&&(n.$cta_button=e,n.$cta_button_label=r.label,r.action.kind==="form"&&(n.$cta_form_id=r.action.value)),n},ue=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async ctas(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=new URLSearchParams({anonymous:String(e.anonymous),device:e.device,distinct_id:e.distinctId,language:e.language,url:e.url}),i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(`${this.host}/v1/ctas?${r.toString()}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(o.status<200||o.status>=300)throw new f(`ctas request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).ctas}finally{s!==void 0&&clearTimeout(s);}}};function Vt(t,e,n){Mt(t.eventName),Ot(t.distinctId);let r={distinct_id:t.distinctId,event_id:t.eventId??n.uuid(),event_name:t.eventName,properties:t.properties??{},schema_version:1,timestamp:ae(t.timestamp??e.now())};return t.context&&(r.context=t.context),t.sessionId&&(r.session_id=t.sessionId),r}var j=Symbol("absent");function Rr(t,e){if(t==="distinct_id")return e.distinctId;let n=e.properties??{};if(Object.prototype.hasOwnProperty.call(n,t))return n[t];let r=e.attributes??{};return Object.prototype.hasOwnProperty.call(r,t)?r[t]:j}function V(t){return t===j?"undefined":String(t)}function jt(t){return t===j?Number.NaN:Number(t)}function Ut(t){return t!==j&&t!==null&&t!==""}function Wt(t,e){if(!Array.isArray(e))return false;let n=V(t);return e.map(r=>String(r)).includes(n)}function zt(t,e){let n=Rr(t.attribute,e),r=t.value;switch(t.op){case "is_set":return Ut(n);case "is_not_set":return !Ut(n);case "eq":return V(n)===V(r===void 0?j:r);case "neq":return V(n)!==V(r===void 0?j:r);case "contains":return V(n).includes(V(r===void 0?j:r));case "in":return Wt(n,r);case "not_in":return Array.isArray(r)?!Wt(n,r):false;case "gt":return ce(n,r,(i,s)=>i>s);case "gte":return ce(n,r,(i,s)=>i>=s);case "lt":return ce(n,r,(i,s)=>i<s);case "lte":return ce(n,r,(i,s)=>i<=s);case "in_cohort":return typeof r=="string"&&r!==""&&(e.cohorts??[]).includes(r);case "not_in_cohort":return typeof r=="string"&&r!==""&&!(e.cohorts??[]).includes(r);default:return false}}function ce(t,e,n){let r=jt(t),i=e===void 0?Number.NaN:jt(e);return Number.isNaN(r)||Number.isNaN(i)?false:n(r,i)}function Jt(t,e){let n=`${t}:${e}`,r=2166136261;for(let i=0;i<n.length;i++)r^=n.charCodeAt(i),r=Math.imul(r,16777619);return (r>>>0)%100}function Ue(t,e){return t.targeting.length===0||t.targeting.every(n=>zt(n,e))}function Yt(t,e){let n=Jt(t.key,e.distinctId),r=t.variations??[];if(r.length===0)return t.rolloutPercentage>=100||n<t.rolloutPercentage?"true":"false";let i=0;for(let s=r.length-1;s>=0;s--)if(i+=r[s].weight,n<i)return r[s].key;return r[0].key}function We(t,e,n,r){for(let i of t.prerequisites??[]){if(r.includes(i.flagKey))return false;let s=e.find(a=>a.key===i.flagKey);if(!s||!s.enabled)return false;r.push(s.key);let o=We(s,e,n,r)&&Ue(s,n)&&Yt(s,n)===i.variationKey;if(r.pop(),!o)return false}return true}function le(t,e,n){return t.enabled?We(t,e,n,[t.key])?Ue(t,n)?t.rolloutPercentage>=100?{enabled:true,reason:"rollout_full"}:Jt(t.key,n.distinctId)<t.rolloutPercentage?{enabled:true,reason:"rollout"}:{enabled:false,reason:"rollout_excluded"}:{enabled:false,reason:"targeting"}:{enabled:false,reason:"prerequisite"}:{enabled:false,reason:"disabled"}}function Qt(t,e){let n={};for(let r of t)n[r.key]=le(r,t,e).enabled;return n}function ze(t,e,n){let r=t.variations??[],i=r[0];if(!i)return null;if(!t.enabled||!We(t,e,n,[t.key])||!Ue(t,n))return i;let s=Yt(t,n);return r.find(o=>o.key===s)??i}function Xt(t){return t.some(e=>e.targeting.some(n=>n.op==="in_cohort"||n.op==="not_in_cohort"))}function Zt(t){return `40${JSON.stringify(t)}`}function en(){return "3"}function tn(t){let e=t.charAt(0),n=t.slice(1);if(e==="2")return {kind:"ping"};if(e==="1")return {kind:"disconnect"};if(e==="0"){let o=Je(n);return {kind:"open",pingInterval:typeof o?.pingInterval=="number"?o.pingInterval:25e3,pingTimeout:typeof o?.pingTimeout=="number"?o.pingTimeout:2e4}}if(e!=="4")return {kind:"other"};let r=n.charAt(0),i=n.slice(1);if(r==="0")return {kind:"connected"};if(r==="1")return {kind:"disconnect"};if(r==="4"){let o=Je(i);return {kind:"connectError",message:typeof o?.message=="string"?o.message:"refused"}}if(r!=="2")return {kind:"other"};let s=Je(i);return !Array.isArray(s)||typeof s[0]!="string"?{kind:"other"}:{kind:"event",name:s[0],payload:s[1]}}function Je(t){try{return JSON.parse(t)}catch{return null}}var Or="/socket.io/?EIO=4&transport=websocket",Mr=250,pe=class{constructor(e){this.options=e;d(this,"socket",null);d(this,"heartbeat",null);d(this,"pending",null);d(this,"lastKey","");d(this,"ready",false);d(this,"closed",false);d(this,"heartbeatWindow",45e3);d(this,"factory");d(this,"setTimer");d(this,"clearTimer");this.factory=e.socketFactory??Dr,this.setTimer=e.setTimer??((n,r)=>setTimeout(n,r)),this.clearTimer=e.clearTimer??(n=>clearTimeout(n));}open(){if(this.socket||this.closed)return;let e=`${this.options.host.replace(/^http/,"ws").replace(/\/+$/,"")}${Or}`,n;try{n=this.factory(e);}catch{this.options.onClosed(false);return}this.socket=n,n.onmessage=r=>this.receive(String(r.data)),n.onerror=()=>n.close(),n.onclose=()=>this.fell();}close(){this.closed=true,this.stopHeartbeat(),this.pending!==null&&this.clearTimer(this.pending),this.pending=null;let e=this.socket;this.socket=null,e?.close();}receive(e){let n=tn(e);if(n.kind==="open"){this.armHeartbeat(n.pingInterval+n.pingTimeout),this.socket?.send(Zt({projectKey:this.options.projectKey}));return}if(n.kind==="ping"){this.armHeartbeat(),this.socket?.send(en());return}if(n.kind==="connectError"||n.kind==="disconnect"){this.stopHeartbeat(),this.socket?.close();return}if(n.kind==="event"){if(n.name==="ready"){this.ready=true;return}if(n.name==="flagChange"){let r=n.payload?.key;this.lastKey=typeof r=="string"?r:"",this.pending===null&&(this.pending=this.setTimer(()=>{this.pending=null,this.options.onChange(this.lastKey);},Mr));}}}fell(){this.stopHeartbeat();let e=this.ready;this.socket=null,this.ready=false,this.closed||this.options.onClosed(e);}armHeartbeat(e){e!==void 0&&(this.heartbeatWindow=e),this.stopHeartbeat(),this.heartbeat=this.setTimer(()=>this.socket?.close(),this.heartbeatWindow);}stopHeartbeat(){this.heartbeat!==null&&this.clearTimer(this.heartbeat),this.heartbeat=null;}};function Dr(t){let e=globalThis.WebSocket;if(!e)throw new f("no WebSocket");return new e(t)}var me=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async fetchAll(e){return (await this.fetchDecisions(e)).flags}async fetchDecisions(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags?distinct_id=${encodeURIComponent(e)}`,i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`flags request failed with status ${o.status}`,o.status);let a=JSON.parse(await o.text());return {flags:a.flags??{},variants:a.variants??{}}}finally{s!==void 0&&clearTimeout(s);}}async snapshot(){let e=this.fetch;if(!e)throw new f("no fetch implementation available in this runtime");let n=`${this.host}/v1/flags/snapshot`,r=L(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await e(n,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r?.signal});if(!s.ok)throw new f(`flag snapshot request failed with status ${s.status}`,s.status);let o=JSON.parse(await s.text()),a={flags:o.flags??[],generatedAt:o.generatedAt};return typeof o.socketUrl=="string"&&o.socketUrl!==""&&(a.socketUrl=o.socketUrl),a}finally{i!==void 0&&clearTimeout(i);}}async memberships(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags/memberships?distinct_id=${encodeURIComponent(e)}`,i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await n(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`memberships request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).cohorts??[]}finally{s!==void 0&&clearTimeout(s);}}};var nn="$form_viewed",rn="$form_started",te=class extends Error{constructor(n,r,i){super(i);d(this,"fields");d(this,"status");this.name="FormRefusedError",this.status=n,this.fields=r;}},fe=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async request(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o={authorization:`Bearer ${this.projectKey}`};n.body!==void 0&&(o["content-type"]="application/json");let a=await r(`${this.host}${e}`,{body:n.body,headers:o,method:n.method,signal:i?.signal});return {status:a.status,text:await a.text()}}finally{s!==void 0&&clearTimeout(s);}}async form(e,n){let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}?distinct_id=${encodeURIComponent(n)}`,{method:"GET"});if(r<200||r>=300)throw new f(`form request failed with status ${r}`,r);return JSON.parse(i)}async submit(e,n){let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}/submissions`,{body:JSON.stringify(n),method:"POST"});if(r>=200&&r<300)return JSON.parse(i).afterSubmit;let s=[],o=`form submission failed with status ${r}`;try{let a=JSON.parse(i);s=a.error?.fields??[],o=a.error?.message??o;}catch{s=[];}throw new te(r,s,o)}};var sn="$survey_shown",on="$survey_dismissed",an="$survey_sent",ge=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async surveys(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o=await r(`${this.host}/v1/surveys?distinct_id=${encodeURIComponent(e)}${n?`&lang=${encodeURIComponent(n)}`:""}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i?.signal});if(!o.ok)throw new f(`surveys request failed with status ${o.status}`,o.status);return JSON.parse(await o.text()).surveys??[]}finally{s!==void 0&&clearTimeout(s);}}},qr=864e5,he=t=>`${t.id}:${t.iteration}`;function Ye(t,e){return t.length===0?true:t.some(n=>{switch(n.matches){case "exact":return e===n.value;case "starts_with":return e.startsWith(n.value);default:return e.includes(n.value)}})}function dn(t,e,n,r,i){return t.kind!=="popover"||e.settled.includes(he(t))||t.showOnce&&e.settled.some(s=>s.startsWith(`${t.id}:`))||t.waitDays>0&&e.lastShownAt!==void 0&&r-e.lastShownAt<t.waitDays*qr||t.event&&t.event!==i?false:Ye(t.urls,n)}function ye(t,e){let n={$survey_id:t.id,$survey_iteration:t.iteration,$survey_name:t.name};for(let[r,i]of Object.entries(e))n[`$survey_response_${r}`]=i;return n}var Qe="$guide_shown",un="$guide_step_viewed",cn="$guide_step_missed",Xe="$guide_completed",Ze="$guide_dismissed",ln="$checklist_task_done",ve=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async guides(e){let n=this.fetch;if(!n)throw new f("no fetch implementation available in this runtime");let r=L(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await n(`${this.host}/v1/guides?distinct_id=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r?.signal});if(!s.ok)throw new f(`guides request failed with status ${s.status}`,s.status);return JSON.parse(await s.text()).guides??[]}finally{i!==void 0&&clearTimeout(i);}}},Kr=864e5,z=t=>`${t.id}:${t.iteration}`,be=(t,e)=>`${z(t)}:${e}`;function pn(t,e,n,r,i){return e.settled.includes(z(t))||t.showOnce&&e.settled.some(s=>s.startsWith(`${t.id}:`))||t.kind!=="checklist"&&t.waitDays>0&&e.lastShownAt!==void 0&&r-e.lastShownAt<t.waitDays*Kr||t.event&&t.event!==i?false:Ye(t.urls,n)}var et=(t,e)=>t.steps.filter(n=>e.done.includes(be(t,n.id))).map(n=>n.id),mn=(t,e)=>t.kind==="checklist"?t.steps.find(n=>n.event===e):void 0;function fn(t,e){let n={$guide_id:t.id,$guide_iteration:t.iteration,$guide_name:t.name};return e!==void 0&&(n.$guide_step_id=e),n}function ne(t){if(typeof t!="string")return;let e=Array.from(t).length;return e>=1&&e<=200?t:void 0}function ke(t,e){return `pdx.${t}.${e}`}var nt="consent",Hr=["identityLink","analytics","marketing","functional"];function tt(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))return null;let n=e,r={};for(let i of Hr){let s=n[i];typeof s=="boolean"&&(r[i]=s);}return typeof n.version=="number"&&Number.isInteger(n.version)&&(r.version=n.version),Array.isArray(n.categories)&&n.categories.every(i=>typeof i=="string")&&(r.categories=n.categories),Object.keys(r).length===0?null:r}catch{return null}}var gn=t=>t.endsWith(`.${nt}`);function Se(t,e){return tt(t.getItem(ke(e,nt)))}function Br(t,e,n){let r=ke(e,nt),i=tt(JSON.stringify(n)),s=i===null?null:tt(JSON.stringify({...Se(t,e)??{},...i}));if(s===null){t.removeItem(r);return}t.setItem(r,JSON.stringify(s));}function hn(t,e,n,r){let i=ke(n,"anonymous_id"),s=ne(e.getItem(i))??ne(t.getItem(i));return e.setItem(i,r),t.setItem(i,r),s!==void 0&&s!==r?s:void 0}var xe=class{constructor(e,n,r,i){this.storage=e;this.shared=n;this.ids=r;this.namespace=i;d(this,"anonymousId");d(this,"distinctId");d(this,"identified");this.refresh();}refresh(){let e=ne(this.shared.getItem(this.key("anonymous_id"))),n=ne(this.storage.getItem(this.key("anonymous_id")));e?(this.anonymousId=e,n!==e&&this.storage.setItem(this.key("anonymous_id"),e)):n?(this.anonymousId=n,this.shared.setItem(this.key("anonymous_id"),n)):(this.anonymousId=this.ids.uuid(),this.shared.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.setItem(this.key("anonymous_id"),this.anonymousId));let r=ne(this.storage.getItem(this.key("distinct_id")));r?(this.distinctId=r,this.identified=true):(this.distinctId=this.anonymousId,this.identified=false);}getAnonymousId(){return this.anonymousId}getDistinctId(){return this.distinctId}isIdentified(){return this.identified}snapshot(){return {anonymousId:this.anonymousId,distinctId:this.distinctId,identified:this.identified}}consent(){return Se(this.shared,this.namespace)}setConsent(e){Br(this.shared,this.namespace,e);}assumeAnonymousId(e){this.anonymousId=e,this.shared.setItem(this.key("anonymous_id"),e),this.storage.setItem(this.key("anonymous_id"),e),this.identified||(this.distinctId=e);}identify(e){let n=!this.identified||this.distinctId!==e,r=this.storage.getItem(this.key("linked_anonymous_id")),i=n||r!==this.anonymousId;return this.distinctId=e,this.identified=true,n&&this.storage.setItem(this.key("distinct_id"),e),!i||this.consent()?.identityLink===false?{changed:n}:(this.storage.setItem(this.key("linked_anonymous_id"),this.anonymousId),{anonymousToLink:this.anonymousId,changed:n})}reset(){this.anonymousId=this.ids.uuid(),this.distinctId=this.anonymousId,this.identified=false,this.shared.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.setItem(this.key("anonymous_id"),this.anonymousId),this.storage.removeItem(this.key("distinct_id")),this.storage.removeItem(this.key("linked_anonymous_id"));}key(e){return ke(this.namespace,e)}};var we=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async inbox(e){let n=this.requireFetch(),r=`${this.host}/v1/messages?distinct_id=${encodeURIComponent(e)}`,i=await this.request(n,r,{headers:this.authHeaders(),method:"GET"});if(!i.ok)throw new f(`inbox request failed with status ${i.status}`,i.status);return JSON.parse(await i.text()).messages??[]}async markRead(e,n){let r=this.requireFetch(),i=`${this.host}/v1/messages/read`,s=await this.request(r,i,{body:JSON.stringify({distinct_id:n,message_id:e}),headers:{...this.authHeaders(),"content-type":"application/json"},method:"POST"});if(!s.ok)throw new f(`mark-read request failed with status ${s.status}`,s.status)}requireFetch(){if(!this.fetch)throw new f("no fetch implementation available in this runtime");return this.fetch}authHeaders(){return {authorization:`Bearer ${this.projectKey}`}}async request(e,n,r){let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{return await e(n,{...r,signal:i?.signal})}finally{s!==void 0&&clearTimeout(s);}}};var Ee=class{constructor(e,n){this.maxSize=e;this.onOverflow=n;d(this,"events",[]);}get size(){return this.events.length}enqueue(e){this.events.push(e),this.enforceCap();}restore(e){this.events.push(...e),this.enforceCap();}requeue(e){this.events.unshift(...e),this.enforceCap();}drain(e){let n=e===void 0?this.events.length:Math.min(e,this.events.length);return this.events.splice(0,n)}snapshot(){return [...this.events]}enforceCap(){if(this.events.length<=this.maxSize)return;let e=this.events.splice(0,this.events.length-this.maxSize);this.onOverflow?.({dropped:e});}};var Gr={idleMs:18e5,maxMs:864e5,throttleMs:1e4};function yn(t){return `pdx.${t}.session`}function vn(t,e,n,r){let i={id:n.id,lastActivityAt:r,startedAt:n.startedAt};t.setItem(yn(e),JSON.stringify(i));}var Te=class{constructor(e,n,r,i,s=Gr){this.storage=e;this.ids=n;this.clock=r;this.namespace=i;this.options=s;}current(){return this.touch().id}startedAt(){return this.touch().startedAt}reset(){this.storage.removeItem(this.key());}touch(){let e=this.clock.now().getTime(),n=this.live(this.read(),e);if(n===void 0)return this.write({id:this.ids.uuid(),lastActivityAt:e,startedAt:e});if(e-n.lastActivityAt<=this.options.throttleMs)return n;let r=this.live(this.read(),e),i=r!==void 0&&r.id!==n.id?r:n;return this.write({...i,lastActivityAt:e})}live(e,n){if(e!==void 0&&!(n-e.lastActivityAt>this.options.idleMs||n-e.startedAt>this.options.maxMs))return e}write(e){return this.storage.setItem(this.key(),JSON.stringify(e)),e}read(){let e=this.storage.getItem(this.key());if(e)try{let n=JSON.parse(e);return typeof n.id=="string"&&typeof n.startedAt=="number"&&typeof n.lastActivityAt=="number"?{id:n.id,lastActivityAt:n.lastActivityAt,startedAt:n.startedAt}:void 0}catch{return}}key(){return yn(this.namespace)}};var w={autocapture:"$autocapture",createAlias:"$create_alias",featureFlagCalled:"$feature_flag_called",group:"$group",identify:"$identify",pageview:"$pageview",set:"$set",webVitals:"$web_vitals"};var bn=6e4;function Vr(t){return t.length*3<=bn||new TextEncoder().encode(t).length<=bn}function xn(t){return t>=400&&t<500&&t!==429}var J=class{constructor(e={}){d(this,"fetch");d(this,"maxRetries");d(this,"requestTimeoutMs");d(this,"baseDelayMs");d(this,"maxDelayMs");d(this,"sleep");d(this,"random");this.fetch=F(e.fetch),this.maxRetries=e.maxRetries??3,this.requestTimeoutMs=e.requestTimeoutMs??1e4,this.baseDelayMs=e.baseDelayMs??500,this.maxDelayMs=e.maxDelayMs??3e4,this.sleep=e.sleep??Ft,this.random=e.random??Math.random;}async send(e,n={}){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=JSON.stringify(e.body),s=n.keepalive===true&&Vr(i),o;for(let a=0;a<=this.maxRetries;a+=1){try{let c=await this.attempt(r,e,i,s);if(c.ok)return;if(xn(c.status))throw new f(`ingest rejected batch with status ${c.status}`,c.status);o=new f(`ingest transient status ${c.status}`,c.status);}catch(c){if(c instanceof f&&c.status!==void 0&&xn(c.status))throw c;o=c;}a<this.maxRetries&&await this.sleep(this.backoff(a));}throw new f("ingest delivery failed after retries",void 0,{cause:o})}async attempt(e,n,r,i){let s=L(),o=s?setTimeout(()=>s.abort(),this.requestTimeoutMs):void 0;try{return await e(n.url,{body:r,headers:{authorization:`Bearer ${n.projectKey}`,"content-type":"application/json"},...i?{keepalive:!0}:{},method:"POST",signal:s?.signal})}finally{o!==void 0&&clearTimeout(o);}}backoff(e){return Math.min(this.maxDelayMs,this.baseDelayMs*2**e)+this.random()*this.baseDelayMs}};var jr="queue",Ur=1e3,kn=3e4,rt=t=>{let e={};return t.avatar!==void 0&&(e.$avatar=t.avatar),t.email!==void 0&&(e.$email=t.email),t.name!==void 0&&(e.$name=t.name),t.phone!==void 0&&(e.$phone=t.phone),e},Ce=class{constructor(e){d(this,"config");d(this,"identity");d(this,"session");d(this,"queue");d(this,"transport");d(this,"flagsClient");d(this,"messagesClient");d(this,"surveysClient");d(this,"guidesClient");d(this,"captureListeners",new Set);d(this,"formsClient");d(this,"ctasClient");d(this,"context");d(this,"flushTimer");d(this,"flushing",false);d(this,"cachedFlags");d(this,"cachedSnapshot");d(this,"membershipCache");d(this,"stream");d(this,"shutDown",false);d(this,"exposures",new Set);d(this,"gates");d(this,"cookielessId");d(this,"storageListeners",new Set);let n=Kt(e),r=Se(n.sharedStorage,n.namespace)??n.consent??null;if(this.gates=[new ee(n.storage),new ee(n.sharedStorage,gn)],n.consentMode!=="banner"||r?.analytics===true)for(let o of this.gates)o.open();let[i,s]=this.gates;this.config={...n,sharedStorage:s,storage:i},this.identity=new xe(this.config.storage,this.config.sharedStorage,this.config.ids,this.config.namespace),this.config.consent!==void 0&&this.identity.setConsent(this.config.consent),this.session=this.config.sessionTracking?new Te(this.config.sharedStorage,this.config.ids,this.config.clock,this.config.namespace):void 0,this.queue=new Ee(this.config.maxQueueSize,({dropped:o})=>{this.config.onError(new D("queue_overflow",`event queue overflow: dropped ${o.length} oldest event(s)`));}),this.transport=this.config.transport??new J({maxRetries:this.config.maxRetries,requestTimeoutMs:this.config.requestTimeoutMs}),this.flagsClient=new me({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.messagesClient=new we({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.surveysClient=new ge({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.guidesClient=new ve({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.formsClient=new fe({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.ctasClient=new ue({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.context={sdk:this.config.sdkName,sdk_version:this.config.sdkVersion},this.config.os&&(this.context.os=this.config.os),this.config.locale&&(this.context.locale=this.config.locale),this.restoreQueue(),this.startTimer();}get distinctId(){return this.identity.getDistinctId()}get anonymousId(){return this.identity.getAnonymousId()}get isIdentified(){return this.identity.isIdentified()}get sessionId(){return this.session?.current()}get sessionStartedAt(){return this.session?.startedAt()}capture(e,n={}){try{this.identity.refresh();let r={...this.config.defaultProperties(),...n.element===void 0?{}:this.config.describeElement?.(n.element)??{},...n.properties??{}},i=Vt({context:this.context,distinctId:n.distinctId??this.identity.getDistinctId(),eventName:e,properties:r,sessionId:n.sessionId??this.session?.current(),timestamp:n.timestamp},this.config.clock,this.config.ids);this.enqueue(i);}catch(r){this.config.onError(r);}for(let r of this.captureListeners)try{r(e);}catch(i){this.config.onError(i);}}onCapture(e){return this.captureListeners.add(e),()=>{this.captureListeners.delete(e);}}identify(e,n={}){if(this.isCookieless())return;this.identity.refresh();let r=this.identity.identify(e),i={};r.anonymousToLink!==void 0&&(i.$anon_distinct_id=r.anonymousToLink);let s=$t(),o={...s===null?{}:{$timezone:s},...rt(n.traits??{}),...n.set??{}};Object.keys(o).length>0&&(i.$set=o),this.capture(w.identify,{properties:i});}link(e,n,r){if(this.isCookieless())return;let i={$anon_distinct_id:n},s=rt(r??{});Object.keys(s).length>0&&(i.$set=s),this.capture(w.identify,{distinctId:e,properties:i});}setConsent(e){this.identity.setConsent(e),e.analytics===true&&this.allowStorage(),e.analytics===false&&this.config.consentMode==="banner"&&this.forbidStorage();}isCookieless(){return !this.gates[0].isOpen}takeCookielessId(e){this.cookielessId=e,this.isCookieless()&&this.identity.assumeAnonymousId(e);}allowStorage(){if(this.isCookieless()){for(let e of this.gates)e.open();this.identity.refresh();for(let e of [...this.storageListeners])e();}}onStorageAllowed(e){return this.storageListeners.add(e),()=>{this.storageListeners.delete(e);}}forbidStorage(){if(!this.isCookieless()){for(let e of ["anonymous_id","distinct_id","linked_anonymous_id","session"])this.config.storage.removeItem(`pdx.${this.config.namespace}.${e}`),this.config.sharedStorage.removeItem(`pdx.${this.config.namespace}.${e}`);for(let e of this.gates)e.close();this.identity.refresh(),this.cookielessId!==void 0&&this.identity.assumeAnonymousId(this.cookielessId);}}consent(){return this.identity.consent()}alias(e){this.capture(w.createAlias,{properties:{alias:e}});}group(e,n,r){let i={$group_key:n,$group_type:e};r&&(i.$set=r),this.capture(w.group,{properties:i});}setPersonProperties(e,n){if(this.isCookieless())return;let r={};e&&(r.$set=e),n&&(r.$set_once=n),this.capture(w.set,{properties:r});}setPersonTraits(e){if(this.isCookieless())return;let n=rt(e);Object.keys(n).length!==0&&this.capture(w.set,{properties:{$set:n}});}async getAllFlags(){let e=this.identity.getDistinctId(),n=await this.flagsClient.fetchDecisions(e);return this.cachedFlags={distinctId:e,flags:n.flags,variants:n.variants??{}},n.flags}async isFeatureEnabled(e){let r=(await this.getAllFlags())[e]??false;return this.recordExposure(e,this.cachedFlags?.variants[e]?.key??String(r)),r}async getVariant(e){let n=await this.getAllFlags(),r=this.cachedFlags?.variants[e]??null;return this.recordExposure(e,r?.key??String(n[e]??false)),r}async getVariantLocal(e,n={}){let r=await this.flagSnapshot(),i=r.flags.find(c=>c.key===e),s=await this.localContext(n,r.flags),o=i?ze(i,r.flags,s):null,a=i?le(i,r.flags,s).enabled:false;return this.recordExposure(e,o?.key??String(a)),o?{key:o.key,value:o.value}:null}recordExposure(e,n){let r=`${this.identity.getDistinctId()} ${e} ${n}`;this.exposures.has(r)||(this.exposures.add(r),this.capture(w.featureFlagCalled,{properties:{$feature_flag:e,$feature_flag_response:n}}));}getCachedFlag(e){if(!(!this.cachedFlags||this.cachedFlags.distinctId!==this.distinctId))return this.cachedFlags.flags[e]}async getLocalFlags(e={}){let n=await this.flagSnapshot();return Qt(n.flags,await this.localContext(e,n.flags))}async isFeatureEnabledLocal(e,n={}){let r=await this.flagSnapshot(),i=r.flags.find(a=>a.key===e),s=await this.localContext(n,r.flags),o=i?le(i,r.flags,s).enabled:false;return this.recordExposure(e,(i?ze(i,r.flags,s)?.key:void 0)??String(o)),o}async localContext(e,n){let r=this.identity.getDistinctId(),i=e.cohorts;if(i===void 0&&Xt(n)){let s=this.config.clock.now().getTime();this.membershipCache&&this.membershipCache.distinctId===r&&s-this.membershipCache.fetchedAt<kn?i=this.membershipCache.cohorts:(i=await this.flagsClient.memberships(r),this.membershipCache={cohorts:i,distinctId:r,fetchedAt:s});}return {attributes:e.attributes,cohorts:i,distinctId:r,properties:e.properties}}async flagSnapshot(){let e=this.config.clock.now().getTime();if(this.cachedSnapshot&&e-this.cachedSnapshot.fetchedAt<kn)return this.cachedSnapshot.snapshot;let n=await this.flagsClient.snapshot();return this.cachedSnapshot={fetchedAt:e,snapshot:n},this.maybeStream(n),n}maybeStream(e){if(!this.config.streamFlags||this.shutDown||this.stream||!e.socketUrl)return;let n=new pe({host:e.socketUrl,onChange:()=>{this.cachedSnapshot=void 0,this.flagSnapshot().catch(r=>this.config.onError(r));},onClosed:r=>{this.stream=void 0,r&&this.maybeStream(e);},projectKey:this.config.apiKey,socketFactory:this.config.socketFactory});this.stream=n,n.open();}async getInbox(){return this.messagesClient.inbox(this.identity.getDistinctId())}async markMessageRead(e){await this.messagesClient.markRead(e,this.identity.getDistinctId());}async getSurveys(e){return this.surveysClient.surveys(this.identity.getDistinctId(),e??this.config.locale)}captureSurveyShown(e){this.capture(sn,{properties:ye(e,{})});}captureSurveyDismissed(e){this.capture(on,{properties:ye(e,{})});}captureSurveySent(e,n){this.capture(an,{properties:ye(e,n)});}async getGuides(){return this.guidesClient.guides(this.identity.getDistinctId())}captureGuide(e,n,r){this.capture(e,{properties:fn(n,r)});}async getForm(e){return this.formsClient.form(e,this.identity.getDistinctId())}async submitForm(e,n,r,i){let{$page_id:s,$page_variant:o}=this.config.defaultProperties();return this.formsClient.submit(e,{answers:n,challenge:r,distinctId:this.identity.getDistinctId(),isAnonymous:!this.identity.isIdentified(),pageUrl:typeof window>"u"?"":window.location.href,solution:i,...typeof s=="string"&&typeof o=="string"?{pageId:s,pageVariant:o}:{}})}async getCtas(e){return this.ctasClient.ctas({...e,anonymous:!this.identity.isIdentified(),distinctId:this.identity.getDistinctId()})}captureCta(e,n,r){this.capture(e,{properties:Gt(n,r)});}async flush(){if(this.flushing||this.queue.size===0)return;this.flushing=true;let e=this.queue.drain(Ur);try{await this.transport.send({body:{events:e,sent_at:ae(this.config.clock.now())},projectKey:this.config.apiKey,url:`${this.config.host}/v1/events`}),this.persistQueue();}catch(n){this.queue.requeue(e),this.persistQueue(),this.config.onError(n);}finally{this.flushing=false;}}reset(){this.session?.reset(),this.identity.reset(),this.cachedFlags=void 0,this.cachedSnapshot=void 0,this.membershipCache=void 0;}async shutdown(){this.shutDown=true,this.stopTimer(),this.stream?.close(),this.stream=void 0,await this.flush();}enqueue(e){this.queue.enqueue(e),this.persistQueue(),this.queue.size>=this.config.flushAt&&this.flush();}persistQueue(){try{this.config.storage.setItem(this.persistKey(),JSON.stringify(this.queue.snapshot()));}catch(e){this.config.onError(e);}}restoreQueue(){try{let e=this.config.storage.getItem(this.persistKey());if(!e)return;let n=JSON.parse(e);Array.isArray(n)&&this.queue.restore(n);}catch(e){this.config.onError(e);}}startTimer(){if(this.config.flushIntervalMs<=0)return;let e=setInterval(()=>{this.flush();},this.config.flushIntervalMs),n=e;typeof n.unref=="function"&&n.unref(),this.flushTimer=e;}stopTimer(){this.flushTimer!==void 0&&(clearInterval(this.flushTimer),this.flushTimer=void 0);}persistKey(){return `pdx.${this.config.namespace}.${jr}`}};var wn="data-prodantix",En="data-prodantix-action",Tn="data-prodantix-ignore",Y=300,it="data-pdx-no-capture",st="pdx-no-capture",Wr=new Set(["a","button","input","label","option","select","summary","textarea"]),zr=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]);function Jr(t){return Wr.has(t.tagName.toLowerCase())||zr.has((t.getAttribute("role")??"").trim().toLowerCase())}function ot(t){for(let e=t;e!==null;e=e.parentElement)if(Jr(e))return e;return t}function at(t){for(let e=t;e!==null;e=e.parentElement)if(e.getAttribute(Tn)!==null)return true;return false}function dt(t){for(let e=t;e!==null;e=e.parentElement)if(e.getAttribute(it)!==null||typeof e.className=="string"&&e.className.split(/\s+/).includes(st))return true;return false}function Ie(t){let e=new Set;return n=>{e.has(n.message)||(e.add(n.message),t(n));}}function Sn(t,e,n){let r=t.getAttribute(e);if(r===null)return;let i=r.trim();if(i!==""){if(i.length>Y){n(new D("validation",`${e} on a <${t.tagName.toLowerCase()}> is ${i.length} characters, over the ${Y}-character limit, so it was ignored: "${i.slice(0,40)}\u2026"`));return}return i}}function ut(t,e){let n={},r=Sn(t,wn,e);r!==void 0&&(n.$el_description=r,n.$el_description_source="annotation");let i=Sn(t,En,e);return i!==void 0&&(n.$el_action=i),n}function Cn(t,e){return !Yr(t)||at(t)||dt(t)?{}:ut(ot(t),e)}function Yr(t){return typeof t=="object"&&t!==null&&typeof t.tagName=="string"&&typeof t.getAttribute=="function"}var Qr="$form_submitted",Xr=new Set(["button","file","hidden","image","password","reset","submit"]),In=/(card|cc-?num|cvc|cvv|iban|security.?code)/i,Zr=t=>(t.getAttribute("autocomplete")??"").startsWith("cc-")||In.test(t.name)||In.test(t.id),ei=t=>{let e=t.name.toLowerCase();return t instanceof HTMLInputElement&&t.type==="email"||e==="email"||t.getAttribute("autocomplete")==="email"?"$email":e==="name"||e==="full_name"||e==="fullname"||t.getAttribute("autocomplete")==="name"?"$name":null},ti=(t,e)=>{if(t.closest("[data-prodantix-ignore]")||t.hasAttribute("data-prodantix-form"))return null;let n={},r={};for(let i of Array.from(t.elements)){if(!(i instanceof HTMLInputElement||i instanceof HTMLSelectElement||i instanceof HTMLTextAreaElement)||!i.name||i.closest("[data-prodantix-ignore]")||Zr(i)||i instanceof HTMLInputElement&&(Xr.has(i.type)||(i.type==="checkbox"||i.type==="radio")&&!i.checked))continue;let s=i.value.trim();if(s==="")continue;n[i.name]=s;let o=ei(i);o&&(r[o]=s);}return {$answers:n,$form_id:t.id||`${e}#${Array.from(t.ownerDocument.forms).indexOf(t)}`,$page_url:t.ownerDocument.location?.href??"",$set:r,collected:true}},_n=(t,e=document)=>{let n=r=>{if(r.target instanceof HTMLFormElement){let i=ti(r.target,e.location?.pathname??"");i&&t.capture(Qr,{properties:i});}};return e.addEventListener("submit",n,true),()=>e.removeEventListener("submit",n,true)};var ni=1e3,ri=5e3,ii=50,ct=class{constructor(){d(this,"fcp");d(this,"lcp");d(this,"cls");d(this,"window",{end:0,start:0,sum:0});d(this,"interactions",new Map);}add(e){if(e.entryType==="paint"&&e.name==="first-contentful-paint"&&(this.fcp=e.startTime),e.entryType==="largest-contentful-paint"&&(this.lcp=e.startTime),e.entryType==="layout-shift"&&!e.hadRecentInput&&e.value!==void 0){let n=this.window.sum>0&&e.startTime-this.window.end<ni&&e.startTime-this.window.start<ri;this.window=n?{end:e.startTime,start:this.window.start,sum:this.window.sum+e.value}:{end:e.startTime,start:e.startTime,sum:e.value},this.cls=Math.max(this.cls??0,this.window.sum);}e.entryType==="event"&&e.interactionId!==void 0&&e.interactionId>0&&this.interactions.set(e.interactionId,Math.max(this.interactions.get(e.interactionId)??0,e.duration));}properties(e){let n={};if(this.lcp!==void 0&&(n.$lcp_ms=Math.round(this.lcp)),this.fcp!==void 0&&(n.$fcp_ms=Math.round(this.fcp)),this.cls!==void 0&&(n.$cls=Math.round(this.cls*1e4)/1e4),this.interactions.size>0){let r=[...this.interactions.values()].sort((i,s)=>s-i);n.$inp_ms=Math.round(r[Math.min(r.length-1,Math.floor(r.length/ii))]??0);}return e!==void 0&&(n.$ttfb_ms=Math.round(e)),n}},si=[{type:"paint"},{type:"largest-contentful-paint"},{type:"layout-shift"},{durationThreshold:40,type:"event"}];function Pn(t,e){let n=new ct,r=[];for(let o of si){let a=e.observer(c=>{for(let u of c)n.add(u);});if(a!==void 0)try{a.observe({...o,buffered:!0}),r.push(a);}catch{a.disconnect();}}let i=false,s=()=>{if(i)return;let o=n.properties(e.firstByte());if(Object.keys(o).length===0)return;i=true;let a=e.path();t.capture(w.webVitals,{properties:a===void 0?o:{...o,$pathname:a}});};return e.addEventListener("visibilitychange",()=>{e.isHidden()&&s();}),e.addEventListener("pagehide",s),()=>{for(let o of r)o.disconnect();}}function An(){if(!(typeof window>"u"||typeof document>"u"||typeof PerformanceObserver>"u"))return {addEventListener:(t,e)=>(t==="pagehide"?window:document).addEventListener(t,e),firstByte:()=>{let t=performance.getEntriesByType("navigation")[0];return t instanceof PerformanceNavigationTiming&&t.responseStart>0?t.responseStart:void 0},isHidden:()=>document.visibilityState==="hidden",observer:t=>{try{return new PerformanceObserver(e=>t(e.getEntries()))}catch{return}},path:()=>window.location?.pathname}}var oi=new Set(["input","select","textarea"]),ai=new Set(["email","password","tel"]);function Pe(){return globalThis.location}function Fn(){return globalThis.document}function di(){return globalThis.window??globalThis}function ui(t){return typeof t=="object"&&t!==null&&typeof t.tagName=="string"}function _e(t,e){let n;try{n=new URL(t,e);}catch{return}return n.protocol==="http:"||n.protocol==="https:"?`${n.origin}${n.pathname}`:n.protocol}function Ln(){let t=Pe(),e=Fn(),n={};if(t){let r=_e(t.href);r&&(n.$current_url=r),n.$pathname=t.pathname,n.$host=t.host;}if(e){e.title&&(n.$title=e.title);let r=e.referrer?_e(e.referrer):void 0;r&&(n.$referrer=r);}return n}function ci(t){return typeof t.className=="string"?t.className:""}function li(t){return oi.has(t.tagName.toLowerCase())||ai.has((t.getAttribute("type")??"").toLowerCase())}function pi(t,e,n){let r={$el_tag:t.tagName.toLowerCase(),$event_type:"click"};if(e)return r;let i=n?t.textContent?.trim():void 0;i&&(r.$el_text=i.slice(0,255)),t.id&&(r.$el_id=t.id);let s=ci(t);s&&(r.$el_classes=s);let o=t.getAttribute("href"),a=o?_e(o,Pe()?.href):void 0;return a&&(r.$el_href=a),r}function lt(t){return (t??"").replace(/\s+/g," ").trim()}function re(t,e){return {$el_description:t,$el_description_source:e}}function mi(t,e,n){if(!e&&n){let o=lt(t.getAttribute("aria-label"));if(o!==""&&o.length<=Y)return re(o,"aria_label");let a=lt(t.textContent);if(a!==""&&a.length<=Y)return re(a,"text")}let r=e?null:t.getAttribute("href"),i=r?_e(r,Pe()?.href):void 0;if(i)return re(i,"href");let s=lt(t.getAttribute("role")).toLowerCase();return s===""?re(t.tagName.toLowerCase(),"tag"):re(s,"role")}function fi(t,e){let n=new Set,r=(u,l)=>{if(n.has(u))return false;try{return l()}catch(p){return n.add(u),e(new D("config",`autocapture maskSelectors entry "${u}" is not a valid selector`,{cause:p})),false}},i=(u,l)=>u.matches?r(l,()=>u.matches?.(l)===!0):false,s=u=>{let l=u.querySelector?.bind(u);return l?l(`[${it}], .${st}`)!==null||t.some(p=>r(p,()=>l(p)!==null)):false},o=u=>{for(let l=u;l;l=l.parentElement){let p=l;if(t.some(x=>i(p,x)))return true}return false},a=u=>{for(let l=u;l;l=l.parentElement)if(li(l))return true;return false},c=u=>dt(u)||o(u);return {holdsMasked:s,isMasked:u=>c(u)||a(u),isOptedOut:c}}function gi(t){let e=globalThis.history,n=di(),r="",i=()=>{let a=Pe(),c=a?`${a.pathname}${a.search}`:"";c!==r&&(r=c,t.capture(w.pageview,{properties:Ln()}));};if(i(),!e||!n)return ()=>{};let s=e.pushState.bind(e),o=e.replaceState.bind(e);return e.pushState=(...a)=>{s(...a),i();},e.replaceState=(...a)=>{o(...a),i();},n.addEventListener("popstate",i),()=>{e.pushState=s,e.replaceState=o,n.removeEventListener("popstate",i);}}function hi(t,e){let n=Fn();if(!n)return ()=>{};let r=e.onError??(()=>{}),i=fi(e.maskSelectors??[],r),s=Ie(r),o=e.captureElementText??false,a=c=>{let u=c.target;if(!ui(u)||at(u))return;let l=ot(u),p=i.isMasked(u)||i.holdsMasked(l),x=i.isOptedOut(u)?{}:ut(l,s),$=x.$el_description===void 0?mi(l,p,o):{};t.capture(w.autocapture,{properties:{...Ln(),...pi(l,p,o),...$,...x}});};return n.addEventListener("click",a,true),()=>n.removeEventListener("click",a,true)}function $n(t,e={}){let n=[];(e.pageviews??true)&&n.push(gi(t)),(e.clicks??true)&&n.push(hi(t,e)),e.collectForms===true&&typeof document<"u"&&n.push(_n(t));let r=e.webVitals===false?void 0:An();return r!==void 0&&n.push(Pn(t,r)),()=>{for(let i of n)i();}}function yi(){return globalThis.document?.visibilityState==="hidden"}var Ae=class{constructor(e={}){d(this,"fetchTransport");this.fetchTransport=new J(e);}async send(e){await this.fetchTransport.send(e,{keepalive:yi()});}};var pt="prodantix:consent-ready",mt="prodantix:consent",Nn="__prodantixConsent";var Rn=(t,e)=>{t.takeCookielessId(e.anonymousId),e.consent!==null?t.setConsent(e.consent):e.rule==="notice"&&t.allowStorage();},On=(t,e)=>{let n=e[Nn];n&&Rn(t,n);let r=s=>{let o=s.detail;o&&Rn(t,o);},i=s=>{let o=s.detail;o&&t.setConsent(o);};return e.addEventListener(pt,r),e.addEventListener(mt,i),()=>{e.removeEventListener(pt,r),e.removeEventListener(mt,i);}};var vi=/^\d{1,3}(\.\d{1,3}){3}$/,bi=/^[a-z0-9.-]+$/i;function Mn(){return Math.random().toString(36).slice(2,12)}function Fe(t,e){let n=`${e}=`,r=[];for(let i of t.cookie.split(";")){let s=i.trim();s.startsWith(n)&&r.push(s.slice(n.length));}return r}function ie(t,e,n){let r=["Path=/",`Max-Age=${e}`,"SameSite=Lax"];return t&&r.push(`Domain=${t}`),n&&r.push("Secure"),r.join("; ")}function Dn(t,e,n,r){try{let i=`pdx_probe_${r()}`,s=r();t.cookie=`${i}=${s}; ${ie(e,60,n)}`;let o=Fe(t,i).includes(s);t.cookie=`${i}=; ${ie(e,0,n)}`;let a=Fe(t,i).includes(s);return o&&!a}catch{return false}}function gt(t){let e=t.replace(/^\[|\]$/g,"").toLowerCase();if(e.includes(":")||vi.test(e)||!e.includes("."))return [];let n=e.split("."),r=[];for(let i=n.length-2;i>=0;i-=1)r.push(n.slice(i).join("."));return r}function qn(t,e,n,r=Mn){for(let i of gt(t))if(Dn(e,i,n,r))return i}function xi(t){let e=new Map,n=JSON.parse(decodeURIComponent(t));if(n===null||typeof n!="object"||Array.isArray(n))return e;for(let[r,i]of Object.entries(n))typeof i=="string"&&e.set(r,i);return e}var ft=class{constructor(e,n,r,i){this.jar=e;this.name=n;this.domain=r;this.secure=i;}getItem(e){return this.read().get(e)??null}setItem(e,n){let r=this.read();r.set(e,n),this.write(r);}removeItem(e){let n=this.read();n.delete(e)&&this.write(n);}read(){try{let e=Fe(this.jar,this.name);e.length>1&&this.domain&&(this.jar.cookie=`${this.name}=; ${ie(void 0,0,this.secure)}`,e=Fe(this.jar,this.name));let n=e[0];return n?xi(n):new Map}catch{return new Map}}write(e){try{if(e.size===0){this.jar.cookie=`${this.name}=; ${ie(this.domain,0,this.secure)}`;return}let n=encodeURIComponent(JSON.stringify(Object.fromEntries(e)));this.jar.cookie=`${this.name}=${n}; ${ie(this.domain,31536e3,this.secure)}`;}catch{return}}};function ki(){return globalThis.document}function Si(){return globalThis.location?.hostname??""}function wi(){return globalThis.location?.protocol==="https:"}function Ei(t){if(t===void 0)return;let e=t.startsWith(".")?t.slice(1):t;return bi.test(e)?e.toLowerCase():void 0}function ht(t){let e="jar"in t?t.jar:ki();if(!e||globalThis.navigator?.cookieEnabled===false)return null;let r=t.random??Mn,i=t.secure??wi(),s=t.hostname??Si();try{let o=Ei(t.domain)??qn(s,e,i,r);return Dn(e,o,i,r)?new ft(e,t.name,o,i):null}catch{return null}}var Ti=["am","ar","bn","de","en","es","et","fil","fr","hi","id","ja","ko","pt","ru","sw","vi","zh"],Kn=t=>{let e=(t??"").toLowerCase().split("-")[0]??"";return Ti.find(n=>n===e)??"en"};var Ci=/^\$(survey|guide|checklist)_/,Hn=()=>({guides:{done:[],settled:[]},surveys:{settled:[]}});function Ii(t,e){try{let n=t.getItem(e);if(n===null)return Hn();let r=JSON.parse(n);return {guides:{done:r.guides?.done??[],lastShownAt:r.guides?.lastShownAt,settled:r.guides?.settled??[]},surveys:{lastShownAt:r.surveys?.lastShownAt,settled:r.surveys?.settled??[]}}}catch{return Hn()}}function Bn(t,e,n){let r=n();return r?Promise.resolve(r):new Promise(i=>{let s=t.document.createElement("script");s.src=e,s.async=true,s.onload=()=>i(n()??null),s.onerror=()=>i(null),t.document.head.append(s);})}function Gn(t,e,n){let r=`pdx_engage_${n.namespace}`,i=Ii(n.storage,r),s=()=>{try{n.storage.setItem(r,JSON.stringify(i));}catch(y){n.onError(y);}},o=Kn(e.document.documentElement.lang||e.navigator.language),a=[],c=[],u=false,l=false,p=new Map,x=()=>Bn(e,`${n.edgeHost}/surveys.js`,()=>e.prodantixSurveys),$=()=>Bn(e,`${n.edgeHost}/guides.js`,()=>e.prodantixGuides),_=async y=>{if(u)return;let g=a.find(A=>dn(A,i.surveys,e.location.href,Date.now(),y));if(!g)return;u=true;let T=await x();if(!T){u=false;return}let E=()=>{i.surveys.settled=[...i.surveys.settled.filter(A=>A!==he(g)),he(g)],s(),u=false;};T.showSurvey(e.document,g,o,{onDismissed:()=>{t.captureSurveyDismissed(g),E();},onSent:A=>{t.captureSurveySent(g,A),E();},onShown:()=>{i.surveys.lastShownAt=Date.now(),s(),t.captureSurveyShown(g);}});},R=y=>{i.guides.settled=[...i.guides.settled.filter(g=>g!==z(y)),z(y)],s();},H=async y=>{let g=c.filter(v=>!p.has(v.id)&&pn(v,i.guides,e.location.href,Date.now(),y)),T=g.filter(v=>v.kind==="checklist"),E=l?void 0:g.find(v=>v.kind!=="checklist");if(T.length===0&&!E)return;E&&(l=true);let A=await $();if(!A){l=false;return}for(let v of T)p.has(v.id)||p.set(v.id,A.showChecklist(e.document,v,o,et(v,i.guides),{onDismissed:()=>{t.captureGuide(Ze,v),R(v),p.delete(v.id);},onShown:()=>t.captureGuide(Qe,v)}));if(!E)return;(E.kind==="tooltip"?A.showTooltip:A.showTour)(e.document,E,o,{onCompleted:()=>{t.captureGuide(Xe,E),R(E),l=false;},onDismissed:()=>{t.captureGuide(Ze,E),R(E),l=false;},onMissed:v=>t.captureGuide(cn,E,v),onShown:()=>{i.guides.lastShownAt=Date.now(),s(),t.captureGuide(Qe,E);},onStep:v=>t.captureGuide(un,E,v)});},X=y=>{for(let g of c){let T=mn(g,y);!T||i.guides.done.includes(be(g,T.id))||i.guides.settled.includes(z(g))||(i.guides.done=[...i.guides.done,be(g,T.id)],t.captureGuide(ln,g,T.id),p.get(g.id)?.markDone(T.id),et(g,i.guides).length===g.steps.length&&(t.captureGuide(Xe,g),R(g),p.get(g.id)?.close(),p.delete(g.id)),s());}},O=y=>{n.surveys&&_(y).catch(n.onError),n.guides&&H(y).catch(n.onError);},M=t.onCapture(y=>{Ci.test(y)||(X(y),O(y));}),P=()=>O();e.addEventListener("popstate",P);let K=async()=>{let y=E=>(n.onError(E),[]),[g,T]=await Promise.all([n.surveys?t.getSurveys(e.document.documentElement.lang||e.navigator.language).catch(y):[],n.guides?t.getGuides().catch(y):[]]);a=g,c=T,O();};return e.document.readyState==="loading"?e.document.addEventListener("DOMContentLoaded",()=>void K(),{once:true}):K(),()=>{M(),e.removeEventListener("popstate",P);for(let y of p.values())y.close();p.clear();}}var Un="_pdx",Wn="~",_i=200,Pi=/^\d+$/;function zn(t,e,n,r){let i=Fi(t.href);if(i===void 0||vt(i.search).some(bt))return;let s=Vn(i.hostname,n);s===void 0||s===Vn(r,n)||(i.search=`${i.search}${i.search?"&":"?"}${Un}=${Ai(e)}`,t.href=i.href);}function Ai(t){return [t.anonymousId,t.sessionId,String(t.sessionStartedAt)].map($i).join(Wn)}function Jn(t){let e=vt(t).find(bt);if(e===void 0)return;let n=Li(e).split(Wn);if(n.length!==3)return;let r=Le(n[0]),i=Le(n[1]),s=Le(n[2]);if(!(!jn(r)||!jn(i)||!Ni(s)))return {anonymousId:r,sessionId:i,sessionStartedAt:Number(s)}}function Yn(t,e){let n=vt(e.search),r=n.filter(s=>!bt(s));if(r.length===n.length)return;let i=r.length>0?`?${r.join("&")}`:"";t.replaceState(t.state,"",`${e.pathname}${i}${e.hash}`);}function Qn(t){if(t.location===void 0||typeof t.location.search!="string")return;let e=Jn(t.location.search);if(e===void 0)return;let n=hn(t.storage,t.shared,t.namespace,e.anonymousId);return vn(t.shared,t.namespace,{id:e.sessionId,startedAt:e.sessionStartedAt},t.now),t.history!==void 0&&Yn(t.history,t.location),n}function yt(t,e,n){if(n.length===0)return ()=>{};let r=i=>{let s=Mi(i.target);if(s===void 0)return;let o=Ri(e);o!==void 0&&zn(s,o,n,t.location?.hostname??"");};return t.addEventListener("click",r,true),t.addEventListener("auxclick",r,true),()=>{t.removeEventListener("click",r,true),t.removeEventListener("auxclick",r,true);}}function Fi(t){try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"?e:void 0}catch{return}}function Vn(t,e){let n=e.map(r=>r.replace(/^\./,"").toLowerCase());return gt(t).find(r=>n.includes(r))}function vt(t){return t.replace(/^\?/,"").split("&").filter(e=>e!=="")}function bt(t){let e=t.indexOf("=");return Le(e===-1?t:t.slice(0,e))===Un}function Li(t){let e=t.indexOf("=");return e===-1?"":t.slice(e+1)}function $i(t){return encodeURIComponent(t).replace(/~/g,"%7E")}function Le(t){try{return decodeURIComponent(t)}catch{return}}function jn(t){if(t===void 0)return false;let e=de(t);return e>=1&&e<=_i}function Ni(t){return t!==void 0&&Pi.test(t)&&Number.isSafeInteger(Number(t))}function Ri(t){if(t.consent?.()?.identityLink===false)return;let e=t.sessionId,n=t.sessionStartedAt;if(!(e===void 0||n===void 0))return {anonymousId:t.anonymousId,sessionId:e,sessionStartedAt:n}}function Oi(t){return typeof t.tagName=="string"&&t.tagName.toUpperCase()==="A"&&typeof t.href=="string"}function Mi(t){let e=typeof t=="object"?t:null;for(;e;){if(Oi(e))return e;e=e.parentElement??null;}}var Xn={maskAllInputs:true,maskAllText:false},Di=new Set(["email","password","tel"]);function Zn(t){return t.replace(/\S/g,"*")}function $e(t,e,n){return qi(e)||n.maskAllInputs?Zn(t):t}function Ne(t,e){return e.maskAllText?Zn(t):t}function qi(t){return Di.has((t??"").toLowerCase())}var Ki=5e3,Re=class{constructor(e){this.options=e;d(this,"buffer",[]);d(this,"seq",0);d(this,"maxEvents");this.maxEvents=Math.min(Math.max(1,e.maxEvents),Ki);}add(e){return this.buffer.push(e),this.buffer.length>=this.maxEvents?this.flush():null}flush(){if(this.buffer.length===0)return null;let e=this.buffer;this.buffer=[];let n={distinct_id:this.options.distinctId(),events:e,masked:this.options.masked,schema_version:1,seq:this.seq,session_id:this.options.sessionId,timestamp:new Date(this.options.now()).toISOString()};return this.seq+=1,n}};var xt=1,kt=3,Hi=9,Oe=class{constructor(){d(this,"next",1);}allocate(){let e=this.next;return this.next+=1,e}},Bi=new Set(["NOSCRIPT","SCRIPT"]);function Me(t,e,n,r){if(t.nodeType===kt){let i=e.allocate();return r?.(t,i),{id:i,textContent:Ne(t.textValue??"",n),type:"text"}}if(t.nodeType===Hi){let i=e.allocate();return r?.(t,i),{childNodes:er(t,e,n,r),id:i,type:"document"}}if(t.nodeType===xt){let i=t.tagName??"";if(Bi.has(i))return null;let s=e.allocate();return r?.(t,s),{attributes:Gi(t,n),childNodes:er(t,e,n,r),id:s,tagName:i,type:"element"}}return null}function er(t,e,n,r){let i=[];for(let s of t.childNodes??[]){let o=Me(s,e,n,r);o&&i.push(o);}return i}function Gi(t,e){let n={};for(let r of t.attributes??[])n[r.name]=r.value;return t.inputValue!==void 0&&(n.value=$e(t.inputValue,t.inputType,e)),n}async function tr(t,e){let n=`${C(e.replayHost)}/v1/replay`;return (await e.fetch(n,{body:JSON.stringify(t),headers:{authorization:`Bearer ${e.apiKey}`,"content-type":"application/json"},method:"POST"})).ok}var nr=new Set(["INPUT","SELECT","TEXTAREA"]),De=class{constructor(e){this.options=e;d(this,"allocator",new Oe);d(this,"mirror",new Map);d(this,"chunker");d(this,"fetchImpl");d(this,"observer");d(this,"timer");d(this,"started",false);this.chunker=new Re({distinctId:e.distinctId,masked:e.mask.maskAllInputs,maxEvents:e.maxEvents,now:e.now,sessionId:e.sessionId}),this.fetchImpl=F(e.fetch);}start(){if(this.started)return;let e=Vi(),n=e?.documentElement;!e||!n||!this.fetchImpl||(this.started=true,this.captureFullSnapshot(n),this.observeMutations(n),this.observeInteractions(e),this.timer=setInterval(()=>this.upload(this.chunker.flush()),this.options.flushIntervalMs));}stop(){this.started&&(this.started=false,this.observer?.disconnect(),this.timer&&clearInterval(this.timer),this.upload(this.chunker.flush()));}captureFullSnapshot(e){let n=Me(this.adapt(e),this.allocator,this.options.mask,(r,i)=>{let s=r.ref;s&&this.mirror.set(s,i);});n&&this.push(2,{node:n});}observeMutations(e){let n=globalThis.MutationObserver;n&&(this.observer=new n(r=>{for(let i of r)this.handleMutation(i);}),this.observer.observe(e,{attributes:true,characterData:true,childList:true,subtree:true}));}handleMutation(e){if(e.type==="characterData"){let n=this.mirror.get(e.target);n!==void 0&&this.push(3,{texts:[{id:n,value:Ne(e.target.textContent??"",this.options.mask)}]});return}if(e.type==="attributes"&&e.attributeName){let n=this.mirror.get(e.target),r=e.target;n!==void 0&&this.push(3,{attributes:[{attributes:{[e.attributeName]:r.getAttribute(e.attributeName)??""},id:n}]});return}if(e.type==="childList"){let n=this.mirror.get(e.target);if(n===void 0)return;for(let r of Array.from(e.addedNodes)){let i=Me(this.adapt(r),this.allocator,this.options.mask,(s,o)=>{let a=s.ref;a&&this.mirror.set(a,o);});i&&this.push(3,{adds:[{node:i,parentId:n}]});}for(let r of Array.from(e.removedNodes)){let i=this.mirror.get(r);i!==void 0&&(this.push(3,{removes:[{id:i,parentId:n}]}),this.mirror.delete(r));}}}observeInteractions(e){e.addEventListener("input",n=>{let r=n.target;if(!r||!nr.has(r.tagName))return;let i=this.mirror.get(r);i!==void 0&&this.push(3,{input:{id:i,value:$e(r.value??"",r.type,this.options.mask)}});},true),e.addEventListener("scroll",n=>{let r=n.target,i=r?this.mirror.get(r):void 0;this.push(3,{scroll:{id:i??0,x:r?.scrollLeft??0,y:r?.scrollTop??0}});},true);}adapt(e){let n={childNodes:[],nodeType:e.nodeType,ref:e};if(e.nodeType===kt)return n.textValue=e.textContent??"",n;if(e.nodeType===xt){let r=e;if(n.tagName=r.tagName,n.attributes=Array.from(r.attributes).map(i=>({name:i.name,value:i.value})),nr.has(r.tagName)){let i=r;n.inputType=i.type,n.inputValue=i.value??"";}}return n.childNodes=Array.from(e.childNodes).map(r=>this.adapt(r)),n}push(e,n){let r=this.chunker.add({data:n,timestamp:this.options.now(),type:e});r&&this.upload(r);}upload(e){!e||!this.fetchImpl||tr(e,{apiKey:this.options.apiKey,fetch:this.fetchImpl,replayHost:this.options.replayHost}).catch(n=>this.options.onError?.(n));}};function Vi(){return globalThis.document}function rr(t){let e=new De({apiKey:t.apiKey,distinctId:t.distinctId,flushIntervalMs:t.flushIntervalMs??5e3,mask:{...Xn,...t.mask},maxEvents:t.maxEvents??200,now:t.now??(()=>Date.now()),onError:t.onError,replayHost:t.replayHost,sessionId:t.sessionId??Ve()});return e.start(),e}var ir=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],sr=["gclid","gbraid","wbraid","fbclid","msclkid","ttclid","li_fat_id","twclid"];var St=(t,e)=>{let n=new URLSearchParams(t),r={};for(let i of [...ir,...sr]){let s=n.get(i)?.trim();s&&(r[i]=s.slice(0,255));}return e&&(r.$session_referrer=e),r},ji=t=>{let e={};for(let n of [...ir,...sr])t[n]!==void 0&&(e[`$initial_${n}`]=t[n]);return e.$initial_referrer=t.$session_referrer??"$direct",e},Ui=(t,e)=>{let n=t.getItem(e);if(n)try{let r=JSON.parse(n);return typeof r.sessionId=="string"&&typeof r.properties=="object"&&r.properties!==null?{properties:r.properties,sessionId:r.sessionId}:void 0}catch{return}},or=(t,e)=>{let n=`pdx_${e}_session_touch`,r=`pdx_${e}_first_touch`;return {forSession:(i,s,o)=>{if(i===void 0)return {};let a=Ui(t,n);if(a!==void 0&&a.sessionId===i)return a.properties;let c=St(s,o);return t.setItem(n,JSON.stringify({properties:c,sessionId:i})),t.getItem(r)?c:(t.setItem(r,"1"),{...c,$set_once:ji(c)})}}};var qe=t=>`prodantix-cta:${t}`,ar=t=>{try{let e=window.localStorage.getItem(qe(t));return e===null?null:Number(e)}catch{return null}},dr=t=>{try{return window.sessionStorage.getItem(qe(t))!==null}catch{return false}},ur=(t,e)=>{try{window.localStorage.setItem(qe(t),String(e)),window.sessionStorage.setItem(qe(t),String(e));}catch{return}},cr=(t,e,n,r)=>e===null?true:t.kind==="once"?false:t.kind==="session"?!n:r-e>=t.value*864e5;var B={am:{back:"\u1270\u1218\u1208\u1235",close:"\u12DD\u130B",closed:"\u12ED\u1205 \u1245\u133D \u12A0\u1201\u1295 \u121D\u120B\u123E\u127D\u1295 \u12A0\u12ED\u1240\u1260\u120D\u121D\u1362",failed:"\u1218\u120B\u12AD \u12A0\u120D\u1270\u127B\u1208\u121D\u1362 \u12A5\u1295\u12F0\u1308\u1293 \u12ED\u121E\u12AD\u1229\u1362",invalid:"\u12ED\u1205 \u1218\u120D\u1235 \u12A0\u12ED\u1240\u1260\u120D\u121D\u1362",next:"\u1240\u1323\u12ED",poweredBy:"\u1260Prodantix \u12E8\u1270\u1230\u122B",required:"\u12ED\u1205 \u12EB\u1235\u1348\u120D\u130B\u120D\u1362",sending:"\u1260\u1218\u120B\u12AD \u120B\u12ED\u2026",step:"\u12F0\u1228\u1303 {step} \u12A8{total}",submit:"\u120B\u12AD",thanks:"\u12A5\u1293\u1218\u1230\u130D\u1293\u1208\u1295\u1362"},ar:{back:"\u0631\u062C\u0648\u0639",close:"\u0625\u063A\u0644\u0627\u0642",closed:"\u0644\u0627 \u064A\u0642\u0628\u0644 \u0647\u0630\u0627 \u0627\u0644\u0646\u0645\u0648\u0630\u062C \u0631\u062F\u0648\u062F\u064B\u0627 \u0627\u0644\u0622\u0646.",failed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",invalid:"\u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629.",next:"\u0627\u0644\u062A\u0627\u0644\u064A",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Prodantix",required:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628.",sending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",step:"\u0627\u0644\u062E\u0637\u0648\u0629 {step} \u0645\u0646 {total}",submit:"\u0625\u0631\u0633\u0627\u0644",thanks:"\u0634\u0643\u0631\u064B\u0627 \u0644\u0643."},bn:{back:"\u09AA\u09C7\u099B\u09A8\u09C7",close:"\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8",closed:"\u098F\u0987 \u09AB\u09B0\u09CD\u09AE\u099F\u09BF \u098F\u0996\u09A8 \u0989\u09A4\u09CD\u09A4\u09B0 \u09A8\u09BF\u099A\u09CD\u099B\u09C7 \u09A8\u09BE\u0964",failed:"\u09AA\u09BE\u09A0\u09BE\u09A8\u09CB \u09AF\u09BE\u09AF\u09BC\u09A8\u09BF\u0964 \u0986\u09AC\u09BE\u09B0 \u099A\u09C7\u09B7\u09CD\u099F\u09BE \u0995\u09B0\u09C1\u09A8\u0964",invalid:"\u098F\u0987 \u0989\u09A4\u09CD\u09A4\u09B0\u099F\u09BF \u0997\u09CD\u09B0\u09B9\u09A3\u09AF\u09CB\u0997\u09CD\u09AF \u09A8\u09AF\u09BC\u0964",next:"\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0",poweredBy:"Prodantix \u09A6\u09CD\u09AC\u09BE\u09B0\u09BE \u099A\u09BE\u09B2\u09BF\u09A4",required:"\u098F\u099F\u09BF \u0986\u09AC\u09B6\u09CD\u09AF\u0995\u0964",sending:"\u09AA\u09BE\u09A0\u09BE\u09A8\u09CB \u09B9\u099A\u09CD\u099B\u09C7\u2026",step:"\u09A7\u09BE\u09AA {step} / {total}",submit:"\u099C\u09AE\u09BE \u09A6\u09BF\u09A8",thanks:"\u09A7\u09A8\u09CD\u09AF\u09AC\u09BE\u09A6\u0964"},de:{back:"Zur\xFCck",close:"Schlie\xDFen",closed:"Dieses Formular nimmt gerade keine Antworten an.",failed:"Senden fehlgeschlagen. Bitte erneut versuchen.",invalid:"Diese Antwort wird nicht angenommen.",next:"Weiter",poweredBy:"Bereitgestellt von Prodantix",required:"Dieses Feld ist erforderlich.",sending:"Wird gesendet\u2026",step:"Schritt {step} von {total}",submit:"Absenden",thanks:"Vielen Dank."},en:{back:"Back",close:"Close",closed:"This form is not accepting responses right now.",failed:"This could not be sent. Try again.",invalid:"This answer is not accepted.",next:"Next",poweredBy:"Powered by Prodantix",required:"This is required.",sending:"Sending\u2026",step:"Step {step} of {total}",submit:"Submit",thanks:"Thank you."},es:{back:"Atr\xE1s",close:"Cerrar",closed:"Este formulario no acepta respuestas ahora.",failed:"No se pudo enviar. Int\xE9ntalo de nuevo.",invalid:"Esta respuesta no se acepta.",next:"Siguiente",poweredBy:"Con la tecnolog\xEDa de Prodantix",required:"Este campo es obligatorio.",sending:"Enviando\u2026",step:"Paso {step} de {total}",submit:"Enviar",thanks:"Gracias."},et:{back:"Tagasi",close:"Sulge",closed:"See vorm ei v\xF5ta praegu vastuseid vastu.",failed:"Saatmine eba\xF5nnestus. Proovi uuesti.",invalid:"Seda vastust ei v\xF5eta vastu.",next:"Edasi",poweredBy:"Toetab Prodantix",required:"See on kohustuslik.",sending:"Saatmine\u2026",step:"Samm {step}/{total}",submit:"Saada",thanks:"Ait\xE4h."},fil:{back:"Bumalik",close:"Isara",closed:"Hindi tumatanggap ng sagot ang form na ito ngayon.",failed:"Hindi naipadala. Subukan ulit.",invalid:"Hindi tinatanggap ang sagot na ito.",next:"Susunod",poweredBy:"Pinapagana ng Prodantix",required:"Kailangan ito.",sending:"Ipinapadala\u2026",step:"Hakbang {step} sa {total}",submit:"Ipadala",thanks:"Salamat."},fr:{back:"Retour",close:"Fermer",closed:"Ce formulaire n\u2019accepte plus de r\xE9ponses pour le moment.",failed:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez.",invalid:"Cette r\xE9ponse n\u2019est pas accept\xE9e.",next:"Suivant",poweredBy:"Propuls\xE9 par Prodantix",required:"Ce champ est obligatoire.",sending:"Envoi\u2026",step:"\xC9tape {step} sur {total}",submit:"Envoyer",thanks:"Merci."},hi:{back:"\u092A\u0940\u091B\u0947",close:"\u092C\u0902\u0926 \u0915\u0930\u0947\u0902",closed:"\u092F\u0939 \u092B\u093C\u0949\u0930\u094D\u092E \u0905\u092D\u0940 \u091C\u0935\u093E\u092C \u0928\u0939\u0940\u0902 \u0932\u0947 \u0930\u0939\u093E \u0939\u0948\u0964",failed:"\u092D\u0947\u091C\u093E \u0928\u0939\u0940\u0902 \u091C\u093E \u0938\u0915\u093E\u0964 \u092B\u093F\u0930 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0947\u0902\u0964",invalid:"\u092F\u0939 \u091C\u0935\u093E\u092C \u0938\u094D\u0935\u0940\u0915\u093E\u0930 \u0928\u0939\u0940\u0902 \u0939\u0948\u0964",next:"\u0906\u0917\u0947",poweredBy:"Prodantix \u0926\u094D\u0935\u093E\u0930\u093E \u0938\u0902\u091A\u093E\u0932\u093F\u0924",required:"\u092F\u0939 \u091C\u093C\u0930\u0942\u0930\u0940 \u0939\u0948\u0964",sending:"\u092D\u0947\u091C\u093E \u091C\u093E \u0930\u0939\u093E \u0939\u0948\u2026",step:"\u091A\u0930\u0923 {step} / {total}",submit:"\u092D\u0947\u091C\u0947\u0902",thanks:"\u0927\u0928\u094D\u092F\u0935\u093E\u0926\u0964"},id:{back:"Kembali",close:"Tutup",closed:"Formulir ini sedang tidak menerima tanggapan.",failed:"Gagal mengirim. Coba lagi.",invalid:"Jawaban ini tidak diterima.",next:"Berikutnya",poweredBy:"Didukung oleh Prodantix",required:"Wajib diisi.",sending:"Mengirim\u2026",step:"Langkah {step} dari {total}",submit:"Kirim",thanks:"Terima kasih."},ja:{back:"\u623B\u308B",close:"\u9589\u3058\u308B",closed:"\u3053\u306E\u30D5\u30A9\u30FC\u30E0\u306F\u73FE\u5728\u56DE\u7B54\u3092\u53D7\u3051\u4ED8\u3051\u3066\u3044\u307E\u305B\u3093\u3002",failed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",invalid:"\u3053\u306E\u56DE\u7B54\u306F\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3002",next:"\u6B21\u3078",poweredBy:"Powered by Prodantix",required:"\u5FC5\u9808\u9805\u76EE\u3067\u3059\u3002",sending:"\u9001\u4FE1\u4E2D\u2026",step:"\u30B9\u30C6\u30C3\u30D7 {step}/{total}",submit:"\u9001\u4FE1",thanks:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3057\u305F\u3002"},ko:{back:"\uC774\uC804",close:"\uB2EB\uAE30",closed:"\uC774 \uC591\uC2DD\uC740 \uC9C0\uAE08 \uC751\uB2F5\uC744 \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",failed:"\uBCF4\uB0B4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC138\uC694.",invalid:"\uC774 \uB2F5\uBCC0\uC740 \uBC1B\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",next:"\uB2E4\uC74C",poweredBy:"Prodantix \uC81C\uACF5",required:"\uD544\uC218 \uD56D\uBAA9\uC785\uB2C8\uB2E4.",sending:"\uBCF4\uB0B4\uB294 \uC911\u2026",step:"{total}\uB2E8\uACC4 \uC911 {step}\uB2E8\uACC4",submit:"\uC81C\uCD9C",thanks:"\uAC10\uC0AC\uD569\uB2C8\uB2E4."},pt:{back:"Voltar",close:"Fechar",closed:"Este formul\xE1rio n\xE3o est\xE1 a aceitar respostas neste momento.",failed:"N\xE3o foi poss\xEDvel enviar. Tente novamente.",invalid:"Esta resposta n\xE3o \xE9 aceite.",next:"Seguinte",poweredBy:"Com tecnologia Prodantix",required:"Este campo \xE9 obrigat\xF3rio.",sending:"A enviar\u2026",step:"Passo {step} de {total}",submit:"Enviar",thanks:"Obrigado."},ru:{back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",closed:"\u042D\u0442\u0430 \u0444\u043E\u0440\u043C\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043D\u0435 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u043E\u0442\u0432\u0435\u0442\u044B.",failed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.",invalid:"\u042D\u0442\u043E\u0442 \u043E\u0442\u0432\u0435\u0442 \u043D\u0435 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442\u0441\u044F.",next:"\u0414\u0430\u043B\u0435\u0435",poweredBy:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043D\u0430 Prodantix",required:"\u042D\u0442\u043E \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435.",sending:"\u041E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u2026",step:"\u0428\u0430\u0433 {step} \u0438\u0437 {total}",submit:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",thanks:"\u0421\u043F\u0430\u0441\u0438\u0431\u043E."},sw:{back:"Rudi",close:"Funga",closed:"Fomu hii haipokei majibu kwa sasa.",failed:"Imeshindwa kutuma. Jaribu tena.",invalid:"Jibu hili halikubaliki.",next:"Endelea",poweredBy:"Inaendeshwa na Prodantix",required:"Hii inahitajika.",sending:"Inatuma\u2026",step:"Hatua {step} kati ya {total}",submit:"Tuma",thanks:"Asante."},vi:{back:"Quay l\u1EA1i",close:"\u0110\xF3ng",closed:"Bi\u1EC3u m\u1EABu n\xE0y hi\u1EC7n kh\xF4ng nh\u1EADn c\xE2u tr\u1EA3 l\u1EDDi.",failed:"Kh\xF4ng g\u1EEDi \u0111\u01B0\u1EE3c. H\xE3y th\u1EED l\u1EA1i.",invalid:"C\xE2u tr\u1EA3 l\u1EDDi n\xE0y kh\xF4ng \u0111\u01B0\u1EE3c ch\u1EA5p nh\u1EADn.",next:"Ti\u1EBFp",poweredBy:"\u0110\u01B0\u1EE3c h\u1ED7 tr\u1EE3 b\u1EDFi Prodantix",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c.",sending:"\u0110ang g\u1EEDi\u2026",step:"B\u01B0\u1EDBc {step}/{total}",submit:"G\u1EEDi",thanks:"C\u1EA3m \u01A1n b\u1EA1n."},zh:{back:"\u4E0A\u4E00\u6B65",close:"\u5173\u95ED",closed:"\u6B64\u8868\u5355\u76EE\u524D\u4E0D\u63A5\u53D7\u56DE\u590D\u3002",failed:"\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",invalid:"\u6B64\u56DE\u7B54\u65E0\u6548\u3002",next:"\u4E0B\u4E00\u6B65",poweredBy:"\u7531 Prodantix \u63D0\u4F9B\u652F\u6301",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879\u3002",sending:"\u6B63\u5728\u53D1\u9001\u2026",step:"\u7B2C {step} \u6B65\uFF0C\u5171 {total} \u6B65",submit:"\u63D0\u4EA4",thanks:"\u8C22\u8C22\u3002"}},Ke=t=>{let e=(t??"").toLowerCase().split("-")[0]??"";return e in B?e:"en"};var b="prodantix-cta",lr="prodantix-cta-style",Wi=`.${b}{font-family:system-ui,sans-serif;color:var(--pdx-text);background:var(--pdx-background);border-radius:var(--pdx-radius);box-sizing:border-box;padding:16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
|
|
2
2
|
.${b} *{box-sizing:border-box}
|
|
3
3
|
.${b} h2{font-size:18px;line-height:1.3;margin:0;font-weight:700}
|
|
4
4
|
.${b} p{margin:0;font-size:15px;line-height:1.5}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
dialog.${b}{border:0;max-width:min(480px,calc(100vw - 32px));box-shadow:0 16px 48px rgba(0,0,0,.24)}
|
|
20
20
|
dialog.${b}::backdrop{background:rgba(0,0,0,.45)}
|
|
21
21
|
@media (prefers-reduced-motion:no-preference){.${b}[data-kind=slide_in],.${b}[data-kind=banner],dialog.${b}{animation:pdx-cta-in .2s ease-out}}
|
|
22
|
-
@keyframes pdx-cta-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}`,
|
|
22
|
+
@keyframes pdx-cta-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}`,zi=()=>{if(document.getElementById(lr))return;let t=document.createElement("style");t.id=lr,t.textContent=Wi,document.head.append(t);},Ji=(t,e)=>{let n=e.variant.style;for(let[r,i]of [["--pdx-background",n.background],["--pdx-text",n.text],["--pdx-button",n.button],["--pdx-button-text",n.buttonText],["--pdx-radius",`${n.radius}px`]])t.style.setProperty(r,i);},wt=(t,e,n,r)=>{let i=e.variant.content,s=B[n.language];if(t.className=b,t.dataset.kind=e.kind,t.dataset.placement=e.placement,t.dataset.ctaId=e.id,Ji(t,e),i.image){let a=document.createElement("img");a.src=i.image,a.alt=i.imageAlt,a.loading="lazy",t.append(a);}let o=document.createElement("div");if(o.className="pdx-text",i.heading){let a=document.createElement("h2");a.textContent=i.heading,o.append(a);}if(i.body){let a=document.createElement("p");a.textContent=i.body,o.append(a);}if(t.append(o),i.buttons.length>0){let a=document.createElement("div");a.className="pdx-actions",i.buttons.forEach((c,u)=>{let l=document.createElement("button");l.type="button",l.textContent=c.label,l.dataset.action=`button-${u}`,u>0&&(l.dataset.secondary=""),l.addEventListener("click",()=>n.onButton(u)),a.append(l);}),t.append(a);}if(r){let a=document.createElement("button");a.type="button",a.className="pdx-close",a.dataset.action="close",a.textContent="\xD7",a.setAttribute("aria-label",s.close),a.title=s.close,a.addEventListener("click",r),t.append(a);}if(e.poweredBy){let a=document.createElement("p");a.className="pdx-meta",a.textContent=s.poweredBy,t.append(a);}},He=(t,e)=>{zi();let n=t.variant.content.heading||t.variant.content.body;if(t.kind==="embedded"){let o=[...document.querySelectorAll("[data-prodantix-cta]")].filter(a=>a.dataset.prodantixCta===t.id).map(a=>{let c=document.createElement("section");return c.setAttribute("aria-label",n),wt(c,t,e,null),a.replaceChildren(c),c});return {destroy:()=>o.forEach(a=>a.remove()),elements:o}}if(t.kind==="popup"){let s=document.activeElement instanceof HTMLElement?document.activeElement:null,o=document.createElement("dialog");o.setAttribute("aria-label",n);let a=false,c=()=>{a||(a=true,o.open&&o.close(),o.remove(),s?.focus());},u=()=>{c(),e.onDismiss();};return wt(o,t,e,u),o.addEventListener("cancel",l=>{l.preventDefault(),u();}),document.body.append(o),o.showModal(),{destroy:c,elements:[o]}}let r=document.createElement("section");r.setAttribute("aria-label",n),t.kind==="slide_in"&&(r.setAttribute("role","dialog"),r.setAttribute("aria-modal","false"));let i=()=>r.remove();return wt(r,t,e,()=>{i(),e.onDismiss();}),document.body.append(r),{destroy:i,elements:[r]}};var pr=(t,e)=>{let n=false,r=[],i=()=>{n=true;for(let o of r.splice(0))o();},s=()=>{n||(i(),e());};if(t.kind==="load")queueMicrotask(s);else if(t.kind==="delay"){let o=setTimeout(s,t.value*1e3);r.push(()=>clearTimeout(o));}else if(t.kind==="scroll"){let o=()=>{let a=document.documentElement.scrollHeight-window.innerHeight;(a<=0||window.scrollY/a*100>=t.value)&&s();};window.addEventListener("scroll",o,{passive:true}),r.push(()=>window.removeEventListener("scroll",o)),o();}else if(t.kind==="exit"){let o=a=>{a.relatedTarget===null&&a.clientY<=0&&s();};document.addEventListener("mouseout",o),r.push(()=>document.removeEventListener("mouseout",o));}else {let o=t.value,a=u=>{try{return u.closest(o)!==null}catch{return false}},c=u=>{let l=u.target;l instanceof Element&&a(l)&&s();};document.addEventListener("click",c,true),r.push(()=>document.removeEventListener("click",c,true));}return i};var mr=t=>`prodantix-form-popup:${t}`,Yi=t=>{try{let e=window.localStorage.getItem(mr(t));return e===null?null:Number(e)}catch{return null}},Qi=(t,e)=>{try{window.localStorage.setItem(mr(t),String(e));}catch{return}},fr=(t,e,n)=>n===null||e-n>=t.periodDays*864e5,gr=(t,e,n=Date.now)=>{if(!fr(t,n(),Yi(t.formId)))return ()=>{};let r=false,i=[],s=()=>{if(!r){r=true;for(let a of i)a();Qi(t.formId,n()),e();}},o=t.trigger;if(o.kind==="delay"){let a=setTimeout(s,o.seconds*1e3);i.push(()=>clearTimeout(a));}else if(o.kind==="scroll"){let a=()=>{let c=document.documentElement.scrollHeight-window.innerHeight;(c<=0||window.scrollY/c*100>=o.percent)&&s();};window.addEventListener("scroll",a,{passive:true}),i.push(()=>window.removeEventListener("scroll",a));}else {let a=c=>{c.relatedTarget===null&&c.clientY<=0&&s();};document.addEventListener("mouseout",a),i.push(()=>document.removeEventListener("mouseout",a));}return ()=>{r=true;for(let a of i)a();}};var Xi=t=>{let e=0;for(let n of t){if(n!==0)return e+Math.clz32(n)-24;e+=8;}return e},Zi=async t=>new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t))),hr=async t=>{for(let e=0;;e+=1){let n=e.toString(36);if(Xi(await Zi(`${t.nonce}:${n}`))>=t.difficulty)return n}};var I="prodantix-form",es=`.${I}{font-family:var(--pdx-font);color:var(--pdx-text);background:var(--pdx-background);max-width:var(--pdx-width);box-sizing:border-box;padding:16px;border-radius:var(--pdx-radius)}
|
|
23
23
|
.${I} *{box-sizing:border-box}
|
|
24
24
|
.${I} .pdx-field{display:flex;flex-direction:column;gap:4px;margin:0 0 12px}
|
|
25
25
|
.${I} .pdx-field[hidden]{display:none}
|
|
@@ -32,6 +32,6 @@ dialog.${b}::backdrop{background:rgba(0,0,0,.45)}
|
|
|
32
32
|
.${I} button[data-variant=back]{background:transparent;color:inherit;border:1px solid currentColor}
|
|
33
33
|
.${I} .pdx-actions{display:flex;gap:8px;justify-content:flex-end}
|
|
34
34
|
.${I} .pdx-hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
|
|
35
|
-
.${I} :focus-visible{outline:2px solid var(--pdx-button);outline-offset:2px}`,hr=t=>t==null||t===false||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0,yr=(t,e)=>{let n=t.condition;if(!n)return true;let r=e[n.field];return hr(r)?false:n.op==="is_set"?true:n.op==="equals"?typeof r=="string"&&r===n.values[0]:(Array.isArray(r)?r:[r]).some(s=>typeof s=="string"&&n.values.includes(s))},es=t=>{let e=`${encodeURIComponent(t)}=`,n=document.cookie.split("; ").find(r=>r.startsWith(e));return n?decodeURIComponent(n.slice(e.length)):""},ts=t=>{let e=t.hidden;return e?e.source==="fixed"?e.value:e.source==="query"?new URLSearchParams(window.location.search).get(e.value)??"":es(e.value):""},m=(t,e={},n=[])=>{let r=Object.assign(document.createElement(t),e);return r.append(...n),r},ns=(t,e,n)=>{let r=m("p",{className:"pdx-error",id:`${e}-error`}),i=t.help?m("p",{className:"pdx-help",id:`${e}-help`},[t.help]):null,s=[i?`${e}-help`:"",`${e}-error`].filter(Boolean).join(" "),o=m("div",{className:"pdx-field"});if(o.dataset.field=t.key,t.kind==="rich_text")return o.append(m("p",{},[t.label])),{error:r,field:t,focus:()=>{},read:()=>{},root:o};if(t.kind==="hidden")return o.hidden=true,{error:r,field:t,focus:()=>{},read:()=>ts(t),root:o};if(t.kind==="radio"||t.kind==="checkboxes"){let l=m("fieldset",{});l.setAttribute("aria-describedby",s),t.required&&l.setAttribute("aria-required","true"),l.append(m("legend",{},[t.label]));let p=t.options.filter($=>!$.archived).map(($,_)=>{let R=m("input",{id:`${e}-${_}`,name:e,type:t.kind==="radio"?"radio":"checkbox",value:$.value});return R.addEventListener("change",n),l.append(m("div",{className:"pdx-choice"},[R,m("label",{htmlFor:`${e}-${_}`},[$.label])])),R});return o.append(l,...i?[i]:[],r),{error:r,field:t,focus:()=>p[0]?.focus(),read:()=>{let $=p.filter(_=>_.checked).map(_=>_.value);return t.kind==="radio"?$[0]??"":$},root:o}}let a=m("label",{htmlFor:e},[t.label]),u;if(t.kind==="textarea")u=m("textarea",{id:e,placeholder:t.placeholder,rows:4});else if(t.kind==="dropdown")u=m("select",{id:e},[m("option",{value:""},[""]),...t.options.filter(l=>!l.archived).map(l=>m("option",{value:l.value},[l.label]))]);else if(t.kind==="checkbox")u=m("input",{id:e,type:"checkbox"});else {let l={date:"date",email:"email",file:"file",number:"number",phone:"tel"};u=m("input",{id:e,placeholder:t.placeholder,type:l[t.kind]??"text"}),t.kind==="email"&&(u.autocomplete="email");}return u.setAttribute("aria-describedby",s),t.required&&u.setAttribute("aria-required","true"),u.addEventListener("input",n),u.addEventListener("change",n),t.kind==="checkbox"?o.append(m("div",{className:"pdx-choice"},[u,a]),...i?[i]:[],r):o.append(a,...i?[i]:[],u,r),{error:r,field:t,focus:()=>u.focus(),read:()=>u instanceof HTMLInputElement&&u.type==="checkbox"?u.checked:t.kind==="number"?u.value===""?"":Number(u.value):u.value,root:o}},rs=(t,e)=>{let n=e.style,r={"--pdx-background":n.background,"--pdx-button":n.button,"--pdx-button-text":n.buttonText,"--pdx-field-background":n.fieldBackground,"--pdx-field-text":n.fieldText,"--pdx-font":n.font,"--pdx-radius":`${n.radius}px`,"--pdx-text":n.text,"--pdx-width":`${n.width}px`};for(let[i,s]of Object.entries(r))t.style.setProperty(i,s);},is=()=>{document.getElementById("prodantix-form-style")||document.head.append(m("style",{id:"prodantix-form-style",textContent:Zi}));},He=(t,e)=>{let{formId:n,host:r,language:i}=e,s=H[i],o=p=>s[p],a=m("form",{className:I,noValidate:true});a.dataset.prodantixForm=n;let u=m("p",{className:"pdx-meta"});u.setAttribute("aria-live","polite"),u.setAttribute("role","status");let c=false,l=r.form(n).then(p=>{if(c)return;if(!p.accepting){a.replaceChildren(m("p",{className:"pdx-meta"},[o("closed")]));return}is(),rs(a,p);let x=p.challenge?gr(p.challenge):null,$=false,_=[],R=()=>{let h={};for(let k of _.flat())if(!k.root.hidden||k.field.kind==="hidden"){let N=k.read();N!==void 0&&(h[k.field.key]=N);}return h},B=()=>{let h=R();for(let k of _.flat())k.field.kind!=="hidden"&&(k.root.hidden=!yr(k.field,h));},X=()=>{$||($=true,r.capture(rn,{$form_id:p.id,$form_version:p.version})),B();},O=p.steps.map((h,k)=>{let N=m("div",{});N.dataset.step=String(k),h.title&&N.append(m("p",{className:"pdx-meta"},[h.title]));let S=h.fields.map(q=>ns(q,`pdx-${n}-${q.key}`,X));return _.push(S),N.append(...S.map(q=>q.root)),N}),M=m("input",{autocomplete:"off",name:p.honeypot,tabIndex:-1,type:"text"}),P=m("div",{className:"pdx-hp"},[M]);P.setAttribute("aria-hidden","true");let K=[],y=m("div",{});if(p.consent.processing){let h=m("input",{id:`pdx-${n}-consent`,type:"checkbox"});h.setAttribute("aria-required","true"),K.push({input:h,key:"$consent_processing"}),y.append(m("div",{className:"pdx-choice"},[h,m("label",{htmlFor:h.id},[p.consent.processing])]));}for(let h of p.consent.purposes){let k=m("input",{id:`pdx-${n}-consent-${h.key}`,type:"checkbox"});K.push({input:k,key:`$consent_${h.key}`}),y.append(m("div",{className:"pdx-choice"},[k,m("label",{htmlFor:k.id},[h.label])])),h.notice&&y.append(m("p",{className:"pdx-help"},[h.notice]));}let g=m("p",{className:"pdx-meta"}),T=m("button",{type:"button"},[o("back")]);T.dataset.variant="back";let E=m("button",{type:"button"},[o("next")]),A=m("button",{type:"submit"},[o("submit")]);T.dataset.action="back",E.dataset.action="next",A.dataset.action="submit";let Ct=m("div",{className:"pdx-actions"},[T,E,A]),v=0,Ge=()=>{O.forEach((k,N)=>{k.hidden=N!==v;});let h=v===O.length-1;T.hidden=v===0,E.hidden=h,A.hidden=!h,y.hidden=!h,g.hidden=O.length<2,g.textContent=o("step").replace("{step}",String(v+1)).replace("{total}",String(O.length));},Er=()=>{for(let h of _.flat())h.error.textContent="",h.root.querySelector("[aria-invalid]")?.removeAttribute("aria-invalid");},It=(h,k)=>{h.error.textContent=k,h.root.querySelector("input,select,textarea,fieldset")?.setAttribute("aria-invalid","true");},_t=h=>{Er();let k=R(),N=(_[h]??[]).filter(S=>!S.root.hidden&&S.field.required&&hr(k[S.field.key]));for(let S of N)It(S,o("required"));return N.length>0?(u.textContent=o("required"),N[0]?.focus(),false):true};T.addEventListener("click",()=>{v=Math.max(0,v-1),Ge();}),E.addEventListener("click",()=>{_t(v)&&(v+=1,Ge());}),a.addEventListener("submit",h=>{if(h.preventDefault(),!_t(v))return;let k={...R(),[p.honeypot]:M.value};for(let S of K)k[S.key]=S.input.checked;A.disabled=true,A.textContent=o("sending");let N=p.challenge;if(!N||!x){u.textContent=o("closed");return}x.then(S=>r.submit(n,k,N,S)).then(S=>{if(S.kind==="redirect"&&S.value.startsWith("https://")){window.location.assign(S.value);return}let q=m("p",{},[S.kind==="message"&&S.value?S.value:o("thanks")]);q.setAttribute("role","status"),a.replaceChildren(q);}).catch(S=>{A.disabled=false,A.textContent=o("submit");let q=S instanceof te?S.fields:[];for(let Pt of q){let At=_.flat().find(Tr=>Tr.field.key===Pt.field);At&&It(At,Pt.rule==="required"?o("required"):o("invalid"));}u.textContent=q.length>0?o("invalid"):o("failed");});}),a.append(g,...O,P,y,Ct,u),p.poweredBy&&e.poweredBy!==false&&a.append(m("p",{className:"pdx-meta"},[o("poweredBy")])),Ge(),B(),r.capture(nn,{$form_id:p.id,$form_version:p.version});}).catch(()=>{c||a.replaceChildren(m("p",{className:"pdx-meta"},[o("closed")]));});return t.append(a),{destroy:()=>{c=true,a.remove();},ready:l}};var Et=t=>({capture:(e,n)=>t.capture(e,{properties:n}),form:e=>t.getForm(e),submit:(e,n,r,i)=>t.submitForm(e,n,r,i)});var vr=t=>({capture:(e,n,r)=>t.captureCta(e,n,r),ctas:e=>t.getCtas(e),forms:Et(t),isEnabled:e=>t.isFeatureEnabled(e),variant:async e=>(await t.getVariant(e))?.key??null}),br=t=>t<768?"mobile":t<1024?"tablet":"desktop",xr=async(t,e)=>{let n=e.flag;return n?n.variant?await t.variant(n.key)===n.variant:t.isEnabled(n.key):true},ss=(t,e,n)=>{let r=document.createElement("dialog");r.className="prodantix-form-popup";let i=document.createElement("button");i.type="button",i.textContent="\xD7",i.setAttribute("aria-label",H[n].close),i.title=H[n].close,i.addEventListener("click",()=>r.close()),r.addEventListener("close",()=>r.remove()),r.append(i),document.body.append(r),He(r,{formId:t,host:e,language:n}),r.showModal();},os=()=>{let t=window.prodantix;typeof t=="function"&&t("open");},kr=async(t,e)=>{let n=e.now??Date.now,r=e.open??(c=>window.location.assign(c)),i=[],s=[],o=false,a=()=>{o=true;for(let c of i.splice(0))c();for(let c of s.splice(0))c.destroy();},u=await t.ctas({device:br(window.innerWidth),language:document.documentElement.lang||e.language,url:window.location.href});for(let c of u)o||!cr(c.frequency,or(c.id),ar(c.id),n())||!await xr(t,c)||i.push(lr(c.trigger,()=>{if(o)return;let l=Be(c,{language:e.language,onButton:p=>{t.capture(Ht,c,p);let x=c.variant.content.buttons[p]?.action;x&&((x.kind!=="url"||c.kind!=="embedded")&&l.destroy(),x.kind==="url"?r(x.value):x.kind==="form"?ss(x.value,t.forms,e.language):x.kind==="messenger"?os():t.capture(je,c));},onDismiss:()=>t.capture(je,c)});l.elements.length!==0&&(s.push(l),dr(c.id,n()),t.capture(Bt,c));}));return a},as=()=>{},ds=(t,e)=>{let n=vr(t),r=Ke(e??document.documentElement.lang),i=()=>kr(n,{language:r}).catch(l=>(console.error("[prodantix] the CTAs for this page could not be read",l),as)),s=i(),o=window.location.href,a=()=>{if(window.location.href===o)return;o=window.location.href,s=s.then(p=>(p(),i()));},u=history.pushState.bind(history),c=history.replaceState.bind(history);return history.pushState=(...l)=>{u(...l),a();},history.replaceState=(...l)=>{c(...l),a();},window.addEventListener("popstate",a),()=>{history.pushState=u,history.replaceState=c,window.removeEventListener("popstate",a),s.then(l=>l());}};var Q=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async request(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o={authorization:`Bearer ${this.projectKey}`};n.body!==void 0&&(o["content-type"]="application/json");let a=await r(`${this.host}${e}`,{body:n.body,headers:o,method:n.method,signal:i?.signal});return {status:a.status,text:await a.text()}}finally{s!==void 0&&clearTimeout(s);}}async vapidKey(e){let{status:n,text:r}=await this.request(`/v1/push/vapid?appId=${encodeURIComponent(e)}`,{method:"GET"});if(n<200||n>=300)throw new f(`push key request failed with status ${n}`,n);return JSON.parse(r).publicKey}async register(e){let{status:n,text:r}=await this.request("/v1/push/devices",{body:JSON.stringify(e),method:"POST"});if(n<200||n>=300)throw new f(`push registration failed with status ${n}`,n);return JSON.parse(r).id}async opened(e){let{status:n}=await this.request("/v1/push/opens",{body:JSON.stringify({sendId:e}),method:"POST"});if(n<200||n>=300)throw new f(`push open report failed with status ${n}`,n)}};var Sr="/prodantix-push-sw.js",cs=()=>{let t=globalThis,e=t.navigator?.serviceWorker,n=t.Notification;return e===void 0||n===void 0||t.PushManager===void 0?null:{register:async r=>(await e.register(r),e.ready),requestPermission:()=>n.requestPermission()}},us=t=>{let e=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(Math.ceil(t.length/4)*4,"="),n=atob(e);return Uint8Array.from(n,r=>r.charCodeAt(0))},ls=(t,e,n)=>`${t}${t.includes("?")?"&":"?"}host=${encodeURIComponent(e)}&key=${encodeURIComponent(n)}`,ps=async t=>{let e=t.browser??cs();if(e===null)return {status:"unsupported"};if(await e.requestPermission()!=="granted")return {status:"denied"};let r=new Q({fetch:t.fetch,host:t.host,projectKey:t.apiKey}),i=await e.register(ls(t.serviceWorker??Sr,t.host,t.apiKey)),s=await i.pushManager.getSubscription()??await i.pushManager.subscribe({applicationServerKey:us(await r.vapidKey(t.appId)),userVisibleOnly:true});return {deviceId:await r.register({appId:t.appId,distinctId:t.distinctId,permission:"granted",platform:"web",token:JSON.stringify(s.toJSON())}),status:"registered"}};function ms(){return globalThis.navigator}function fs(){return globalThis.document}function gs(){return globalThis.history}function Tt(){return globalThis.location}function wr(){let t=globalThis.document?.referrer;if(t)try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"?`${e.origin}${e.pathname}`:void 0}catch{return}}function hs(t){let e=t?.userAgentData?.platform??t?.platform;return e?e.slice(0,50):void 0}function ys(t){let e=()=>{t.flush();};globalThis.document?.addEventListener?.("visibilitychange",e),globalThis.addEventListener?.("pagehide",e);}function vs(t,e,n){try{return ht({domain:e,name:`pdx_${W(t)}`})??n}catch{return n}}function Kd(t){let{autocaptureOptions:e,cookieDomain:n,guides:r,linkedDomains:i,replayHost:s,sessionReplay:o,sessionReplayOptions:a,surveys:u,...c}=t,l=ms(),p=Lt(),x=c.storage??p,$=c.sharedStorage??vs(c.apiKey,n,p),_=Yn({history:gs(),location:Tt(),namespace:W(c.apiKey),now:(c.clock??oe).now().getTime(),shared:$,storage:x}),R=Ie(c.onError??(()=>{})),B={},X=sr(x,W(c.apiKey)),O=c.defaultProperties,M={...c,defaultProperties:()=>({...typeof O=="function"?O():O??{},...B.client?.isCookieless()?St(Tt()?.search??"",wr()):X.forSession(B.client?.sessionId,Tt()?.search??"",wr())}),describeElement:c.describeElement??(g=>Tn(g,R)),locale:c.locale??(l?.language?l.language.slice(0,20):void 0),os:c.os??hs(l),sessionTracking:c.sessionTracking??true,sharedStorage:$,storage:x,transport:c.transport??new Ae({maxRetries:c.maxRetries,requestTimeoutMs:c.requestTimeoutMs})},P=new Ce(M);B.client=P,_!==void 0&&P.alias(_),ys(P),M.consentMode==="banner"&&typeof window<"u"&&Rn(P,window),(t.autocapture??true)&&Ln(P,{onError:M.onError,...e});let K=fs();K&&i&&yt(K,P,i);let y=typeof window>"u"?void 0:window;if(y&&(u!==false||r!==false)&&Hn(P,y,{edgeHost:(c.flagsHost??c.host).replace(/\/+$/,""),guides:r!==false,namespace:W(c.apiKey),onError:M.onError??(()=>{}),storage:x,surveys:u!==false}),o&&s){let g=()=>{nr({apiKey:M.apiKey,distinctId:()=>P.distinctId,onError:M.onError,replayHost:s,...a,sessionId:a?.sessionId??P.sessionId});};if(P.isCookieless()){let T=P.onStorageAllowed(()=>{T(),g();});}else g();}return P}
|
|
36
|
-
exports.ACTION_ATTRIBUTE=
|
|
35
|
+
.${I} :focus-visible{outline:2px solid var(--pdx-button);outline-offset:2px}`,yr=t=>t==null||t===false||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0,vr=(t,e)=>{let n=t.condition;if(!n)return true;let r=e[n.field];return yr(r)?false:n.op==="is_set"?true:n.op==="equals"?typeof r=="string"&&r===n.values[0]:(Array.isArray(r)?r:[r]).some(s=>typeof s=="string"&&n.values.includes(s))},ts=t=>{let e=`${encodeURIComponent(t)}=`,n=document.cookie.split("; ").find(r=>r.startsWith(e));return n?decodeURIComponent(n.slice(e.length)):""},ns=t=>{let e=t.hidden;return e?e.source==="fixed"?e.value:e.source==="query"?new URLSearchParams(window.location.search).get(e.value)??"":ts(e.value):""},m=(t,e={},n=[])=>{let r=Object.assign(document.createElement(t),e);return r.append(...n),r},rs=(t,e,n)=>{let r=m("p",{className:"pdx-error",id:`${e}-error`}),i=t.help?m("p",{className:"pdx-help",id:`${e}-help`},[t.help]):null,s=[i?`${e}-help`:"",`${e}-error`].filter(Boolean).join(" "),o=m("div",{className:"pdx-field"});if(o.dataset.field=t.key,t.kind==="rich_text")return o.append(m("p",{},[t.label])),{error:r,field:t,focus:()=>{},read:()=>{},root:o};if(t.kind==="hidden")return o.hidden=true,{error:r,field:t,focus:()=>{},read:()=>ns(t),root:o};if(t.kind==="radio"||t.kind==="checkboxes"){let l=m("fieldset",{});l.setAttribute("aria-describedby",s),t.required&&l.setAttribute("aria-required","true"),l.append(m("legend",{},[t.label]));let p=t.options.filter($=>!$.archived).map(($,_)=>{let R=m("input",{id:`${e}-${_}`,name:e,type:t.kind==="radio"?"radio":"checkbox",value:$.value});return R.addEventListener("change",n),l.append(m("div",{className:"pdx-choice"},[R,m("label",{htmlFor:`${e}-${_}`},[$.label])])),R});return o.append(l,...i?[i]:[],r),{error:r,field:t,focus:()=>p[0]?.focus(),read:()=>{let $=p.filter(_=>_.checked).map(_=>_.value);return t.kind==="radio"?$[0]??"":$},root:o}}let a=m("label",{htmlFor:e},[t.label]),c;if(t.kind==="textarea")c=m("textarea",{id:e,placeholder:t.placeholder,rows:4});else if(t.kind==="dropdown")c=m("select",{id:e},[m("option",{value:""},[""]),...t.options.filter(l=>!l.archived).map(l=>m("option",{value:l.value},[l.label]))]);else if(t.kind==="checkbox")c=m("input",{id:e,type:"checkbox"});else {let l={date:"date",email:"email",file:"file",number:"number",phone:"tel"};c=m("input",{id:e,placeholder:t.placeholder,type:l[t.kind]??"text"}),t.kind==="email"&&(c.autocomplete="email");}return c.setAttribute("aria-describedby",s),t.required&&c.setAttribute("aria-required","true"),c.addEventListener("input",n),c.addEventListener("change",n),t.kind==="checkbox"?o.append(m("div",{className:"pdx-choice"},[c,a]),...i?[i]:[],r):o.append(a,...i?[i]:[],c,r),{error:r,field:t,focus:()=>c.focus(),read:()=>c instanceof HTMLInputElement&&c.type==="checkbox"?c.checked:t.kind==="number"?c.value===""?"":Number(c.value):c.value,root:o}},is=(t,e)=>{let n=e.style,r={"--pdx-background":n.background,"--pdx-button":n.button,"--pdx-button-text":n.buttonText,"--pdx-field-background":n.fieldBackground,"--pdx-field-text":n.fieldText,"--pdx-font":n.font,"--pdx-radius":`${n.radius}px`,"--pdx-text":n.text,"--pdx-width":`${n.width}px`};for(let[i,s]of Object.entries(r))t.style.setProperty(i,s);},ss=()=>{document.getElementById("prodantix-form-style")||document.head.append(m("style",{id:"prodantix-form-style",textContent:es}));},Be=(t,e)=>{let{formId:n,host:r,language:i}=e,s=B[i],o=p=>s[p],a=m("form",{className:I,noValidate:true});a.dataset.prodantixForm=n;let c=m("p",{className:"pdx-meta"});c.setAttribute("aria-live","polite"),c.setAttribute("role","status");let u=false,l=r.form(n).then(p=>{if(u)return;if(!p.accepting){a.replaceChildren(m("p",{className:"pdx-meta"},[o("closed")]));return}ss(),is(a,p);let x=p.challenge?hr(p.challenge):null,$=false,_=[],R=()=>{let h={};for(let k of _.flat())if(!k.root.hidden||k.field.kind==="hidden"){let N=k.read();N!==void 0&&(h[k.field.key]=N);}return h},H=()=>{let h=R();for(let k of _.flat())k.field.kind!=="hidden"&&(k.root.hidden=!vr(k.field,h));},X=()=>{$||($=true,r.capture(rn,{$form_id:p.id,$form_version:p.version})),H();},O=p.steps.map((h,k)=>{let N=m("div",{});N.dataset.step=String(k),h.title&&N.append(m("p",{className:"pdx-meta"},[h.title]));let S=h.fields.map(q=>rs(q,`pdx-${n}-${q.key}`,X));return _.push(S),N.append(...S.map(q=>q.root)),N}),M=m("input",{autocomplete:"off",name:p.honeypot,tabIndex:-1,type:"text"}),P=m("div",{className:"pdx-hp"},[M]);P.setAttribute("aria-hidden","true");let K=[],y=m("div",{});if(p.consent.processing){let h=m("input",{id:`pdx-${n}-consent`,type:"checkbox"});h.setAttribute("aria-required","true"),K.push({input:h,key:"$consent_processing"}),y.append(m("div",{className:"pdx-choice"},[h,m("label",{htmlFor:h.id},[p.consent.processing])]));}for(let h of p.consent.purposes){let k=m("input",{id:`pdx-${n}-consent-${h.key}`,type:"checkbox"});K.push({input:k,key:`$consent_${h.key}`}),y.append(m("div",{className:"pdx-choice"},[k,m("label",{htmlFor:k.id},[h.label])])),h.notice&&y.append(m("p",{className:"pdx-help"},[h.notice]));}let g=m("p",{className:"pdx-meta"}),T=m("button",{type:"button"},[o("back")]);T.dataset.variant="back";let E=m("button",{type:"button"},[o("next")]),A=m("button",{type:"submit"},[o("submit")]);T.dataset.action="back",E.dataset.action="next",A.dataset.action="submit";let Ct=m("div",{className:"pdx-actions"},[T,E,A]),v=0,Ge=()=>{O.forEach((k,N)=>{k.hidden=N!==v;});let h=v===O.length-1;T.hidden=v===0,E.hidden=h,A.hidden=!h,y.hidden=!h,g.hidden=O.length<2,g.textContent=o("step").replace("{step}",String(v+1)).replace("{total}",String(O.length));},Tr=()=>{for(let h of _.flat())h.error.textContent="",h.root.querySelector("[aria-invalid]")?.removeAttribute("aria-invalid");},It=(h,k)=>{h.error.textContent=k,h.root.querySelector("input,select,textarea,fieldset")?.setAttribute("aria-invalid","true");},_t=h=>{Tr();let k=R(),N=(_[h]??[]).filter(S=>!S.root.hidden&&S.field.required&&yr(k[S.field.key]));for(let S of N)It(S,o("required"));return N.length>0?(c.textContent=o("required"),N[0]?.focus(),false):true};T.addEventListener("click",()=>{v=Math.max(0,v-1),Ge();}),E.addEventListener("click",()=>{_t(v)&&(v+=1,Ge());}),a.addEventListener("submit",h=>{if(h.preventDefault(),!_t(v))return;let k={...R(),[p.honeypot]:M.value};for(let S of K)k[S.key]=S.input.checked;A.disabled=true,A.textContent=o("sending");let N=p.challenge;if(!N||!x){c.textContent=o("closed");return}x.then(S=>r.submit(n,k,N,S)).then(S=>{if(S.kind==="redirect"&&S.value.startsWith("https://")){window.location.assign(S.value);return}let q=m("p",{},[S.kind==="message"&&S.value?S.value:o("thanks")]);q.setAttribute("role","status"),a.replaceChildren(q);}).catch(S=>{A.disabled=false,A.textContent=o("submit");let q=S instanceof te?S.fields:[];for(let Pt of q){let At=_.flat().find(Cr=>Cr.field.key===Pt.field);At&&It(At,Pt.rule==="required"?o("required"):o("invalid"));}c.textContent=q.length>0?o("invalid"):o("failed");});}),a.append(g,...O,P,y,Ct,c),p.poweredBy&&e.poweredBy!==false&&a.append(m("p",{className:"pdx-meta"},[o("poweredBy")])),Ge(),H(),r.capture(nn,{$form_id:p.id,$form_version:p.version});}).catch(()=>{u||a.replaceChildren(m("p",{className:"pdx-meta"},[o("closed")]));});return t.append(a),{destroy:()=>{u=true,a.remove();},ready:l}};var Et=t=>({capture:(e,n)=>t.capture(e,{properties:n}),form:e=>t.getForm(e),submit:(e,n,r,i)=>t.submitForm(e,n,r,i)});var br=t=>({capture:(e,n,r)=>t.captureCta(e,n,r),ctas:e=>t.getCtas(e),forms:Et(t),isEnabled:e=>t.isFeatureEnabled(e),variant:async e=>(await t.getVariant(e))?.key??null}),xr=t=>t<768?"mobile":t<1024?"tablet":"desktop",kr=async(t,e)=>{let n=e.flag;return n?n.variant?await t.variant(n.key)===n.variant:t.isEnabled(n.key):true},os=(t,e,n)=>{let r=document.createElement("dialog");r.className="prodantix-form-popup";let i=document.createElement("button");i.type="button",i.textContent="\xD7",i.setAttribute("aria-label",B[n].close),i.title=B[n].close,i.addEventListener("click",()=>r.close()),r.addEventListener("close",()=>r.remove()),r.append(i),document.body.append(r),Be(r,{formId:t,host:e,language:n}),r.showModal();},as=()=>{let t=window.prodantix;typeof t=="function"&&t("open");},Sr=async(t,e)=>{let n=e.now??Date.now,r=e.open??(u=>window.location.assign(u)),i=[],s=[],o=false,a=()=>{o=true;for(let u of i.splice(0))u();for(let u of s.splice(0))u.destroy();},c=await t.ctas({device:xr(window.innerWidth),language:document.documentElement.lang||e.language,url:window.location.href});for(let u of c)o||!cr(u.frequency,ar(u.id),dr(u.id),n())||!await kr(t,u)||i.push(pr(u.trigger,()=>{if(o)return;let l=He(u,{language:e.language,onButton:p=>{t.capture(Bt,u,p);let x=u.variant.content.buttons[p]?.action;x&&((x.kind!=="url"||u.kind!=="embedded")&&l.destroy(),x.kind==="url"?r(x.value):x.kind==="form"?os(x.value,t.forms,e.language):x.kind==="messenger"?as():t.capture(je,u));},onDismiss:()=>t.capture(je,u)});l.elements.length!==0&&(s.push(l),ur(u.id,n()),t.capture(Ht,u));}));return a},ds=()=>{},us=(t,e)=>{let n=br(t),r=Ke(e??document.documentElement.lang),i=()=>Sr(n,{language:r}).catch(l=>(console.error("[prodantix] the CTAs for this page could not be read",l),ds)),s=i(),o=window.location.href,a=()=>{if(window.location.href===o)return;o=window.location.href,s=s.then(p=>(p(),i()));},c=history.pushState.bind(history),u=history.replaceState.bind(history);return history.pushState=(...l)=>{c(...l),a();},history.replaceState=(...l)=>{u(...l),a();},window.addEventListener("popstate",a),()=>{history.pushState=c,history.replaceState=u,window.removeEventListener("popstate",a),s.then(l=>l());}};var Q=class{constructor(e){d(this,"fetch");d(this,"host");d(this,"projectKey");d(this,"requestTimeoutMs");this.fetch=F(e.fetch),this.host=C(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=e.requestTimeoutMs??1e4;}async request(e,n){let r=this.fetch;if(!r)throw new f("no fetch implementation available in this runtime");let i=L(),s=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let o={authorization:`Bearer ${this.projectKey}`};n.body!==void 0&&(o["content-type"]="application/json");let a=await r(`${this.host}${e}`,{body:n.body,headers:o,method:n.method,signal:i?.signal});return {status:a.status,text:await a.text()}}finally{s!==void 0&&clearTimeout(s);}}async vapidKey(e){let{status:n,text:r}=await this.request(`/v1/push/vapid?appId=${encodeURIComponent(e)}`,{method:"GET"});if(n<200||n>=300)throw new f(`push key request failed with status ${n}`,n);return JSON.parse(r).publicKey}async register(e){let{status:n,text:r}=await this.request("/v1/push/devices",{body:JSON.stringify(e),method:"POST"});if(n<200||n>=300)throw new f(`push registration failed with status ${n}`,n);return JSON.parse(r).id}async opened(e){let{status:n}=await this.request("/v1/push/opens",{body:JSON.stringify({sendId:e}),method:"POST"});if(n<200||n>=300)throw new f(`push open report failed with status ${n}`,n)}};var wr="/prodantix-push-sw.js",cs=()=>{let t=globalThis,e=t.navigator?.serviceWorker,n=t.Notification;return e===void 0||n===void 0||t.PushManager===void 0?null:{register:async r=>(await e.register(r),e.ready),requestPermission:()=>n.requestPermission()}},ls=t=>{let e=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(Math.ceil(t.length/4)*4,"="),n=atob(e);return Uint8Array.from(n,r=>r.charCodeAt(0))},ps=(t,e,n)=>`${t}${t.includes("?")?"&":"?"}host=${encodeURIComponent(e)}&key=${encodeURIComponent(n)}`,ms=async t=>{let e=t.browser??cs();if(e===null)return {status:"unsupported"};if(await e.requestPermission()!=="granted")return {status:"denied"};let r=new Q({fetch:t.fetch,host:t.host,projectKey:t.apiKey}),i=await e.register(ps(t.serviceWorker??wr,t.host,t.apiKey)),s=await i.pushManager.getSubscription()??await i.pushManager.subscribe({applicationServerKey:ls(await r.vapidKey(t.appId)),userVisibleOnly:true});return {deviceId:await r.register({appId:t.appId,distinctId:t.distinctId,permission:"granted",platform:"web",token:JSON.stringify(s.toJSON())}),status:"registered"}};function fs(){return globalThis.navigator}function gs(){return globalThis.document}function hs(){return globalThis.history}function Tt(){return globalThis.location}function Er(){let t=globalThis.document?.referrer;if(t)try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"?`${e.origin}${e.pathname}`:void 0}catch{return}}function ys(t){let e=t?.userAgentData?.platform??t?.platform;return e?e.slice(0,50):void 0}function vs(t){let e=()=>{t.flush();};globalThis.document?.addEventListener?.("visibilitychange",e),globalThis.addEventListener?.("pagehide",e);}function bs(t,e,n){try{return ht({domain:e,name:`pdx_${W(t)}`})??n}catch{return n}}function Hd(t){let{autocaptureOptions:e,cookieDomain:n,guides:r,linkedDomains:i,replayHost:s,sessionReplay:o,sessionReplayOptions:a,surveys:c,...u}=t,l=fs(),p=Lt(),x=u.storage??p,$=u.sharedStorage??bs(u.apiKey,n,p),_=Qn({history:hs(),location:Tt(),namespace:W(u.apiKey),now:(u.clock??oe).now().getTime(),shared:$,storage:x}),R=Ie(u.onError??(()=>{})),H={},X=or(x,W(u.apiKey)),O=u.defaultProperties,M={...u,defaultProperties:()=>({...typeof O=="function"?O():O??{},...H.client?.isCookieless()?St(Tt()?.search??"",Er()):X.forSession(H.client?.sessionId,Tt()?.search??"",Er())}),describeElement:u.describeElement??(g=>Cn(g,R)),locale:u.locale??(l?.language?l.language.slice(0,20):void 0),os:u.os??ys(l),sessionTracking:u.sessionTracking??true,sharedStorage:$,storage:x,transport:u.transport??new Ae({maxRetries:u.maxRetries,requestTimeoutMs:u.requestTimeoutMs})},P=new Ce(M);H.client=P,_!==void 0&&P.alias(_),vs(P),M.consentMode==="banner"&&typeof window<"u"&&On(P,window),(t.autocapture??true)&&$n(P,{onError:M.onError,...e});let K=gs();K&&i&&yt(K,P,i);let y=typeof window>"u"?void 0:window;if(y&&(c!==false||r!==false)&&Gn(P,y,{edgeHost:(u.flagsHost??u.host).replace(/\/+$/,""),guides:r!==false,namespace:W(u.apiKey),onError:M.onError??(()=>{}),storage:x,surveys:c!==false}),o&&s){let g=()=>{rr({apiKey:M.apiKey,distinctId:()=>P.distinctId,onError:M.onError,replayHost:s,...a,sessionId:a?.sessionId??P.sessionId});};if(P.isCookieless()){let T=P.onStorageAllowed(()=>{T(),g();});}else g();}return P}
|
|
36
|
+
exports.ACTION_ATTRIBUTE=En;exports.ANNOTATION_ATTRIBUTE=wn;exports.ANNOTATION_MAX_LENGTH=Y;exports.DEFAULT_SERVICE_WORKER=wr;exports.IGNORE_ATTRIBUTE=Tn;exports.PushClient=Q;exports.WebTransport=Ae;exports.createCookieStorage=ht;exports.createWebClient=Hd;exports.ctasHost=br;exports.decorateLink=zn;exports.deviceOf=xr;exports.flagAllows=kr;exports.formLanguage=Ke;exports.formsHost=Et;exports.installAutocapture=$n;exports.installLinkCarry=yt;exports.installSessionReplay=rr;exports.readCarry=Jn;exports.registerPush=ms;exports.renderCta=He;exports.renderForm=Be;exports.resolveCookieDomain=qn;exports.runCtas=Sr;exports.startCtas=us;exports.stripCarry=Yn;exports.watchPopup=gr;//# sourceMappingURL=web.cjs.map
|
|
37
37
|
//# sourceMappingURL=web.cjs.map
|
package/dist/web.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as ProdantixClient, N as ServedForm, O as FormChallenge, Q as FormAfterSubmit, R as ServedCta, T as CtaDevice } from './client-
|
|
1
|
+
import { P as ProdantixClient, N as ServedForm, O as FormChallenge, Q as FormAfterSubmit, R as ServedCta, T as CtaDevice } from './client-C8r0UAth.cjs';
|
|
2
2
|
import { T as Transport, i as TransportRequest, a as StorageAdapter, b as Consent, P as ProdantixConfig } from './types-BUXFV_aE.cjs';
|
|
3
|
-
import { a as FetchTransportOptions } from './transport-
|
|
4
|
-
import { F as FetchLike } from './http-
|
|
3
|
+
import { a as FetchTransportOptions } from './transport-BBYpAuVK.cjs';
|
|
4
|
+
import { F as FetchLike } from './http-CAOViYSh.cjs';
|
|
5
5
|
|
|
6
6
|
declare const ANNOTATION_ATTRIBUTE = "data-prodantix";
|
|
7
7
|
declare const ACTION_ATTRIBUTE = "data-prodantix-action";
|
package/dist/web.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as ProdantixClient, N as ServedForm, O as FormChallenge, Q as FormAfterSubmit, R as ServedCta, T as CtaDevice } from './client-
|
|
1
|
+
import { P as ProdantixClient, N as ServedForm, O as FormChallenge, Q as FormAfterSubmit, R as ServedCta, T as CtaDevice } from './client-DnfOdWQo.js';
|
|
2
2
|
import { T as Transport, i as TransportRequest, a as StorageAdapter, b as Consent, P as ProdantixConfig } from './types-BUXFV_aE.js';
|
|
3
|
-
import { a as FetchTransportOptions } from './transport-
|
|
4
|
-
import { F as FetchLike } from './http-
|
|
3
|
+
import { a as FetchTransportOptions } from './transport-BZDcmleq.js';
|
|
4
|
+
import { F as FetchLike } from './http-CAOViYSh.js';
|
|
5
5
|
|
|
6
6
|
declare const ANNOTATION_ATTRIBUTE = "data-prodantix";
|
|
7
7
|
declare const ACTION_ATTRIBUTE = "data-prodantix-action";
|