@prodantix/sdk 0.7.0-beta.438 → 0.7.0-beta.441
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/dist/chat.cjs +5 -107
- package/dist/chat.d.cts +93 -8
- package/dist/chat.d.ts +93 -8
- package/dist/chat.js +5 -107
- package/dist/chunk-L4P6GMBC.js +2 -0
- package/dist/client-Cz7M6XJC.d.ts +477 -0
- package/dist/client-vogZuHfD.d.cts +477 -0
- package/dist/{config-C9Njc6-j.d.ts → config-C6Yz_Tdf.d.ts} +41 -3
- package/dist/{config-CpfUyEw8.d.cts → config-Cs3L7V_P.d.cts} +41 -3
- package/dist/consent.iife.js +20 -0
- package/dist/ctas.iife.js +37 -0
- package/dist/forms.iife.js +16 -0
- package/dist/guides.iife.js +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/messenger-help.iife.js +1 -1
- package/dist/messenger-tickets.iife.js +3 -0
- package/dist/messenger.cjs +1 -1
- package/dist/messenger.d.cts +1 -1
- package/dist/messenger.d.ts +1 -1
- package/dist/messenger.iife.js +5 -107
- package/dist/messenger.js +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +3 -2
- package/dist/node.d.ts +3 -2
- package/dist/node.js +1 -1
- package/dist/pages.iife.js +2 -0
- package/dist/prodantix-push-sw.js +3 -0
- package/dist/surveys.iife.js +2 -0
- package/dist/{transport-DKFvkfX4.d.ts → transport-C4mkCaix.d.ts} +1 -1
- package/dist/{transport-DN9pXyrX.d.cts → transport-C9C4hqlF.d.cts} +1 -1
- package/dist/{types-Q2VNlJbG.d.cts → types-BUXFV_aE.d.cts} +11 -0
- package/dist/{types-Q2VNlJbG.d.ts → types-BUXFV_aE.d.ts} +11 -0
- package/dist/web.cjs +36 -1
- package/dist/web.d.cts +185 -4
- package/dist/web.d.ts +185 -4
- package/dist/web.js +36 -1
- package/package.json +1 -1
- package/dist/chunk-D6PMLUYA.js +0 -2
- package/dist/client-CL6Xvhay.d.cts +0 -135
- package/dist/client-QyKW0LFW.d.ts +0 -135
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){'use strict';var kt=Object.defineProperty;var Et=(n,e,t)=>e in n?kt(n,e,{enumerable:true,configurable:true,writable:true,value:t}):n[e]=t;var c=(n,e,t)=>Et(n,typeof e!="symbol"?e+"":e,t);var b=class extends Error{constructor(t,r,i){super(r,i);c(this,"code");this.code=t,this.name="ProdantixError";}},F=class extends b{constructor(e){super("config",e),this.name="ConfigError";}},w=class extends b{constructor(t,r){super("validation",r);c(this,"field");this.field=t,this.name="ValidationError";}},p=class extends b{constructor(t,r,i){super("transport",t,i);c(this,"status");this.status=r,this.name="TransportError";}};function y(n){if(n)return n;let e=globalThis.fetch;if(typeof e=="function")return e.bind(globalThis)}function h(){let n=globalThis.AbortController;return n?new n:void 0}var Ee=n=>new Promise(e=>{setTimeout(e,n);});function f(n){return n.replace(/\/+$/,"")}var E=class{constructor(){c(this,"store",new Map);}getItem(e){var t;return (t=this.store.get(e))!=null?t:null}removeItem(e){this.store.delete(e);}setItem(e,t){this.store.set(e,t);}},A=class{constructor(e,t=()=>false){this.real=e;this.passes=t;c(this,"held",new E);c(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,t){this.target(e).setItem(e,t);}};function xe(){try{let n=globalThis.localStorage;if(n){let e="__pdx_probe__";return n.setItem(e,"1"),n.removeItem(e),n}}catch(n){return new E}return new E}var Te={now:()=>new Date};function O(n){return n.toISOString()}function we(){if(typeof window=="undefined"||typeof Intl=="undefined")return null;let n=Intl.DateTimeFormat().resolvedOptions().timeZone;return typeof n=="string"&&n!==""?n:null}function xt(){return globalThis.crypto}function Tt(n){n[6]=n[6]&15|64,n[8]=n[8]&63|128;let e=[];for(let t=0;t<16;t+=1)e.push(n[t].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 te(){let n=xt();if(n!=null&&n.randomUUID)return n.randomUUID();let e=new Uint8Array(16);if(n!=null&&n.getRandomValues)n.getRandomValues(e);else for(let t=0;t<16;t+=1)e[t]=Math.floor(Math.random()*256);return Tt(e)}var Ce={uuid:te};var wt=/^pdx_pub_(?:(?:live|test)_)?[a-z0-9]{32}$/;var Ct=/^(?:\$|[a-z])[a-z0-9_.]*$/;function _e(n){let e=0;for(let t of n)e+=1;return e}function Ie(n){return wt.test(n)}function _t(n){return Ct.test(n)}function Fe(n){let e=_e(n);if(e<1||e>200)throw new w("distinct_id","distinct_id must be between 1 and 200 characters")}function Ae(n){let e=_e(n);if(e<1||e>200)throw new w("event_name","event_name must be between 1 and 200 characters");if(!_t(n))throw new w("event_name","event_name must match /^(\\$|[a-z])[a-z0-9_.]*$/")}var $e="prodantix-js",Pe="0.7.0";var It=n=>{};function Me(n){var i,o,s,a,l,u,d,g,v,k,_,I,L,Se,ke;if(!n.apiKey||!Ie(n.apiKey))throw new F("apiKey must be a public project key of the form pdx_pub_<32 lowercase alphanumerics>");if(!n.host)throw new F("host is required (the ingest base URL)");let e=f(n.host),t=n.defaultProperties,r=(i=n.storage)!=null?i:new E;return {apiKey:n.apiKey,autocapture:(o=n.autocapture)!=null?o:false,clock:(s=n.clock)!=null?s:Te,consent:n.consent,consentMode:n.consentMode,defaultProperties:typeof t=="function"?t:()=>t!=null?t:{},describeElement:n.describeElement,flagsHost:n.flagsHost?f(n.flagsHost):e,flushAt:(a=n.flushAt)!=null?a:20,flushIntervalMs:(l=n.flushIntervalMs)!=null?l:1e4,host:e,ids:(u=n.ids)!=null?u:Ce,locale:n.locale,maxQueueSize:(d=n.maxQueueSize)!=null?d:1e3,maxRetries:(g=n.maxRetries)!=null?g:3,namespace:ne(n.apiKey),onError:(v=n.onError)!=null?v:It,os:n.os,requestTimeoutMs:(k=n.requestTimeoutMs)!=null?k:1e4,sdkName:(_=n.sdkName)!=null?_:$e,sdkVersion:(I=n.sdkVersion)!=null?I:Pe,sessionTracking:(L=n.sessionTracking)!=null?L:false,sharedStorage:(Se=n.sharedStorage)!=null?Se:r,socketFactory:n.socketFactory,storage:r,streamFlags:(ke=n.streamFlags)!=null?ke:false,transport:n.transport}}function ne(n){return n.slice(0,16)}var Le=(n,e)=>{let t={$cta_id:n.id,$cta_kind:n.kind,$cta_variant:n.variant.key,$cta_version:n.version},r=e===void 0?void 0:n.variant.content.buttons[e];return r&&e!==void 0&&(t.$cta_button=e,t.$cta_button_label=r.label,r.action.kind==="form"&&(t.$cta_form_id=r.action.value)),t},N=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async ctas(e){let t=this.fetch;if(!t)throw new p("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=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let s=await t(`${this.host}/v1/ctas?${r.toString()}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i==null?void 0:i.signal});if(s.status<200||s.status>=300)throw new p(`ctas request failed with status ${s.status}`,s.status);return JSON.parse(await s.text()).ctas}finally{o!==void 0&&clearTimeout(o);}}};function Oe(n,e,t){var i,o,s;Ae(n.eventName),Fe(n.distinctId);let r={distinct_id:n.distinctId,event_id:(i=n.eventId)!=null?i:t.uuid(),event_name:n.eventName,properties:(o=n.properties)!=null?o:{},schema_version:1,timestamp:O((s=n.timestamp)!=null?s:e.now())};return n.context&&(r.context=n.context),n.sessionId&&(r.session_id=n.sessionId),r}var T=Symbol("absent");function Ft(n,e){var i,o;if(n==="distinct_id")return e.distinctId;let t=(i=e.properties)!=null?i:{};if(Object.prototype.hasOwnProperty.call(t,n))return t[n];let r=(o=e.attributes)!=null?o:{};return Object.prototype.hasOwnProperty.call(r,n)?r[n]:T}function x(n){return n===T?"undefined":String(n)}function Ne(n){return n===T?Number.NaN:Number(n)}function Re(n){return n!==T&&n!==null&&n!==""}function De(n,e){if(!Array.isArray(e))return false;let t=x(n);return e.map(r=>String(r)).includes(t)}function qe(n,e){var i,o;let t=Ft(n.attribute,e),r=n.value;switch(n.op){case "is_set":return Re(t);case "is_not_set":return !Re(t);case "eq":return x(t)===x(r===void 0?T:r);case "neq":return x(t)!==x(r===void 0?T:r);case "contains":return x(t).includes(x(r===void 0?T:r));case "in":return De(t,r);case "not_in":return Array.isArray(r)?!De(t,r):false;case "gt":return R(t,r,(s,a)=>s>a);case "gte":return R(t,r,(s,a)=>s>=a);case "lt":return R(t,r,(s,a)=>s<a);case "lte":return R(t,r,(s,a)=>s<=a);case "in_cohort":return typeof r=="string"&&r!==""&&((i=e.cohorts)!=null?i:[]).includes(r);case "not_in_cohort":return typeof r=="string"&&r!==""&&!((o=e.cohorts)!=null?o:[]).includes(r);default:return false}}function R(n,e,t){let r=Ne(n),i=e===void 0?Number.NaN:Ne(e);return Number.isNaN(r)||Number.isNaN(i)?false:t(r,i)}function Ke(n,e){let t=`${n}:${e}`,r=2166136261;for(let i=0;i<t.length;i++)r^=t.charCodeAt(i),r=Math.imul(r,16777619);return (r>>>0)%100}function re(n,e){return n.targeting.length===0||n.targeting.every(t=>qe(t,e))}function je(n,e){var o;let t=Ke(n.key,e.distinctId),r=(o=n.variations)!=null?o:[];if(r.length===0)return n.rolloutPercentage>=100||t<n.rolloutPercentage?"true":"false";let i=0;for(let s=r.length-1;s>=0;s--)if(i+=r[s].weight,t<i)return r[s].key;return r[0].key}function ie(n,e,t,r){var i;for(let o of (i=n.prerequisites)!=null?i:[]){if(r.includes(o.flagKey))return false;let s=e.find(l=>l.key===o.flagKey);if(!s||!s.enabled)return false;r.push(s.key);let a=ie(s,e,t,r)&&re(s,t)&&je(s,t)===o.variationKey;if(r.pop(),!a)return false}return true}function D(n,e,t){return n.enabled?ie(n,e,t,[n.key])?re(n,t)?n.rolloutPercentage>=100?{enabled:true,reason:"rollout_full"}:Ke(n.key,t.distinctId)<n.rolloutPercentage?{enabled:true,reason:"rollout"}:{enabled:false,reason:"rollout_excluded"}:{enabled:false,reason:"targeting"}:{enabled:false,reason:"prerequisite"}:{enabled:false,reason:"disabled"}}function Ge(n,e){let t={};for(let r of n)t[r.key]=D(r,n,e).enabled;return t}function se(n,e,t){var s,a;let r=(s=n.variations)!=null?s:[],i=r[0];if(!i)return null;if(!n.enabled||!ie(n,e,t,[n.key])||!re(n,t))return i;let o=je(n,t);return (a=r.find(l=>l.key===o))!=null?a:i}function Ve(n){return n.some(e=>e.targeting.some(t=>t.op==="in_cohort"||t.op==="not_in_cohort"))}function Be(n){return `40${JSON.stringify(n)}`}function Ue(){return "3"}function He(n){let e=n.charAt(0),t=n.slice(1);if(e==="2")return {kind:"ping"};if(e==="1")return {kind:"disconnect"};if(e==="0"){let s=oe(t);return {kind:"open",pingInterval:typeof(s==null?void 0:s.pingInterval)=="number"?s.pingInterval:25e3,pingTimeout:typeof(s==null?void 0:s.pingTimeout)=="number"?s.pingTimeout:2e4}}if(e!=="4")return {kind:"other"};let r=t.charAt(0),i=t.slice(1);if(r==="0")return {kind:"connected"};if(r==="1")return {kind:"disconnect"};if(r==="4"){let s=oe(i);return {kind:"connectError",message:typeof(s==null?void 0:s.message)=="string"?s.message:"refused"}}if(r!=="2")return {kind:"other"};let o=oe(i);return !Array.isArray(o)||typeof o[0]!="string"?{kind:"other"}:{kind:"event",name:o[0],payload:o[1]}}function oe(n){try{return JSON.parse(n)}catch(e){return null}}var At="/socket.io/?EIO=4&transport=websocket",$t=250,q=class{constructor(e){this.options=e;c(this,"socket",null);c(this,"heartbeat",null);c(this,"pending",null);c(this,"lastKey","");c(this,"ready",false);c(this,"closed",false);c(this,"heartbeatWindow",45e3);c(this,"factory");c(this,"setTimer");c(this,"clearTimer");var t,r,i;this.factory=(t=e.socketFactory)!=null?t:Pt,this.setTimer=(r=e.setTimer)!=null?r:((o,s)=>setTimeout(o,s)),this.clearTimer=(i=e.clearTimer)!=null?i:(o=>clearTimeout(o));}open(){if(this.socket||this.closed)return;let e=`${this.options.host.replace(/^http/,"ws").replace(/\/+$/,"")}${At}`,t;try{t=this.factory(e);}catch(r){this.options.onClosed(false);return}this.socket=t,t.onmessage=r=>this.receive(String(r.data)),t.onerror=()=>t.close(),t.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==null||e.close();}receive(e){var r,i,o,s;let t=He(e);if(t.kind==="open"){this.armHeartbeat(t.pingInterval+t.pingTimeout),(r=this.socket)==null||r.send(Be({projectKey:this.options.projectKey}));return}if(t.kind==="ping"){this.armHeartbeat(),(i=this.socket)==null||i.send(Ue());return}if(t.kind==="connectError"||t.kind==="disconnect"){this.stopHeartbeat(),(o=this.socket)==null||o.close();return}if(t.kind==="event"){if(t.name==="ready"){this.ready=true;return}if(t.name==="flagChange"){let a=(s=t.payload)==null?void 0:s.key;this.lastKey=typeof a=="string"?a:"",this.pending===null&&(this.pending=this.setTimer(()=>{this.pending=null,this.options.onChange(this.lastKey);},$t));}}}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(()=>{var t;return (t=this.socket)==null?void 0:t.close()},this.heartbeatWindow);}stopHeartbeat(){this.heartbeat!==null&&this.clearTimer(this.heartbeat),this.heartbeat=null;}};function Pt(n){let e=globalThis.WebSocket;if(!e)throw new p("no WebSocket");return new e(n)}var K=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async fetchAll(e){return (await this.fetchDecisions(e)).flags}async fetchDecisions(e){var s,a;let t=this.fetch;if(!t)throw new p("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags?distinct_id=${encodeURIComponent(e)}`,i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let l=await t(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i==null?void 0:i.signal});if(!l.ok)throw new p(`flags request failed with status ${l.status}`,l.status);let u=JSON.parse(await l.text());return {flags:(s=u.flags)!=null?s:{},variants:(a=u.variants)!=null?a:{}}}finally{o!==void 0&&clearTimeout(o);}}async snapshot(){var o;let e=this.fetch;if(!e)throw new p("no fetch implementation available in this runtime");let t=`${this.host}/v1/flags/snapshot`,r=h(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await e(t,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r==null?void 0:r.signal});if(!s.ok)throw new p(`flag snapshot request failed with status ${s.status}`,s.status);let a=JSON.parse(await s.text()),l={flags:(o=a.flags)!=null?o:[],generatedAt:a.generatedAt};return typeof a.socketUrl=="string"&&a.socketUrl!==""&&(l.socketUrl=a.socketUrl),l}finally{i!==void 0&&clearTimeout(i);}}async memberships(e){var s;let t=this.fetch;if(!t)throw new p("no fetch implementation available in this runtime");let r=`${this.host}/v1/flags/memberships?distinct_id=${encodeURIComponent(e)}`,i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let a=await t(r,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i==null?void 0:i.signal});if(!a.ok)throw new p(`memberships request failed with status ${a.status}`,a.status);return (s=JSON.parse(await a.text()).cohorts)!=null?s:[]}finally{o!==void 0&&clearTimeout(o);}}};var ae=class extends Error{constructor(t,r,i){super(i);c(this,"fields");c(this,"status");this.name="FormRefusedError",this.status=t,this.fields=r;}},j=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async request(e,t){let r=this.fetch;if(!r)throw new p("no fetch implementation available in this runtime");let i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let s={authorization:`Bearer ${this.projectKey}`};t.body!==void 0&&(s["content-type"]="application/json");let a=await r(`${this.host}${e}`,{body:t.body,headers:s,method:t.method,signal:i==null?void 0:i.signal});return {status:a.status,text:await a.text()}}finally{o!==void 0&&clearTimeout(o);}}async form(e,t){let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}?distinct_id=${encodeURIComponent(t)}`,{method:"GET"});if(r<200||r>=300)throw new p(`form request failed with status ${r}`,r);return JSON.parse(i)}async submit(e,t){var a,l,u,d;let{status:r,text:i}=await this.request(`/v1/forms/${encodeURIComponent(e)}/submissions`,{body:JSON.stringify(t),method:"POST"});if(r>=200&&r<300)return JSON.parse(i).afterSubmit;let o=[],s=`form submission failed with status ${r}`;try{let g=JSON.parse(i);o=(l=(a=g.error)==null?void 0:a.fields)!=null?l:[],s=(d=(u=g.error)==null?void 0:u.message)!=null?d:s;}catch(g){o=[];}throw new ae(r,o,s)}};var Je="$survey_shown",We="$survey_dismissed",ze="$survey_sent",G=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async surveys(e,t){var s;let r=this.fetch;if(!r)throw new p("no fetch implementation available in this runtime");let i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{let a=await r(`${this.host}/v1/surveys?distinct_id=${encodeURIComponent(e)}${t?`&lang=${encodeURIComponent(t)}`:""}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:i==null?void 0:i.signal});if(!a.ok)throw new p(`surveys request failed with status ${a.status}`,a.status);return (s=JSON.parse(await a.text()).surveys)!=null?s:[]}finally{o!==void 0&&clearTimeout(o);}}};function V(n,e){let t={$survey_id:n.id,$survey_iteration:n.iteration,$survey_name:n.name};for(let[r,i]of Object.entries(e))t[`$survey_response_${r}`]=i;return t}var B=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async guides(e){var o;let t=this.fetch;if(!t)throw new p("no fetch implementation available in this runtime");let r=h(),i=r?setTimeout(()=>r.abort(),this.requestTimeoutMs):void 0;try{let s=await t(`${this.host}/v1/guides?distinct_id=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${this.projectKey}`},method:"GET",signal:r==null?void 0:r.signal});if(!s.ok)throw new p(`guides request failed with status ${s.status}`,s.status);return (o=JSON.parse(await s.text()).guides)!=null?o:[]}finally{i!==void 0&&clearTimeout(i);}}};function Ye(n,e){let t={$guide_id:n.id,$guide_iteration:n.iteration,$guide_name:n.name};return e!==void 0&&(t.$guide_step_id=e),t}function ce(n){if(typeof n!="string")return;let e=Array.from(n).length;return e>=1&&e<=200?n:void 0}function ue(n,e){return `pdx.${n}.${e}`}var de="consent",Mt=["identityLink","analytics","marketing","functional"];function le(n){if(typeof n!="string")return null;try{let e=JSON.parse(n);if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e,r={};for(let i of Mt){let o=t[i];typeof o=="boolean"&&(r[i]=o);}return typeof t.version=="number"&&Number.isInteger(t.version)&&(r.version=t.version),Array.isArray(t.categories)&&t.categories.every(i=>typeof i=="string")&&(r.categories=t.categories),Object.keys(r).length===0?null:r}catch(e){return null}}var Qe=n=>n.endsWith(`.${de}`);function H(n,e){return le(n.getItem(ue(e,de)))}function Lt(n,e,t){var s;let r=ue(e,de),i=le(JSON.stringify(t)),o=i===null?null:le(JSON.stringify({...(s=H(n,e))!=null?s:{},...i}));if(o===null){n.removeItem(r);return}n.setItem(r,JSON.stringify(o));}var U=class{constructor(e,t,r,i){this.storage=e;this.shared=t;this.ids=r;this.namespace=i;c(this,"anonymousId");c(this,"distinctId");c(this,"identified");this.refresh();}refresh(){let e=ce(this.shared.getItem(this.key("anonymous_id"))),t=ce(this.storage.getItem(this.key("anonymous_id")));e?(this.anonymousId=e,t!==e&&this.storage.setItem(this.key("anonymous_id"),e)):t?(this.anonymousId=t,this.shared.setItem(this.key("anonymous_id"),t)):(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=ce(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 H(this.shared,this.namespace)}setConsent(e){Lt(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){var o;let t=!this.identified||this.distinctId!==e,r=this.storage.getItem(this.key("linked_anonymous_id")),i=t||r!==this.anonymousId;return this.distinctId=e,this.identified=true,t&&this.storage.setItem(this.key("distinct_id"),e),!i||((o=this.consent())==null?void 0:o.identityLink)===false?{changed:t}:(this.storage.setItem(this.key("linked_anonymous_id"),this.anonymousId),{anonymousToLink:this.anonymousId,changed:t})}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 ue(this.namespace,e)}};var J=class{constructor(e){c(this,"fetch");c(this,"host");c(this,"projectKey");c(this,"requestTimeoutMs");var t;this.fetch=y(e.fetch),this.host=f(e.host),this.projectKey=e.projectKey,this.requestTimeoutMs=(t=e.requestTimeoutMs)!=null?t:1e4;}async inbox(e){var s;let t=this.requireFetch(),r=`${this.host}/v1/messages?distinct_id=${encodeURIComponent(e)}`,i=await this.request(t,r,{headers:this.authHeaders(),method:"GET"});if(!i.ok)throw new p(`inbox request failed with status ${i.status}`,i.status);return (s=JSON.parse(await i.text()).messages)!=null?s:[]}async markRead(e,t){let r=this.requireFetch(),i=`${this.host}/v1/messages/read`,o=await this.request(r,i,{body:JSON.stringify({distinct_id:t,message_id:e}),headers:{...this.authHeaders(),"content-type":"application/json"},method:"POST"});if(!o.ok)throw new p(`mark-read request failed with status ${o.status}`,o.status)}requireFetch(){if(!this.fetch)throw new p("no fetch implementation available in this runtime");return this.fetch}authHeaders(){return {authorization:`Bearer ${this.projectKey}`}}async request(e,t,r){let i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{return await e(t,{...r,signal:i==null?void 0:i.signal})}finally{o!==void 0&&clearTimeout(o);}}};var W=class{constructor(e,t){this.maxSize=e;this.onOverflow=t;c(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 t=e===void 0?this.events.length:Math.min(e,this.events.length);return this.events.splice(0,t)}snapshot(){return [...this.events]}enforceCap(){var t;if(this.events.length<=this.maxSize)return;let e=this.events.splice(0,this.events.length-this.maxSize);(t=this.onOverflow)==null||t.call(this,{dropped:e});}};var Ot={idleMs:18e5,maxMs:864e5,throttleMs:1e4};function Nt(n){return `pdx.${n}.session`}var z=class{constructor(e,t,r,i,o=Ot){this.storage=e;this.ids=t;this.clock=r;this.namespace=i;this.options=o;}current(){return this.touch().id}startedAt(){return this.touch().startedAt}reset(){this.storage.removeItem(this.key());}touch(){let e=this.clock.now().getTime(),t=this.live(this.read(),e);if(t===void 0)return this.write({id:this.ids.uuid(),lastActivityAt:e,startedAt:e});if(e-t.lastActivityAt<=this.options.throttleMs)return t;let r=this.live(this.read(),e),i=r!==void 0&&r.id!==t.id?r:t;return this.write({...i,lastActivityAt:e})}live(e,t){if(e!==void 0&&!(t-e.lastActivityAt>this.options.idleMs||t-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 t=JSON.parse(e);return typeof t.id=="string"&&typeof t.startedAt=="number"&&typeof t.lastActivityAt=="number"?{id:t.id,lastActivityAt:t.lastActivityAt,startedAt:t.startedAt}:void 0}catch(t){return}}key(){return Nt(this.namespace)}};var m={autocapture:"$autocapture",createAlias:"$create_alias",featureFlagCalled:"$feature_flag_called",group:"$group",identify:"$identify",pageleave:"$pageleave",pageview:"$pageview",set:"$set"};function Xe(n){return n>=400&&n<500&&n!==429}var C=class{constructor(e={}){c(this,"fetch");c(this,"maxRetries");c(this,"requestTimeoutMs");c(this,"baseDelayMs");c(this,"maxDelayMs");c(this,"sleep");c(this,"random");var t,r,i,o,s,a;this.fetch=y(e.fetch),this.maxRetries=(t=e.maxRetries)!=null?t:3,this.requestTimeoutMs=(r=e.requestTimeoutMs)!=null?r:1e4,this.baseDelayMs=(i=e.baseDelayMs)!=null?i:500,this.maxDelayMs=(o=e.maxDelayMs)!=null?o:3e4,this.sleep=(s=e.sleep)!=null?s:Ee,this.random=(a=e.random)!=null?a:Math.random;}async send(e){let t=this.fetch;if(!t)throw new p("no fetch implementation available in this runtime");let r=JSON.stringify(e.body),i;for(let o=0;o<=this.maxRetries;o+=1){try{let s=await this.attempt(t,e,r);if(s.ok)return;if(Xe(s.status))throw new p(`ingest rejected batch with status ${s.status}`,s.status);i=new p(`ingest transient status ${s.status}`,s.status);}catch(s){if(s instanceof p&&s.status!==void 0&&Xe(s.status))throw s;i=s;}o<this.maxRetries&&await this.sleep(this.backoff(o));}throw new p("ingest delivery failed after retries",void 0,{cause:i})}async attempt(e,t,r){let i=h(),o=i?setTimeout(()=>i.abort(),this.requestTimeoutMs):void 0;try{return await e(t.url,{body:r,headers:{authorization:`Bearer ${t.projectKey}`,"content-type":"application/json"},method:"POST",signal:i==null?void 0:i.signal})}finally{o!==void 0&&clearTimeout(o);}}backoff(e){return Math.min(this.maxDelayMs,this.baseDelayMs*2**e)+this.random()*this.baseDelayMs}};var Rt="queue",Dt=1e3,Ze=3e4,pe=n=>{let e={};return n.avatar!==void 0&&(e.$avatar=n.avatar),n.email!==void 0&&(e.$email=n.email),n.name!==void 0&&(e.$name=n.name),n.phone!==void 0&&(e.$phone=n.phone),e},Y=class{constructor(e){c(this,"config");c(this,"identity");c(this,"session");c(this,"queue");c(this,"transport");c(this,"flagsClient");c(this,"messagesClient");c(this,"surveysClient");c(this,"guidesClient");c(this,"captureListeners",new Set);c(this,"formsClient");c(this,"ctasClient");c(this,"context");c(this,"flushTimer");c(this,"flushing",false);c(this,"cachedFlags");c(this,"cachedSnapshot");c(this,"membershipCache");c(this,"stream");c(this,"shutDown",false);c(this,"exposures",new Set);c(this,"gates");c(this,"cookielessId");c(this,"storageListeners",new Set);var s,a,l;let t=Me(e),r=(a=(s=H(t.sharedStorage,t.namespace))!=null?s:t.consent)!=null?a:null;if(this.gates=[new A(t.storage),new A(t.sharedStorage,Qe)],t.consentMode!=="banner"||(r==null?void 0:r.analytics)===true)for(let u of this.gates)u.open();let[i,o]=this.gates;this.config={...t,sharedStorage:o,storage:i},this.identity=new U(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 z(this.config.sharedStorage,this.config.ids,this.config.clock,this.config.namespace):void 0,this.queue=new W(this.config.maxQueueSize,({dropped:u})=>{this.config.onError(new b("queue_overflow",`event queue overflow: dropped ${u.length} oldest event(s)`));}),this.transport=(l=this.config.transport)!=null?l:new C({maxRetries:this.config.maxRetries,requestTimeoutMs:this.config.requestTimeoutMs}),this.flagsClient=new K({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.messagesClient=new J({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.surveysClient=new G({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.guidesClient=new B({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.formsClient=new j({host:this.config.flagsHost,projectKey:this.config.apiKey,requestTimeoutMs:this.config.requestTimeoutMs}),this.ctasClient=new N({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(){var e;return (e=this.session)==null?void 0:e.current()}get sessionStartedAt(){var e;return (e=this.session)==null?void 0:e.startedAt()}capture(e,t={}){var r,i,o,s,a,l,u;try{this.identity.refresh();let d={...this.config.defaultProperties(),...t.element===void 0?{}:(o=(i=(r=this.config).describeElement)==null?void 0:i.call(r,t.element))!=null?o:{},...(s=t.properties)!=null?s:{}},g=Oe({context:this.context,distinctId:(a=t.distinctId)!=null?a:this.identity.getDistinctId(),eventName:e,properties:d,sessionId:(u=t.sessionId)!=null?u:(l=this.session)==null?void 0:l.current(),timestamp:t.timestamp},this.config.clock,this.config.ids);this.enqueue(g);}catch(d){this.config.onError(d);}for(let d of this.captureListeners)try{d(e);}catch(g){this.config.onError(g);}}onCapture(e){return this.captureListeners.add(e),()=>{this.captureListeners.delete(e);}}identify(e,t={}){var a,l;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 o=we(),s={...o===null?{}:{$timezone:o},...pe((a=t.traits)!=null?a:{}),...(l=t.set)!=null?l:{}};Object.keys(s).length>0&&(i.$set=s),this.capture(m.identify,{properties:i});}link(e,t,r){if(this.isCookieless())return;let i={$anon_distinct_id:t},o=pe(r!=null?r:{});Object.keys(o).length>0&&(i.$set=o),this.capture(m.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(m.createAlias,{properties:{alias:e}});}group(e,t,r){let i={$group_key:t,$group_type:e};r&&(i.$set=r),this.capture(m.group,{properties:i});}setPersonProperties(e,t){if(this.isCookieless())return;let r={};e&&(r.$set=e),t&&(r.$set_once=t),this.capture(m.set,{properties:r});}setPersonTraits(e){if(this.isCookieless())return;let t=pe(e);Object.keys(t).length!==0&&this.capture(m.set,{properties:{$set:t}});}async getAllFlags(){var r;let e=this.identity.getDistinctId(),t=await this.flagsClient.fetchDecisions(e);return this.cachedFlags={distinctId:e,flags:t.flags,variants:(r=t.variants)!=null?r:{}},t.flags}async isFeatureEnabled(e){var i,o,s,a;let r=(i=(await this.getAllFlags())[e])!=null?i:false;return this.recordExposure(e,(a=(s=(o=this.cachedFlags)==null?void 0:o.variants[e])==null?void 0:s.key)!=null?a:String(r)),r}async getVariant(e){var i,o,s,a;let t=await this.getAllFlags(),r=(o=(i=this.cachedFlags)==null?void 0:i.variants[e])!=null?o:null;return this.recordExposure(e,(a=r==null?void 0:r.key)!=null?a:String((s=t[e])!=null?s:false)),r}async getVariantLocal(e,t={}){var l;let r=await this.flagSnapshot(),i=r.flags.find(u=>u.key===e),o=await this.localContext(t,r.flags),s=i?se(i,r.flags,o):null,a=i?D(i,r.flags,o).enabled:false;return this.recordExposure(e,(l=s==null?void 0:s.key)!=null?l:String(a)),s?{key:s.key,value:s.value}:null}recordExposure(e,t){let r=`${this.identity.getDistinctId()} ${e} ${t}`;this.exposures.has(r)||(this.exposures.add(r),this.capture(m.featureFlagCalled,{properties:{$feature_flag:e,$feature_flag_response:t}}));}getCachedFlag(e){if(!(!this.cachedFlags||this.cachedFlags.distinctId!==this.distinctId))return this.cachedFlags.flags[e]}async getLocalFlags(e={}){let t=await this.flagSnapshot();return Ge(t.flags,await this.localContext(e,t.flags))}async isFeatureEnabledLocal(e,t={}){var a,l;let r=await this.flagSnapshot(),i=r.flags.find(u=>u.key===e),o=await this.localContext(t,r.flags),s=i?D(i,r.flags,o).enabled:false;return this.recordExposure(e,(l=i?(a=se(i,r.flags,o))==null?void 0:a.key:void 0)!=null?l:String(s)),s}async localContext(e,t){let r=this.identity.getDistinctId(),i=e.cohorts;if(i===void 0&&Ve(t)){let o=this.config.clock.now().getTime();this.membershipCache&&this.membershipCache.distinctId===r&&o-this.membershipCache.fetchedAt<Ze?i=this.membershipCache.cohorts:(i=await this.flagsClient.memberships(r),this.membershipCache={cohorts:i,distinctId:r,fetchedAt:o});}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<Ze)return this.cachedSnapshot.snapshot;let t=await this.flagsClient.snapshot();return this.cachedSnapshot={fetchedAt:e,snapshot:t},this.maybeStream(t),t}maybeStream(e){if(!this.config.streamFlags||this.shutDown||this.stream||!e.socketUrl)return;let t=new q({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=t,t.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!=null?e:this.config.locale)}captureSurveyShown(e){this.capture(Je,{properties:V(e,{})});}captureSurveyDismissed(e){this.capture(We,{properties:V(e,{})});}captureSurveySent(e,t){this.capture(ze,{properties:V(e,t)});}async getGuides(){return this.guidesClient.guides(this.identity.getDistinctId())}captureGuide(e,t,r){this.capture(e,{properties:Ye(t,r)});}async getForm(e){return this.formsClient.form(e,this.identity.getDistinctId())}async submitForm(e,t,r,i){let{$page_id:o,$page_variant:s}=this.config.defaultProperties();return this.formsClient.submit(e,{answers:t,challenge:r,distinctId:this.identity.getDistinctId(),isAnonymous:!this.identity.isIdentified(),pageUrl:typeof window=="undefined"?"":window.location.href,solution:i,...typeof o=="string"&&typeof s=="string"?{pageId:o,pageVariant:s}:{}})}async getCtas(e){return this.ctasClient.ctas({...e,anonymous:!this.identity.isIdentified(),distinctId:this.identity.getDistinctId()})}captureCta(e,t,r){this.capture(e,{properties:Le(t,r)});}async flush(){if(this.flushing||this.queue.size===0)return;this.flushing=true;let e=this.queue.drain(Dt);try{await this.transport.send({body:{events:e,sent_at:O(this.config.clock.now())},projectKey:this.config.apiKey,url:`${this.config.host}/v1/events`}),this.persistQueue();}catch(t){this.queue.requeue(e),this.persistQueue(),this.config.onError(t);}finally{this.flushing=false;}}reset(){var e;(e=this.session)==null||e.reset(),this.identity.reset(),this.cachedFlags=void 0,this.cachedSnapshot=void 0,this.membershipCache=void 0;}async shutdown(){var e;this.shutDown=true,this.stopTimer(),(e=this.stream)==null||e.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 t=JSON.parse(e);Array.isArray(t)&&this.queue.restore(t);}catch(e){this.config.onError(e);}}startTimer(){if(this.config.flushIntervalMs<=0)return;let e=setInterval(()=>{this.flush();},this.config.flushIntervalMs),t=e;typeof t.unref=="function"&&t.unref(),this.flushTimer=e;}stopTimer(){this.flushTimer!==void 0&&(clearInterval(this.flushTimer),this.flushTimer=void 0);}persistKey(){return `pdx.${this.config.namespace}.${Rt}`}};var qt="data-prodantix",Kt="data-prodantix-action",jt="data-prodantix-ignore",$=300,ge="data-pdx-no-capture",me="pdx-no-capture",Gt=new Set(["a","button","input","label","option","select","summary","textarea"]),Vt=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]);function Bt(n){var e;return Gt.has(n.tagName.toLowerCase())||Vt.has(((e=n.getAttribute("role"))!=null?e:"").trim().toLowerCase())}function tt(n){for(let e=n;e!==null;e=e.parentElement)if(Bt(e))return e;return n}function nt(n){for(let e=n;e!==null;e=e.parentElement)if(e.getAttribute(jt)!==null)return true;return false}function rt(n){for(let e=n;e!==null;e=e.parentElement)if(e.getAttribute(ge)!==null||typeof e.className=="string"&&e.className.split(/\s+/).includes(me))return true;return false}function it(n){let e=new Set;return t=>{e.has(t.message)||(e.add(t.message),n(t));}}function et(n,e,t){let r=n.getAttribute(e);if(r===null)return;let i=r.trim();if(i!==""){if(i.length>$){t(new b("validation",`${e} on a <${n.tagName.toLowerCase()}> is ${i.length} characters, over the ${$}-character limit, so it was ignored: "${i.slice(0,40)}\u2026"`));return}return i}}function st(n,e){let t={},r=et(n,qt,e);r!==void 0&&(t.$el_description=r,t.$el_description_source="annotation");let i=et(n,Kt,e);return i!==void 0&&(t.$el_action=i),t}var Ut="$form_submitted",Ht=new Set(["button","file","hidden","image","password","reset","submit"]),ot=/(card|cc-?num|cvc|cvv|iban|security.?code)/i,Jt=n=>{var t;return ((t=n.getAttribute("autocomplete"))!=null?t:"").startsWith("cc-")||ot.test(n.name)||ot.test(n.id)},Wt=n=>{let e=n.name.toLowerCase();return n instanceof HTMLInputElement&&n.type==="email"||e==="email"||n.getAttribute("autocomplete")==="email"?"$email":e==="name"||e==="full_name"||e==="fullname"||n.getAttribute("autocomplete")==="name"?"$name":null},zt=(n,e)=>{var i,o;if(n.closest("[data-prodantix-ignore]")||n.hasAttribute("data-prodantix-form"))return null;let t={},r={};for(let s of Array.from(n.elements)){if(!(s instanceof HTMLInputElement||s instanceof HTMLSelectElement||s instanceof HTMLTextAreaElement)||!s.name||s.closest("[data-prodantix-ignore]")||Jt(s)||s instanceof HTMLInputElement&&(Ht.has(s.type)||(s.type==="checkbox"||s.type==="radio")&&!s.checked))continue;let a=s.value.trim();if(a==="")continue;t[s.name]=a;let l=Wt(s);l&&(r[l]=a);}return {$answers:t,$form_id:n.id||`${e}#${Array.from(n.ownerDocument.forms).indexOf(n)}`,$page_url:(o=(i=n.ownerDocument.location)==null?void 0:i.href)!=null?o:"",$set:r,collected:true}},at=(n,e=document)=>{let t=r=>{var i,o;if(r.target instanceof HTMLFormElement){let s=zt(r.target,(o=(i=e.location)==null?void 0:i.pathname)!=null?o:"");s&&n.capture(Ut,{properties:s});}};return e.addEventListener("submit",t,true),()=>e.removeEventListener("submit",t,true)};var Yt=new Set(["input","select","textarea"]),Qt=new Set(["email","password","tel"]);function X(){return globalThis.location}function ct(){return globalThis.document}function Xt(){let n=globalThis.window;return n!=null?n:globalThis}function Zt(n){return typeof n=="object"&&n!==null&&typeof n.tagName=="string"}function Q(n,e){let t;try{t=new URL(n,e);}catch(r){return}return t.protocol==="http:"||t.protocol==="https:"?`${t.origin}${t.pathname}`:t.protocol}function lt(){let n=X(),e=ct(),t={};if(n){let r=Q(n.href);r&&(t.$current_url=r),t.$pathname=n.pathname,t.$host=n.host;}if(e){e.title&&(t.$title=e.title);let r=e.referrer?Q(e.referrer):void 0;r&&(t.$referrer=r);}return t}function en(n){return typeof n.className=="string"?n.className:""}function tn(n){var e;return Yt.has(n.tagName.toLowerCase())||Qt.has(((e=n.getAttribute("type"))!=null?e:"").toLowerCase())}function nn(n,e,t){var l,u;let r={$el_tag:n.tagName.toLowerCase(),$event_type:"click"};if(e)return r;let i=t?(l=n.textContent)==null?void 0:l.trim():void 0;i&&(r.$el_text=i.slice(0,255)),n.id&&(r.$el_id=n.id);let o=en(n);o&&(r.$el_classes=o);let s=n.getAttribute("href"),a=s?Q(s,(u=X())==null?void 0:u.href):void 0;return a&&(r.$el_href=a),r}function he(n){return (n!=null?n:"").replace(/\s+/g," ").trim()}function P(n,e){return {$el_description:n,$el_description_source:e}}function rn(n,e,t){var s;if(!e&&t){let a=he(n.getAttribute("aria-label"));if(a!==""&&a.length<=$)return P(a,"aria_label");let l=he(n.textContent);if(l!==""&&l.length<=$)return P(l,"text")}let r=e?null:n.getAttribute("href"),i=r?Q(r,(s=X())==null?void 0:s.href):void 0;if(i)return P(i,"href");let o=he(n.getAttribute("role")).toLowerCase();return o===""?P(n.tagName.toLowerCase(),"tag"):P(o,"role")}function sn(n,e){let t=new Set,r=(u,d)=>{if(t.has(u))return false;try{return d()}catch(g){return t.add(u),e(new b("config",`autocapture maskSelectors entry "${u}" is not a valid selector`,{cause:g})),false}},i=(u,d)=>u.matches?r(d,()=>{var g;return ((g=u.matches)==null?void 0:g.call(u,d))===!0}):false,o=u=>{var g;let d=(g=u.querySelector)==null?void 0:g.bind(u);return d?d(`[${ge}], .${me}`)!==null||n.some(v=>r(v,()=>d(v)!==null)):false},s=u=>{for(let d=u;d;d=d.parentElement){let g=d;if(n.some(v=>i(g,v)))return true}return false},a=u=>{for(let d=u;d;d=d.parentElement)if(tn(d))return true;return false},l=u=>rt(u)||s(u);return {holdsMasked:o,isMasked:u=>l(u)||a(u),isOptedOut:l}}function on(n){let e=globalThis.history,t=Xt(),r="",i=()=>{let a=X(),l=a?`${a.pathname}${a.search}`:"";l!==r&&(r=l,n.capture(m.pageview,{properties:lt()}));};if(i(),!e||!t)return ()=>{};let o=e.pushState.bind(e),s=e.replaceState.bind(e);return e.pushState=(...a)=>{o(...a),i();},e.replaceState=(...a)=>{s(...a),i();},t.addEventListener("popstate",i),()=>{e.pushState=o,e.replaceState=s,t.removeEventListener("popstate",i);}}function an(n,e){var l,u,d;let t=ct();if(!t)return ()=>{};let r=(l=e.onError)!=null?l:(()=>{}),i=sn((u=e.maskSelectors)!=null?u:[],r),o=it(r),s=(d=e.captureElementText)!=null?d:false,a=g=>{let v=g.target;if(!Zt(v)||nt(v))return;let k=tt(v),_=i.isMasked(v)||i.holdsMasked(k),I=i.isOptedOut(v)?{}:st(k,o),L=I.$el_description===void 0?rn(k,_,s):{};n.capture(m.autocapture,{properties:{...lt(),...nn(k,_,s),...L,...I}});};return t.addEventListener("click",a,true),()=>t.removeEventListener("click",a,true)}function ut(n,e={}){var r,i;let t=[];return ((r=e.pageviews)==null||r)&&t.push(on(n)),((i=e.clicks)==null||i)&&t.push(an(n,e)),e.collectForms===true&&typeof document!="undefined"&&t.push(at(n)),()=>{for(let o of t)o();}}function cn(){let n=globalThis.document;return (n==null?void 0:n.visibilityState)==="hidden"}function ln(n){let e=globalThis.navigator,t=globalThis.Blob;if(!(e!=null&&e.sendBeacon)||!t)return false;let r=JSON.stringify({...n.body,api_key:n.projectKey});try{let i=new t([r],{type:"application/json"});return e.sendBeacon(n.url,i)}catch(i){return false}}var Z=class{constructor(e={}){c(this,"fetchTransport");this.fetchTransport=new C(e);}async send(e){cn()&&ln(e)||await this.fetchTransport.send(e);}};var fe="prodantix:consent-ready",ye="prodantix:consent",dt="__prodantixConsent";var pt=(n,e)=>{n.takeCookielessId(e.anonymousId),e.consent!==null?n.setConsent(e.consent):e.rule==="notice"&&n.allowStorage();},gt=(n,e)=>{let t=e[dt];t&&pt(n,t);let r=o=>{let s=o.detail;s&&pt(n,s);},i=o=>{let s=o.detail;s&&n.setConsent(s);};return e.addEventListener(fe,r),e.addEventListener(ye,i),()=>{e.removeEventListener(fe,r),e.removeEventListener(ye,i);}};var un=/^\d{1,3}(\.\d{1,3}){3}$/,dn=/^[a-z0-9.-]+$/i;function mt(){return Math.random().toString(36).slice(2,12)}function ee(n,e){let t=`${e}=`,r=[];for(let i of n.cookie.split(";")){let o=i.trim();o.startsWith(t)&&r.push(o.slice(t.length));}return r}function M(n,e,t){let r=["Path=/",`Max-Age=${e}`,"SameSite=Lax"];return n&&r.push(`Domain=${n}`),t&&r.push("Secure"),r.join("; ")}function ht(n,e,t,r){try{let i=`pdx_probe_${r()}`,o=r();n.cookie=`${i}=${o}; ${M(e,60,t)}`;let s=ee(n,i).includes(o);n.cookie=`${i}=; ${M(e,0,t)}`;let a=ee(n,i).includes(o);return s&&!a}catch(i){return false}}function pn(n){let e=n.replace(/^\[|\]$/g,"").toLowerCase();if(e.includes(":")||un.test(e)||!e.includes("."))return [];let t=e.split("."),r=[];for(let i=t.length-2;i>=0;i-=1)r.push(t.slice(i).join("."));return r}function gn(n,e,t,r=mt){for(let i of pn(n))if(ht(e,i,t,r))return i}function mn(n){let e=new Map,t=JSON.parse(decodeURIComponent(n));if(t===null||typeof t!="object"||Array.isArray(t))return e;for(let[r,i]of Object.entries(t))typeof i=="string"&&e.set(r,i);return e}var ve=class{constructor(e,t,r,i){this.jar=e;this.name=t;this.domain=r;this.secure=i;}getItem(e){var t;return (t=this.read().get(e))!=null?t:null}setItem(e,t){let r=this.read();r.set(e,t),this.write(r);}removeItem(e){let t=this.read();t.delete(e)&&this.write(t);}read(){try{let e=ee(this.jar,this.name);e.length>1&&this.domain&&(this.jar.cookie=`${this.name}=; ${M(void 0,0,this.secure)}`,e=ee(this.jar,this.name));let t=e[0];return t?mn(t):new Map}catch(e){return new Map}}write(e){try{if(e.size===0){this.jar.cookie=`${this.name}=; ${M(this.domain,0,this.secure)}`;return}let t=encodeURIComponent(JSON.stringify(Object.fromEntries(e)));this.jar.cookie=`${this.name}=${t}; ${M(this.domain,31536e3,this.secure)}`;}catch(t){return}}};function hn(){return globalThis.document}function fn(){var n,e;return (e=(n=globalThis.location)==null?void 0:n.hostname)!=null?e:""}function yn(){var n;return ((n=globalThis.location)==null?void 0:n.protocol)==="https:"}function vn(n){if(n===void 0)return;let e=n.startsWith(".")?n.slice(1):n;return dn.test(e)?e.toLowerCase():void 0}function ft(n){var s,a,l,u,d;let e="jar"in n?n.jar:hn();if(!e||((s=globalThis.navigator)==null?void 0:s.cookieEnabled)===false)return null;let r=(a=n.random)!=null?a:mt,i=(l=n.secure)!=null?l:yn(),o=(u=n.hostname)!=null?u:fn();try{let g=(d=vn(n.domain))!=null?d:gn(o,e,i,r);return ht(e,g,i,r)?new ve(e,n.name,g,i):null}catch(g){return null}}var yt=(n,e,t,r=Date.now)=>{let i=0,o=e.visibilityState==="visible"?r():void 0,s=()=>{o!==void 0&&(i+=r()-o,o=void 0,n(Math.round(i/1e3)));},a=()=>{e.visibilityState==="visible"?o!=null||(o=r()):s();};return e.addEventListener("visibilitychange",a),t.addEventListener("pagehide",s),()=>{e.removeEventListener("visibilitychange",a),t.removeEventListener("pagehide",s);}};var vt=(n,e)=>({...n.page?{$page_id:n.page}:{},...n.page&&e?{$page_view_id:e}:{},...n.variant?{$page_variant:n.variant}:{}});var bn=(n,e)=>{var t;try{return (t=ft({name:`pdx_${ne(n)}`}))!=null?t:e}catch(r){return e}},S=document.currentScript,be=S==null?void 0:S.dataset.key,bt,St;if(S&&be){let n=new URL(S.src,window.location.href).origin,e=xe(),t=S.dataset.consent==="banner",r=new Y({apiKey:be,...t?{consentMode:"banner"}:{},defaultProperties:vt(S.dataset,te()),flagsHost:(bt=S.dataset.edge)!=null?bt:n,host:(St=S.dataset.host)!=null?St:n,sharedStorage:bn(be,e),storage:e,transport:new Z({})});t&>(r,window),ut(r,{clicks:true,collectForms:false,pageviews:true}),yt(i=>{r.capture(m.pageleave,{properties:{$engaged_seconds:i}}),r.flush();},document,window);}})();//# sourceMappingURL=pages.iife.js.map
|
|
2
|
+
//# sourceMappingURL=pages.iife.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(){'use strict';var w=Object.defineProperty;var k=(e,r,t)=>r in e?w(e,r,{enumerable:true,configurable:true,writable:true,value:t}):e[r]=t;var a=(e,r,t)=>k(e,typeof r!="symbol"?r+"":r,t);var g=class extends Error{constructor(t,i,o){super(i,o);a(this,"code");this.code=t,this.name="ProdantixError";}};var d=class extends g{constructor(t,i,o){super("transport",t,o);a(this,"status");this.status=i,this.name="TransportError";}};function m(e){if(e)return e;let r=globalThis.fetch;if(typeof r=="function")return r.bind(globalThis)}function y(){let e=globalThis.AbortController;return e?new e:void 0}function P(e){return e.replace(/\/+$/,"")}var f=class{constructor(r){a(this,"fetch");a(this,"host");a(this,"projectKey");a(this,"requestTimeoutMs");var t;this.fetch=m(r.fetch),this.host=P(r.host),this.projectKey=r.projectKey,this.requestTimeoutMs=(t=r.requestTimeoutMs)!=null?t:1e4;}async request(r,t){let i=this.fetch;if(!i)throw new d("no fetch implementation available in this runtime");let o=y(),u=o?setTimeout(()=>o.abort(),this.requestTimeoutMs):void 0;try{let l={authorization:`Bearer ${this.projectKey}`};t.body!==void 0&&(l["content-type"]="application/json");let n=await i(`${this.host}${r}`,{body:t.body,headers:l,method:t.method,signal:o==null?void 0:o.signal});return {status:n.status,text:await n.text()}}finally{u!==void 0&&clearTimeout(u);}}async vapidKey(r){let{status:t,text:i}=await this.request(`/v1/push/vapid?appId=${encodeURIComponent(r)}`,{method:"GET"});if(t<200||t>=300)throw new d(`push key request failed with status ${t}`,t);return JSON.parse(i).publicKey}async register(r){let{status:t,text:i}=await this.request("/v1/push/devices",{body:JSON.stringify(r),method:"POST"});if(t<200||t>=300)throw new d(`push registration failed with status ${t}`,t);return JSON.parse(i).id}async opened(r){let{status:t}=await this.request("/v1/push/opens",{body:JSON.stringify({sendId:r}),method:"POST"});if(t<200||t>=300)throw new d(`push open report failed with status ${t}`,t)}};var x=e=>{if(e===null||typeof e!="object")return {};let r=e,t=i=>{let o=r[i];return typeof o=="string"?o:void 0};return {body:t("body"),image:t("image"),send:t("send"),title:t("title"),url:t("url")}},v=e=>e!==void 0&&(e.startsWith("https://")||e.startsWith("/")&&!e.startsWith("//")),b=e=>{var u,l;let r=new URLSearchParams(e.location.search),t=(u=r.get("host"))!=null?u:"",i=(l=r.get("key"))!=null?l:"",o=t===""||i===""?null:new f({host:t,projectKey:i});e.addEventListener("push",n=>{var c,p,h;let s=x((p=(c=n.data)==null?void 0:c.json())!=null?p:null);n.waitUntil(e.registration.showNotification((h=s.title)!=null?h:"",{body:s.body,data:s,image:s.image}));}),e.addEventListener("notificationclick",n=>{var p;n.notification.close();let s=(p=n.notification.data)!=null?p:{},c=[];o!==null&&s.send!==void 0&&c.push(o.opened(s.send).catch(h=>console.error("[prodantix] the push open could not be recorded",h))),v(s.url)&&c.push(e.clients.openWindow(s.url)),n.waitUntil(Promise.all(c));});};b(self);
|
|
2
|
+
})();//# sourceMappingURL=prodantix-push-sw.js.map
|
|
3
|
+
//# sourceMappingURL=prodantix-push-sw.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){'use strict';function re(e,r,p){var a,i;return e>=((a=r.minScore)!=null?a:0)&&e<=((i=r.maxScore)!=null?i:p)}function q(e,r,p){var v,h,l,f;let a=r.kind==="nps"?10:(v=r.scale)!=null?v:5,i=r.branches.find(c=>c.choice!=null?p===c.choice:typeof p=="number"&&re(p,c,a));if(i)return (h=i.next)!=null?h:null;let x=e.questions.findIndex(c=>c.id===r.id);return (f=(l=e.questions[x+1])==null?void 0:l.id)!=null?f:null}var X={am:{close:"\u12DD\u130B",done:"\u1270\u1320\u1293\u124B\u120D",next:"\u1240\u1323\u12ED",open:"\u12AD\u1348\u1275",poweredBy:"\u1260 Prodantix \u12E8\u1240\u1228\u1260",required:"\u12ED\u1205 \u12EB\u1235\u1348\u120D\u130B\u120D\u1362",send:"\u120B\u12AD",step:"{n} \u12A8 {total}",tasks:"\u1270\u130D\u1263\u122B\u1275",thanks:"\u12A5\u1293\u1218\u1230\u130D\u1293\u1208\u1295\u1362"},ar:{close:"\u0625\u063A\u0644\u0627\u0642",done:"\u062A\u0645",next:"\u0627\u0644\u062A\u0627\u0644\u064A",open:"\u0627\u0641\u062A\u062D",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 Prodantix",required:"\u0647\u0630\u0627 \u0645\u0637\u0644\u0648\u0628.",send:"\u0625\u0631\u0633\u0627\u0644",step:"{n} \u0645\u0646 {total}",tasks:"\u0627\u0644\u0645\u0647\u0627\u0645",thanks:"\u0634\u0643\u0631\u064B\u0627 \u0644\u0643."},bn:{close:"\u09AC\u09A8\u09CD\u09A7 \u0995\u09B0\u09C1\u09A8",done:"\u09B8\u09AE\u09CD\u09AA\u09A8\u09CD\u09A8",next:"\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0",open:"\u0996\u09C1\u09B2\u09C1\u09A8",poweredBy:"Prodantix \u09A6\u09CD\u09AC\u09BE\u09B0\u09BE \u099A\u09BE\u09B2\u09BF\u09A4",required:"\u098F\u099F\u09BF \u09AA\u09CD\u09B0\u09AF\u09BC\u09CB\u099C\u09A8\u0964",send:"\u09AA\u09BE\u09A0\u09BE\u09A8",step:"{total}\u099F\u09BF\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 {n}",tasks:"\u0995\u09BE\u099C",thanks:"\u09A7\u09A8\u09CD\u09AF\u09AC\u09BE\u09A6\u0964"},de:{close:"Schlie\xDFen",done:"Fertig",next:"Weiter",open:"\xD6ffnen",poweredBy:"Bereitgestellt von Prodantix",required:"Bitte beantworten.",send:"Senden",step:"{n} von {total}",tasks:"Aufgaben",thanks:"Danke!"},en:{close:"Close",done:"Done",next:"Next",open:"Open",poweredBy:"Powered by Prodantix",required:"This one needs an answer.",send:"Send",step:"{n} of {total}",tasks:"Tasks",thanks:"Thank you."},es:{close:"Cerrar",done:"Listo",next:"Siguiente",open:"Abrir",poweredBy:"Con la tecnolog\xEDa de Prodantix",required:"Esta necesita una respuesta.",send:"Enviar",step:"{n} de {total}",tasks:"Tareas",thanks:"Gracias."},et:{close:"Sulge",done:"Valmis",next:"Edasi",open:"Ava",poweredBy:"Toetab Prodantix",required:"See vajab vastust.",send:"Saada",step:"{n} / {total}",tasks:"\xDClesanded",thanks:"Ait\xE4h."},fil:{close:"Isara",done:"Tapos",next:"Susunod",open:"Buksan",poweredBy:"Pinapagana ng Prodantix",required:"Kailangan itong sagutin.",send:"Ipadala",step:"{n} sa {total}",tasks:"Mga gawain",thanks:"Salamat."},fr:{close:"Fermer",done:"Termin\xE9",next:"Suivant",open:"Ouvrir",poweredBy:"Propuls\xE9 par Prodantix",required:"Cette question demande une r\xE9ponse.",send:"Envoyer",step:"{n} sur {total}",tasks:"T\xE2ches",thanks:"Merci."},hi:{close:"\u092C\u0902\u0926 \u0915\u0930\u0947\u0902",done:"\u092A\u0942\u0930\u093E",next:"\u0905\u0917\u0932\u093E",open:"\u0916\u094B\u0932\u0947\u0902",poweredBy:"Prodantix \u0926\u094D\u0935\u093E\u0930\u093E \u0938\u0902\u091A\u093E\u0932\u093F\u0924",required:"\u0907\u0938\u0915\u093E \u091C\u0935\u093E\u092C \u091A\u093E\u0939\u093F\u090F\u0964",send:"\u092D\u0947\u091C\u0947\u0902",step:"{total} \u092E\u0947\u0902 \u0938\u0947 {n}",tasks:"\u0915\u093E\u092E",thanks:"\u0927\u0928\u094D\u092F\u0935\u093E\u0926\u0964"},id:{close:"Tutup",done:"Selesai",next:"Berikutnya",open:"Buka",poweredBy:"Didukung oleh Prodantix",required:"Pertanyaan ini perlu dijawab.",send:"Kirim",step:"{n} dari {total}",tasks:"Tugas",thanks:"Terima kasih."},ja:{close:"\u9589\u3058\u308B",done:"\u5B8C\u4E86",next:"\u6B21\u3078",open:"\u958B\u304F",poweredBy:"Powered by Prodantix",required:"\u3053\u306E\u8CEA\u554F\u306B\u306F\u56DE\u7B54\u304C\u5FC5\u8981\u3067\u3059\u3002",send:"\u9001\u4FE1",step:"{n} / {total}",tasks:"\u30BF\u30B9\u30AF",thanks:"\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3057\u305F\u3002"},ko:{close:"\uB2EB\uAE30",done:"\uC644\uB8CC",next:"\uB2E4\uC74C",open:"\uC5F4\uAE30",poweredBy:"Prodantix \uC81C\uACF5",required:"\uC774 \uC9C8\uBB38\uC5D0 \uB2F5\uD574 \uC8FC\uC138\uC694.",send:"\uBCF4\uB0B4\uAE30",step:"{n} / {total}",tasks:"\uC791\uC5C5",thanks:"\uAC10\uC0AC\uD569\uB2C8\uB2E4."},pt:{close:"Fechar",done:"Concluir",next:"Avan\xE7ar",open:"Abrir",poweredBy:"Com tecnologia Prodantix",required:"Esta precisa de uma resposta.",send:"Enviar",step:"{n} de {total}",tasks:"Tarefas",thanks:"Obrigado."},ru:{close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",done:"\u0413\u043E\u0442\u043E\u0432\u043E",next:"\u0414\u0430\u043B\u0435\u0435",open:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C",poweredBy:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043D\u0430 Prodantix",required:"\u0417\u0434\u0435\u0441\u044C \u043D\u0443\u0436\u0435\u043D \u043E\u0442\u0432\u0435\u0442.",send:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",step:"{n} \u0438\u0437 {total}",tasks:"\u0417\u0430\u0434\u0430\u0447\u0438",thanks:"\u0421\u043F\u0430\u0441\u0438\u0431\u043E."},sw:{close:"Funga",done:"Imekamilika",next:"Endelea",open:"Fungua",poweredBy:"Inaendeshwa na Prodantix",required:"Hili linahitaji jibu.",send:"Tuma",step:"{n} kati ya {total}",tasks:"Kazi",thanks:"Asante."},vi:{close:"\u0110\xF3ng",done:"Xong",next:"Ti\u1EBFp",open:"M\u1EDF",poweredBy:"Cung c\u1EA5p b\u1EDFi Prodantix",required:"C\xE2u n\xE0y c\u1EA7n \u0111\u01B0\u1EE3c tr\u1EA3 l\u1EDDi.",send:"G\u1EEDi",step:"{n} tr\xEAn {total}",tasks:"Vi\u1EC7c",thanks:"C\u1EA3m \u01A1n b\u1EA1n."},zh:{close:"\u5173\u95ED",done:"\u5B8C\u6210",next:"\u4E0B\u4E00\u6B65",open:"\u6253\u5F00",poweredBy:"\u7531 Prodantix \u63D0\u4F9B\u652F\u6301",required:"\u6B64\u9898\u9700\u8981\u56DE\u7B54\u3002",send:"\u53D1\u9001",step:"{n} / {total}",tasks:"\u4EFB\u52A1",thanks:"\u8C22\u8C22\u3002"}};var J=[':host{all:initial;--pdx-accent:#4f46e5;--pdx-ink:#1d1d1f;--pdx-ink-2:#5f6368;--pdx-paper:#fff;--pdx-line:#e3e3e8;font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--pdx-ink)}',"@media (prefers-color-scheme:dark){:host{--pdx-ink:#f2f2f7;--pdx-ink-2:#a1a1aa;--pdx-paper:#1c1c1f;--pdx-line:#3a3a40}}",".card{position:fixed;z-index:2147483000;bottom:20px;box-sizing:border-box;width:min(340px,calc(100vw - 32px));padding:16px;background:var(--pdx-paper);border:1px solid var(--pdx-line);border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.18)}",'.card[data-placement="bottom_right"]{right:20px}.card[data-placement="bottom_left"]{left:20px}.card[data-placement="bottom_center"]{left:50%;transform:translateX(-50%)}',".close{position:absolute;top:6px;right:6px;display:grid;place-items:center;width:44px;height:44px;padding:0;font:inherit;font-size:20px;color:var(--pdx-ink-2);cursor:pointer;background:none;border:0;border-radius:8px}",".close:focus-visible,.point:focus-visible,.primary:focus-visible,.choice input:focus-visible,.text:focus-visible,.beacon:focus-visible,.pill:focus-visible{outline:2px solid var(--pdx-accent);outline-offset:2px}",".prompt{margin:0 40px 8px 0;font-size:15px;font-weight:600}.description{margin:0 0 10px;color:var(--pdx-ink-2)}",".scale{display:flex;flex-wrap:wrap;gap:4px}.point{flex:1;min-width:28px;min-height:44px;padding:0;font:inherit;color:var(--pdx-ink);cursor:pointer;background:none;border:1px solid var(--pdx-line);border-radius:8px}",'.point[aria-pressed="true"]{color:#fff;background:var(--pdx-accent);border-color:var(--pdx-accent)}',".ends{display:flex;justify-content:space-between;margin-top:4px;font-size:12px;color:var(--pdx-ink-2)}",".choices{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0}.hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}",".choice{display:flex;gap:8px;align-items:center;min-height:44px;padding:0 10px;cursor:pointer;border:1px solid var(--pdx-line);border-radius:8px}.choice input{accent-color:var(--pdx-accent)}",".text{box-sizing:border-box;width:100%;padding:8px;font:inherit;color:var(--pdx-ink);background:var(--pdx-paper);border:1px solid var(--pdx-line);border-radius:8px;resize:vertical}",".problem{margin:6px 0 0;font-size:12.5px;color:#c5221f}.problem:empty{display:none}",".foot{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:12px}.step{font-size:12px;color:var(--pdx-ink-2)}",".primary{display:inline-grid;place-items:center;min-height:44px;padding:0 16px;font:inherit;font-weight:600;color:#fff;text-decoration:none;cursor:pointer;background:var(--pdx-accent);border:0;border-radius:8px}",".secondary{min-height:44px;padding:0 12px;font:inherit;color:var(--pdx-ink-2);cursor:pointer;background:none;border:0;border-radius:8px}",".powered{margin:10px 0 0;font-size:11px;color:var(--pdx-ink-2);text-align:center}.thanks{margin:8px 40px 4px 0;font-weight:600}",".tour{position:absolute;z-index:2147483000;box-sizing:border-box;width:min(300px,calc(100vw - 32px));padding:16px;background:var(--pdx-paper);border:1px solid var(--pdx-line);border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.18)}",".tour[data-centred]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}",".tour img{display:block;width:100%;height:auto;margin-bottom:10px;border-radius:8px}.title{margin:0 40px 6px 0;font-size:15px;font-weight:600}.body{margin:0;color:var(--pdx-ink-2)}",".arrow{position:absolute;width:12px;height:12px;background:var(--pdx-paper);border:1px solid var(--pdx-line);transform:rotate(45deg)}",'.tour[data-side="bottom"] .arrow{top:-7px;border-right:0;border-bottom:0}.tour[data-side="top"] .arrow{bottom:-7px;border-top:0;border-left:0}',".beacon{position:absolute;z-index:2147483000;width:44px;height:44px;padding:0;cursor:pointer;background:none;border:0;transform:translate(-50%,-50%)}",'.beacon::before,.beacon::after{position:absolute;top:50%;left:50%;width:14px;height:14px;content:"";border-radius:50%;transform:translate(-50%,-50%)}',".beacon::before{background:var(--pdx-accent)}.beacon::after{border:2px solid var(--pdx-accent);animation:pdx-pulse 1.6s ease-out infinite}","@keyframes pdx-pulse{from{opacity:.8;transform:translate(-50%,-50%) scale(1)}to{opacity:0;transform:translate(-50%,-50%) scale(2.6)}}","@media (prefers-reduced-motion:reduce){.beacon::after{animation:none}}",'.launcher{position:fixed;z-index:2147483000;bottom:20px;display:flex;flex-direction:column;gap:10px}.launcher[data-side="bottom_right"]{right:20px;align-items:flex-end}.launcher[data-side="bottom_left"]{left:20px;align-items:flex-start}',".pill{display:inline-flex;gap:8px;align-items:center;min-height:44px;padding:0 16px 0 8px;font:inherit;font-weight:600;color:#fff;cursor:pointer;background:var(--pdx-accent);border:0;border-radius:999px;box-shadow:0 8px 20px rgba(0,0,0,.18)}",".ring{width:28px;height:28px;transform:rotate(-90deg)}.ring circle{fill:none;stroke-width:3}.ring .track{stroke:rgba(255,255,255,.35)}.ring .done{stroke:#fff}",".list{box-sizing:border-box;width:min(320px,calc(100vw - 32px));padding:14px;background:var(--pdx-paper);border:1px solid var(--pdx-line);border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.18)}",".list h2{margin:0 0 8px;font-size:15px}.list ol{display:flex;flex-direction:column;gap:4px;margin:0;padding:0;list-style:none}",".task{display:flex;gap:10px;align-items:center;min-height:44px}.task a{color:var(--pdx-ink)}.mark{flex:none;width:18px;height:18px;box-sizing:border-box;border:2px solid var(--pdx-line);border-radius:50%}",".task[data-done] .mark{background:var(--pdx-accent);border-color:var(--pdx-accent)}.task[data-done] span,.task[data-done] a{color:var(--pdx-ink-2);text-decoration:line-through}"].join("");var oe=/^#[0-9a-fA-F]{6}$/,Z={3:["\u{1F641}","\u{1F610}","\u{1F642}"],5:["\u{1F61E}","\u{1F641}","\u{1F610}","\u{1F642}","\u{1F604}"]},ie=3e3,ae=e=>{var a;let r=e.kind==="nps"?0:1,p=e.kind==="nps"?10:(a=e.scale)!=null?a:5;return Array.from({length:p-r+1},(i,x)=>r+x)},se=e=>e!==void 0&&e!==""&&!(Array.isArray(e)&&e.length===0),de=e=>e.questions.length;function o(e,r,p,a){let i=e.createElement(r);return p&&(i.className=p),a!==void 0&&(i.textContent=a),i}function ee(e,r,p,a){let i=X[p],x=o(e,"div");x.dataset.prodantixSurvey=r.id;let v=x.attachShadow({mode:"closed"}),h=o(e,"style");h.textContent=J;let l=o(e,"section","card");l.dataset.placement=r.appearance.placement,l.setAttribute("role","dialog"),l.setAttribute("aria-label",r.name);let f=r.appearance.accent;f&&oe.test(f)&&x.style.setProperty("--pdx-accent",f),v.append(h,l);let c={},_=r.questions[0],P=1,B=false,z=false,L=()=>{z||(z=true,e.removeEventListener("keydown",M),x.remove());},C=()=>{B||a.onDismissed(),L();},M=t=>{t.key==="Escape"&&C();},te=()=>{var t;B=true,a.onSent(c),l.replaceChildren(j(),o(e,"p","thanks",(t=r.appearance.thankYou)!=null?t:i.thanks)),setTimeout(L,ie);},j=()=>{let t=o(e,"button","close","\xD7");return t.type="button",t.setAttribute("aria-label",i.close),t.title=i.close,t.addEventListener("click",C),t},$=()=>{var I,G,D,N,O,H,F,Q,U,Y,V;let t=_;if(!t){te();return}let y=o(e,"h2","prompt",t.prompt);y.id=`pdx-q-${t.id}`;let g=[j(),y];t.description&&g.push(o(e,"p","description",t.description));let w=o(e,"p","problem");w.setAttribute("role","alert");let T=()=>c[t.id],b=n=>{n===void 0?delete c[t.id]:c[t.id]=n,w.textContent="";};if(t.kind==="nps"||t.kind==="rating"||t.kind==="emoji"){let n=o(e,"div","scale");n.setAttribute("role","group"),n.setAttribute("aria-labelledby",y.id);let u=(D=(G=Z[(I=t.scale)!=null?I:5])!=null?G:Z[5])!=null?D:[],E=ae(t).map((s,A)=>{var m;let d=o(e,"button","point",t.kind==="emoji"&&(m=u[A])!=null?m:String(s));return d.type="button",d.setAttribute("aria-pressed","false"),t.kind==="emoji"&&d.setAttribute("aria-label",String(s)),d.addEventListener("click",()=>{b(s);for(let k of E)k.setAttribute("aria-pressed",String(k===d));}),d});if(n.append(...E),g.push(n),t.lowLabel||t.highLabel){let s=o(e,"div","ends");s.append(o(e,"span",void 0,(N=t.lowLabel)!=null?N:""),o(e,"span",void 0,(O=t.highLabel)!=null?O:"")),g.push(s);}}else if(t.kind==="single"||t.kind==="multiple"){let n=o(e,"fieldset","choices");n.append(o(e,"legend","hidden",t.prompt));let u=t.kind==="multiple";for(let[E,s]of t.choices.entries()){let A=o(e,"label","choice"),d=o(e,"input");d.type=u?"checkbox":"radio",d.name=`pdx-${t.id}`,d.value=s,d.addEventListener("change",()=>{if(!u){b(s);return}let m=T(),k=Array.isArray(m)?m:[],W=d.checked?[...k,s]:k.filter(ne=>ne!==s);b(W.length===0?void 0:W);}),A.append(d,o(e,"span",void 0,(Q=(F=(H=r.choiceLabels)==null?void 0:H[t.id])==null?void 0:F[E])!=null?Q:s)),n.append(A);}g.push(n);}else if(t.kind==="open"){let n=o(e,"textarea","text");n.rows=3,n.setAttribute("aria-labelledby",y.id),n.addEventListener("input",()=>b(n.value.trim()===""?void 0:n.value)),g.push(n);}let S=o(e,"div","foot"),R=de(r);S.append(o(e,"span","step",R>1?i.step.replace("{n}",String(P)).replace("{total}",String(R)):""));let K=()=>{if(!t.optional&&!se(T())&&t.kind!=="link"){w.textContent=i.required;return}let n=q(r,t,T());_=n===null?void 0:r.questions.find(u=>u.id===n),P+=1,$();};if(t.kind==="link"&&t.link){let n=o(e,"a","primary",i.open);n.href=t.link,n.target="_blank",n.rel="noopener noreferrer",n.addEventListener("click",()=>{b("opened"),K();}),S.append(n);}else {let n=q(r,t,void 0)===null&&((U=r.questions.at(-1))==null?void 0:U.id)===t.id,u=o(e,"button","primary",n?(Y=r.appearance.submitLabel)!=null?Y:i.send:i.next);u.type="button",u.addEventListener("click",K),S.append(u);}g.push(w,S,o(e,"p","powered",i.poweredBy)),l.replaceChildren(...g),(V=l.querySelector("button.point, input, textarea, .primary"))==null||V.focus();};return $(),e.addEventListener("keydown",M),e.body.append(x),a.onShown(),L}window.prodantixSurveys={showSurvey:ee};})();//# sourceMappingURL=surveys.iife.js.map
|
|
2
|
+
//# sourceMappingURL=surveys.iife.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { F as FetchLike } from './http-BCh716Vs.js';
|
|
2
|
-
import { T as Transport, i as TransportRequest } from './types-
|
|
2
|
+
import { T as Transport, i as TransportRequest } from './types-BUXFV_aE.js';
|
|
3
3
|
|
|
4
4
|
interface FetchTransportOptions {
|
|
5
5
|
baseDelayMs?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { F as FetchLike } from './http-BCh716Vs.cjs';
|
|
2
|
-
import { T as Transport, i as TransportRequest } from './types-
|
|
2
|
+
import { T as Transport, i as TransportRequest } from './types-BUXFV_aE.cjs';
|
|
3
3
|
|
|
4
4
|
interface FetchTransportOptions {
|
|
5
5
|
baseDelayMs?: number;
|
|
@@ -52,6 +52,13 @@ interface Clock {
|
|
|
52
52
|
*/
|
|
53
53
|
interface Consent {
|
|
54
54
|
identityLink?: boolean;
|
|
55
|
+
/** The banner's categories; necessary is always on and never asked. */
|
|
56
|
+
analytics?: boolean;
|
|
57
|
+
marketing?: boolean;
|
|
58
|
+
functional?: boolean;
|
|
59
|
+
/** The banner version answered, and the categories it asked then. */
|
|
60
|
+
version?: number;
|
|
61
|
+
categories?: string[];
|
|
55
62
|
}
|
|
56
63
|
interface IdFactory {
|
|
57
64
|
uuid(): string;
|
|
@@ -90,6 +97,10 @@ interface ProdantixConfig {
|
|
|
90
97
|
/** The visitor's answer, for an app that already holds it. Written to the
|
|
91
98
|
* shared store when the client is built, so the answer survives the page. */
|
|
92
99
|
consent?: Consent;
|
|
100
|
+
/** `banner`: the project's consent banner decides. Until its answer grants
|
|
101
|
+
* analytics, nothing is kept on the device and events carry the edge's
|
|
102
|
+
* daily id; identify, person properties and replay wait. */
|
|
103
|
+
consentMode?: 'banner';
|
|
93
104
|
defaultProperties?: EventProperties | (() => EventProperties);
|
|
94
105
|
describeElement?: (element: unknown) => EventProperties;
|
|
95
106
|
flagsHost?: string;
|
|
@@ -52,6 +52,13 @@ interface Clock {
|
|
|
52
52
|
*/
|
|
53
53
|
interface Consent {
|
|
54
54
|
identityLink?: boolean;
|
|
55
|
+
/** The banner's categories; necessary is always on and never asked. */
|
|
56
|
+
analytics?: boolean;
|
|
57
|
+
marketing?: boolean;
|
|
58
|
+
functional?: boolean;
|
|
59
|
+
/** The banner version answered, and the categories it asked then. */
|
|
60
|
+
version?: number;
|
|
61
|
+
categories?: string[];
|
|
55
62
|
}
|
|
56
63
|
interface IdFactory {
|
|
57
64
|
uuid(): string;
|
|
@@ -90,6 +97,10 @@ interface ProdantixConfig {
|
|
|
90
97
|
/** The visitor's answer, for an app that already holds it. Written to the
|
|
91
98
|
* shared store when the client is built, so the answer survives the page. */
|
|
92
99
|
consent?: Consent;
|
|
100
|
+
/** `banner`: the project's consent banner decides. Until its answer grants
|
|
101
|
+
* analytics, nothing is kept on the device and events carry the edge's
|
|
102
|
+
* daily id; identify, person properties and replay wait. */
|
|
103
|
+
consentMode?: 'banner';
|
|
93
104
|
defaultProperties?: EventProperties | (() => EventProperties);
|
|
94
105
|
describeElement?: (element: unknown) => EventProperties;
|
|
95
106
|
flagsHost?: string;
|