posthog-js
Advanced tools
@@ -1,2 +0,2 @@ | ||
| !function(){"use strict";var e={LIB_VERSION:"1.397.0",LIB_NAME:"web"};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},r.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var t=Object.prototype,i=t.hasOwnProperty,o=t.toString,a=Array.isArray||function(e){return"[object Array]"===o.call(e)},l=e=>e===Object(e)&&!a(e),u=e=>{if(l(e)){for(var r in e)if(i.call(e,r))return!1;return!0}return!1},s=e=>void 0===e,c=e=>s(e)||(e=>null===e)(e),d=e=>"[object Number]"==o.call(e)&&e==e,f=e=>e instanceof FormData;function v(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),d(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):r>e?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),v(n,r,n,t))}class h{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=v(e.bucketSize,0,100,e.Ae),this.$e=v(e.refillRate,0,this.Fe,e.Ae),this.De=v(e.refillInterval,0,864e5,e.Ae)}Ne(e,r){var n=Math.floor((r-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess=e.lastAccess+n*this.De)}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.Ee[t];return i?this.Ne(i,n):this.Ee[t]=i={tokens:this.Fe,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.Pe)||r.call(this,e)),0===i.tokens)}stop(){this.Ee={}}}var p="Mobile",g="iOS",w="Android",m="Tablet",_=w+" "+m,x="iPad",b="Apple",E=b+" Watch",R="Safari",y="BlackBerry",S="Samsung",M=S+"Browser",k=S+" Internet",P="Chrome",A=P+" OS",O=P+" "+g,B="Internet Explorer",D=B+" "+p,I="Opera",N=I+" Mini",U="Edge",T="Microsoft "+U,C="Firefox",W=C+" "+g,F="Nintendo",L="PlayStation",j="Xbox",z=w+" "+p,G=p+" "+R,K="Windows",V=K+" Phone",H="Nokia",X="Ouya",Y="Generic",q=Y+" "+p.toLowerCase(),J=Y+" "+m.toLowerCase(),Q="Konqueror",Z="Oculus Browser",ee="Vivaldi",re="Yandex",ne="Whale",te="DuckDuckGo",ie="Pale Moon",oe="Waterfox",ae="Brave",le="Google Search App",ue="(\\d+(\\.\\d+)?)",se=new RegExp("Version/"+ue),ce=new RegExp(j,"i"),de=new RegExp(L+" \\w+","i"),fe=new RegExp(F+" \\w+","i"),ve=new RegExp(y+"|PlayBook|BB10","i"),he={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},pe=function(e,r,t,i){r=r||"";var o=function(e){return null!=e&&e.brave?ae:null}(t);return o||(null!=i&&i.detectGoogleSearchApp&&n(e,"GSA/")?le:n(e," OPR/")&&n(e,"Mini")?N:n(e," OPR/")?I:ve.test(e)?y:n(e,"IE"+p)||n(e,"WPDesktop")?D:n(e,"OculusBrowser")?Z:n(e,M)?k:n(e,U)||n(e,"Edg/")?T:n(e,ee+"/")?ee:n(e,"YaBrowser/")?re:n(e,ne+"/")?ne:n(e,te+"/")||n(e,"Ddg/")?te:n(e,"FBIOS")?"Facebook "+p:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?O:n(e,"CrMo")||n(e,P)?P:n(e,w)&&n(e,R)?z:n(e,"FxiOS")?W:n(e.toLowerCase(),Q.toLowerCase())?Q:n(e,ae+"/")?ae:((e,r)=>r&&n(r,b)||function(e){return n(e,R)&&!n(e,P)&&!n(e,w)}(e))(e,r)?n(e,p)?G:R:n(e,"PaleMoon/")?ie:n(e,oe+"/")?oe:n(e,C)?C:n(e,"MSIE")||n(e,"Trident/")?B:n(e,"Gecko")?C:"")},ge={[D]:[new RegExp("rv:"+ue)],[T]:[new RegExp(U+"?\\/"+ue)],[P]:[new RegExp("("+P+"|CrMo)\\/"+ue)],[O]:[new RegExp("CriOS\\/"+ue)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ue)],[R]:[se],[G]:[se],[I]:[new RegExp("(Opera|OPR)\\/"+ue)],[C]:[new RegExp(C+"\\/"+ue)],[W]:[new RegExp("FxiOS\\/"+ue)],[Q]:[new RegExp("Konqueror[:/]?"+ue,"i")],[y]:[new RegExp(y+" "+ue),se],[z]:[new RegExp("android\\s"+ue,"i")],[k]:[new RegExp(M+"\\/"+ue)],[Z]:[new RegExp("OculusBrowser\\/"+ue)],[ee]:[new RegExp(ee+"\\/"+ue)],[re]:[new RegExp("YaBrowser\\/"+ue)],[ne]:[new RegExp(ne+"\\/"+ue)],[ae]:[new RegExp(ae+"\\/"+ue)],[te]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ue)],[ie]:[new RegExp("PaleMoon\\/"+ue)],[oe]:[new RegExp(oe+"\\/"+ue)],[le]:[new RegExp("GSA\\/"+ue)],[B]:[new RegExp("(rv:|MSIE )"+ue)],Mozilla:[new RegExp("rv:"+ue)]},we=function(e,r,n,t){var i=pe(e,r,n,t),o=ge[i];if(s(o))return null;for(var a=0;o.length>a;a++){var l=e.match(o[a]);if(l)return parseFloat(l[l.length-2])}return null},me=[[new RegExp(j+"; "+j+" (.*?)[);]","i"),e=>[j,e&&e[1]||""]],[new RegExp(F,"i"),[F,""]],[new RegExp(L,"i"),[L,""]],[ve,[y,""]],[new RegExp(K,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(p).test(r)&&!/IEMobile\b/.test(r))return[K+" "+p,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=he[n[1]]||"";return/arm/i.test(r)&&(t="RT"),[K,t]}return[K,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[g,[e[3],e[4],e[5]||"0"].join(".")]:[g,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=s(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+w+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+w+")","i"),e=>e&&e[2]?[w,[e[2],e[3],e[4]||"0"].join(".")]:[w,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[A,""]],[/Linux|debian/i,["Linux",""]]],_e=function(e){return fe.test(e)?F:de.test(e)?L:ce.test(e)?j:new RegExp(X,"i").test(e)?X:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?E:ve.test(e)?y:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(H,"i").test(e)?H:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(p).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?w:_:new RegExp("(pda|"+p+")","i").test(e)?q:new RegExp(m,"i").test(e)&&!new RegExp(m+" pc","i").test(e)?J:""},xe="undefined"!=typeof window?window:void 0,be="undefined"!=typeof globalThis?globalThis:xe;"undefined"==typeof self&&(be.self=be),"undefined"==typeof File&&(be.File=function(){});var Ee=null==be?void 0:be.navigator,Re=null==be?void 0:be.document,ye=null==be?void 0:be.location;null!=be&&be.XMLHttpRequest&&new be.XMLHttpRequest;var $e=null==Ee?void 0:Ee.userAgent,Se=null!=xe?xe:{},Me=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,t={k(r){if(xe&&(Se.POSTHOG_DEBUG||n)&&!s(xe.console)&&xe.console){for(var t=("__rrweb_original__"in xe.console[r]?xe.console[r].__rrweb_original__:xe.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];t(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("error",...r)},critical(){for(var r=arguments.length,n=new Array(r),t=0;r>t;t++)n[t]=arguments[t];console.error(e,...n)},uninitializedWarning(e){t.error("You must initialize PostHog before calling "+e)},createLogger:(r,n)=>Me(e+" "+r,n)};return t},ke=Me("[PostHog.js]"),Pe=ke.createLogger;function Ae(e,r){if(!c(e))if(a(e))e.forEach(r);else if(f(e))e.forEach(((e,n)=>r(e,n)));else for(var n in e)i.call(e,n)&&r(e[n],n)}var Oe=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;r>t;t++)n[t-1]=arguments[t];for(var i of n)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},Be=e=>{var r=null==Re?void 0:Re.createElement("a");return s(r)?null:(r.href=e,r)},De=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[1],o=(t[0]||"").split("?"),l=o[1],u=o[0],s=(l||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");a(f)&&(r.includes(f[0])?c.push(f[0]+"="+n):c.push(s[d]))}var v=u;return null!=l&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return d(e)&&isFinite(e)&&Math.floor(e)===e});class Ie{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||0>e||0>r||0>n||0>t||e>0xffffffffffff||r>4095||n>1073741823||t>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ie(i)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ie(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ne{constructor(){this.S=0,this.C=0,this.I=new Ce}generate(){var e=this.generateOrAbort();if(s(e)){this.S=0;var r=this.generateOrAbort();if(s(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Ie.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Ue,Te=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};xe&&!s(xe.crypto)&&crypto.getRandomValues&&(Te=e=>crypto.getRandomValues(e));class Ce{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Te(this.R),this.O=0),this.R[this.O++]}}var We=()=>(Ue||(Ue=new Ne)).generate(),Fe="",Le=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function je(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=Re),Fe)return Fe;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),i="dmn_chk_"+We().toString();!Fe&&t--;){var o=n.slice(t).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",Fe=o)}return Fe}(e);if(!n){var t=(e=>{var r=e.match(Le);return r?r[0]:""})(e);t!==n&&ke.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var ze={N:()=>!!Re,D(e){ke.error("cookieStore error: "+e)},A(e){if(Re){try{for(var r=e+"=",n=Re.cookie.split(";").filter((e=>e.length)),t=0;n.length>t;t++){for(var i=n[t];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(ze.A(e))||{}}catch(e){}return r},q(e,r,n,t,i){if(!Re)return!1;try{var o="",a="",l=je(Re.location.hostname,t);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),o="; expires="+u.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+l+a;return s.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+s.length),Re.cookie=s,!0}catch(e){return!1}},P(e,r){if(null!=Re&&Re.cookie)try{ze.q(e,"",-1,r)}catch(e){return}}},Ge=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ke=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ge],Ve=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],He="<masked>",Xe=["li_fat_id"];function Ye(e,r,n){if(!Re)return{};var t,i,o,l=r?[...Ge,...n||[]]:[],u=(t=De(Re.URL,l,He),i=Ke.concat(e||[]),o={},Ae(i,(function(e){var r=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;t.length>i;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!a(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch(e){ke.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")}(t,e);o[e]=r||null})),o),s=function(){var e={};return Ae(Xe,(function(r){var n=ze.A(r);e[r]=n||null})),e}();return Oe(s,u)}function qe(){return navigator.language||navigator.userLanguage}var Je="$direct";function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n,t,i){var a,l,u,s;if(void 0===i&&(i=!1),!$e)return{};var c,f,v,h,g,w,b,R,y,S,M,k,P=r?[...Ge,...n||[]]:[],[A,O]=function(e){for(var r=0;me.length>r;r++){var[n,t]=me[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}($e),B=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},D={detectGoogleSearchApp:t},I=Oe((M={$os:A,$os_version:O,$browser:pe($e,navigator.vendor,B,D),$device:_e($e),$device_type:(h=$e,g={userAgentDataPlatform:null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,maxTouchPoints:null==(l=navigator)?void 0:l.maxTouchPoints,screenWidth:null==xe||null==(u=xe.screen)?void 0:u.width,screenHeight:null==xe||null==(s=xe.screen)?void 0:s.height,devicePixelRatio:null==xe?void 0:xe.devicePixelRatio},S=_e(h),S===x||S===_||"Kobo"===S||"Kindle Fire"===S||S===J?m:S===F||S===j||S===L||S===X?"Console":S===E?"Wearable":S?p:"Android"===(null==g?void 0:g.userAgentDataPlatform)&&(null!==(w=null==g?void 0:g.maxTouchPoints)&&void 0!==w?w:0)>0?600>Math.min(null!==(b=null==g?void 0:g.screenWidth)&&void 0!==b?b:0,null!==(R=null==g?void 0:g.screenHeight)&&void 0!==R?R:0)/(null!==(y=null==g?void 0:g.devicePixelRatio)&&void 0!==y?y:1)?p:m:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()},k={},Ae(M,(function(e,r){("[object String]"==o.call(e)&&e.length>0||d(e))&&(k[r]=e)})),k),{$current_url:De(i?(v=null==ye?void 0:ye.href,v?v.split("#")[0]:v):null==ye?void 0:ye.href,P,He),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:$e.length>1e3?$e.substring(0,997)+"...":$e,$browser_version:we($e,navigator.vendor,B,D),$browser_language:qe(),$browser_language_prefix:(f=qe(),"string"==typeof f?f.split("-")[0]:void 0),$screen_height:null==xe?void 0:xe.screen.height,$screen_width:null==xe?void 0:xe.screen.width,$viewport_height:null==xe?void 0:xe.innerHeight,$viewport_width:null==xe?void 0:xe.innerWidth,$lib:e.LIB_NAME,$lib_version:e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return e.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=e.SDK_DIST_CHANNEL),I}function rr(e,r){return[...e||[],...a(r)?r:[r]]}function nr(e,r){return(s(e)?1:e)*r}function tr(e,r){return function(e){for(var r=0,n=0;e.length>n;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<v(100*r,0,100,ke)}var ir=["type"];function or(e){var{type:r,executionTimeMs:n}=e;return r+(c(n)?"":" ("+n.toFixed(2)+"ms)")}var ar=Pe("[PostHog Action RateLimiting]");function lr(e,r){console.log(e,r)}function ur(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],d=r[o];if(s(a))t[o]=d;else if(s(d))t[o]=a;else if(!(a===d||c(a)&&c(d)))if(l(a)&&l(d))if(n>1){var f=ur(a,d,n-1);u(f)||(t[o]=f)}else t[o]="max depth reached, checking for changed value";else t[o]=d}return t}var sr,cr,dr,fr=(sr=null,cr=0,dr=null,{info(e){dr!==e&&(cr=0,dr=e),cr++,sr&&clearTimeout(sr),sr=setTimeout((()=>{ar.info(1===cr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+cr+" times)"),cr=0,sr=null}),1e3)}});function vr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=or,logger:i=lr,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:l=10,__stateComparisonDepth:u}=e,s=new h({refillRate:a,bucketSize:l,refillInterval:1e3,Ae:ar});return e=>a=>l=>{var c=l,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))fr.info(c.type);else try{var w=n?n(d,g):d,m=n?n(p,g):p,_=o.changedState?ur(w,m,null!=u?u:5):void 0,{type:x}=g,b={type:x,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,ir),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=t(b);i(E,b)}catch(e){ar.error("Error logging state:",e)}return v}}Se.posthogCustomizations=Object.freeze({__proto__:null,browserConsoleLogger:lr,posthogKeaLogger(e){void 0===e&&(e={});var r=vr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:vr,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:e=>n=>n&&tr(n.properties.distinct_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null,sampleByEvent:(e,t)=>i=>{var o,a,l;return i?n(e,i.event)?100*Math.random()<v(100*t,0,100,ke)?r({},i,{properties:r({},i.properties,{$sample_type:rr(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:nr(null==(a=i.properties)?void 0:a.$sample_threshold,t),$sampled_events:rr(null==(l=i.properties)?void 0:l.$sampled_events,e)})}):null:i:null},sampleBySessionId:e=>n=>n&&tr(n.properties.$session_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:rr(n.properties.$sample_type,"sampleBySessionId"),$sample_threshold:nr(n.properties.$sample_threshold,e)})}):null,sessionRecordingLoggerForPostHogInstance:e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags(e){var r,t=Oe({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties,e.config.detect_google_search_app,e.config.disable_capture_url_hashes),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==Re?void 0:Re.referrer)||Je,$referring_domain:null!=Re&&Re.referrer&&(null==(r=Be(Re.referrer))?void 0:r.host)||Je}),i={};Ae(t,(function(e,r){(n(Ke,r)||n(Ve,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)}})}(); | ||
| !function(){"use strict";var e={LIB_VERSION:"1.398.0",LIB_NAME:"web"};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},r.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var t=Object.prototype,i=t.hasOwnProperty,o=t.toString,a=Array.isArray||function(e){return"[object Array]"===o.call(e)},l=e=>e===Object(e)&&!a(e),u=e=>{if(l(e)){for(var r in e)if(i.call(e,r))return!1;return!0}return!1},s=e=>void 0===e,c=e=>s(e)||(e=>null===e)(e),d=e=>"[object Number]"==o.call(e)&&e==e,f=e=>e instanceof FormData;function v(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),d(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):r>e?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),v(n,r,n,t))}class h{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=v(e.bucketSize,0,100,e.Ae),this.$e=v(e.refillRate,0,this.Fe,e.Ae),this.De=v(e.refillInterval,0,864e5,e.Ae)}Ne(e,r){var n=Math.floor((r-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess=e.lastAccess+n*this.De)}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.Ee[t];return i?this.Ne(i,n):this.Ee[t]=i={tokens:this.Fe,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.Pe)||r.call(this,e)),0===i.tokens)}stop(){this.Ee={}}}var p="Mobile",g="iOS",w="Android",m="Tablet",_=w+" "+m,x="iPad",b="Apple",E=b+" Watch",R="Safari",y="BlackBerry",S="Samsung",M=S+"Browser",k=S+" Internet",P="Chrome",A=P+" OS",O=P+" "+g,B="Internet Explorer",D=B+" "+p,I="Opera",N=I+" Mini",U="Edge",T="Microsoft "+U,C="Firefox",W=C+" "+g,F="Nintendo",L="PlayStation",j="Xbox",z=w+" "+p,G=p+" "+R,K="Windows",V=K+" Phone",H="Nokia",X="Ouya",Y="Generic",q=Y+" "+p.toLowerCase(),J=Y+" "+m.toLowerCase(),Q="Konqueror",Z="Oculus Browser",ee="Vivaldi",re="Yandex",ne="Whale",te="DuckDuckGo",ie="Pale Moon",oe="Waterfox",ae="Brave",le="Google Search App",ue="(\\d+(\\.\\d+)?)",se=new RegExp("Version/"+ue),ce=new RegExp(j,"i"),de=new RegExp(L+" \\w+","i"),fe=new RegExp(F+" \\w+","i"),ve=new RegExp(y+"|PlayBook|BB10","i"),he={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},pe=function(e,r,t,i){r=r||"";var o=function(e){return null!=e&&e.brave?ae:null}(t);return o||(null!=i&&i.detectGoogleSearchApp&&n(e,"GSA/")?le:n(e," OPR/")&&n(e,"Mini")?N:n(e," OPR/")?I:ve.test(e)?y:n(e,"IE"+p)||n(e,"WPDesktop")?D:n(e,"OculusBrowser")?Z:n(e,M)?k:n(e,U)||n(e,"Edg/")?T:n(e,ee+"/")?ee:n(e,"YaBrowser/")?re:n(e,ne+"/")?ne:n(e,te+"/")||n(e,"Ddg/")?te:n(e,"FBIOS")?"Facebook "+p:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?O:n(e,"CrMo")||n(e,P)?P:n(e,w)&&n(e,R)?z:n(e,"FxiOS")?W:n(e.toLowerCase(),Q.toLowerCase())?Q:n(e,ae+"/")?ae:((e,r)=>r&&n(r,b)||function(e){return n(e,R)&&!n(e,P)&&!n(e,w)}(e))(e,r)?n(e,p)?G:R:n(e,"PaleMoon/")?ie:n(e,oe+"/")?oe:n(e,C)?C:n(e,"MSIE")||n(e,"Trident/")?B:n(e,"Gecko")?C:"")},ge={[D]:[new RegExp("rv:"+ue)],[T]:[new RegExp(U+"?\\/"+ue)],[P]:[new RegExp("("+P+"|CrMo)\\/"+ue)],[O]:[new RegExp("CriOS\\/"+ue)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ue)],[R]:[se],[G]:[se],[I]:[new RegExp("(Opera|OPR)\\/"+ue)],[C]:[new RegExp(C+"\\/"+ue)],[W]:[new RegExp("FxiOS\\/"+ue)],[Q]:[new RegExp("Konqueror[:/]?"+ue,"i")],[y]:[new RegExp(y+" "+ue),se],[z]:[new RegExp("android\\s"+ue,"i")],[k]:[new RegExp(M+"\\/"+ue)],[Z]:[new RegExp("OculusBrowser\\/"+ue)],[ee]:[new RegExp(ee+"\\/"+ue)],[re]:[new RegExp("YaBrowser\\/"+ue)],[ne]:[new RegExp(ne+"\\/"+ue)],[ae]:[new RegExp(ae+"\\/"+ue)],[te]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ue)],[ie]:[new RegExp("PaleMoon\\/"+ue)],[oe]:[new RegExp(oe+"\\/"+ue)],[le]:[new RegExp("GSA\\/"+ue)],[B]:[new RegExp("(rv:|MSIE )"+ue)],Mozilla:[new RegExp("rv:"+ue)]},we=function(e,r,n,t){var i=pe(e,r,n,t),o=ge[i];if(s(o))return null;for(var a=0;o.length>a;a++){var l=e.match(o[a]);if(l)return parseFloat(l[l.length-2])}return null},me=[[new RegExp(j+"; "+j+" (.*?)[);]","i"),e=>[j,e&&e[1]||""]],[new RegExp(F,"i"),[F,""]],[new RegExp(L,"i"),[L,""]],[ve,[y,""]],[new RegExp(K,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(p).test(r)&&!/IEMobile\b/.test(r))return[K+" "+p,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=he[n[1]]||"";return/arm/i.test(r)&&(t="RT"),[K,t]}return[K,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[g,[e[3],e[4],e[5]||"0"].join(".")]:[g,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=s(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+w+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+w+")","i"),e=>e&&e[2]?[w,[e[2],e[3],e[4]||"0"].join(".")]:[w,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[A,""]],[/Linux|debian/i,["Linux",""]]],_e=function(e){return fe.test(e)?F:de.test(e)?L:ce.test(e)?j:new RegExp(X,"i").test(e)?X:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?E:ve.test(e)?y:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(H,"i").test(e)?H:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(p).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?w:_:new RegExp("(pda|"+p+")","i").test(e)?q:new RegExp(m,"i").test(e)&&!new RegExp(m+" pc","i").test(e)?J:""},xe="undefined"!=typeof window?window:void 0,be="undefined"!=typeof globalThis?globalThis:xe;"undefined"==typeof self&&(be.self=be),"undefined"==typeof File&&(be.File=function(){});var Ee=null==be?void 0:be.navigator,Re=null==be?void 0:be.document,ye=null==be?void 0:be.location;null!=be&&be.XMLHttpRequest&&new be.XMLHttpRequest;var $e=null==Ee?void 0:Ee.userAgent,Se=null!=xe?xe:{},Me=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,t={k(r){if(xe&&(Se.POSTHOG_DEBUG||n)&&!s(xe.console)&&xe.console){for(var t=("__rrweb_original__"in xe.console[r]?xe.console[r].__rrweb_original__:xe.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];t(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("error",...r)},critical(){for(var r=arguments.length,n=new Array(r),t=0;r>t;t++)n[t]=arguments[t];console.error(e,...n)},uninitializedWarning(e){t.error("You must initialize PostHog before calling "+e)},createLogger:(r,n)=>Me(e+" "+r,n)};return t},ke=Me("[PostHog.js]"),Pe=ke.createLogger;function Ae(e,r){if(!c(e))if(a(e))e.forEach(r);else if(f(e))e.forEach(((e,n)=>r(e,n)));else for(var n in e)i.call(e,n)&&r(e[n],n)}var Oe=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;r>t;t++)n[t-1]=arguments[t];for(var i of n)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},Be=e=>{var r=null==Re?void 0:Re.createElement("a");return s(r)?null:(r.href=e,r)},De=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[1],o=(t[0]||"").split("?"),l=o[1],u=o[0],s=(l||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");a(f)&&(r.includes(f[0])?c.push(f[0]+"="+n):c.push(s[d]))}var v=u;return null!=l&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return d(e)&&isFinite(e)&&Math.floor(e)===e});class Ie{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||0>e||0>r||0>n||0>t||e>0xffffffffffff||r>4095||n>1073741823||t>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ie(i)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ie(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ne{constructor(){this.S=0,this.C=0,this.I=new Ce}generate(){var e=this.generateOrAbort();if(s(e)){this.S=0;var r=this.generateOrAbort();if(s(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Ie.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Ue,Te=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};xe&&!s(xe.crypto)&&crypto.getRandomValues&&(Te=e=>crypto.getRandomValues(e));class Ce{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Te(this.R),this.O=0),this.R[this.O++]}}var We=()=>(Ue||(Ue=new Ne)).generate(),Fe="",Le=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function je(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=Re),Fe)return Fe;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),i="dmn_chk_"+We().toString();!Fe&&t--;){var o=n.slice(t).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",Fe=o)}return Fe}(e);if(!n){var t=(e=>{var r=e.match(Le);return r?r[0]:""})(e);t!==n&&ke.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var ze={N:()=>!!Re,D(e){ke.error("cookieStore error: "+e)},A(e){if(Re){try{for(var r=e+"=",n=Re.cookie.split(";").filter((e=>e.length)),t=0;n.length>t;t++){for(var i=n[t];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(ze.A(e))||{}}catch(e){}return r},q(e,r,n,t,i){if(!Re)return!1;try{var o="",a="",l=je(Re.location.hostname,t);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),o="; expires="+u.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+l+a;return s.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+s.length),Re.cookie=s,!0}catch(e){return!1}},P(e,r){if(null!=Re&&Re.cookie)try{ze.q(e,"",-1,r)}catch(e){return}}},Ge=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ke=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ge],Ve=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],He="<masked>",Xe=["li_fat_id"];function Ye(e,r,n){if(!Re)return{};var t,i,o,l=r?[...Ge,...n||[]]:[],u=(t=De(Re.URL,l,He),i=Ke.concat(e||[]),o={},Ae(i,(function(e){var r=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;t.length>i;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!a(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch(e){ke.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")}(t,e);o[e]=r||null})),o),s=function(){var e={};return Ae(Xe,(function(r){var n=ze.A(r);e[r]=n||null})),e}();return Oe(s,u)}function qe(){return navigator.language||navigator.userLanguage}var Je="$direct";function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n,t,i){var a,l,u,s;if(void 0===i&&(i=!1),!$e)return{};var c,f,v,h,g,w,b,R,y,S,M,k,P=r?[...Ge,...n||[]]:[],[A,O]=function(e){for(var r=0;me.length>r;r++){var[n,t]=me[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}($e),B=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},D={detectGoogleSearchApp:t},I=Oe((M={$os:A,$os_version:O,$browser:pe($e,navigator.vendor,B,D),$device:_e($e),$device_type:(h=$e,g={userAgentDataPlatform:null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,maxTouchPoints:null==(l=navigator)?void 0:l.maxTouchPoints,screenWidth:null==xe||null==(u=xe.screen)?void 0:u.width,screenHeight:null==xe||null==(s=xe.screen)?void 0:s.height,devicePixelRatio:null==xe?void 0:xe.devicePixelRatio},S=_e(h),S===x||S===_||"Kobo"===S||"Kindle Fire"===S||S===J?m:S===F||S===j||S===L||S===X?"Console":S===E?"Wearable":S?p:"Android"===(null==g?void 0:g.userAgentDataPlatform)&&(null!==(w=null==g?void 0:g.maxTouchPoints)&&void 0!==w?w:0)>0?600>Math.min(null!==(b=null==g?void 0:g.screenWidth)&&void 0!==b?b:0,null!==(R=null==g?void 0:g.screenHeight)&&void 0!==R?R:0)/(null!==(y=null==g?void 0:g.devicePixelRatio)&&void 0!==y?y:1)?p:m:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()},k={},Ae(M,(function(e,r){("[object String]"==o.call(e)&&e.length>0||d(e))&&(k[r]=e)})),k),{$current_url:De(i?(v=null==ye?void 0:ye.href,v?v.split("#")[0]:v):null==ye?void 0:ye.href,P,He),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:$e.length>1e3?$e.substring(0,997)+"...":$e,$browser_version:we($e,navigator.vendor,B,D),$browser_language:qe(),$browser_language_prefix:(f=qe(),"string"==typeof f?f.split("-")[0]:void 0),$screen_height:null==xe?void 0:xe.screen.height,$screen_width:null==xe?void 0:xe.screen.width,$viewport_height:null==xe?void 0:xe.innerHeight,$viewport_width:null==xe?void 0:xe.innerWidth,$lib:e.LIB_NAME,$lib_version:e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return e.SDK_DIST_CHANNEL&&(I.$sdk_dist_channel=e.SDK_DIST_CHANNEL),I}function rr(e,r){return[...e||[],...a(r)?r:[r]]}function nr(e,r){return(s(e)?1:e)*r}function tr(e,r){return function(e){for(var r=0,n=0;e.length>n;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<v(100*r,0,100,ke)}var ir=["type"];function or(e){var{type:r,executionTimeMs:n}=e;return r+(c(n)?"":" ("+n.toFixed(2)+"ms)")}var ar=Pe("[PostHog Action RateLimiting]");function lr(e,r){console.log(e,r)}function ur(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],d=r[o];if(s(a))t[o]=d;else if(s(d))t[o]=a;else if(!(a===d||c(a)&&c(d)))if(l(a)&&l(d))if(n>1){var f=ur(a,d,n-1);u(f)||(t[o]=f)}else t[o]="max depth reached, checking for changed value";else t[o]=d}return t}var sr,cr,dr,fr=(sr=null,cr=0,dr=null,{info(e){dr!==e&&(cr=0,dr=e),cr++,sr&&clearTimeout(sr),sr=setTimeout((()=>{ar.info(1===cr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+cr+" times)"),cr=0,sr=null}),1e3)}});function vr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=or,logger:i=lr,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:l=10,__stateComparisonDepth:u}=e,s=new h({refillRate:a,bucketSize:l,refillInterval:1e3,Ae:ar});return e=>a=>l=>{var c=l,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))fr.info(c.type);else try{var w=n?n(d,g):d,m=n?n(p,g):p,_=o.changedState?ur(w,m,null!=u?u:5):void 0,{type:x}=g,b={type:x,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,ir),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=t(b);i(E,b)}catch(e){ar.error("Error logging state:",e)}return v}}Se.posthogCustomizations=Object.freeze({__proto__:null,browserConsoleLogger:lr,posthogKeaLogger(e){void 0===e&&(e={});var r=vr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}},posthogReduxLogger:vr,printAndDropEverything:e=>(console.log("Would have sent event:",e),null),sampleByDistinctId:e=>n=>n&&tr(n.properties.distinct_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null,sampleByEvent:(e,t)=>i=>{var o,a,l;return i?n(e,i.event)?100*Math.random()<v(100*t,0,100,ke)?r({},i,{properties:r({},i.properties,{$sample_type:rr(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:nr(null==(a=i.properties)?void 0:a.$sample_threshold,t),$sampled_events:rr(null==(l=i.properties)?void 0:l.$sampled_events,e)})}):null:i:null},sampleBySessionId:e=>n=>n&&tr(n.properties.$session_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:rr(n.properties.$sample_type,"sampleBySessionId"),$sample_threshold:nr(n.properties.$sample_threshold,e)})}):null,sessionRecordingLoggerForPostHogInstance:e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})},setAllPersonProfilePropertiesAsPersonPropertiesForFlags(e){var r,t=Oe({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties,e.config.detect_google_search_app,e.config.disable_capture_url_hashes),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==Re?void 0:Re.referrer)||Je,$referring_domain:null!=Re&&Re.referrer&&(null==(r=Be(Re.referrer))?void 0:r.host)||Je}),i={};Ae(t,(function(e,r){(n(Ke,r)||n(Ve,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)}})}(); | ||
| //# sourceMappingURL=customizations.full.js.map |
@@ -1,2 +0,2 @@ | ||
| var e={LIB_VERSION:"1.397.0",LIB_NAME:"web"};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},r.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var t=Object.prototype,i=t.hasOwnProperty,o=t.toString,a=Array.isArray||function(e){return"[object Array]"===o.call(e)},u=e=>e===Object(e)&&!a(e),l=e=>{if(u(e)){for(var r in e)if(i.call(e,r))return!1;return!0}return!1},s=e=>void 0===e,c=e=>s(e)||(e=>null===e)(e),d=e=>"[object Number]"==o.call(e)&&e==e,f=e=>e instanceof FormData;function v(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),d(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):r>e?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),v(n,r,n,t))}class h{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=v(e.bucketSize,0,100,e.Ae),this.$e=v(e.refillRate,0,this.Fe,e.Ae),this.De=v(e.refillInterval,0,864e5,e.Ae)}Ne(e,r){var n=Math.floor((r-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess=e.lastAccess+n*this.De)}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.Ee[t];return i?this.Ne(i,n):this.Ee[t]=i={tokens:this.Fe,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.Pe)||r.call(this,e)),0===i.tokens)}stop(){this.Ee={}}}var p="Mobile",g="iOS",w="Android",m="Tablet",_=w+" "+m,x="iPad",b="Apple",E=b+" Watch",R="Safari",y="BlackBerry",M="Samsung",S=M+"Browser",k=M+" Internet",A="Chrome",O=A+" OS",P=A+" "+g,B="Internet Explorer",D=B+" "+p,N="Opera",U=N+" Mini",I="Edge",T="Microsoft "+I,C="Firefox",W=C+" "+g,z="Nintendo",F="PlayStation",j="Xbox",G=w+" "+p,L=p+" "+R,K="Windows",V=K+" Phone",H="Nokia",X="Ouya",Y="Generic",q=Y+" "+p.toLowerCase(),J=Y+" "+m.toLowerCase(),Q="Konqueror",Z="Oculus Browser",ee="Vivaldi",re="Yandex",ne="Whale",te="DuckDuckGo",ie="Pale Moon",oe="Waterfox",ae="Brave",ue="Google Search App",le="(\\d+(\\.\\d+)?)",se=new RegExp("Version/"+le),ce=new RegExp(j,"i"),de=new RegExp(F+" \\w+","i"),fe=new RegExp(z+" \\w+","i"),ve=new RegExp(y+"|PlayBook|BB10","i"),he={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},pe=function(e,r,t,i){r=r||"";var o=function(e){return null!=e&&e.brave?ae:null}(t);return o||(null!=i&&i.detectGoogleSearchApp&&n(e,"GSA/")?ue:n(e," OPR/")&&n(e,"Mini")?U:n(e," OPR/")?N:ve.test(e)?y:n(e,"IE"+p)||n(e,"WPDesktop")?D:n(e,"OculusBrowser")?Z:n(e,S)?k:n(e,I)||n(e,"Edg/")?T:n(e,ee+"/")?ee:n(e,"YaBrowser/")?re:n(e,ne+"/")?ne:n(e,te+"/")||n(e,"Ddg/")?te:n(e,"FBIOS")?"Facebook "+p:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?P:n(e,"CrMo")||n(e,A)?A:n(e,w)&&n(e,R)?G:n(e,"FxiOS")?W:n(e.toLowerCase(),Q.toLowerCase())?Q:n(e,ae+"/")?ae:((e,r)=>r&&n(r,b)||function(e){return n(e,R)&&!n(e,A)&&!n(e,w)}(e))(e,r)?n(e,p)?L:R:n(e,"PaleMoon/")?ie:n(e,oe+"/")?oe:n(e,C)?C:n(e,"MSIE")||n(e,"Trident/")?B:n(e,"Gecko")?C:"")},ge={[D]:[new RegExp("rv:"+le)],[T]:[new RegExp(I+"?\\/"+le)],[A]:[new RegExp("("+A+"|CrMo)\\/"+le)],[P]:[new RegExp("CriOS\\/"+le)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+le)],[R]:[se],[L]:[se],[N]:[new RegExp("(Opera|OPR)\\/"+le)],[C]:[new RegExp(C+"\\/"+le)],[W]:[new RegExp("FxiOS\\/"+le)],[Q]:[new RegExp("Konqueror[:/]?"+le,"i")],[y]:[new RegExp(y+" "+le),se],[G]:[new RegExp("android\\s"+le,"i")],[k]:[new RegExp(S+"\\/"+le)],[Z]:[new RegExp("OculusBrowser\\/"+le)],[ee]:[new RegExp(ee+"\\/"+le)],[re]:[new RegExp("YaBrowser\\/"+le)],[ne]:[new RegExp(ne+"\\/"+le)],[ae]:[new RegExp(ae+"\\/"+le)],[te]:[new RegExp("(DuckDuckGo|Ddg)\\/"+le)],[ie]:[new RegExp("PaleMoon\\/"+le)],[oe]:[new RegExp(oe+"\\/"+le)],[ue]:[new RegExp("GSA\\/"+le)],[B]:[new RegExp("(rv:|MSIE )"+le)],Mozilla:[new RegExp("rv:"+le)]},we=function(e,r,n,t){var i=pe(e,r,n,t),o=ge[i];if(s(o))return null;for(var a=0;o.length>a;a++){var u=e.match(o[a]);if(u)return parseFloat(u[u.length-2])}return null},me=[[new RegExp(j+"; "+j+" (.*?)[);]","i"),e=>[j,e&&e[1]||""]],[new RegExp(z,"i"),[z,""]],[new RegExp(F,"i"),[F,""]],[ve,[y,""]],[new RegExp(K,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(p).test(r)&&!/IEMobile\b/.test(r))return[K+" "+p,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=he[n[1]]||"";return/arm/i.test(r)&&(t="RT"),[K,t]}return[K,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[g,[e[3],e[4],e[5]||"0"].join(".")]:[g,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=s(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+w+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+w+")","i"),e=>e&&e[2]?[w,[e[2],e[3],e[4]||"0"].join(".")]:[w,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[O,""]],[/Linux|debian/i,["Linux",""]]],_e=function(e){return fe.test(e)?z:de.test(e)?F:ce.test(e)?j:new RegExp(X,"i").test(e)?X:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?E:ve.test(e)?y:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(H,"i").test(e)?H:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(p).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?w:_:new RegExp("(pda|"+p+")","i").test(e)?q:new RegExp(m,"i").test(e)&&!new RegExp(m+" pc","i").test(e)?J:""},xe="undefined"!=typeof window?window:void 0,be="undefined"!=typeof globalThis?globalThis:xe;"undefined"==typeof self&&(be.self=be),"undefined"==typeof File&&(be.File=function(){});var Ee=null==be?void 0:be.navigator,Re=null==be?void 0:be.document,ye=null==be?void 0:be.location;null!=be&&be.XMLHttpRequest&&new be.XMLHttpRequest;var $e=null==Ee?void 0:Ee.userAgent,Me=null!=xe?xe:{},Se=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,t={k(r){if(xe&&(Me.POSTHOG_DEBUG||n)&&!s(xe.console)&&xe.console){for(var t=("__rrweb_original__"in xe.console[r]?xe.console[r].__rrweb_original__:xe.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];t(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("error",...r)},critical(){for(var r=arguments.length,n=new Array(r),t=0;r>t;t++)n[t]=arguments[t];console.error(e,...n)},uninitializedWarning(e){t.error("You must initialize PostHog before calling "+e)},createLogger:(r,n)=>Se(e+" "+r,n)};return t},ke=Se("[PostHog.js]"),Ae=ke.createLogger;function Oe(e,r){if(!c(e))if(a(e))e.forEach(r);else if(f(e))e.forEach(((e,n)=>r(e,n)));else for(var n in e)i.call(e,n)&&r(e[n],n)}var Pe=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;r>t;t++)n[t-1]=arguments[t];for(var i of n)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},Be=e=>{var r=null==Re?void 0:Re.createElement("a");return s(r)?null:(r.href=e,r)},De=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[1],o=(t[0]||"").split("?"),u=o[1],l=o[0],s=(u||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");a(f)&&(r.includes(f[0])?c.push(f[0]+"="+n):c.push(s[d]))}var v=l;return null!=u&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return d(e)&&isFinite(e)&&Math.floor(e)===e});class Ne{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||0>e||0>r||0>n||0>t||e>0xffffffffffff||r>4095||n>1073741823||t>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ne(i)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ne(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ue{constructor(){this.S=0,this.C=0,this.I=new Ce}generate(){var e=this.generateOrAbort();if(s(e)){this.S=0;var r=this.generateOrAbort();if(s(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Ne.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Ie,Te=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};xe&&!s(xe.crypto)&&crypto.getRandomValues&&(Te=e=>crypto.getRandomValues(e));class Ce{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Te(this.R),this.O=0),this.R[this.O++]}}var We=()=>(Ie||(Ie=new Ue)).generate(),ze="",Fe=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function je(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=Re),ze)return ze;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),i="dmn_chk_"+We().toString();!ze&&t--;){var o=n.slice(t).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",ze=o)}return ze}(e);if(!n){var t=(e=>{var r=e.match(Fe);return r?r[0]:""})(e);t!==n&&ke.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var Ge={N:()=>!!Re,D(e){ke.error("cookieStore error: "+e)},A(e){if(Re){try{for(var r=e+"=",n=Re.cookie.split(";").filter((e=>e.length)),t=0;n.length>t;t++){for(var i=n[t];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(Ge.A(e))||{}}catch(e){}return r},q(e,r,n,t,i){if(!Re)return!1;try{var o="",a="",u=je(Re.location.hostname,t);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o="; expires="+l.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+u+a;return s.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+s.length),Re.cookie=s,!0}catch(e){return!1}},P(e,r){if(null!=Re&&Re.cookie)try{Ge.q(e,"",-1,r)}catch(e){return}}},Le=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ke=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Le],Ve=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],He="<masked>",Xe=["li_fat_id"];function Ye(e,r,n){if(!Re)return{};var t,i,o,u=r?[...Le,...n||[]]:[],l=(t=De(Re.URL,u,He),i=Ke.concat(e||[]),o={},Oe(i,(function(e){var r=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;t.length>i;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!a(n)||2>n.length)return"";var u=n[1];try{u=decodeURIComponent(u)}catch(e){ke.error("Skipping decoding for malformed query param: "+u)}return u.replace(/\+/g," ")}(t,e);o[e]=r||null})),o),s=function(){var e={};return Oe(Xe,(function(r){var n=Ge.A(r);e[r]=n||null})),e}();return Pe(s,l)}function qe(){return navigator.language||navigator.userLanguage}var Je="$direct";function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n,t,i){var a,u,l,s;if(void 0===i&&(i=!1),!$e)return{};var c,f,v,h,g,w,b,R,y,M,S,k,A=r?[...Le,...n||[]]:[],[O,P]=function(e){for(var r=0;me.length>r;r++){var[n,t]=me[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}($e),B=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},D={detectGoogleSearchApp:t},N=Pe((S={$os:O,$os_version:P,$browser:pe($e,navigator.vendor,B,D),$device:_e($e),$device_type:(h=$e,g={userAgentDataPlatform:null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,maxTouchPoints:null==(u=navigator)?void 0:u.maxTouchPoints,screenWidth:null==xe||null==(l=xe.screen)?void 0:l.width,screenHeight:null==xe||null==(s=xe.screen)?void 0:s.height,devicePixelRatio:null==xe?void 0:xe.devicePixelRatio},M=_e(h),M===x||M===_||"Kobo"===M||"Kindle Fire"===M||M===J?m:M===z||M===j||M===F||M===X?"Console":M===E?"Wearable":M?p:"Android"===(null==g?void 0:g.userAgentDataPlatform)&&(null!==(w=null==g?void 0:g.maxTouchPoints)&&void 0!==w?w:0)>0?600>Math.min(null!==(b=null==g?void 0:g.screenWidth)&&void 0!==b?b:0,null!==(R=null==g?void 0:g.screenHeight)&&void 0!==R?R:0)/(null!==(y=null==g?void 0:g.devicePixelRatio)&&void 0!==y?y:1)?p:m:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()},k={},Oe(S,(function(e,r){("[object String]"==o.call(e)&&e.length>0||d(e))&&(k[r]=e)})),k),{$current_url:De(i?(v=null==ye?void 0:ye.href,v?v.split("#")[0]:v):null==ye?void 0:ye.href,A,He),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:$e.length>1e3?$e.substring(0,997)+"...":$e,$browser_version:we($e,navigator.vendor,B,D),$browser_language:qe(),$browser_language_prefix:(f=qe(),"string"==typeof f?f.split("-")[0]:void 0),$screen_height:null==xe?void 0:xe.screen.height,$screen_width:null==xe?void 0:xe.screen.width,$viewport_height:null==xe?void 0:xe.innerHeight,$viewport_width:null==xe?void 0:xe.innerWidth,$lib:e.LIB_NAME,$lib_version:e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return e.SDK_DIST_CHANNEL&&(N.$sdk_dist_channel=e.SDK_DIST_CHANNEL),N}var rr=e=>{var r,t=Pe({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties,e.config.detect_google_search_app,e.config.disable_capture_url_hashes),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==Re?void 0:Re.referrer)||Je,$referring_domain:null!=Re&&Re.referrer&&(null==(r=Be(Re.referrer))?void 0:r.host)||Je}),i={};Oe(t,(function(e,r){(n(Ke,r)||n(Ve,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)};function nr(e,r){return[...e||[],...a(r)?r:[r]]}function tr(e,r){return(s(e)?1:e)*r}function ir(e,r){return function(e){for(var r=0,n=0;e.length>n;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<v(100*r,0,100,ke)}function or(e){return n=>n&&ir(n.properties.distinct_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null}function ar(e){return n=>n&&ir(n.properties.$session_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:nr(n.properties.$sample_type,"sampleBySessionId"),$sample_threshold:tr(n.properties.$sample_threshold,e)})}):null}function ur(e,t){return i=>{var o,a,u;return i?n(e,i.event)?100*Math.random()<v(100*t,0,100,ke)?r({},i,{properties:r({},i.properties,{$sample_type:nr(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:tr(null==(a=i.properties)?void 0:a.$sample_threshold,t),$sampled_events:nr(null==(u=i.properties)?void 0:u.$sampled_events,e)})}):null:i:null}}var lr=e=>(console.log("Would have sent event:",e),null),sr=["type"];function cr(e){var{type:r,executionTimeMs:n}=e;return r+(c(n)?"":" ("+n.toFixed(2)+"ms)")}var dr=Ae("[PostHog Action RateLimiting]");function fr(e,r){console.log(e,r)}var vr=e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})};function hr(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],d=r[o];if(s(a))t[o]=d;else if(s(d))t[o]=a;else if(!(a===d||c(a)&&c(d)))if(u(a)&&u(d))if(n>1){var f=hr(a,d,n-1);l(f)||(t[o]=f)}else t[o]="max depth reached, checking for changed value";else t[o]=d}return t}var pr,gr,wr,mr=(pr=null,gr=0,wr=null,{info(e){wr!==e&&(gr=0,wr=e),gr++,pr&&clearTimeout(pr),pr=setTimeout((()=>{dr.info(1===gr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+gr+" times)"),gr=0,pr=null}),1e3)}});function _r(e){void 0===e&&(e={});var r=xr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}}function xr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=cr,logger:i=fr,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:l}=e,s=new h({refillRate:a,bucketSize:u,refillInterval:1e3,Ae:dr});return e=>a=>u=>{var c=u,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))mr.info(c.type);else try{var w=n?n(d,g):d,m=n?n(p,g):p,_=o.changedState?hr(w,m,null!=l?l:5):void 0,{type:x}=g,b={type:x,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,sr),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=t(b);i(E,b)}catch(e){dr.error("Error logging state:",e)}return v}}export{fr as browserConsoleLogger,_r as posthogKeaLogger,xr as posthogReduxLogger,lr as printAndDropEverything,or as sampleByDistinctId,ur as sampleByEvent,ar as sampleBySessionId,vr as sessionRecordingLoggerForPostHogInstance,rr as setAllPersonProfilePropertiesAsPersonPropertiesForFlags}; | ||
| var e={LIB_VERSION:"1.398.0",LIB_NAME:"web"};function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;arguments.length>r;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},r.apply(null,arguments)}function n(e,r){return-1!==e.indexOf(r)}var t=Object.prototype,i=t.hasOwnProperty,o=t.toString,a=Array.isArray||function(e){return"[object Array]"===o.call(e)},u=e=>e===Object(e)&&!a(e),l=e=>{if(u(e)){for(var r in e)if(i.call(e,r))return!1;return!0}return!1},s=e=>void 0===e,c=e=>s(e)||(e=>null===e)(e),d=e=>"[object Number]"==o.call(e)&&e==e,f=e=>e instanceof FormData;function v(e,r,n,t,i){return r>n&&(t.warn("min cannot be greater than max."),r=n),d(e)?e>n?(t.warn(" cannot be greater than max: "+n+". Using max value instead."),n):r>e?(t.warn(" cannot be less than min: "+r+". Using min value instead."),r):e:(t.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),v(n,r,n,t))}class h{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=v(e.bucketSize,0,100,e.Ae),this.$e=v(e.refillRate,0,this.Fe,e.Ae),this.De=v(e.refillInterval,0,864e5,e.Ae)}Ne(e,r){var n=Math.floor((r-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess=e.lastAccess+n*this.De)}consumeRateLimit(e){var r,n=Date.now(),t=String(e),i=this.Ee[t];return i?this.Ne(i,n):this.Ee[t]=i={tokens:this.Fe,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(r=this.Pe)||r.call(this,e)),0===i.tokens)}stop(){this.Ee={}}}var p="Mobile",g="iOS",w="Android",m="Tablet",_=w+" "+m,x="iPad",b="Apple",E=b+" Watch",R="Safari",y="BlackBerry",M="Samsung",S=M+"Browser",k=M+" Internet",A="Chrome",O=A+" OS",P=A+" "+g,B="Internet Explorer",D=B+" "+p,N="Opera",U=N+" Mini",I="Edge",T="Microsoft "+I,C="Firefox",W=C+" "+g,z="Nintendo",F="PlayStation",j="Xbox",G=w+" "+p,L=p+" "+R,K="Windows",V=K+" Phone",H="Nokia",X="Ouya",Y="Generic",q=Y+" "+p.toLowerCase(),J=Y+" "+m.toLowerCase(),Q="Konqueror",Z="Oculus Browser",ee="Vivaldi",re="Yandex",ne="Whale",te="DuckDuckGo",ie="Pale Moon",oe="Waterfox",ae="Brave",ue="Google Search App",le="(\\d+(\\.\\d+)?)",se=new RegExp("Version/"+le),ce=new RegExp(j,"i"),de=new RegExp(F+" \\w+","i"),fe=new RegExp(z+" \\w+","i"),ve=new RegExp(y+"|PlayBook|BB10","i"),he={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},pe=function(e,r,t,i){r=r||"";var o=function(e){return null!=e&&e.brave?ae:null}(t);return o||(null!=i&&i.detectGoogleSearchApp&&n(e,"GSA/")?ue:n(e," OPR/")&&n(e,"Mini")?U:n(e," OPR/")?N:ve.test(e)?y:n(e,"IE"+p)||n(e,"WPDesktop")?D:n(e,"OculusBrowser")?Z:n(e,S)?k:n(e,I)||n(e,"Edg/")?T:n(e,ee+"/")?ee:n(e,"YaBrowser/")?re:n(e,ne+"/")?ne:n(e,te+"/")||n(e,"Ddg/")?te:n(e,"FBIOS")?"Facebook "+p:n(e,"UCWEB")||n(e,"UCBrowser")?"UC Browser":n(e,"CriOS")?P:n(e,"CrMo")||n(e,A)?A:n(e,w)&&n(e,R)?G:n(e,"FxiOS")?W:n(e.toLowerCase(),Q.toLowerCase())?Q:n(e,ae+"/")?ae:((e,r)=>r&&n(r,b)||function(e){return n(e,R)&&!n(e,A)&&!n(e,w)}(e))(e,r)?n(e,p)?L:R:n(e,"PaleMoon/")?ie:n(e,oe+"/")?oe:n(e,C)?C:n(e,"MSIE")||n(e,"Trident/")?B:n(e,"Gecko")?C:"")},ge={[D]:[new RegExp("rv:"+le)],[T]:[new RegExp(I+"?\\/"+le)],[A]:[new RegExp("("+A+"|CrMo)\\/"+le)],[P]:[new RegExp("CriOS\\/"+le)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+le)],[R]:[se],[L]:[se],[N]:[new RegExp("(Opera|OPR)\\/"+le)],[C]:[new RegExp(C+"\\/"+le)],[W]:[new RegExp("FxiOS\\/"+le)],[Q]:[new RegExp("Konqueror[:/]?"+le,"i")],[y]:[new RegExp(y+" "+le),se],[G]:[new RegExp("android\\s"+le,"i")],[k]:[new RegExp(S+"\\/"+le)],[Z]:[new RegExp("OculusBrowser\\/"+le)],[ee]:[new RegExp(ee+"\\/"+le)],[re]:[new RegExp("YaBrowser\\/"+le)],[ne]:[new RegExp(ne+"\\/"+le)],[ae]:[new RegExp(ae+"\\/"+le)],[te]:[new RegExp("(DuckDuckGo|Ddg)\\/"+le)],[ie]:[new RegExp("PaleMoon\\/"+le)],[oe]:[new RegExp(oe+"\\/"+le)],[ue]:[new RegExp("GSA\\/"+le)],[B]:[new RegExp("(rv:|MSIE )"+le)],Mozilla:[new RegExp("rv:"+le)]},we=function(e,r,n,t){var i=pe(e,r,n,t),o=ge[i];if(s(o))return null;for(var a=0;o.length>a;a++){var u=e.match(o[a]);if(u)return parseFloat(u[u.length-2])}return null},me=[[new RegExp(j+"; "+j+" (.*?)[);]","i"),e=>[j,e&&e[1]||""]],[new RegExp(z,"i"),[z,""]],[new RegExp(F,"i"),[F,""]],[ve,[y,""]],[new RegExp(K,"i"),(e,r)=>{if(/Phone/.test(r)||/WPDesktop/.test(r))return[V,""];if(new RegExp(p).test(r)&&!/IEMobile\b/.test(r))return[K+" "+p,""];var n=/Windows NT ([0-9.]+)/i.exec(r);if(n&&n[1]){var t=he[n[1]]||"";return/arm/i.test(r)&&(t="RT"),[K,t]}return[K,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[g,[e[3],e[4],e[5]||"0"].join(".")]:[g,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var r="";return e&&e.length>=3&&(r=s(e[2])?e[3]:e[2]),["watchOS",r]}],[new RegExp("("+w+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+w+")","i"),e=>e&&e[2]?[w,[e[2],e[3],e[4]||"0"].join(".")]:[w,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var r=["Mac OS X",""];return e&&e[1]&&(r[1]=[e[1],e[2],e[3]||"0"].join(".")),r}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[O,""]],[/Linux|debian/i,["Linux",""]]],_e=function(e){return fe.test(e)?z:de.test(e)?F:ce.test(e)?j:new RegExp(X,"i").test(e)?X:new RegExp("("+V+"|WPDesktop)","i").test(e)?V:/iPad/.test(e)?x:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?E:ve.test(e)?y:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(H,"i").test(e)?H:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(p).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?w:_:new RegExp("(pda|"+p+")","i").test(e)?q:new RegExp(m,"i").test(e)&&!new RegExp(m+" pc","i").test(e)?J:""},xe="undefined"!=typeof window?window:void 0,be="undefined"!=typeof globalThis?globalThis:xe;"undefined"==typeof self&&(be.self=be),"undefined"==typeof File&&(be.File=function(){});var Ee=null==be?void 0:be.navigator,Re=null==be?void 0:be.document,ye=null==be?void 0:be.location;null!=be&&be.XMLHttpRequest&&new be.XMLHttpRequest;var $e=null==Ee?void 0:Ee.userAgent,Me=null!=xe?xe:{},Se=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,t={k(r){if(xe&&(Me.POSTHOG_DEBUG||n)&&!s(xe.console)&&xe.console){for(var t=("__rrweb_original__"in xe.console[r]?xe.console[r].__rrweb_original__:xe.console[r]),i=arguments.length,o=new Array(i>1?i-1:0),a=1;i>a;a++)o[a-1]=arguments[a];t(e,...o)}},debug(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("debug",...r)},info(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("log",...r)},warn(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("warn",...r)},error(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];t.k("error",...r)},critical(){for(var r=arguments.length,n=new Array(r),t=0;r>t;t++)n[t]=arguments[t];console.error(e,...n)},uninitializedWarning(e){t.error("You must initialize PostHog before calling "+e)},createLogger:(r,n)=>Se(e+" "+r,n)};return t},ke=Se("[PostHog.js]"),Ae=ke.createLogger;function Oe(e,r){if(!c(e))if(a(e))e.forEach(r);else if(f(e))e.forEach(((e,n)=>r(e,n)));else for(var n in e)i.call(e,n)&&r(e[n],n)}var Pe=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),t=1;r>t;t++)n[t-1]=arguments[t];for(var i of n)for(var o in i)void 0!==i[o]&&(e[o]=i[o]);return e},Be=e=>{var r=null==Re?void 0:Re.createElement("a");return s(r)?null:(r.href=e,r)},De=function(e,r,n){if(!e||!r||!r.length)return e;for(var t=e.split("#"),i=t[1],o=(t[0]||"").split("?"),u=o[1],l=o[0],s=(u||"").split("&"),c=[],d=0;s.length>d;d++){var f=s[d].split("=");a(f)&&(r.includes(f[0])?c.push(f[0]+"="+n):c.push(s[d]))}var v=l;return null!=u&&(v+="?"+c.join("&")),null!=i&&(v+="#"+i),v};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return d(e)&&isFinite(e)&&Math.floor(e)===e});class Ne{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,t){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(t)||0>e||0>r||0>n||0>t||e>0xffffffffffff||r>4095||n>1073741823||t>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=t>>>24,i[13]=t>>>16,i[14]=t>>>8,i[15]=t,new Ne(i)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),3!==r&&5!==r&&7!==r&&9!==r||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Ne(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(0!==n)return Math.sign(n)}return 0}}class Ue{constructor(){this.S=0,this.C=0,this.I=new Ce}generate(){var e=this.generateOrAbort();if(s(e)){this.S=0;var r=this.generateOrAbort();if(s(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Ne.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Ie,Te=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var r=0;e.length>r;r++)e[r]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};xe&&!s(xe.crypto)&&crypto.getRandomValues&&(Te=e=>crypto.getRandomValues(e));class Ce{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Te(this.R),this.O=0),this.R[this.O++]}}var We=()=>(Ie||(Ie=new Ue)).generate(),ze="",Fe=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function je(e,r){if(r){var n=function(e,r){if(void 0===r&&(r=Re),ze)return ze;if(!r)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),t=Math.min(n.length,8),i="dmn_chk_"+We().toString();!ze&&t--;){var o=n.slice(t).join("."),a=i+"=1;domain=."+o+";path=/";r.cookie=a+";max-age=3",r.cookie.includes(i)&&(r.cookie=a+";max-age=0",ze=o)}return ze}(e);if(!n){var t=(e=>{var r=e.match(Fe);return r?r[0]:""})(e);t!==n&&ke.info("Warning: cookie subdomain discovery mismatch",t,n),n=t}return n?"; domain=."+n:""}return""}var Ge={N:()=>!!Re,D(e){ke.error("cookieStore error: "+e)},A(e){if(Re){try{for(var r=e+"=",n=Re.cookie.split(";").filter((e=>e.length)),t=0;n.length>t;t++){for(var i=n[t];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(r))return decodeURIComponent(i.substring(r.length,i.length))}}catch(e){}return null}},F(e){var r;try{r=JSON.parse(Ge.A(e))||{}}catch(e){}return r},q(e,r,n,t,i){if(!Re)return!1;try{var o="",a="",u=je(Re.location.hostname,t);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o="; expires="+l.toUTCString()}i&&(a="; secure");var s=e+"="+encodeURIComponent(JSON.stringify(r))+o+"; SameSite=Lax; path=/"+u+a;return s.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+s.length),Re.cookie=s,!0}catch(e){return!1}},P(e,r){if(null!=Re&&Re.cookie)try{Ge.q(e,"",-1,r)}catch(e){return}}},Le=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ke=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Le],Ve=["$app_build","$app_name","$app_namespace","$app_version","$browser","$browser_version","$device_type","$current_url","$pathname","$os","$os_name","$os_version","$referring_domain","$referrer","$screen_height","$screen_width","$viewport_height","$viewport_width","$raw_user_agent"],He="<masked>",Xe=["li_fat_id"];function Ye(e,r,n){if(!Re)return{};var t,i,o,u=r?[...Le,...n||[]]:[],l=(t=De(Re.URL,u,He),i=Ke.concat(e||[]),o={},Oe(i,(function(e){var r=function(e,r){for(var n,t=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;t.length>i;i++){var o=t[i].split("=");if(o[0]===r){n=o;break}}if(!a(n)||2>n.length)return"";var u=n[1];try{u=decodeURIComponent(u)}catch(e){ke.error("Skipping decoding for malformed query param: "+u)}return u.replace(/\+/g," ")}(t,e);o[e]=r||null})),o),s=function(){var e={};return Oe(Xe,(function(r){var n=Ge.A(r);e[r]=n||null})),e}();return Pe(s,l)}function qe(){return navigator.language||navigator.userLanguage}var Je="$direct";function Qe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Ze(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function er(r,n,t,i){var a,u,l,s;if(void 0===i&&(i=!1),!$e)return{};var c,f,v,h,g,w,b,R,y,M,S,k,A=r?[...Le,...n||[]]:[],[O,P]=function(e){for(var r=0;me.length>r;r++){var[n,t]=me[r],i=n.exec(e),o=i&&("function"==typeof t?t(i,e):t);if(o)return o}return["",""]}($e),B=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},D={detectGoogleSearchApp:t},N=Pe((S={$os:O,$os_version:P,$browser:pe($e,navigator.vendor,B,D),$device:_e($e),$device_type:(h=$e,g={userAgentDataPlatform:null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,maxTouchPoints:null==(u=navigator)?void 0:u.maxTouchPoints,screenWidth:null==xe||null==(l=xe.screen)?void 0:l.width,screenHeight:null==xe||null==(s=xe.screen)?void 0:s.height,devicePixelRatio:null==xe?void 0:xe.devicePixelRatio},M=_e(h),M===x||M===_||"Kobo"===M||"Kindle Fire"===M||M===J?m:M===z||M===j||M===F||M===X?"Console":M===E?"Wearable":M?p:"Android"===(null==g?void 0:g.userAgentDataPlatform)&&(null!==(w=null==g?void 0:g.maxTouchPoints)&&void 0!==w?w:0)>0?600>Math.min(null!==(b=null==g?void 0:g.screenWidth)&&void 0!==b?b:0,null!==(R=null==g?void 0:g.screenHeight)&&void 0!==R?R:0)/(null!==(y=null==g?void 0:g.devicePixelRatio)&&void 0!==y?y:1)?p:m:"Desktop"),$timezone:Qe(),$timezone_offset:Ze()},k={},Oe(S,(function(e,r){("[object String]"==o.call(e)&&e.length>0||d(e))&&(k[r]=e)})),k),{$current_url:De(i?(v=null==ye?void 0:ye.href,v?v.split("#")[0]:v):null==ye?void 0:ye.href,A,He),$host:null==ye?void 0:ye.host,$pathname:null==ye?void 0:ye.pathname,$raw_user_agent:$e.length>1e3?$e.substring(0,997)+"...":$e,$browser_version:we($e,navigator.vendor,B,D),$browser_language:qe(),$browser_language_prefix:(f=qe(),"string"==typeof f?f.split("-")[0]:void 0),$screen_height:null==xe?void 0:xe.screen.height,$screen_width:null==xe?void 0:xe.screen.width,$viewport_height:null==xe?void 0:xe.innerHeight,$viewport_width:null==xe?void 0:xe.innerWidth,$lib:e.LIB_NAME,$lib_version:e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return e.SDK_DIST_CHANNEL&&(N.$sdk_dist_channel=e.SDK_DIST_CHANNEL),N}var rr=e=>{var r,t=Pe({},er(e.config.mask_personal_data_properties,e.config.custom_personal_data_properties,e.config.detect_google_search_app,e.config.disable_capture_url_hashes),Ye(e.config.custom_campaign_params,e.config.mask_personal_data_properties,e.config.custom_personal_data_properties),{$referrer:(null==Re?void 0:Re.referrer)||Je,$referring_domain:null!=Re&&Re.referrer&&(null==(r=Be(Re.referrer))?void 0:r.host)||Je}),i={};Oe(t,(function(e,r){(n(Ke,r)||n(Ve,r))&&(i[r]=e)})),e.setPersonPropertiesForFlags(i)};function nr(e,r){return[...e||[],...a(r)?r:[r]]}function tr(e,r){return(s(e)?1:e)*r}function ir(e,r){return function(e){for(var r=0,n=0;e.length>n;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return Math.abs(r)}(e)%100<v(100*r,0,100,ke)}function or(e){return n=>n&&ir(n.properties.distinct_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:["sampleByDistinctId"],$sample_threshold:e})}):null}function ar(e){return n=>n&&ir(n.properties.$session_id,e)?r({},n,{properties:r({},n.properties,{$sample_type:nr(n.properties.$sample_type,"sampleBySessionId"),$sample_threshold:tr(n.properties.$sample_threshold,e)})}):null}function ur(e,t){return i=>{var o,a,u;return i?n(e,i.event)?100*Math.random()<v(100*t,0,100,ke)?r({},i,{properties:r({},i.properties,{$sample_type:nr(null==(o=i.properties)?void 0:o.$sample_type,"sampleByEvent"),$sample_threshold:tr(null==(a=i.properties)?void 0:a.$sample_threshold,t),$sampled_events:nr(null==(u=i.properties)?void 0:u.$sampled_events,e)})}):null:i:null}}var lr=e=>(console.log("Would have sent event:",e),null),sr=["type"];function cr(e){var{type:r,executionTimeMs:n}=e;return r+(c(n)?"":" ("+n.toFixed(2)+"ms)")}var dr=Ae("[PostHog Action RateLimiting]");function fr(e,r){console.log(e,r)}var vr=e=>(r,n)=>{var t;null==e||null==(t=e.sessionRecording)||t.tryAddCustomEvent("app-state",{title:r,stateEvent:n})};function hr(e,r,n){if(void 0===n&&(n=5),"object"!=typeof e||"object"!=typeof r)return{};if(e===r)return{};if(!e&&r)return r;if(!r||!e)return{};var t={},i=new Set([...Object.keys(e),...Object.keys(r)]);for(var o of i){var a=e[o],d=r[o];if(s(a))t[o]=d;else if(s(d))t[o]=a;else if(!(a===d||c(a)&&c(d)))if(u(a)&&u(d))if(n>1){var f=hr(a,d,n-1);l(f)||(t[o]=f)}else t[o]="max depth reached, checking for changed value";else t[o]=d}return t}var pr,gr,wr,mr=(pr=null,gr=0,wr=null,{info(e){wr!==e&&(gr=0,wr=e),gr++,pr&&clearTimeout(pr),pr=setTimeout((()=>{dr.info(1===gr?'action "'+e+'" has been rate limited':'action "'+e+'" has been rate limited ('+gr+" times)"),gr=0,pr=null}),1e3)}});function _r(e){void 0===e&&(e={});var r=xr(e);return{name:"posthog-kea-logger",events:{beforeReduxStore(e){e.middleware.push(r)}}}}function xr(e){void 0===e&&(e={});var{maskAction:r,maskState:n,titleFunction:t=cr,logger:i=fr,include:o={prevState:!0,nextState:!1,changedState:!0},rateLimiterRefillRate:a=1,rateLimiterBucketSize:u=10,__stateComparisonDepth:l}=e,s=new h({refillRate:a,bucketSize:u,refillInterval:1e3,Ae:dr});return e=>a=>u=>{var c=u,d=e.getState(),f=performance.now(),v=a(c),h=performance.now()-f,p=e.getState(),g=r?r(c):c;if(!g)return v;if(s.consumeRateLimit(c.type))mr.info(c.type);else try{var w=n?n(d,g):d,m=n?n(p,g):p,_=o.changedState?hr(w,m,null!=l?l:5):void 0,{type:x}=g,b={type:x,payload:function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(g,sr),timestamp:Date.now(),executionTimeMs:h,prevState:o.prevState?w:void 0,nextState:o.nextState?m:void 0,changedState:o.changedState?_:void 0},E=t(b);i(E,b)}catch(e){dr.error("Error logging state:",e)}return v}}export{fr as browserConsoleLogger,_r as posthogKeaLogger,xr as posthogReduxLogger,lr as printAndDropEverything,or as sampleByDistinctId,ur as sampleByEvent,ar as sampleBySessionId,vr as sessionRecordingLoggerForPostHogInstance,rr as setAllPersonProfilePropertiesAsPersonPropertiesForFlags}; | ||
| //# sourceMappingURL=customizations.js.map |
@@ -33,2 +33,3 @@ /** | ||
| hideCancelButton?: boolean; | ||
| disableAutofocus?: boolean; | ||
| position?: SurveyPosition; | ||
@@ -35,0 +36,0 @@ widgetType?: SurveyWidgetType; |
+1
-1
| { | ||
| "name": "posthog-js", | ||
| "version": "1.397.0", | ||
| "version": "1.398.0", | ||
| "bugs": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/PostHog/posthog-js/issues" |
@@ -97,3 +97,7 @@ "use strict"; | ||
| }), 2), text = _b[0], setText = _b[1]; | ||
| var disableAutofocus = appearance === null || appearance === void 0 ? void 0 : appearance.disableAutofocus; | ||
| (0, hooks_1.useEffect)(function () { | ||
| if (disableAutofocus) { | ||
| return; | ||
| } | ||
| setTimeout(function () { | ||
@@ -105,3 +109,3 @@ var _a; | ||
| }, 100); | ||
| }, [isPreviewMode]); | ||
| }, [isPreviewMode, disableAutofocus]); | ||
| var htmlFor = "surveyQuestion".concat(displayQuestionIndex); | ||
@@ -108,0 +112,0 @@ // Validation logic |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"QuestionTypes.js","sourceRoot":"","sources":["../../../../../src/extensions/surveys/components/QuestionTypes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,4CA4FC;AAED,oCA4BC;AAED,wCAsHC;AAED,oCAwBC;AAED,wDAmNC;;AApjBD,iCAA2C;AAC3C,sCAAmE;AACnE,wEAOuC;AACvC,sCAAyF;AACzF,iDAAmG;AACnG,kCAQiB;AACjB,sEAAqF;AACrF,iDAA+C;AAC/C,mDAAiD;AAkBjD,IAAM,kBAAkB,GAAG,UAAC,KAAc;IACtC,OAAO,IAAA,cAAO,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,UAAC,IAAI,IAAK,OAAA,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAd,CAAc,CAAC,CAAA;AAClE,CAAC,CAAA;AAED,IAAM,yBAAyB,GAAG,UAC9B,YAA2D,EAC3D,YAAgC;IAEhC,IAAI,IAAA,eAAQ,EAAC,YAAY,CAAC,EAAE,CAAC;QACzB,OAAO,YAAY,CAAA;IACvB,CAAC;IACD,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;QACnC,OAAO,YAAY,CAAA;IACvB,CAAC;IACD,OAAO,YAAY,KAAK,0CAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;AACvE,CAAC,CAAA;AAED,IAAM,wBAAwB,GAAG,UAC7B,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AAE,YAAY,EACtB,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GAChB,IACK,CACd,CAAA;AACL,CAAC;AAED,IAAM,gBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AACxC,IAAM,iBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/C,IAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAE1D,IAAM,eAAe,GAAkE;IACnF,CAAC,EAAE,CAAC,qBAAa,EAAE,uBAAe,CAAC;IACnC,CAAC,EAAE,CAAC,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,CAAC;IACpD,CAAC,EAAE,CAAC,6BAAqB,EAAE,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,EAAE,0BAAkB,CAAC;CAClG,CAAA;AAED,SAAS,eAAe,CAAC,KAAa;IAClC,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,CAAC;YACF,OAAO,gBAAgB,CAAA;QAC3B,KAAK,CAAC;YACF,OAAO,iBAAiB,CAAA;QAC5B,KAAK,EAAE;YACH,OAAO,eAAe,CAAA;QAC1B;YACI,OAAO,gBAAgB,CAAA;IAC/B,CAAC;AACL,CAAC","sourcesContent":["import { Fragment, type JSX } from 'preact'\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks'\nimport {\n BasicSurveyQuestion,\n LinkSurveyQuestion,\n MultipleSurveyQuestion,\n RatingSurveyQuestion,\n SurveyAppearance,\n SurveyQuestionType,\n} from '../../../posthog-surveys-types'\nimport { isArray, isNull, isNumber, isString, SurveyValidationType } from '@posthog/core'\nimport { getValidationError, getLengthFromRules, getRequirementsHint } from '@posthog/core/surveys'\nimport {\n dissatisfiedEmoji,\n neutralEmoji,\n satisfiedEmoji,\n thumbsDownEmoji,\n thumbsUpEmoji,\n veryDissatisfiedEmoji,\n verySatisfiedEmoji,\n} from '../icons'\nimport { getDisplayOrderChoices, useSurveyContext } from '../surveys-extension-utils'\nimport { BottomSection } from './BottomSection'\nimport { QuestionHeader } from './QuestionHeader'\n\nexport interface CommonQuestionProps {\n forceDisableHtml: boolean\n appearance: SurveyAppearance\n onSubmit: (res: string | string[] | number | null) => void\n onPreviewSubmit: (res: string | string[] | number | null) => void\n initialValue?: string | string[] | number | null\n displayQuestionIndex: number\n canGoBack?: boolean\n onBack?: () => void\n}\n\ninterface OpenEndedInputState {\n isSelected: boolean\n inputValue: string\n}\n\nconst isValidStringArray = (value: unknown): value is string[] => {\n return isArray(value) && value.every((item) => isString(item))\n}\n\nconst initializeSelectedChoices = (\n initialValue: string | string[] | number | null | undefined,\n questionType: SurveyQuestionType\n): string | string[] | null => {\n if (isString(initialValue)) {\n return initialValue\n }\n if (isValidStringArray(initialValue)) {\n return initialValue\n }\n return questionType === SurveyQuestionType.SingleChoice ? null : []\n}\n\nconst initializeOpenEndedState = (\n initialValue: string | string[] | number | null | undefined,\n choices: string[]\n): OpenEndedInputState => {\n if (isString(initialValue) && !choices.includes(initialValue)) {\n return {\n isSelected: true,\n inputValue: initialValue,\n }\n }\n if (isValidStringArray(initialValue)) {\n const openEndedValue = initialValue.find((choice) => !choices.includes(choice))\n if (openEndedValue) {\n return {\n isSelected: true,\n inputValue: openEndedValue,\n }\n }\n }\n return {\n isSelected: false,\n inputValue: '',\n }\n}\n\nexport function OpenTextQuestion({\n question,\n forceDisableHtml,\n appearance,\n onSubmit,\n onPreviewSubmit,\n displayQuestionIndex,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: BasicSurveyQuestion\n}) {\n const { isPreviewMode } = useSurveyContext()\n const inputRef = useRef<HTMLTextAreaElement>(null)\n const [text, setText] = useState<string>(() => {\n if (isString(initialValue)) {\n return initialValue\n }\n return ''\n })\n useEffect(() => {\n setTimeout(() => {\n if (!isPreviewMode) {\n inputRef.current?.focus()\n }\n }, 100)\n }, [isPreviewMode])\n\n const htmlFor = `surveyQuestion${displayQuestionIndex}`\n\n // Validation logic\n const validationError = useMemo(() => {\n return getValidationError(text, question.validation, question.optional)\n }, [text, question.validation, question.optional])\n\n // Build requirements hint message\n const minLength = getLengthFromRules(question.validation, SurveyValidationType.MinLength)\n const maxLength = getLengthFromRules(question.validation, SurveyValidationType.MaxLength)\n const requirementsHint = useMemo(() => getRequirementsHint(minLength, maxLength), [minLength, maxLength])\n\n const handleSubmit = () => {\n if (validationError) {\n return\n }\n onSubmit(text.trim())\n }\n\n const handlePreviewSubmit = () => {\n if (validationError) {\n return\n }\n onPreviewSubmit(text.trim())\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} htmlFor={htmlFor} />\n <textarea\n ref={inputRef}\n id={htmlFor}\n rows={4}\n placeholder={appearance?.placeholder}\n minLength={minLength}\n maxLength={maxLength}\n onInput={(e) => {\n setText(e.currentTarget.value)\n e.stopPropagation()\n }}\n onKeyDown={(e) => {\n e.stopPropagation()\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !validationError) {\n e.preventDefault()\n isPreviewMode ? handlePreviewSubmit() : handleSubmit()\n }\n }}\n value={text}\n />\n {requirementsHint && <div className=\"validation-hint\">{requirementsHint}</div>}\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={!!validationError}\n appearance={appearance}\n onSubmit={handleSubmit}\n onPreviewSubmit={handlePreviewSubmit}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function LinkQuestion({\n question,\n forceDisableHtml,\n appearance,\n onSubmit,\n onPreviewSubmit,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: LinkSurveyQuestion\n}) {\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={false}\n link={question.link}\n appearance={appearance}\n onSubmit={() => onSubmit('link clicked')}\n onPreviewSubmit={() => onPreviewSubmit('link clicked')}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function RatingQuestion({\n question,\n forceDisableHtml,\n displayQuestionIndex,\n appearance,\n onSubmit,\n onPreviewSubmit,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: RatingSurveyQuestion\n}) {\n const scale = question.scale\n const starting = question.scale === 10 ? 0 : 1\n const [rating, setRating] = useState<number | null>(() => {\n if (isNumber(initialValue)) {\n return initialValue\n }\n if (isArray(initialValue) && initialValue.length > 0 && isNumber(parseInt(initialValue[0]))) {\n return parseInt(initialValue[0])\n }\n if (isString(initialValue) && isNumber(parseInt(initialValue))) {\n return parseInt(initialValue)\n }\n return null\n })\n\n const isThumbSurvey = question.display === 'emoji' && question.scale === 2\n\n const { isPreviewMode } = useSurveyContext()\n\n const handleSubmit = (num: number) => {\n if (isPreviewMode) {\n return onPreviewSubmit(num)\n }\n return onSubmit(num)\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n <div className=\"rating-section\">\n <div className=\"rating-options\">\n {question.display === 'emoji' && (\n <div className={`rating-options-emoji${isThumbSurvey ? ' rating-options-emoji-2' : ''}`}>\n {emojiScaleLists[question.scale]?.map((emoji, idx) => {\n const active = idx + 1 === rating\n return (\n <button\n aria-label={`Rate ${idx + 1}`}\n className={`ratings-emoji question-${displayQuestionIndex}-rating-${idx} ${\n active ? 'rating-active' : ''\n }`}\n value={idx + 1}\n key={idx}\n type=\"button\"\n onClick={() => {\n const response = idx + 1\n setRating(response)\n if (question.skipSubmitButton) {\n handleSubmit(response)\n }\n }}\n >\n {emoji}\n </button>\n )\n })}\n </div>\n )}\n {question.display === 'number' && (\n <div\n className=\"rating-options-number\"\n style={{ gridTemplateColumns: `repeat(${scale - starting + 1}, minmax(0, 1fr))` }}\n >\n {getScaleNumbers(question.scale).map((number, idx) => {\n const active = rating === number\n return (\n <RatingButton\n key={idx}\n displayQuestionIndex={displayQuestionIndex}\n active={active}\n appearance={appearance}\n num={number}\n setActiveNumber={(response) => {\n setRating(response)\n if (question.skipSubmitButton) {\n handleSubmit(response)\n }\n }}\n />\n )\n })}\n </div>\n )}\n </div>\n {!isThumbSurvey && (\n <div className=\"rating-text\">\n <div>{question.lowerBoundLabel}</div>\n <div>{question.upperBoundLabel}</div>\n </div>\n )}\n </div>\n </div>\n <BottomSection\n text={question.buttonText || appearance?.submitButtonText || 'Submit'}\n submitDisabled={isNull(rating) && !question.optional}\n appearance={appearance}\n onSubmit={() => onSubmit(rating)}\n onPreviewSubmit={() => onPreviewSubmit(rating)}\n skipSubmitButton={question.skipSubmitButton}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function RatingButton({\n num,\n active,\n displayQuestionIndex,\n setActiveNumber,\n}: {\n num: number\n active: boolean\n displayQuestionIndex: number\n appearance: SurveyAppearance\n setActiveNumber: (num: number) => void\n}) {\n return (\n <button\n aria-label={`Rate ${num}`}\n className={`ratings-number question-${displayQuestionIndex}-rating-${num} ${active ? 'rating-active' : ''}`}\n type=\"button\"\n onClick={() => {\n setActiveNumber(num)\n }}\n >\n {num}\n </button>\n )\n}\n\nexport function MultipleChoiceQuestion({\n question,\n forceDisableHtml,\n displayQuestionIndex,\n appearance,\n onSubmit,\n onPreviewSubmit,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: MultipleSurveyQuestion\n}) {\n const openChoiceInputRef = useRef<HTMLInputElement>(null)\n const choices = useMemo(() => getDisplayOrderChoices(question), [question])\n const [selectedChoices, setSelectedChoices] = useState<string | string[] | null>(() =>\n initializeSelectedChoices(initialValue, question.type)\n )\n const [openEndedState, setOpenEndedState] = useState<OpenEndedInputState>(() =>\n initializeOpenEndedState(initialValue, choices)\n )\n\n const { isPreviewMode } = useSurveyContext()\n\n const isSingleChoiceQuestion = question.type === SurveyQuestionType.SingleChoice\n const isMultipleChoiceQuestion = question.type === SurveyQuestionType.MultipleChoice\n\n const shouldSkipSubmit = question.skipSubmitButton && isSingleChoiceQuestion && !question.hasOpenChoice\n\n const handleChoiceChange = (val: string, isOpenChoice: boolean) => {\n if (isOpenChoice) {\n const newOpenSelected = !openEndedState.isSelected\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: newOpenSelected,\n inputValue: newOpenSelected ? prev.inputValue : '',\n }))\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices('')\n }\n\n // Focus the input when open choice is selected, slight delay because of the animation\n if (newOpenSelected) {\n setTimeout(() => openChoiceInputRef.current?.focus(), 75)\n }\n return\n }\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices(val)\n // Deselect open choice when selecting another option\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: false,\n inputValue: '',\n }))\n\n if (shouldSkipSubmit) {\n onSubmit(val)\n if (isPreviewMode) {\n onPreviewSubmit(val)\n }\n }\n return\n }\n\n if (isMultipleChoiceQuestion && isArray(selectedChoices)) {\n if (selectedChoices.includes(val)) {\n setSelectedChoices(selectedChoices.filter((choice) => choice !== val))\n } else {\n setSelectedChoices([...selectedChoices, val])\n }\n }\n }\n\n const handleOpenEndedInputChange = (e: JSX.TargetedEvent<HTMLInputElement>) => {\n e.stopPropagation()\n const newValue = e.currentTarget.value\n\n setOpenEndedState((prev) => ({\n ...prev,\n inputValue: newValue,\n }))\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices(newValue)\n }\n }\n\n const handleOpenEndedKeyDown = (e: JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n e.stopPropagation()\n\n // Handle Enter key to submit form if valid\n if (e.key === 'Enter' && !isSubmitDisabled()) {\n e.preventDefault()\n handleSubmit()\n }\n\n // Handle Escape key to clear input and deselect\n if (e.key === 'Escape') {\n e.preventDefault()\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: false,\n inputValue: '',\n }))\n if (isSingleChoiceQuestion) {\n setSelectedChoices(null)\n }\n }\n }\n\n const isSubmitDisabled = (): boolean => {\n if (question.optional) {\n return false\n }\n if (isNull(selectedChoices)) {\n return true\n }\n if (isArray(selectedChoices)) {\n if (!openEndedState.isSelected && selectedChoices.length === 0) {\n return true\n }\n }\n if (openEndedState.isSelected && openEndedState.inputValue.trim() === '') {\n return true\n }\n return false\n }\n\n const handleSubmit = () => {\n if (openEndedState.isSelected && isMultipleChoiceQuestion) {\n if (isArray(selectedChoices)) {\n isPreviewMode\n ? onPreviewSubmit([...selectedChoices, openEndedState.inputValue])\n : onSubmit([...selectedChoices, openEndedState.inputValue])\n }\n } else {\n isPreviewMode ? onPreviewSubmit(selectedChoices) : onSubmit(selectedChoices)\n }\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n <fieldset className=\"multiple-choice-options limit-height\">\n <legend className=\"sr-only\">\n {isMultipleChoiceQuestion ? ' Select all that apply' : ' Select one'}\n </legend>\n {choices.map((choice: string, idx: number) => {\n const isOpenChoice = !!question.hasOpenChoice && idx === question.choices.length - 1\n const inputId = `surveyQuestion${displayQuestionIndex}Choice${idx}`\n const openInputId = `${inputId}Open`\n\n const isChecked = isOpenChoice\n ? openEndedState.isSelected\n : isSingleChoiceQuestion\n ? selectedChoices === choice\n : isArray(selectedChoices) && selectedChoices.includes(choice)\n\n return (\n <label className={isOpenChoice ? 'choice-option-open' : ''} key={idx}>\n <div className=\"response-choice\">\n <input\n type={isSingleChoiceQuestion ? 'radio' : 'checkbox'}\n name={inputId}\n checked={isChecked}\n onChange={() => handleChoiceChange(choice, isOpenChoice)}\n id={inputId}\n aria-controls={openInputId}\n />\n <span>{isOpenChoice ? `${choice}:` : choice}</span>\n </div>\n {isOpenChoice && (\n <input\n type=\"text\"\n ref={openChoiceInputRef}\n id={openInputId}\n name={`question${displayQuestionIndex}Open`}\n value={openEndedState.inputValue}\n onKeyDown={handleOpenEndedKeyDown}\n onInput={handleOpenEndedInputChange}\n onClick={(e) => {\n // Ensure the checkbox/radio gets checked when clicking the input\n if (!openEndedState.isSelected) {\n handleChoiceChange(choice, true)\n }\n e.stopPropagation()\n }}\n aria-label={`${choice} - please specify`}\n />\n )}\n </label>\n )\n })}\n </fieldset>\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={isSubmitDisabled()}\n appearance={appearance}\n onSubmit={handleSubmit}\n onPreviewSubmit={handleSubmit}\n skipSubmitButton={shouldSkipSubmit}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nconst fiveScaleNumbers = [1, 2, 3, 4, 5]\nconst sevenScaleNumbers = [1, 2, 3, 4, 5, 6, 7]\nconst tenScaleNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nconst emojiScaleLists: Partial<Record<RatingSurveyQuestion['scale'], JSX.Element[]>> = {\n 2: [thumbsUpEmoji, thumbsDownEmoji],\n 3: [dissatisfiedEmoji, neutralEmoji, satisfiedEmoji],\n 5: [veryDissatisfiedEmoji, dissatisfiedEmoji, neutralEmoji, satisfiedEmoji, verySatisfiedEmoji],\n}\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return fiveScaleNumbers\n case 7:\n return sevenScaleNumbers\n case 10:\n return tenScaleNumbers\n default:\n return fiveScaleNumbers\n }\n}\n"]} | ||
| {"version":3,"file":"QuestionTypes.js","sourceRoot":"","sources":["../../../../../src/extensions/surveys/components/QuestionTypes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,4CAgGC;AAED,oCA4BC;A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E,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/C,IAAM,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAE1D,IAAM,eAAe,GAAkE;IACnF,CAAC,EAAE,CAAC,qBAAa,EAAE,uBAAe,CAAC;IACnC,CAAC,EAAE,CAAC,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,CAAC;IACpD,CAAC,EAAE,CAAC,6BAAqB,EAAE,yBAAiB,EAAE,oBAAY,EAAE,sBAAc,EAAE,0BAAkB,CAAC;CAClG,CAAA;AAED,SAAS,eAAe,CAAC,KAAa;IAClC,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,CAAC;YACF,OAAO,gBAAgB,CAAA;QAC3B,KAAK,CAAC;YACF,OAAO,iBAAiB,CAAA;QAC5B,KAAK,EAAE;YACH,OAAO,eAAe,CAAA;QAC1B;YACI,OAAO,gBAAgB,CAAA;IAC/B,CAAC;AACL,CAAC","sourcesContent":["import { Fragment, type JSX } from 'preact'\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks'\nimport {\n BasicSurveyQuestion,\n LinkSurveyQuestion,\n MultipleSurveyQuestion,\n RatingSurveyQuestion,\n SurveyAppearance,\n SurveyQuestionType,\n} from '../../../posthog-surveys-types'\nimport { isArray, isNull, isNumber, isString, SurveyValidationType } from '@posthog/core'\nimport { getValidationError, getLengthFromRules, getRequirementsHint } from '@posthog/core/surveys'\nimport {\n dissatisfiedEmoji,\n neutralEmoji,\n satisfiedEmoji,\n thumbsDownEmoji,\n thumbsUpEmoji,\n veryDissatisfiedEmoji,\n verySatisfiedEmoji,\n} from '../icons'\nimport { getDisplayOrderChoices, useSurveyContext } from '../surveys-extension-utils'\nimport { BottomSection } from './BottomSection'\nimport { QuestionHeader } from './QuestionHeader'\n\nexport interface CommonQuestionProps {\n forceDisableHtml: boolean\n appearance: SurveyAppearance\n onSubmit: (res: string | string[] | number | null) => void\n onPreviewSubmit: (res: string | string[] | number | null) => void\n initialValue?: string | string[] | number | null\n displayQuestionIndex: number\n canGoBack?: boolean\n onBack?: () => void\n}\n\ninterface OpenEndedInputState {\n isSelected: boolean\n inputValue: string\n}\n\nconst isValidStringArray = (value: unknown): value is string[] => {\n return isArray(value) && value.every((item) => isString(item))\n}\n\nconst initializeSelectedChoices = (\n initialValue: string | string[] | number | null | undefined,\n questionType: SurveyQuestionType\n): string | string[] | null => {\n if (isString(initialValue)) {\n return initialValue\n }\n if (isValidStringArray(initialValue)) {\n return initialValue\n }\n return questionType === SurveyQuestionType.SingleChoice ? null : []\n}\n\nconst initializeOpenEndedState = (\n initialValue: string | string[] | number | null | undefined,\n choices: string[]\n): OpenEndedInputState => {\n if (isString(initialValue) && !choices.includes(initialValue)) {\n return {\n isSelected: true,\n inputValue: initialValue,\n }\n }\n if (isValidStringArray(initialValue)) {\n const openEndedValue = initialValue.find((choice) => !choices.includes(choice))\n if (openEndedValue) {\n return {\n isSelected: true,\n inputValue: openEndedValue,\n }\n }\n }\n return {\n isSelected: false,\n inputValue: '',\n }\n}\n\nexport function OpenTextQuestion({\n question,\n forceDisableHtml,\n appearance,\n onSubmit,\n onPreviewSubmit,\n displayQuestionIndex,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: BasicSurveyQuestion\n}) {\n const { isPreviewMode } = useSurveyContext()\n const inputRef = useRef<HTMLTextAreaElement>(null)\n const [text, setText] = useState<string>(() => {\n if (isString(initialValue)) {\n return initialValue\n }\n return ''\n })\n const disableAutofocus = appearance?.disableAutofocus\n useEffect(() => {\n if (disableAutofocus) {\n return\n }\n setTimeout(() => {\n if (!isPreviewMode) {\n inputRef.current?.focus()\n }\n }, 100)\n }, [isPreviewMode, disableAutofocus])\n\n const htmlFor = `surveyQuestion${displayQuestionIndex}`\n\n // Validation logic\n const validationError = useMemo(() => {\n return getValidationError(text, question.validation, question.optional)\n }, [text, question.validation, question.optional])\n\n // Build requirements hint message\n const minLength = getLengthFromRules(question.validation, SurveyValidationType.MinLength)\n const maxLength = getLengthFromRules(question.validation, SurveyValidationType.MaxLength)\n const requirementsHint = useMemo(() => getRequirementsHint(minLength, maxLength), [minLength, maxLength])\n\n const handleSubmit = () => {\n if (validationError) {\n return\n }\n onSubmit(text.trim())\n }\n\n const handlePreviewSubmit = () => {\n if (validationError) {\n return\n }\n onPreviewSubmit(text.trim())\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} htmlFor={htmlFor} />\n <textarea\n ref={inputRef}\n id={htmlFor}\n rows={4}\n placeholder={appearance?.placeholder}\n minLength={minLength}\n maxLength={maxLength}\n onInput={(e) => {\n setText(e.currentTarget.value)\n e.stopPropagation()\n }}\n onKeyDown={(e) => {\n e.stopPropagation()\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !validationError) {\n e.preventDefault()\n isPreviewMode ? handlePreviewSubmit() : handleSubmit()\n }\n }}\n value={text}\n />\n {requirementsHint && <div className=\"validation-hint\">{requirementsHint}</div>}\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={!!validationError}\n appearance={appearance}\n onSubmit={handleSubmit}\n onPreviewSubmit={handlePreviewSubmit}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function LinkQuestion({\n question,\n forceDisableHtml,\n appearance,\n onSubmit,\n onPreviewSubmit,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: LinkSurveyQuestion\n}) {\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={false}\n link={question.link}\n appearance={appearance}\n onSubmit={() => onSubmit('link clicked')}\n onPreviewSubmit={() => onPreviewSubmit('link clicked')}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function RatingQuestion({\n question,\n forceDisableHtml,\n displayQuestionIndex,\n appearance,\n onSubmit,\n onPreviewSubmit,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: RatingSurveyQuestion\n}) {\n const scale = question.scale\n const starting = question.scale === 10 ? 0 : 1\n const [rating, setRating] = useState<number | null>(() => {\n if (isNumber(initialValue)) {\n return initialValue\n }\n if (isArray(initialValue) && initialValue.length > 0 && isNumber(parseInt(initialValue[0]))) {\n return parseInt(initialValue[0])\n }\n if (isString(initialValue) && isNumber(parseInt(initialValue))) {\n return parseInt(initialValue)\n }\n return null\n })\n\n const isThumbSurvey = question.display === 'emoji' && question.scale === 2\n\n const { isPreviewMode } = useSurveyContext()\n\n const handleSubmit = (num: number) => {\n if (isPreviewMode) {\n return onPreviewSubmit(num)\n }\n return onSubmit(num)\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n <div className=\"rating-section\">\n <div className=\"rating-options\">\n {question.display === 'emoji' && (\n <div className={`rating-options-emoji${isThumbSurvey ? ' rating-options-emoji-2' : ''}`}>\n {emojiScaleLists[question.scale]?.map((emoji, idx) => {\n const active = idx + 1 === rating\n return (\n <button\n aria-label={`Rate ${idx + 1}`}\n className={`ratings-emoji question-${displayQuestionIndex}-rating-${idx} ${\n active ? 'rating-active' : ''\n }`}\n value={idx + 1}\n key={idx}\n type=\"button\"\n onClick={() => {\n const response = idx + 1\n setRating(response)\n if (question.skipSubmitButton) {\n handleSubmit(response)\n }\n }}\n >\n {emoji}\n </button>\n )\n })}\n </div>\n )}\n {question.display === 'number' && (\n <div\n className=\"rating-options-number\"\n style={{ gridTemplateColumns: `repeat(${scale - starting + 1}, minmax(0, 1fr))` }}\n >\n {getScaleNumbers(question.scale).map((number, idx) => {\n const active = rating === number\n return (\n <RatingButton\n key={idx}\n displayQuestionIndex={displayQuestionIndex}\n active={active}\n appearance={appearance}\n num={number}\n setActiveNumber={(response) => {\n setRating(response)\n if (question.skipSubmitButton) {\n handleSubmit(response)\n }\n }}\n />\n )\n })}\n </div>\n )}\n </div>\n {!isThumbSurvey && (\n <div className=\"rating-text\">\n <div>{question.lowerBoundLabel}</div>\n <div>{question.upperBoundLabel}</div>\n </div>\n )}\n </div>\n </div>\n <BottomSection\n text={question.buttonText || appearance?.submitButtonText || 'Submit'}\n submitDisabled={isNull(rating) && !question.optional}\n appearance={appearance}\n onSubmit={() => onSubmit(rating)}\n onPreviewSubmit={() => onPreviewSubmit(rating)}\n skipSubmitButton={question.skipSubmitButton}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nexport function RatingButton({\n num,\n active,\n displayQuestionIndex,\n setActiveNumber,\n}: {\n num: number\n active: boolean\n displayQuestionIndex: number\n appearance: SurveyAppearance\n setActiveNumber: (num: number) => void\n}) {\n return (\n <button\n aria-label={`Rate ${num}`}\n className={`ratings-number question-${displayQuestionIndex}-rating-${num} ${active ? 'rating-active' : ''}`}\n type=\"button\"\n onClick={() => {\n setActiveNumber(num)\n }}\n >\n {num}\n </button>\n )\n}\n\nexport function MultipleChoiceQuestion({\n question,\n forceDisableHtml,\n displayQuestionIndex,\n appearance,\n onSubmit,\n onPreviewSubmit,\n initialValue,\n canGoBack,\n onBack,\n}: CommonQuestionProps & {\n question: MultipleSurveyQuestion\n}) {\n const openChoiceInputRef = useRef<HTMLInputElement>(null)\n const choices = useMemo(() => getDisplayOrderChoices(question), [question])\n const [selectedChoices, setSelectedChoices] = useState<string | string[] | null>(() =>\n initializeSelectedChoices(initialValue, question.type)\n )\n const [openEndedState, setOpenEndedState] = useState<OpenEndedInputState>(() =>\n initializeOpenEndedState(initialValue, choices)\n )\n\n const { isPreviewMode } = useSurveyContext()\n\n const isSingleChoiceQuestion = question.type === SurveyQuestionType.SingleChoice\n const isMultipleChoiceQuestion = question.type === SurveyQuestionType.MultipleChoice\n\n const shouldSkipSubmit = question.skipSubmitButton && isSingleChoiceQuestion && !question.hasOpenChoice\n\n const handleChoiceChange = (val: string, isOpenChoice: boolean) => {\n if (isOpenChoice) {\n const newOpenSelected = !openEndedState.isSelected\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: newOpenSelected,\n inputValue: newOpenSelected ? prev.inputValue : '',\n }))\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices('')\n }\n\n // Focus the input when open choice is selected, slight delay because of the animation\n if (newOpenSelected) {\n setTimeout(() => openChoiceInputRef.current?.focus(), 75)\n }\n return\n }\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices(val)\n // Deselect open choice when selecting another option\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: false,\n inputValue: '',\n }))\n\n if (shouldSkipSubmit) {\n onSubmit(val)\n if (isPreviewMode) {\n onPreviewSubmit(val)\n }\n }\n return\n }\n\n if (isMultipleChoiceQuestion && isArray(selectedChoices)) {\n if (selectedChoices.includes(val)) {\n setSelectedChoices(selectedChoices.filter((choice) => choice !== val))\n } else {\n setSelectedChoices([...selectedChoices, val])\n }\n }\n }\n\n const handleOpenEndedInputChange = (e: JSX.TargetedEvent<HTMLInputElement>) => {\n e.stopPropagation()\n const newValue = e.currentTarget.value\n\n setOpenEndedState((prev) => ({\n ...prev,\n inputValue: newValue,\n }))\n\n if (isSingleChoiceQuestion) {\n setSelectedChoices(newValue)\n }\n }\n\n const handleOpenEndedKeyDown = (e: JSX.TargetedKeyboardEvent<HTMLInputElement>) => {\n e.stopPropagation()\n\n // Handle Enter key to submit form if valid\n if (e.key === 'Enter' && !isSubmitDisabled()) {\n e.preventDefault()\n handleSubmit()\n }\n\n // Handle Escape key to clear input and deselect\n if (e.key === 'Escape') {\n e.preventDefault()\n setOpenEndedState((prev) => ({\n ...prev,\n isSelected: false,\n inputValue: '',\n }))\n if (isSingleChoiceQuestion) {\n setSelectedChoices(null)\n }\n }\n }\n\n const isSubmitDisabled = (): boolean => {\n if (question.optional) {\n return false\n }\n if (isNull(selectedChoices)) {\n return true\n }\n if (isArray(selectedChoices)) {\n if (!openEndedState.isSelected && selectedChoices.length === 0) {\n return true\n }\n }\n if (openEndedState.isSelected && openEndedState.inputValue.trim() === '') {\n return true\n }\n return false\n }\n\n const handleSubmit = () => {\n if (openEndedState.isSelected && isMultipleChoiceQuestion) {\n if (isArray(selectedChoices)) {\n isPreviewMode\n ? onPreviewSubmit([...selectedChoices, openEndedState.inputValue])\n : onSubmit([...selectedChoices, openEndedState.inputValue])\n }\n } else {\n isPreviewMode ? onPreviewSubmit(selectedChoices) : onSubmit(selectedChoices)\n }\n }\n\n return (\n <Fragment>\n <div className=\"question-container\">\n <QuestionHeader question={question} forceDisableHtml={forceDisableHtml} />\n <fieldset className=\"multiple-choice-options limit-height\">\n <legend className=\"sr-only\">\n {isMultipleChoiceQuestion ? ' Select all that apply' : ' Select one'}\n </legend>\n {choices.map((choice: string, idx: number) => {\n const isOpenChoice = !!question.hasOpenChoice && idx === question.choices.length - 1\n const inputId = `surveyQuestion${displayQuestionIndex}Choice${idx}`\n const openInputId = `${inputId}Open`\n\n const isChecked = isOpenChoice\n ? openEndedState.isSelected\n : isSingleChoiceQuestion\n ? selectedChoices === choice\n : isArray(selectedChoices) && selectedChoices.includes(choice)\n\n return (\n <label className={isOpenChoice ? 'choice-option-open' : ''} key={idx}>\n <div className=\"response-choice\">\n <input\n type={isSingleChoiceQuestion ? 'radio' : 'checkbox'}\n name={inputId}\n checked={isChecked}\n onChange={() => handleChoiceChange(choice, isOpenChoice)}\n id={inputId}\n aria-controls={openInputId}\n />\n <span>{isOpenChoice ? `${choice}:` : choice}</span>\n </div>\n {isOpenChoice && (\n <input\n type=\"text\"\n ref={openChoiceInputRef}\n id={openInputId}\n name={`question${displayQuestionIndex}Open`}\n value={openEndedState.inputValue}\n onKeyDown={handleOpenEndedKeyDown}\n onInput={handleOpenEndedInputChange}\n onClick={(e) => {\n // Ensure the checkbox/radio gets checked when clicking the input\n if (!openEndedState.isSelected) {\n handleChoiceChange(choice, true)\n }\n e.stopPropagation()\n }}\n aria-label={`${choice} - please specify`}\n />\n )}\n </label>\n )\n })}\n </fieldset>\n </div>\n <BottomSection\n text={question.buttonText || 'Submit'}\n submitDisabled={isSubmitDisabled()}\n appearance={appearance}\n onSubmit={handleSubmit}\n onPreviewSubmit={handleSubmit}\n skipSubmitButton={shouldSkipSubmit}\n canGoBack={canGoBack}\n onBack={onBack}\n />\n </Fragment>\n )\n}\n\nconst fiveScaleNumbers = [1, 2, 3, 4, 5]\nconst sevenScaleNumbers = [1, 2, 3, 4, 5, 6, 7]\nconst tenScaleNumbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\nconst emojiScaleLists: Partial<Record<RatingSurveyQuestion['scale'], JSX.Element[]>> = {\n 2: [thumbsUpEmoji, thumbsDownEmoji],\n 3: [dissatisfiedEmoji, neutralEmoji, satisfiedEmoji],\n 5: [veryDissatisfiedEmoji, dissatisfiedEmoji, neutralEmoji, satisfiedEmoji, verySatisfiedEmoji],\n}\n\nfunction getScaleNumbers(scale: number): number[] {\n switch (scale) {\n case 5:\n return fiveScaleNumbers\n case 7:\n return sevenScaleNumbers\n case 10:\n return tenScaleNumbers\n default:\n return fiveScaleNumbers\n }\n}\n"]} |
@@ -33,2 +33,3 @@ /** | ||
| hideCancelButton?: boolean; | ||
| disableAutofocus?: boolean; | ||
| position?: SurveyPosition; | ||
@@ -35,0 +36,0 @@ widgetType?: SurveyWidgetType; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"posthog-surveys-types.js","sourceRoot":"","sources":["../../src/posthog-surveys-types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA6RH;;;GAGG;AAEU,QAAA,eAAe,GAAG;IAC3B,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,cAAc;CACtB,CAAA;AAGG,QAAA,gBAAgB,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK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Ae,EAAE,kBAAkB;IACnC,gBAAgB,EAAE,mBAAmB;IACrC,2BAA2B,EAAE,8BAA8B;IAC3D,0BAA0B,EAAE,6BAA6B;IACzD,oBAAoB,EAAE,uBAAuB;IAC7C,gBAAgB,EAAE,mBAAmB;IACrC,gBAAgB,EAAE,mBAAmB;IACrC,eAAe,EAAE,kBAAkB;IACnC,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,kBAAkB;CAC7B,CAAA;AAGG,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAA","sourcesContent":["/**\n * Having Survey types in types.ts was confusing tsc\n * and generating an invalid module.d.ts\n * See https://github.com/PostHog/posthog-js/issues/698\n */\n\nimport type { Properties, PropertyMatchType } from './types'\nimport type {\n SurveyAppearance as CoreSurveyAppearance,\n SurveyQuestionTranslation,\n SurveyResponseValue as CoreSurveyResponseValue,\n SurveyTranslation,\n SurveyValidationRule,\n} from '@posthog/core'\n\n// Extended operator type to include numeric operators not in PropertyMatchType\nexport type PropertyOperator = PropertyMatchType | 'gt' | 'lt'\n\nexport type PropertyFilters = {\n [propertyName: string]: {\n values: string[]\n operator: PropertyOperator\n }\n}\n\nexport interface SurveyEventWithFilters {\n name: string\n propertyFilters?: PropertyFilters\n}\n\n// Extends core SurveyAppearance with browser-specific fields\n// Omit 'position' from core because browser's SurveyPosition has additional values (e.g., NextToTrigger)\nexport interface SurveyAppearance extends Omit<CoreSurveyAppearance, 'position' | 'widgetType'> {\n // Browser-specific fields not in core\n /** @deprecated - not currently used */\n descriptionTextColor?: string\n ratingButtonHoverColor?: string\n whiteLabel?: boolean\n tabPosition?: SurveyTabPosition\n fontFamily?: string\n maxWidth?: string\n zIndex?: string\n disabledButtonOpacity?: string\n boxPadding?: string\n /** @deprecated Use inputBackground instead (inherited from core) */\n inputBackgroundColor?: string\n // Hide the X (cancel) button - defaults to false (show the button)\n hideCancelButton?: boolean\n // Browser's SurveyPosition has more options than core (e.g., NextToTrigger)\n position?: SurveyPosition\n widgetType?: SurveyWidgetType\n}\n\nexport type SurveyQuestion = BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion\n\nexport type SurveyQuestionDescriptionContentType = 'html' | 'text'\n\ninterface SurveyQuestionBase {\n question: string\n id?: string\n description?: string | null\n descriptionContentType?: SurveyQuestionDescriptionContentType\n optional?: boolean\n buttonText?: string\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching\n validation?: SurveyValidationRule[]\n translations?: Record<string, SurveyQuestionTranslation>\n}\n\nexport interface BasicSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Open\n}\n\nexport interface LinkSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Link\n link?: string | null\n}\n\nexport interface RatingSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Rating\n display: 'number' | 'emoji'\n scale: 2 | 3 | 5 | 7 | 10\n lowerBoundLabel: string\n upperBoundLabel: string\n skipSubmitButton?: boolean\n}\n\nexport interface MultipleSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.SingleChoice | typeof SurveyQuestionType.MultipleChoice\n choices: string[]\n hasOpenChoice?: boolean\n shuffleOptions?: boolean\n skipSubmitButton?: boolean\n}\n\ninterface NextQuestionBranching {\n type: typeof SurveyQuestionBranchingType.NextQuestion\n}\n\ninterface EndBranching {\n type: typeof SurveyQuestionBranchingType.End\n}\n\ninterface ResponseBasedBranching {\n type: typeof SurveyQuestionBranchingType.ResponseBased\n responseValues: Record<string, any>\n}\n\ninterface SpecificQuestionBranching {\n type: typeof SurveyQuestionBranchingType.SpecificQuestion\n index: number\n}\n\nexport type SurveyCallback = (surveys: Survey[], context?: { isLoaded: boolean; error?: string }) => void\n\nexport interface SurveyElement {\n text?: string\n $el_text?: string\n tag_name?: string\n href?: string\n attr_id?: string\n attr_class?: string[]\n nth_child?: number\n nth_of_type?: number\n attributes?: Record<string, any>\n event_id?: number\n order?: number\n group_id?: number\n}\n\n// Re-export from @posthog/types to avoid duplication\nexport type { SurveyRenderReason } from '@posthog/types'\n\nexport interface Survey {\n // Sync this with the backend's SurveyAPISerializer!\n id: string\n name: string\n description?: string\n type: SurveyType\n translations?: Record<string, SurveyTranslation>\n feature_flag_keys:\n | {\n key: string\n value?: string\n }[]\n | null\n // the linked flag key is the flag key that is used to link the survey to a flag\n linked_flag_key: string | null\n targeting_flag_key: string | null\n // the internal targeting flag key is the flag key that is used to target users who have seen the survey\n // eg survey-targeting-<survey-id>\n internal_targeting_flag_key: string | null\n questions: SurveyQuestion[]\n appearance: SurveyAppearance | null\n conditions: {\n url?: string\n selector?: string\n seenSurveyWaitPeriodInDays?: number\n urlMatchType?: PropertyMatchType\n /** events that trigger surveys */\n events: {\n repeatedActivation?: boolean\n values: SurveyEventWithFilters[]\n } | null\n /** events that cancel \"pending\" (time-delayed) surveys */\n cancelEvents: {\n values: SurveyEventWithFilters[]\n } | null\n actions: {\n values: SurveyActionType[]\n } | null\n deviceTypes?: string[]\n deviceTypesMatchType?: PropertyMatchType\n linkedFlagVariant?: string\n } | null\n start_date: string | null\n end_date: string | null\n current_iteration: number | null\n current_iteration_start_date: string | null\n schedule?: SurveySchedule | null\n enable_partial_responses?: boolean | null\n}\n\nexport type SurveyWithTypeAndAppearance = Pick<Survey, 'id' | 'type' | 'appearance'>\n\nexport interface SurveyActionType {\n id: number\n name: string | null\n steps?: ActionStepType[]\n}\n\n/** Sync with plugin-server/src/types.ts */\nexport type ActionStepStringMatching = 'contains' | 'exact' | 'regex'\n\nexport interface ActionStepType {\n event?: string | null\n selector?: string | null\n /** pre-compiled regex pattern for matching selector against $elements_chain */\n selector_regex?: string | null\n /** @deprecated Only `selector` should be used now. */\n tag_name?: string\n text?: string | null\n /** @default StringMatching.Exact */\n text_matching?: ActionStepStringMatching | null\n href?: string | null\n /** @default ActionStepStringMatching.Exact */\n href_matching?: ActionStepStringMatching | null\n url?: string | null\n /** @default StringMatching.Contains */\n url_matching?: ActionStepStringMatching | null\n /** Property filters for action step matching */\n properties?: {\n key: string\n value?: string | number | boolean | (string | number | boolean)[] | null\n operator?: PropertyMatchType\n type?: string\n }[]\n}\n\ninterface DisplaySurveyOptionsBase {\n /**\n * Whether to bypass the survey's targeting and display conditions.\n * @default false\n */\n ignoreConditions: boolean\n\n /**\n * Whether to bypass the survey's configured popup delay.\n * @default false\n */\n ignoreDelay: boolean\n\n /**\n * How the survey should be displayed.\n * @default DisplaySurveyType.Popover\n */\n displayType: DisplaySurveyType\n\n /** Additional properties to include in all survey events (shown, sent, dismissed). */\n properties?: Properties\n\n /** Pre-filled responses by question index (0-based). Only supported for popover surveys. */\n initialResponses?: Record<number, SurveyResponseValue>\n}\n\n/** Options for displaying a survey as a popover. */\nexport interface DisplaySurveyPopoverOptions extends DisplaySurveyOptionsBase {\n displayType: typeof DisplaySurveyType.Popover\n /** Override the survey's configured position. */\n position?: SurveyPosition\n /** CSS selector for the element to position the survey next to (when position is NextToTrigger). */\n selector?: string\n /** When true, `survey shown` events will not be emitted automatically. */\n skipShownEvent?: boolean\n}\n\ninterface DisplaySurveyInlineOptions extends DisplaySurveyOptionsBase {\n displayType: typeof DisplaySurveyType.Inline\n /** CSS selector for the element where the inline survey should render. */\n selector: string\n}\n\n/** Options for `posthog.displaySurvey()`. */\nexport type DisplaySurveyOptions = DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions\n\nexport interface SurveyConfig {\n /**\n * Prefill survey responses from matching URL parameters.\n *\n * @default undefined\n */\n prefillFromUrl?: boolean\n /**\n * @deprecated No longer used. Surveys will automatically advance past\n * prefilled questions with skipSubmitButton enabled. If partial response\n * collection is enabled, partial responses for pre-filled questions will\n * be submitted automatically on page load.\n */\n autoSubmitIfComplete?: boolean\n /**\n * @deprecated No longer used. Pre-filled responses are now sent\n * immediately when partial responses are enabled, or all required\n * questions have been pre-filled.\n */\n autoSubmitDelay?: number\n}\n\nexport type SurveyResponseValue = CoreSurveyResponseValue\n\n/**\n * Surveys related enums and constants.\n * We use const objects instead of TypeScript enums to allow for easier tree-shaking and to avoid issues with enum imports in JavaScript.\n */\n\nexport const SurveyEventType = {\n Activation: 'events',\n Cancellation: 'cancelEvents',\n} as const\nexport type SurveyEventType = (typeof SurveyEventType)[keyof typeof SurveyEventType]\n\nexport const SurveyWidgetType = {\n Button: 'button',\n Tab: 'tab',\n Selector: 'selector',\n} as const\nexport type SurveyWidgetType = (typeof SurveyWidgetType)[keyof typeof SurveyWidgetType]\n\nexport const SurveyPosition = {\n TopLeft: 'top_left',\n TopRight: 'top_right',\n TopCenter: 'top_center',\n MiddleLeft: 'middle_left',\n MiddleRight: 'middle_right',\n MiddleCenter: 'middle_center',\n Left: 'left',\n Center: 'center',\n Right: 'right',\n NextToTrigger: 'next_to_trigger',\n} as const\nexport type SurveyPosition = (typeof SurveyPosition)[keyof typeof SurveyPosition]\n\nexport const SurveyTabPosition = {\n Top: 'top',\n Left: 'left',\n Right: 'right',\n Bottom: 'bottom',\n} as const\nexport type SurveyTabPosition = (typeof SurveyTabPosition)[keyof typeof SurveyTabPosition]\n\nexport const SurveyType = {\n Popover: 'popover',\n API: 'api',\n Widget: 'widget',\n ExternalSurvey: 'external_survey',\n} as const\nexport type SurveyType = (typeof SurveyType)[keyof typeof SurveyType]\n\nexport const SurveyQuestionType = {\n Open: 'open',\n MultipleChoice: 'multiple_choice',\n SingleChoice: 'single_choice',\n Rating: 'rating',\n Link: 'link',\n} as const\nexport type SurveyQuestionType = (typeof SurveyQuestionType)[keyof typeof SurveyQuestionType]\n\nexport const SurveyQuestionBranchingType = {\n NextQuestion: 'next_question',\n End: 'end',\n ResponseBased: 'response_based',\n SpecificQuestion: 'specific_question',\n} as const\nexport type SurveyQuestionBranchingType = (typeof SurveyQuestionBranchingType)[keyof typeof SurveyQuestionBranchingType]\n\nexport const SurveySchedule = {\n Once: 'once',\n Recurring: 'recurring',\n Always: 'always',\n} as const\nexport type SurveySchedule = (typeof SurveySchedule)[keyof typeof SurveySchedule]\n\nexport const SurveyEventName = {\n SHOWN: 'survey shown',\n DISMISSED: 'survey dismissed',\n SENT: 'survey sent',\n ABANDONED: 'survey abandoned',\n} as const\nexport type SurveyEventName = (typeof SurveyEventName)[keyof typeof SurveyEventName]\n\nexport const SurveyEventProperties = {\n SURVEY_ID: '$survey_id',\n SURVEY_NAME: '$survey_name',\n SURVEY_RESPONSE: '$survey_response',\n SURVEY_ITERATION: '$survey_iteration',\n SURVEY_ITERATION_START_DATE: '$survey_iteration_start_date',\n SURVEY_PARTIALLY_COMPLETED: '$survey_partially_completed',\n SURVEY_SUBMISSION_ID: '$survey_submission_id',\n SURVEY_QUESTIONS: '$survey_questions',\n SURVEY_COMPLETED: '$survey_completed',\n PRODUCT_TOUR_ID: '$product_tour_id',\n SURVEY_LAST_SEEN_DATE: '$survey_last_seen_date',\n SURVEY_LANGUAGE: '$survey_language',\n} as const\nexport type SurveyEventProperties = (typeof SurveyEventProperties)[keyof typeof SurveyEventProperties]\n\nexport const DisplaySurveyType = {\n Popover: 'popover',\n Inline: 'inline',\n} as const\nexport type DisplaySurveyType = (typeof DisplaySurveyType)[keyof typeof DisplaySurveyType]\n"]} | ||
| {"version":3,"file":"posthog-surveys-types.js","sourceRoot":"","sources":["../../src/posthog-surveys-types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgSH;;;GAGG;AAEU,QAAA,eAAe,GAAG;IAC3B,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,cAAc;CACtB,CAAA;AAGG,QAAA,gBAAgB,GAAG;IAC5B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;CACd,CAAA;AAGG,QAAA,cAAc,GAAG;IAC1B,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B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AmB;IACrC,eAAe,EAAE,kBAAkB;IACnC,qBAAqB,EAAE,wBAAwB;IAC/C,eAAe,EAAE,kBAAkB;CAC7B,CAAA;AAGG,QAAA,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAA","sourcesContent":["/**\n * Having Survey types in types.ts was confusing tsc\n * and generating an invalid module.d.ts\n * See https://github.com/PostHog/posthog-js/issues/698\n */\n\nimport type { Properties, PropertyMatchType } from './types'\nimport type {\n SurveyAppearance as CoreSurveyAppearance,\n SurveyQuestionTranslation,\n SurveyResponseValue as CoreSurveyResponseValue,\n SurveyTranslation,\n SurveyValidationRule,\n} from '@posthog/core'\n\n// Extended operator type to include numeric operators not in PropertyMatchType\nexport type PropertyOperator = PropertyMatchType | 'gt' | 'lt'\n\nexport type PropertyFilters = {\n [propertyName: string]: {\n values: string[]\n operator: PropertyOperator\n }\n}\n\nexport interface SurveyEventWithFilters {\n name: string\n propertyFilters?: PropertyFilters\n}\n\n// Extends core SurveyAppearance with browser-specific fields\n// Omit 'position' from core because browser's SurveyPosition has additional values (e.g., NextToTrigger)\nexport interface SurveyAppearance extends Omit<CoreSurveyAppearance, 'position' | 'widgetType'> {\n // Browser-specific fields not in core\n /** @deprecated - not currently used */\n descriptionTextColor?: string\n ratingButtonHoverColor?: string\n whiteLabel?: boolean\n tabPosition?: SurveyTabPosition\n fontFamily?: string\n maxWidth?: string\n zIndex?: string\n disabledButtonOpacity?: string\n boxPadding?: string\n /** @deprecated Use inputBackground instead (inherited from core) */\n inputBackgroundColor?: string\n // Hide the X (cancel) button - defaults to false (show the button)\n hideCancelButton?: boolean\n // Don't automatically focus the first open-text input when the question renders.\n // Defaults to false (the input is focused), preserving existing behavior.\n disableAutofocus?: boolean\n // Browser's SurveyPosition has more options than core (e.g., NextToTrigger)\n position?: SurveyPosition\n widgetType?: SurveyWidgetType\n}\n\nexport type SurveyQuestion = BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion\n\nexport type SurveyQuestionDescriptionContentType = 'html' | 'text'\n\ninterface SurveyQuestionBase {\n question: string\n id?: string\n description?: string | null\n descriptionContentType?: SurveyQuestionDescriptionContentType\n optional?: boolean\n buttonText?: string\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching\n validation?: SurveyValidationRule[]\n translations?: Record<string, SurveyQuestionTranslation>\n}\n\nexport interface BasicSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Open\n}\n\nexport interface LinkSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Link\n link?: string | null\n}\n\nexport interface RatingSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.Rating\n display: 'number' | 'emoji'\n scale: 2 | 3 | 5 | 7 | 10\n lowerBoundLabel: string\n upperBoundLabel: string\n skipSubmitButton?: boolean\n}\n\nexport interface MultipleSurveyQuestion extends SurveyQuestionBase {\n type: typeof SurveyQuestionType.SingleChoice | typeof SurveyQuestionType.MultipleChoice\n choices: string[]\n hasOpenChoice?: boolean\n shuffleOptions?: boolean\n skipSubmitButton?: boolean\n}\n\ninterface NextQuestionBranching {\n type: typeof SurveyQuestionBranchingType.NextQuestion\n}\n\ninterface EndBranching {\n type: typeof SurveyQuestionBranchingType.End\n}\n\ninterface ResponseBasedBranching {\n type: typeof SurveyQuestionBranchingType.ResponseBased\n responseValues: Record<string, any>\n}\n\ninterface SpecificQuestionBranching {\n type: typeof SurveyQuestionBranchingType.SpecificQuestion\n index: number\n}\n\nexport type SurveyCallback = (surveys: Survey[], context?: { isLoaded: boolean; error?: string }) => void\n\nexport interface SurveyElement {\n text?: string\n $el_text?: string\n tag_name?: string\n href?: string\n attr_id?: string\n attr_class?: string[]\n nth_child?: number\n nth_of_type?: number\n attributes?: Record<string, any>\n event_id?: number\n order?: number\n group_id?: number\n}\n\n// Re-export from @posthog/types to avoid duplication\nexport type { SurveyRenderReason } from '@posthog/types'\n\nexport interface Survey {\n // Sync this with the backend's SurveyAPISerializer!\n id: string\n name: string\n description?: string\n type: SurveyType\n translations?: Record<string, SurveyTranslation>\n feature_flag_keys:\n | {\n key: string\n value?: string\n }[]\n | null\n // the linked flag key is the flag key that is used to link the survey to a flag\n linked_flag_key: string | null\n targeting_flag_key: string | null\n // the internal targeting flag key is the flag key that is used to target users who have seen the survey\n // eg survey-targeting-<survey-id>\n internal_targeting_flag_key: string | null\n questions: SurveyQuestion[]\n appearance: SurveyAppearance | null\n conditions: {\n url?: string\n selector?: string\n seenSurveyWaitPeriodInDays?: number\n urlMatchType?: PropertyMatchType\n /** events that trigger surveys */\n events: {\n repeatedActivation?: boolean\n values: SurveyEventWithFilters[]\n } | null\n /** events that cancel \"pending\" (time-delayed) surveys */\n cancelEvents: {\n values: SurveyEventWithFilters[]\n } | null\n actions: {\n values: SurveyActionType[]\n } | null\n deviceTypes?: string[]\n deviceTypesMatchType?: PropertyMatchType\n linkedFlagVariant?: string\n } | null\n start_date: string | null\n end_date: string | null\n current_iteration: number | null\n current_iteration_start_date: string | null\n schedule?: SurveySchedule | null\n enable_partial_responses?: boolean | null\n}\n\nexport type SurveyWithTypeAndAppearance = Pick<Survey, 'id' | 'type' | 'appearance'>\n\nexport interface SurveyActionType {\n id: number\n name: string | null\n steps?: ActionStepType[]\n}\n\n/** Sync with plugin-server/src/types.ts */\nexport type ActionStepStringMatching = 'contains' | 'exact' | 'regex'\n\nexport interface ActionStepType {\n event?: string | null\n selector?: string | null\n /** pre-compiled regex pattern for matching selector against $elements_chain */\n selector_regex?: string | null\n /** @deprecated Only `selector` should be used now. */\n tag_name?: string\n text?: string | null\n /** @default StringMatching.Exact */\n text_matching?: ActionStepStringMatching | null\n href?: string | null\n /** @default ActionStepStringMatching.Exact */\n href_matching?: ActionStepStringMatching | null\n url?: string | null\n /** @default StringMatching.Contains */\n url_matching?: ActionStepStringMatching | null\n /** Property filters for action step matching */\n properties?: {\n key: string\n value?: string | number | boolean | (string | number | boolean)[] | null\n operator?: PropertyMatchType\n type?: string\n }[]\n}\n\ninterface DisplaySurveyOptionsBase {\n /**\n * Whether to bypass the survey's targeting and display conditions.\n * @default false\n */\n ignoreConditions: boolean\n\n /**\n * Whether to bypass the survey's configured popup delay.\n * @default false\n */\n ignoreDelay: boolean\n\n /**\n * How the survey should be displayed.\n * @default DisplaySurveyType.Popover\n */\n displayType: DisplaySurveyType\n\n /** Additional properties to include in all survey events (shown, sent, dismissed). */\n properties?: Properties\n\n /** Pre-filled responses by question index (0-based). Only supported for popover surveys. */\n initialResponses?: Record<number, SurveyResponseValue>\n}\n\n/** Options for displaying a survey as a popover. */\nexport interface DisplaySurveyPopoverOptions extends DisplaySurveyOptionsBase {\n displayType: typeof DisplaySurveyType.Popover\n /** Override the survey's configured position. */\n position?: SurveyPosition\n /** CSS selector for the element to position the survey next to (when position is NextToTrigger). */\n selector?: string\n /** When true, `survey shown` events will not be emitted automatically. */\n skipShownEvent?: boolean\n}\n\ninterface DisplaySurveyInlineOptions extends DisplaySurveyOptionsBase {\n displayType: typeof DisplaySurveyType.Inline\n /** CSS selector for the element where the inline survey should render. */\n selector: string\n}\n\n/** Options for `posthog.displaySurvey()`. */\nexport type DisplaySurveyOptions = DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions\n\nexport interface SurveyConfig {\n /**\n * Prefill survey responses from matching URL parameters.\n *\n * @default undefined\n */\n prefillFromUrl?: boolean\n /**\n * @deprecated No longer used. Surveys will automatically advance past\n * prefilled questions with skipSubmitButton enabled. If partial response\n * collection is enabled, partial responses for pre-filled questions will\n * be submitted automatically on page load.\n */\n autoSubmitIfComplete?: boolean\n /**\n * @deprecated No longer used. Pre-filled responses are now sent\n * immediately when partial responses are enabled, or all required\n * questions have been pre-filled.\n */\n autoSubmitDelay?: number\n}\n\nexport type SurveyResponseValue = CoreSurveyResponseValue\n\n/**\n * Surveys related enums and constants.\n * We use const objects instead of TypeScript enums to allow for easier tree-shaking and to avoid issues with enum imports in JavaScript.\n */\n\nexport const SurveyEventType = {\n Activation: 'events',\n Cancellation: 'cancelEvents',\n} as const\nexport type SurveyEventType = (typeof SurveyEventType)[keyof typeof SurveyEventType]\n\nexport const SurveyWidgetType = {\n Button: 'button',\n Tab: 'tab',\n Selector: 'selector',\n} as const\nexport type SurveyWidgetType = (typeof SurveyWidgetType)[keyof typeof SurveyWidgetType]\n\nexport const SurveyPosition = {\n TopLeft: 'top_left',\n TopRight: 'top_right',\n TopCenter: 'top_center',\n MiddleLeft: 'middle_left',\n MiddleRight: 'middle_right',\n MiddleCenter: 'middle_center',\n Left: 'left',\n Center: 'center',\n Right: 'right',\n NextToTrigger: 'next_to_trigger',\n} as const\nexport type SurveyPosition = (typeof SurveyPosition)[keyof typeof SurveyPosition]\n\nexport const SurveyTabPosition = {\n Top: 'top',\n Left: 'left',\n Right: 'right',\n Bottom: 'bottom',\n} as const\nexport type SurveyTabPosition = (typeof SurveyTabPosition)[keyof typeof SurveyTabPosition]\n\nexport const SurveyType = {\n Popover: 'popover',\n API: 'api',\n Widget: 'widget',\n ExternalSurvey: 'external_survey',\n} as const\nexport type SurveyType = (typeof SurveyType)[keyof typeof SurveyType]\n\nexport const SurveyQuestionType = {\n Open: 'open',\n MultipleChoice: 'multiple_choice',\n SingleChoice: 'single_choice',\n Rating: 'rating',\n Link: 'link',\n} as const\nexport type SurveyQuestionType = (typeof SurveyQuestionType)[keyof typeof SurveyQuestionType]\n\nexport const SurveyQuestionBranchingType = {\n NextQuestion: 'next_question',\n End: 'end',\n ResponseBased: 'response_based',\n SpecificQuestion: 'specific_question',\n} as const\nexport type SurveyQuestionBranchingType = (typeof SurveyQuestionBranchingType)[keyof typeof SurveyQuestionBranchingType]\n\nexport const SurveySchedule = {\n Once: 'once',\n Recurring: 'recurring',\n Always: 'always',\n} as const\nexport type SurveySchedule = (typeof SurveySchedule)[keyof typeof SurveySchedule]\n\nexport const SurveyEventName = {\n SHOWN: 'survey shown',\n DISMISSED: 'survey dismissed',\n SENT: 'survey sent',\n ABANDONED: 'survey abandoned',\n} as const\nexport type SurveyEventName = (typeof SurveyEventName)[keyof typeof SurveyEventName]\n\nexport const SurveyEventProperties = {\n SURVEY_ID: '$survey_id',\n SURVEY_NAME: '$survey_name',\n SURVEY_RESPONSE: '$survey_response',\n SURVEY_ITERATION: '$survey_iteration',\n SURVEY_ITERATION_START_DATE: '$survey_iteration_start_date',\n SURVEY_PARTIALLY_COMPLETED: '$survey_partially_completed',\n SURVEY_SUBMISSION_ID: '$survey_submission_id',\n SURVEY_QUESTIONS: '$survey_questions',\n SURVEY_COMPLETED: '$survey_completed',\n PRODUCT_TOUR_ID: '$product_tour_id',\n SURVEY_LAST_SEEN_DATE: '$survey_last_seen_date',\n SURVEY_LANGUAGE: '$survey_language',\n} as const\nexport type SurveyEventProperties = (typeof SurveyEventProperties)[keyof typeof SurveyEventProperties]\n\nexport const DisplaySurveyType = {\n Popover: 'popover',\n Inline: 'inline',\n} as const\nexport type DisplaySurveyType = (typeof DisplaySurveyType)[keyof typeof DisplaySurveyType]\n"]} |
+3
-3
| { | ||
| "name": "posthog-js", | ||
| "version": "1.397.0", | ||
| "version": "1.398.0", | ||
| "bugs": { | ||
@@ -37,4 +37,4 @@ "url": "https://github.com/PostHog/posthog-js/issues" | ||
| "web-vitals": "^5.3.0", | ||
| "@posthog/core": "^1.39.6", | ||
| "@posthog/types": "^1.392.1" | ||
| "@posthog/types": "^1.392.1", | ||
| "@posthog/core": "^1.39.6" | ||
| }, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Telemetry
Supply chain riskThis package contains telemetry which tracks how it is used.
Found 3 instances
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 4 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Telemetry
Supply chain riskThis package contains telemetry which tracks how it is used.
Found 5 instances
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 3 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
39238296
0.02%119109
0.01%3
-40%61
1.67%